def setup_api(service_account=True):

  global api
  if service_account:
    creds = gcelib.gce_util.ServiceAccountCredentials()
  else:
    creds = gcelib.gce_util.get_credentials()
  api = gcelib.gce_v1beta13.GoogleComputeEngine(
      creds, default_project=cfg.project_id,
      logging_level=logging.ERROR)
Sets up a usable Compute API object.
dataset/ETHPy150Open GoogleCloudPlatform/compute-hadoop-java-python/util.py/setup_api