code: def main(argv=None):
      """Main entry point; defines and runs the pipeline."""
      known_args, pipeline_args = parse_cmdline(argv)
      # Copy over the example_info.json file before the pipeline starts.
      example_info_json = "{}*example_info.json".format(
          known_args.input_pattern_list.split(",")[0]
      )
      example_info_json_list = tf.io.gfile.glob(example_info_json)
      if example_info_json_list and tf.io.gfile.exists(
          example_info_json_list[0]
      ):
          training_dir = os.path.dirname(
              known_args.output_pattern_prefix
          )
          if not tf.io.gfile.exists(training_dir):
              tf.io.gfile.makedirs(training_dir)
          output_example_info_json = os.path.join(
              training_dir, "example_info.json"
          )
          if not tf.io.gfile.exists(output_example_info_json):
              tf.io.gfile.copy(
                  example_info_json_list[0], output_example_info_json
              )
  
      pipeline_options = PipelineOptions(pipeline_args)
      with beam.Pipeline(options=pipeline_options) as p:
          input_examples = read_from_tfrecords_files(
              p, known_args.input_pattern_list.split(",")
          )
          output_examples = shuffle_records(input_examples)
  
          _ = output_examples | beam.io.WriteToTFRecord(
              file_path_prefix=known_args.output_pattern_prefix,
              file_name_suffix=".tfrecord.gz",
              coder=coders.BytesCoder(),
          )
          if known_args.output_dataset_config_pbtxt:
              if not known_args.output_dataset_name:
                  raise ValueError("Need to set output_dataset_name.")
              write_summary_string_to_file(
                  p,
                  output_examples,
                  known_args.input_pattern_list,
                  known_args.output_dataset_name,
                  known_args.output_pattern_prefix,
                  known_args.output_dataset_config_pbtxt,
              )
  
file_path: deepvariant/tools/shuffle_tfrecords_beam.py
imports: import argparse
  import hashlib
  import logging
  import os
  import textwrap
  import apache_beam
  from apache_beam import coders
  from apache_beam.options.pipeline_options import PipelineOptions
  import tensorflow.compat.v1
label_desc: Use image node_id 7 for calling a global function with example usage: main(argv) without return types