code: def test_log_matplotlib_figure():
      fig, ax = plt.subplots()
      ax.plot([0, 1], [2, 3])
  
      with mlflow.start_run() as run:
          mlflow.shap._log_matplotlib_figure(fig, "test.png")
          mlflow.shap._log_matplotlib_figure(
              fig, "test.png", artifact_path="dir"
          )
  
      artifacts = set(yield_artifacts(run.info.run_id))
      assert artifacts == {"test.png", "dir/test.png"}
  
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 7 for calling a global function with example usage: test_log_matplotlib_figure() without return types