Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../lib64/python2..../hotshot
File: stones.py
import errno
[0] Fix | Delete
import hotshot
[1] Fix | Delete
import hotshot.stats
[2] Fix | Delete
import sys
[3] Fix | Delete
import test.pystone
[4] Fix | Delete
[5] Fix | Delete
def main(logfile):
[6] Fix | Delete
p = hotshot.Profile(logfile)
[7] Fix | Delete
benchtime, stones = p.runcall(test.pystone.pystones)
[8] Fix | Delete
p.close()
[9] Fix | Delete
[10] Fix | Delete
print "Pystone(%s) time for %d passes = %g" % \
[11] Fix | Delete
(test.pystone.__version__, test.pystone.LOOPS, benchtime)
[12] Fix | Delete
print "This machine benchmarks at %g pystones/second" % stones
[13] Fix | Delete
[14] Fix | Delete
stats = hotshot.stats.load(logfile)
[15] Fix | Delete
stats.strip_dirs()
[16] Fix | Delete
stats.sort_stats('time', 'calls')
[17] Fix | Delete
try:
[18] Fix | Delete
stats.print_stats(20)
[19] Fix | Delete
except IOError, e:
[20] Fix | Delete
if e.errno != errno.EPIPE:
[21] Fix | Delete
raise
[22] Fix | Delete
[23] Fix | Delete
if __name__ == '__main__':
[24] Fix | Delete
if sys.argv[1:]:
[25] Fix | Delete
main(sys.argv[1])
[26] Fix | Delete
else:
[27] Fix | Delete
import tempfile
[28] Fix | Delete
main(tempfile.NamedTemporaryFile().name)
[29] Fix | Delete
[30] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function