code: def main(unused_argv):
      """Saves bundle or runs generator based on flags."""
      tf.logging.set_verbosity(FLAGS.log)
  
      bundle = get_bundle()
  
      if bundle:
          config_id = bundle.generator_details.id
          config = drums_rnn_model.default_configs[config_id]
          config.hparams.parse(FLAGS.hparams)
      else:
          config = drums_rnn_config_flags.config_from_flags()
      # Having too large of a batch size will slow generation down unnecessarily.
      config.hparams.batch_size = min(
          config.hparams.batch_size,
          FLAGS.beam_size * FLAGS.branch_factor,
      )
  
      generator = (
          drums_rnn_sequence_generator.DrumsRnnSequenceGenerator(
              model=drums_rnn_model.DrumsRnnModel(config),
              details=config.details,
              steps_per_quarter=config.steps_per_quarter,
              checkpoint=get_checkpoint(),
              bundle=bundle,
          )
      )
  
      if FLAGS.save_generator_bundle:
          bundle_filename = os.path.expanduser(FLAGS.bundle_file)
          if FLAGS.bundle_description is None:
              tf.logging.warning("No bundle description provided.")
          tf.logging.info(
              "Saving generator bundle to %s", bundle_filename
          )
          generator.create_bundle_file(
              bundle_filename, FLAGS.bundle_description
          )
      else:
          run_with_flags(generator)
  
file_path: magenta/magenta/models/drums_rnn/drums_rnn_generate.py
imports: import ast
  import os
  import time
  from magenta.models.drums_rnn import drums_rnn_config_flags
  from magenta.models.drums_rnn import drums_rnn_model
  from magenta.models.drums_rnn import drums_rnn_sequence_generator
  from magenta.models.shared import sequence_generator
  from magenta.models.shared import sequence_generator_bundle
  import note_seq
  from note_seq.protobuf import generator_pb2
  from note_seq.protobuf import music_pb2
  import tensorflow.compat.v1
label_desc: Use image node_id 4 for calling a global function with example usage: main(unused_argv) without return types