code: def test_sklearn_autolog_works_without_matplotlib():
      mlflow.sklearn.autolog()
      model = RandomForestClassifier(
          max_depth=2, random_state=0, n_estimators=10
      )
      X, y = load_breast_cancer(return_X_y=True)
      with mlflow.start_run() as run, mock.patch(
          "mlflow.sklearn.utils._logger.warning"
      ) as mock_warning:
          model.fit(X, y)
          mock_warning.assert_called_once_with(
              AnyStringWith("Failed to import matplotlib")
          )
  
      run = MlflowClient().get_run(run.info.run_id)
      expected_metric_keys = {
          "training_score",
          "training_accuracy_score",
          "training_precision_score",
          "training_recall_score",
          "training_f1_score",
          "training_log_loss",
      }
      assert set(run.data.metrics).issuperset(expected_metric_keys)
  
file_path: mlflow/tests/sklearn/test_sklearn_autolog_without_matplotlib.py
imports: from unittest import mock
  import pytest
  from sklearn.datasets import load_breast_cancer
  from sklearn.ensemble import RandomForestClassifier
  import mlflow
  from mlflow import MlflowClient
  from tests.helper_functions import AnyStringWith
label_desc: Use image node_id 2 for calling a global function with example usage: test_sklearn_autolog_works_without_matplotlib() without return types