code: def load_model(
      model_uri, dfs_tmpdir=None, dst_path=None, **kwargs
  ):  # pylint: disable=unused-argument
      """
      Load the Johnsnowlabs MLflow model from the path.
  
      Args:
          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``
              - ``models:/<model_name>/<model_version>``
              - ``models:/<model_name>/<stage>``
  
              For more information about supported URI schemes, see
              `Referencing Artifacts <https://www.mlflow.org/docs/latest/concepts.html#
              artifact-locations>`_.
          dfs_tmpdir: Temporary directory path on Distributed (Hadoop) File System (DFS) or local
              filesystem if running in local mode. The model is loaded from this
              destination. Defaults to ``/tmp/mlflow``.
          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.
  
      Returns:
          A
          `nlu.NLUPipeline <https://nlp.johnsnowlabs.com/docs/en/jsl/predict_api>`_.
  
      .. code-block:: python
          :caption: Example
  
          import mlflow
          from johnsnowlabs import nlp
          import os
  
          # Write your raw license.json string into the 'JOHNSNOWLABS_LICENSE_JSON' env variable
          creds = {
              "AWS_ACCESS_KEY_ID": "...",
              "AWS_SECRET_ACCESS_KEY": "...",
              "SPARK_NLP_LICENSE": "...",
              "SECRET": "...",
          }
          os.environ["JOHNSNOWLABS_LICENSE_JSON"] = json.dumps(creds)
  
          # start a spark session
          nlp.start()
          # Load you MLflow Model
          model = mlflow.johnsnowlabs.load_model("johnsnowlabs_model")
  
          # Make predictions on test documents
          # supports datatypes defined in https://nlp.johnsnowlabs.com/docs/en/jsl/predict_api#supported-data-types
          prediction = model.transform(["I love Covid", "I hate Covid"])
      """
      # This MUST be called prior to appending the model flavor to `model_uri` in order
      # for `artifact_path` to take on the correct value for model loading via mlflowdbfs.
      _validate_env_vars()
      root_uri, artifact_path = _get_root_uri_and_artifact_path(
          model_uri
      )
  
      flavor_conf = _get_flavor_configuration_from_uri(
          model_uri, FLAVOR_NAME, _logger
      )
      local_mlflow_model_path = _download_artifact_from_uri(
          artifact_uri=model_uri, output_path=dst_path
      )
      _add_code_from_conf_to_system_path(
          local_mlflow_model_path, flavor_conf
      )
  
      if _should_use_mlflowdbfs(model_uri):
          from pyspark.ml.pipeline import PipelineModel
  
          mlflowdbfs_path = _mlflowdbfs_path(
              DatabricksArtifactRepository._extract_run_id(model_uri),
              artifact_path,
          )
          with databricks_utils.MlflowCredentialContext(
              get_databricks_profile_uri_from_artifact_uri(root_uri)
          ):
              return PipelineModel.load(mlflowdbfs_path)
  
      sparkml_model_uri = append_to_uri_path(
          model_uri, flavor_conf["model_data"]
      )
      local_sparkml_model_path = str(
          Path(local_mlflow_model_path) / flavor_conf["model_data"]
      )
      return _load_model(
          model_uri=sparkml_model_uri,
          dfs_tmpdir_base=dfs_tmpdir,
          local_model_path=local_sparkml_model_path,
      )
  
imports: import json
  import logging
  import os
  import posixpath
  import shutil
  import sys
  from pathlib import Path
  from typing import Any, Dict, Optional
  import yaml
  import mlflow
  from mlflow import mleap, pyfunc
  from mlflow.environment_variables import MLFLOW_DFS_TMP
  from mlflow.models import Model
  from mlflow.models.model import MLMODEL_FILE_NAME
  from mlflow.models.signature import ModelSignature
  from mlflow.models.utils import ModelInputExample, _save_example
  from mlflow.spark import _HadoopFileSystem, _maybe_save_model, _mlflowdbfs_path, _should_use_mlflowdbfs
  from mlflow.store.artifact.databricks_artifact_repo import DatabricksArtifactRepository
  from mlflow.tracking._model_registry import DEFAULT_AWAIT_MAX_SLEEP_SECONDS
  from mlflow.tracking.artifact_utils import _download_artifact_from_uri, _get_root_uri_and_artifact_path
  from mlflow.utils import databricks_utils
  from mlflow.utils.annotations import experimental
  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
  from mlflow.utils.file_utils import TempDir, get_total_file_size, shutil_copytree_without_file_permissions, write_to
  from mlflow.utils.model_utils import _add_code_from_conf_to_system_path, _get_flavor_configuration_from_uri, _validate_and_copy_code_paths
  from mlflow.utils.requirements_utils import _get_pinned_requirement
  from mlflow.utils.uri import append_to_uri_path, dbfs_hdfs_uri_to_fuse_path, generate_tmp_dfs_path, get_databricks_profile_uri_from_artifact_uri, is_local_uri, is_valid_dbfs_uri
label_desc: Use image node_id 11 for calling a global function with example usage: load_model(model_uri, dfs_tmpdir, dst_path) and returns: _load_model, PipelineModel