code: def inject_functional_model_class(cls):
      """Inject `Functional` into the hierarchy of this class if needed."""
      from keras.models import functional
  
      if cls == Model:
          return functional.Functional
      # In case there is any multiple inheritance, we stop injecting the
      # class if keras model is not in its class hierarchy.
      if cls == object:
          return object
  
      cls.__bases__ = tuple(
          inject_functional_model_class(base) for base in cls.__bases__
      )
      # Trigger any `__new__` class swapping that needed to happen on `Functional`
      # but did not because functional was not in the class hierarchy.
      cls.__new__(cls)
  
      return cls
  
imports: import inspect
  import json
  import os
  import warnings
  from keras import backend
  from keras import utils
  from keras.api_export import keras_export
  from keras.layers.layer import Layer
  from keras.models.variable_mapping import map_trackable_variables
  from keras.saving import saving_api
  from keras.saving import saving_lib
  from keras.trainers import trainer
  from keras.utils import io_utils
  from keras.utils import summary_utils
  from keras.utils import traceback_utils
label_desc: Use image node_id 3 for calling a global function with example usage: inject_functional_model_class(cls) and returns: cls, functional, object