code: def _load_keras_model(
      model_path, keras_module, save_format, **kwargs
  ):
      keras_models = importlib.import_module(
          keras_module.__name__ + ".models"
      )
      custom_objects = kwargs.pop("custom_objects", {})
      if saved_custom_objects := _load_custom_objects(
          model_path, _CUSTOM_OBJECTS_SAVE_PATH
      ):
          saved_custom_objects.update(custom_objects)
          custom_objects = saved_custom_objects
  
      if global_custom_objects := _load_custom_objects(
          model_path, _GLOBAL_CUSTOM_OBJECTS_SAVE_PATH
      ):
          global_custom_objects.update(custom_objects)
          custom_objects = global_custom_objects
  
      if os.path.isdir(model_path):
          model_path = os.path.join(model_path, _MODEL_SAVE_PATH)
  
      # If the save_format is HDF5, then we save with h5 file
      # extension to align with prior behavior of mlflow logging
      if save_format == "h5":
          model_path += ".h5"
      # Since TF 2.16.0, it only supports saving model in .h5 or .keras format.
      # But for backwards compatibility, we still save model without suffix
      # for older versions of TF.
      elif os.path.exists(model_path + ".keras"):
          model_path += ".keras"
  
      import tensorflow as tf
  
      # Using naive tuple-based comparison here rather than packaging.version.Version, because
      # the latter consider dev version e.g. 2.16.0.dev2023010 as ahead of 2.16. While that is
      # 'correct', we rather want to treat it is a part of 2.16 here.
      if save_format == "h5" and (2, 2, 3) <= Version(
          tf.__version__
      ).release < (2, 16):
          # NOTE: TF 2.2.3 does not work with unicode paths in python2. Pass in h5py.File instead
          # of string to avoid issues.
          import h5py
  
          with h5py.File(
              os.path.abspath(model_path), "r"
          ) as model_path:
              return keras_models.load_model(
                  model_path, custom_objects=custom_objects, **kwargs
              )
      else:
          # NOTE: Older versions of Keras only handle filepath.
          return keras_models.load_model(
              model_path, custom_objects=custom_objects, **kwargs
          )
  
imports: import atexit
  import importlib
  import logging
  import os
  import shutil
  import tempfile
  import warnings
  from typing import Any, Dict, NamedTuple, Optional
  import numpy
  import pandas
  import yaml
  from packaging.version import Version
  import mlflow
  from mlflow import pyfunc
  from mlflow.data.code_dataset_source import CodeDatasetSource
  from mlflow.data.numpy_dataset import from_numpy
  from mlflow.data.tensorflow_dataset import from_tensorflow
  from mlflow.exceptions import INVALID_PARAMETER_VALUE, MlflowException
  from mlflow.models import Model, ModelInputExample, ModelSignature, infer_signature
  from mlflow.models.model import MLMODEL_FILE_NAME
  from mlflow.models.signature import _infer_signature_from_input_example
  from mlflow.models.utils import _save_example
  from mlflow.tensorflow.callback import MLflowCallback
  from mlflow.tracking._model_registry import DEFAULT_AWAIT_MAX_SLEEP_SECONDS
  from mlflow.tracking.artifact_utils import _download_artifact_from_uri
  from mlflow.tracking.context import registry
  from mlflow.types.schema import TensorSpec
  from mlflow.utils import is_iterator
  from mlflow.utils.autologging_utils import PatchFunction, autologging_integration, batch_metrics_logger, get_autologging_config, log_fn_args_as_params, picklable_exception_safe_function, resolve_input_example_and_signature, safe_patch
  from mlflow.utils.autologging_utils.metrics_queue import add_to_metrics_queue, flush_metrics_queue
  from mlflow.utils.docstring_utils import LOG_MODEL_PARAM_DOCS, format_docstring
  from mlflow.utils.environment import _CONDA_ENV_FILE_NAME, _CONSTRAINTS_FILE_NAME, _PYTHON_ENV_FILE_NAME, _REQUIREMENTS_FILE_NAME, _mlflow_conda_env, _process_conda_env, _process_pip_requirements, _PythonEnv, _validate_env_arguments
  from mlflow.utils.file_utils import get_total_file_size, write_to
  from mlflow.utils.model_utils import _add_code_from_conf_to_system_path, _get_flavor_configuration, _validate_and_copy_code_paths, _validate_and_prepare_target_save_path
  from mlflow.utils.requirements_utils import _get_pinned_requirement
  from mlflow.utils.time import get_current_time_millis
label_desc: Use image node_id 8 for calling a global function with example usage: _load_keras_model(model_path, keras_module, save_format) and returns: keras_models, keras_models