code: def _load_generator_from_bundle_file(bundle_file):
      """Returns initialized generator from bundle file path or None if fails."""
      try:
          bundle = sequence_generator_bundle.read_bundle_file(
              bundle_file
          )
      except sequence_generator_bundle.GeneratorBundleParseError:
          print("Failed to parse bundle file: %s" % FLAGS.bundle_file)
          return None
  
      generator_id = bundle.generator_details.id
      if generator_id not in _GENERATOR_MAP:
          print(
              "Unrecognized SequenceGenerator ID '%s' in bundle file: %s"
              % (generator_id, FLAGS.bundle_file)
          )
          return None
  
      generator = _GENERATOR_MAP[generator_id](
          checkpoint=None, bundle=bundle
      )
      generator.initialize()
      print(
          "Loaded '%s' generator bundle from file '%s'."
          % (bundle.generator_details.id, bundle_file)
      )
      return generator
  
imports: import functools
  import re
  import threading
  import time
  from magenta.interfaces.midi import midi_hub
  from magenta.interfaces.midi import midi_interaction
  from magenta.models.drums_rnn import drums_rnn_sequence_generator
  from magenta.models.melody_rnn import melody_rnn_sequence_generator
  from magenta.models.performance_rnn import performance_sequence_generator
  from magenta.models.pianoroll_rnn_nade import pianoroll_rnn_nade_sequence_generator
  from magenta.models.polyphony_rnn import polyphony_sequence_generator
  from magenta.models.shared import sequence_generator_bundle
  import six
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: _load_generator_from_bundle_file(bundle_file) and returns: generator, None, None