code: def test_sklearn_log_explainer_pyfunc():
      """
      Tests mlflow.shap log_explainer with mlflow
      serialization of the underlying model using pyfunc flavor
      """
  
      with mlflow.start_run() as run:
          run_id = run.info.run_id
  
          X, y = get_housing_data()
  
          model = sklearn.ensemble.RandomForestRegressor(
              n_estimators=100
          )
          model.fit(X, y)
  
          explainer_original = shap.Explainer(
              model.predict, X, algorithm="permutation"
          )
          shap_values_original = explainer_original(X[:2])
  
          mlflow.shap.log_explainer(
              explainer_original, "test_explainer"
          )
  
          explainer_pyfunc = mlflow.pyfunc.load_model(
              "runs:/" + run_id + "/test_explainer"
          )
          shap_values_new = explainer_pyfunc.predict(X[:2])
  
          np.testing.assert_allclose(
              shap_values_original.values,
              shap_values_new,
              rtol=100,
              atol=100,
          )
  
imports: import json
  from unittest import mock
  import numpy
  import pandas
  import pytest
  import shap
  import sklearn
  from numba import njit
  from packaging.version import Version
  from sklearn.datasets import fetch_california_housing, load_diabetes
  import mlflow
  import mlflow.pyfunc.scoring_server
  from mlflow import MlflowClient
  from mlflow.tracking.artifact_utils import _download_artifact_from_uri
  from mlflow.utils import PYTHON_VERSION
  from mlflow.utils.model_utils import _get_flavor_configuration
  from tests.helper_functions import _assert_pip_requirements, _compare_logged_code_paths, _mlflow_major_version_string, pyfunc_serve_and_score_model
label_desc: Use image node_id 5 for calling a global function with example usage: test_sklearn_log_explainer_pyfunc() without return types