

def print_stats(self, profiler):
    name = (((self._type + '-') + self.name) if self._type else self.name)
    filename = os.path.join(self.profile_dir, name)
    logging.debug('Printing stats for {name}'.format(name=name))
    s = StringIO.StringIO()
    sortby = 'cumulative'
    ps = pstats.Stats(profiler, stream=filename)
    ps.strip_dirs()
    ps.sort_stats(sortby)
    ps.print_stats()
    stats_file = (filename + '.stats')
    profile_file = (filename + '.profile')
    ps.dump_stats(stats_file)
    with open(profile_file, 'w') as f:
        f.write(s.getvalue())

dataset/ETHPy150Open lobocv/pyperform/pyperform/thread.py _Profiler.print_stats/VarMisuse@89/112 `s`->`filename`