code: def _load_pyfunc(
      model_path: str, model_config: Optional[Dict[str, Any]] = None
  ):
      pyfunc_config = _get_flavor_configuration(
          model_path=model_path, flavor_name=mlflow.pyfunc.FLAVOR_NAME
      )
  
      python_model_cloudpickle_version = pyfunc_config.get(
          CONFIG_KEY_CLOUDPICKLE_VERSION, None
      )
      if python_model_cloudpickle_version is None:
          mlflow.pyfunc._logger.warning(
              "The version of CloudPickle used to save the model could not be found in the MLmodel"
              " configuration"
          )
      elif python_model_cloudpickle_version != cloudpickle.__version__:
          # CloudPickle does not have a well-defined cross-version compatibility policy. Micro version
          # releases have been known to cause incompatibilities. Therefore, we match on the full
          # library version
          mlflow.pyfunc._logger.warning(
              "The version of CloudPickle that was used to save the model, `CloudPickle %s`, differs"
              " from the version of CloudPickle that is currently running, `CloudPickle %s`, and may"
              " be incompatible",
              python_model_cloudpickle_version,
              cloudpickle.__version__,
          )
  
      python_model_subpath = pyfunc_config.get(
          CONFIG_KEY_PYTHON_MODEL, None
      )
      if python_model_subpath is None:
          raise MlflowException(
              "Python model path was not specified in the model configuration"
          )
      with open(
          os.path.join(model_path, python_model_subpath), "rb"
      ) as f:
          python_model = cloudpickle.load(f)
  
      artifacts = {}
      for saved_artifact_name, saved_artifact_info in pyfunc_config.get(
          CONFIG_KEY_ARTIFACTS, {}
      ).items():
          artifacts[saved_artifact_name] = os.path.join(
              model_path,
              saved_artifact_info[CONFIG_KEY_ARTIFACT_RELATIVE_PATH],
          )
  
      context = PythonModelContext(
          artifacts=artifacts, model_config=model_config
      )
      python_model.load_context(context=context)
      signature = mlflow.models.Model.load(model_path).signature
      return _PythonModelPyfuncWrapper(
          python_model=python_model,
          context=context,
          signature=signature,
      )
  
imports: import inspect
  import logging
  import os
  import shutil
  from abc import ABCMeta, abstractmethod
  from pathlib import Path
  from typing import Any, Dict, List, Optional
  import cloudpickle
  import yaml
  import mlflow.pyfunc
  import mlflow.utils
  from mlflow.exceptions import MlflowException
  from mlflow.models import Model
  from mlflow.models.model import MLMODEL_FILE_NAME
  from mlflow.models.signature import _extract_type_hints
  from mlflow.tracking.artifact_utils import _download_artifact_from_uri
  from mlflow.utils.annotations import experimental
  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
  from mlflow.utils.file_utils import TempDir, _copy_file_or_tree, get_total_file_size, write_to
  from mlflow.utils.model_utils import _get_flavor_configuration
  from mlflow.utils.requirements_utils import _get_pinned_requirement
label_desc: Use image node_id 5 for calling a global function with example usage: _load_pyfunc(model_path, model_config) and returns: _PythonModelPyfuncWrapper