code: def load_model(model_uri, dst_path=None):
      """
      Load a LightGBM model from a local file or a run.
  
      :param model_uri: The location, in URI format, of the MLflow model. For example:
  
                        - ``/Users/me/path/to/local/model``
                        - ``relative/path/to/local/model``
                        - ``s3://my_bucket/path/to/model``
                        - ``runs:/<mlflow_run_id>/run-relative/path/to/model``
  
                        For more information about supported URI schemes, see
                        `Referencing Artifacts <https://www.mlflow.org/docs/latest/tracking.html#
                        artifact-locations>`_.
      :param dst_path: The local filesystem path to which to download the model artifact.
                       This directory must already exist. If unspecified, a local output
                       path will be created.
  
      :return: A LightGBM model (an instance of `lightgbm.Booster`_) or a LightGBM scikit-learn
               model, depending on the saved model class specification.
  
      .. code-block:: python
          :caption: Example
  
          from lightgbm import LGBMClassifier
          from sklearn import datasets
          import mlflow
  
          # Auto log all MLflow entities
          mlflow.lightgbm.autolog()
  
          # Load iris dataset
          X, y = datasets.load_iris(return_X_y=True, as_frame=True)
  
          # Initialize our model
          model = LGBMClassifier(objective="multiclass", random_state=42)
  
          # Train the model
          model.fit(X, y)
  
          # Load model for inference
          model_uri = f"runs:/{mlflow.last_active_run().info.run_id}/model"
          loaded_model = mlflow.lightgbm.load_model(model_uri)
          print(loaded_model.predict(X[:5]))
  
      .. code-block:: text
          :caption: Output
  
          [0 0 0 0 0]
      """
      local_model_path = _download_artifact_from_uri(
          artifact_uri=model_uri, output_path=dst_path
      )
      flavor_conf = _get_flavor_configuration(
          local_model_path, FLAVOR_NAME
      )
      _add_code_from_conf_to_system_path(local_model_path, flavor_conf)
      return _load_model(path=local_model_path)
  
imports: import functools
  import json
  import logging
  import os
  import tempfile
  from copy import deepcopy
  from typing import Any, Dict, Optional
  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.pandas_dataset import from_pandas
  from mlflow.entities.dataset_input import DatasetInput
  from mlflow.entities.input_tag import InputTag
  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.sklearn import _SklearnTrainingSession
  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.utils import _get_fully_qualified_class_name
  from mlflow.utils.arguments_utils import _get_arg_names
  from mlflow.utils.autologging_utils import ENSURE_AUTOLOGGING_ENABLED_TEXT, INPUT_EXAMPLE_SAMPLE_ROWS, InputExampleInfo, MlflowAutologgingQueueingClient, autologging_integration, batch_metrics_logger, get_mlflow_run_params_for_fn_args, picklable_exception_safe_function, resolve_input_example_and_signature, safe_patch
  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.mlflow_tags import MLFLOW_DATASET_CONTEXT
  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
label_desc: Use image node_id 8 for calling a global function with example usage: load_model(model_uri, dst_path) and returns: _load_model