code: def main(_):
      flags.mark_flags_as_required(
          ["input_tfrecord", "output_tfrecord", "config"]
      )
  
      filters = (
          None
          if not FLAGS.enable_filtering
          else {  # pylint: disable=g-long-ternary
              "max_total_time": FLAGS.max_total_time,
              "max_num_notes": FLAGS.max_num_notes,
              "min_velocities": FLAGS.min_velocities,
              "min_metric_positions": FLAGS.min_metric_positions,
              "is_drum": FLAGS.is_drum,
              "drums_only": FLAGS.drums_only,
          }
      )
      pipeline_options = beam.options.pipeline_options.PipelineOptions(
          FLAGS.pipeline_options
      )
      run_pipeline(
          FLAGS.input_tfrecord,
          FLAGS.output_tfrecord,
          FLAGS.output_shards,
          FLAGS.config,
          filters,
          pipeline_options,
      )
  
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 3 for calling a global function with example usage: main(_) without return types