code: def clone_model(model: tf.keras.Model) -> tf.keras.Model:
      """Clone a sequential, functional or subclassed tf.keras.Model."""
      try:  # sequential or functional model
          return tf.keras.models.clone_model(model)
      except ValueError:  # subclassed model
          try:
              config = model.get_config()
          except NotImplementedError:
              config = {}
          return model.__class__.from_config(config)
  
imports: import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: clone_model(model) and returns: tf, model