code: def batch_predict(dataset, model_dir, output_csv, output_bq_table):
      
  
      import apache_beam as beam
      from google.datalab.utils import LambdaJob
      from . import _predictor
  
      if output_csv is None and output_bq_table is None:
        raise ValueError('output_csv and output_bq_table cannot both be None.')
  
      job_id = ('batch-predict-image-classification-' +
                datetime.datetime.now().strftime('%y%m%d-%H%M%S'))
  
      # Project is needed for bigquery data source, even in local run.
      options = {
          'project': _util.default_project(),
      }
      opts = beam.pipeline.PipelineOptions(flags=[], **options)
      p = beam.Pipeline('DirectRunner', options=opts)
      _predictor.configure_pipeline(p, dataset, model_dir, output_csv, output_bq_table)
      job = LambdaJob(lambda: p.run().wait_until_finish(), job_id)
      return job
docs: Batch predict running locally.