def _GetBenchmarkSpec(benchmark_config, benchmark_name, benchmark_uid):
  if stages.PROVISION in FLAGS.run_stage:
    return benchmark_spec.BenchmarkSpec(benchmark_config, benchmark_name,
                                        benchmark_uid)
  else:
    try:
      return benchmark_spec.BenchmarkSpec.GetSpecFromFile(benchmark_uid,
                                                          benchmark_config)
    except IOError:
      if FLAGS.run_stage == [stages.PREPARE]:
        logging.error(
            'We were unable to load the BenchmarkSpec. This may be related '
            'to two additional run stages which have recently been added. '
            'Please make sure to run the stage "provision" before "prepare". '
            'Similarly, make sure to run "teardown" after "cleanup".')
      raise
Make a request over the HTTP transport to the API.
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/pkb.py/_GetBenchmarkSpec--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/gcloud-python/gcloud/connection.py/JSONConnection.api_request