<s> """<STR_LIT>""" <EOL> __author__ = "<STR_LIT>" <EOL> import math <EOL> import operator <EOL> try : <EOL> reduce <EOL> except NameError : <EOL> from functools import reduce <EOL> def run_benchmark ( options , num_runs , bench_func , * args ) : <EOL> """<STR_LIT>""" <EOL> if options . profile : <EOL> import cProfile <EOL> prof = cProfile . Profile ( ) <EOL> prof . runcall ( bench_func , num_runs , * args ) <EOL> prof . print_stats ( sort = options . profile_sort ) <EOL> else : <EOL> data = bench_func ( num_runs , * args ) <EOL> if options . take_geo_mean : <EOL> product = reduce ( operator . mul , data , <NUM_LIT:1> ) <EOL> print ( math . pow ( product , <NUM_LIT:1.0> / len ( data ) ) ) <EOL> else : <EOL> for x in data : <EOL> print ( x ) <EOL> def add_standard_options_to ( parser ) : <EOL> """<STR_LIT>""" <EOL> parser . add_option ( "<STR_LIT>" , action = "<STR_LIT:store>" , type = "<STR_LIT:int>" , default = <NUM_LIT:100> , <EOL> dest = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , action = "<STR_LIT:store>" , type = "<STR_LIT:str>" , <EOL> default = "<STR_LIT:time>" , help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) </s>
