code: def run():
      """Run the beam pipeline to create synthetic dataset."""
      pipeline_options = beam.options.pipeline_options.PipelineOptions(
          FLAGS.pipeline_options
      )
      with beam.Pipeline(options=pipeline_options) as pipeline:
          for gin_search_path in [GIN_PATH] + FLAGS.gin_search_path:
              gin.add_config_file_search_path(gin_search_path)
          gin.parse_config_files_and_bindings(
              FLAGS.gin_file, FLAGS.gin_param, skip_unknown=True
          )
  
          np.random.seed(FLAGS.random_seed)
          _ = (
              pipeline
              | beam.Create(
                  np.random.randint(2**32, size=FLAGS.num_examples)
              )
              | beam.ParDo(GenerateExampleFn(gin.config_str()))
              | beam.Reshuffle()
              | beam.Map(_float_dict_to_tfexample)
              | beam.io.tfrecordio.WriteToTFRecord(
                  FLAGS.output_tfrecord_path,
                  num_shards=FLAGS.num_shards,
                  coder=beam.coders.ProtoCoder(tf.train.Example),
              )
          )
  
file_path: ddsp/ddsp/training/data_preparation/ddsp_generate_synthetic_dataset.py
imports: from absl import app
  from absl import flags
  import apache_beam
  from ddsp.training.data_preparation import synthetic_data
  import gin
  import numpy
  import pkg_resources
  import tensorflow.compat.v2
label_desc: Use image node_id 2 for calling a global function with example usage: run() without return types