parameters: (self, filename, sortby='cumulative')
return_statement: return response
docstring: :rtype stats(index): output of print_stats() for the given profile.
docstring_summary: :rtype stats(index): output of print_stats() for the given profile.
docstring_tokens: : rtype stats ( index ) : output of print_stats () for the given profile .
function: def stats(self, filename, sortby='cumulative'):
          """:rtype stats(index): output of print_stats() for the given profile.
          """
          sio = io.StringIO()
          if sys.version_info >= (2, 5):
              s = pstats.Stats(os.path.join(self.path, filename), stream=sio)
              s.strip_dirs()
              s.sort_stats(sortby)
              s.print_stats()
          else:
              # pstats.Stats before Python 2.5 didn't take a 'stream' arg,
              # but just printed to stdout. So re-route stdout.
              s = pstats.Stats(os.path.join(self.path, filename))
              s.strip_dirs()
              s.sort_stats(sortby)
              oldout = sys.stdout
              try:
                  sys.stdout = sio
                  s.print_stats()
              finally:
                  sys.stdout = oldout
          response = sio.getvalue()
          sio.close()
          return response
function_tokens: def stats ( self , filename , sortby = 'cumulative' ) : sio = io . StringIO ( ) if sys . version_info >= ( 2 , 5 ) : s = pstats . Stats ( os . path . join ( self . path , filename ) , stream = sio ) s . strip_dirs ( ) s . sort_stats ( sortby ) s . print_stats ( ) else : # pstats.Stats before Python 2.5 didn't take a 'stream' arg, # but just printed to stdout. So re-route stdout. s = pstats . Stats ( os . path . join ( self . path , filename ) ) s . strip_dirs ( ) s . sort_stats ( sortby ) oldout = sys . stdout try : sys . stdout = sio s . print_stats ( ) finally : sys . stdout = oldout response = sio . getvalue ( ) sio . close ( ) return response