code: def test_log_explanation_with_artifact_path(regressor, artifact_path):
      model = regressor.model
      X = regressor.X
  
      with mlflow.start_run() as run:
          explanation_path = mlflow.shap.log_explanation(
              model.predict, X, artifact_path
          )
  
      # Assert no figure is open
      assert len(plt.get_fignums()) == 0
  
      artifacts = set(yield_artifacts(run.info.run_id))
  
      assert explanation_path == os.path.join(
          run.info.artifact_uri, artifact_path
      )
      assert artifacts == {
          os.path.join(artifact_path, "base_values.npy"),
          os.path.join(artifact_path, "shap_values.npy"),
          os.path.join(artifact_path, "summary_bar_plot.png"),
      }
  
      shap_values = np.load(
          os.path.join(explanation_path, "shap_values.npy")
      )
      base_values = np.load(
          os.path.join(explanation_path, "base_values.npy")
      )
      np.testing.assert_array_equal(shap_values, regressor.shap_values)
      np.testing.assert_array_equal(base_values, regressor.base_values)
  
imports: import os
  from collections import namedtuple
  import matplotlib.pyplot
  import numpy
  import pandas
  import pytest
  import shap
  from sklearn.datasets import load_diabetes, load_iris
  from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
  import mlflow
  from mlflow import MlflowClient
label_desc: Use image node_id 10 for calling a global function with example usage: test_log_explanation_with_artifact_path(regressor, artifact_path) without return types