def analyze(output_dir, dataset, cloud=False, project_id=None):
  """Blocking version of analyze_async. See documentation of analyze_async."""
  job = analyze_async(
      output_dir=output_dir,
      dataset=dataset,
      cloud=cloud,
      project_id=project_id)
  job.wait()
  print('Analyze: ' + str(job.state))
Blocking version of analyze_async. See documentation of analyze_async.