code: def run_pipeline(
      input_tfrecord,
      output_tfrecord,
      output_shards,
      config,
      filters,
      pipeline_options,
  ):
      with beam.Pipeline(options=pipeline_options) as p:
          _ = (
              p
              | "read_input"
              >> beam.io.ReadFromTFRecord(
                  input_tfrecord,
                  coder=beam.coders.ProtoCoder(note_seq.NoteSequence),
              )
              | "extract_sequences"
              >> beam.ParDo(ExtractExamplesDoFn(config, filters))
              | "group" >> beam.GroupByKey()
              | "uniquify" >> beam.Map(combine_matching_seqs)
              | "shuffle" >> beam.Reshuffle()
              | "write"
              >> beam.io.WriteToTFRecord(
                  output_tfrecord,
                  num_shards=output_shards,
                  coder=beam.coders.ProtoCoder(note_seq.NoteSequence),
              )
          )
  
file_path: magenta/magenta/models/music_vae/preprocess_tfrecord.py
imports: import typing
  from absl import app
  from absl import flags
  from absl import logging
  import apache_beam
  from apache_beam import typehints
  from apache_beam.metrics import Metrics
  from magenta.models.music_vae import configs
  import note_seq
  from note_seq.sequences_lib import split_note_sequence_on_time_changes
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: run_pipeline(input_tfrecord, output_tfrecord, output_shards, config, filters, pipeline_options) without return types