<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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))