text: 
  import apache_beam as beam
  def my_grep(line, term):
     if line.startswith(term):
        yield line
  PROJECT='qwiklabs-gcp-04-cb3b0d81cc77'
  BUCKET='qwiklabs-gcp-04-cb3b0d81cc77'
  def run():
     argv = [
        '--project={0}'.format(PROJECT),
        '--job_name=examplejob3',
        '--save_main_session',
        '--staging_location=gs://{0}/staging/'.format(BUCKET),
        '--temp_location=gs://{0}/staging/'.format(BUCKET),
        '--region=us-central1',
        '--runner=DataflowRunner'
     ]
     p = beam.Pipeline(argv=argv)
     input = 'gs://{0}/javahelp/*.java'.format(BUCKET)
     output_prefix = 'gs://{0}/javahelp/output'.format(BUCKET)
     searchTerm = 'import'
     # find all lines that contain the searchTerm
     (p
        | 'GetJava' >> beam.io.ReadFromText(input)
        | 'Grep' >> beam.FlatMap(lambda line: my_grep(line, searchTerm) )
        | 'write' >> beam.io.WriteToText(output_prefix)
     )
     p.run()
  if __name__ == '__main__':
     run()