code: def get_checkpoint():
      """Get the training dir or checkpoint path to be used by the model."""
      if (
          FLAGS.run_dir
          and FLAGS.bundle_file
          and not FLAGS.save_generator_bundle
      ):
          raise sequence_generator.SequenceGeneratorError(
              "Cannot specify both bundle_file and run_dir"
          )
      if FLAGS.run_dir:
          train_dir = os.path.join(
              os.path.expanduser(FLAGS.run_dir), "train"
          )
          return train_dir
      else:
          return None
  
file_path: magenta/magenta/models/performance_rnn/performance_rnn_generate.py
imports: import ast
  import os
  import time
  from magenta.models.performance_rnn import performance_model
  from magenta.models.performance_rnn import performance_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 1 for calling a global function with example usage: get_checkpoint() and returns: train_dir, None