code: def model_input_signature(model, keep_original_batch_size=False):
      """Inspect model to get its input signature.
  
      The model's input signature is a list with a single (possibly-nested) object.
      This is due to the Keras-enforced restriction that tensor inputs must be
      passed in as the first argument.
  
      For example, a model with input {'feature1': <Tensor>, 'feature2': <Tensor>}
      will have input signature: [{'feature1': TensorSpec, 'feature2': TensorSpec}]
  
      Args:
        model: Keras Model object.
        keep_original_batch_size: A boolean indicating whether we want to keep using
          the original batch size or set it to None. Default is `False`, which means
          that the batch dim of the returned input signature will always be set to
          `None`.
  
      Returns:
        A list containing either a single TensorSpec or an object with nested
        TensorSpecs. This list does not contain the `training` argument.
      """
      input_specs = model._get_save_spec(
          dynamic_batch=not keep_original_batch_size
      )  # pylint: disable=protected-access
      if input_specs is None:
          return None
      input_specs = _enforce_names_consistency(input_specs)
      # Return a list with a single element as the model's input signature.
      if (
          isinstance(input_specs, collections.abc.Sequence)
          and len(input_specs) == 1
      ):
          # Note that the isinstance check filters out single-element dictionaries,
          # which should also be wrapped as a single-element list.
          return input_specs
      else:
          return [input_specs]
  
imports: import collections
  import copy
  import os
  from tensorflow.python.eager import def_function
  from tensorflow.python.keras import backend
  from tensorflow.python.keras import losses
  from tensorflow.python.keras import optimizer_v1
  from tensorflow.python.keras import optimizers
  from tensorflow.python.keras.engine import base_layer_utils
  from tensorflow.python.keras.utils import generic_utils
  from tensorflow.python.keras.utils import version_utils
  from tensorflow.python.keras.utils.io_utils import ask_to_proceed_with_overwrite
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import nest
label_desc: Use image node_id 2 for calling a global function with example usage: model_input_signature(model, keep_original_batch_size) and returns: None, input_specs, list