code: def test_log_model_with_pip_requirements(shap_model, tmp_path):
      expected_mlflow_version = _mlflow_major_version_string()
      sklearn_default_reqs = (
          mlflow.sklearn.get_default_pip_requirements(
              include_cloudpickle=True
          )
      )
      # Path to a requirements file
      req_file = tmp_path.joinpath("requirements.txt")
      req_file.write_text("a")
      with mlflow.start_run():
          mlflow.shap.log_explainer(
              shap_model, "model", pip_requirements=str(req_file)
          )
          _assert_pip_requirements(
              mlflow.get_artifact_uri("model"),
              [expected_mlflow_version, "a", *sklearn_default_reqs],
              strict=False,
          )
  
      # List of requirements
      with mlflow.start_run():
          mlflow.shap.log_explainer(
              shap_model,
              "model",
              pip_requirements=[f"-r {req_file}", "b"],
          )
          _assert_pip_requirements(
              mlflow.get_artifact_uri("model"),
              [
                  expected_mlflow_version,
                  "a",
                  "b",
                  *sklearn_default_reqs,
              ],
              strict=False,
          )
  
      # Constraints file
      with mlflow.start_run():
          mlflow.shap.log_explainer(
              shap_model,
              "model",
              pip_requirements=[f"-c {req_file}", "b"],
          )
          _assert_pip_requirements(
              mlflow.get_artifact_uri("model"),
              [
                  expected_mlflow_version,
                  "b",
                  "-c constraints.txt",
                  *sklearn_default_reqs,
              ],
              ["a"],
              strict=False,
          )
  
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 10 for calling a global function with example usage: test_log_model_with_pip_requirements(shap_model, tmp_path) without return types