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