code: def test_explainer_to_permutationexplainer():
      """Checks that Explainer maps to PermutationExplainer as expected."""
  
      (
          X_train,
          X_test,
          y_train,
          _,
      ) = sklearn.model_selection.train_test_split(
          *shap.datasets.adult(), test_size=0.1, random_state=0
      )
      lr = sklearn.linear_model.LogisticRegression(solver="liblinear")
      lr.fit(X_train, y_train)
  
      explainer = shap.Explainer(lr.predict_proba, masker=X_train)
      assert isinstance(explainer, shap.PermutationExplainer)
  
      # ensures a proper error message is raised if a masker is not provided (GH #3310)
      with pytest.raises(
          ValueError,
          match=r"masker cannot be None",
      ):
          explainer = shap.Explainer(lr.predict_proba)
          _ = explainer(X_test)
  
imports: import pytest
  import sklearn
  import shap
label_desc: Use image node_id 1 for calling a global function with example usage: test_explainer_to_permutationexplainer() without return types