<s> import cProfile , pstats , StringIO <EOL> def profile ( ) : <EOL> pr = cProfile . Profile ( ) <EOL> pr . enable ( ) <EOL> pr . disable ( ) <EOL> s = StringIO . StringIO ( ) <EOL> sortby = '<STR_LIT>' <EOL> ps = pstats . Stats ( pr , stream = s ) . sort_stats ( sortby ) <EOL> ps . strip_dirs ( ) . sort_stats ( "<STR_LIT:time>" ) . print_stats ( ) <EOL> print ( s . getvalue ( ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> profile ( ) </s>
