parameters: ()
docstring: Parses command line and checks bench expectations.
docstring_summary: Parses command line and checks bench expectations.
docstring_tokens: Parses command line and checks bench expectations .
function: def main():
      """Parses command line and checks bench expectations."""
      try:
          opts, _ = getopt.getopt(sys.argv[1:],
                                  "a:b:d:e:r:",
                                  "default-setting=")
      except getopt.GetoptError, err:
          print str(err)
          usage()
          sys.exit(2)
  
      directory = None
      bench_expectations = {}
      rep = '25th'  # bench representation algorithm, default to 25th
      rev = None  # git commit hash or svn revision number
      bot = None
  
      try:
          for option, value in opts:
              if option == "-a":
                  rep = value
              elif option == "-b":
                  bot = value
              elif option == "-d":
                  directory = value
              elif option == "-e":
                  read_expectations(bench_expectations, value)
              elif option == "-r":
                  rev = value
              else:
                  usage()
                  assert False, "unhandled option"
      except ValueError:
          usage()
          sys.exit(2)
  
      if directory is None or bot is None or rev is None:
          usage()
          sys.exit(2)
  
      platform_and_alg = bot + '-' + rep
  
      data_points = bench_util.parse_skp_bench_data(directory, rev, rep)
  
      bench_dict = create_bench_dict(data_points)
  
      if bench_expectations:
          check_expectations(bench_dict, bench_expectations, platform_and_alg)
function_tokens: def main ( ) : try : opts , _ = getopt . getopt ( sys . argv [ 1 : ] , "a:b:d:e:r:" , "default-setting=" ) except getopt . GetoptError , err : print str ( err ) usage ( ) sys . exit ( 2 ) directory = None bench_expectations = { } rep = '25th' # bench representation algorithm, default to 25th rev = None # git commit hash or svn revision number bot = None try : for option , value in opts : if option == "-a" : rep = value elif option == "-b" : bot = value elif option == "-d" : directory = value elif option == "-e" : read_expectations ( bench_expectations , value ) elif option == "-r" : rev = value else : usage ( ) assert False , "unhandled option" except ValueError : usage ( ) sys . exit ( 2 ) if directory is None or bot is None or rev is None : usage ( ) sys . exit ( 2 ) platform_and_alg = bot + '-' + rep data_points = bench_util . parse_skp_bench_data ( directory , rev , rep ) bench_dict = create_bench_dict ( data_points ) if bench_expectations : check_expectations ( bench_dict , bench_expectations , platform_and_alg )