def add_standard_options_to(parser):
 parser.add_option('-n', action='store', type='int', default=100, dest='num_runs', help='Number of times to run the test.')
 parser.add_option('--profile', action='store_true', help='Run the benchmark through cProfile.')
 parser.add_option('--profile_sort', action='store', type='str', default='time', help='Column to sort cProfile output by.')
 parser.add_option('--take_geo_mean', action='store_true', help='Return the geo mean, rather than individual data.')

def add_standard_options_to ( parser ) : parser . add_option ( '-n' , action = 'store' , type = 'int' , default = 100 , dest = 'num_runs' , help = 'Number of times to run the test.' ) parser . add_option ( '--profile' , action = 'store_true' , help = 'Run the benchmark through cProfile.' ) parser . add_option ( '--profile_sort' , action = 'store' , type = 'str' , default = 'time' , help = 'Column to sort cProfile output by.' ) parser . add_option ( '--take_geo_mean' , action = 'store_true' , help = 'Return the geo mean, rather than individual data.' )
add a bunch of common command-line flags to an existing optionparser .