code: def test_explain_exact(target_col, method, kind):
      """Integration test to check correctness."""
      X = np.arange(90).reshape(9, 10).T
      y = np.arange(10) + 10 * target_col
  
      pfi = PermutationImportance(
          predictor=lambda x: x[:, target_col], score_fns=["accuracy"]
      )
      exp = pfi.explain(X=X, y=y, method=method, kind=kind)
  
      if method == "exact":
          feature_importance = exp.data["feature_importance"][0]
          best_idx = np.argmax(feature_importance)
  
          assert best_idx == target_col
          assert np.isclose(feature_importance[best_idx], 1.0)
          assert np.allclose(np.delete(feature_importance, best_idx), 0)
  
      else:
          feature_importance = exp.data["feature_importance"][0]
          mean = [fi["mean"] for fi in feature_importance]
          std = [fi["std"] for fi in feature_importance]
          samples = [fi["samples"] for fi in feature_importance]
  
          best_idx = np.argmax(mean)
          assert best_idx == target_col
          assert np.isclose(mean[best_idx], 1)
          assert np.allclose(np.delete(mean, best_idx), 0)
          assert np.allclose(std, 0)
          assert np.allclose(samples[best_idx], 1)
          assert np.all(
              np.allclose(s, 0) for s in np.delete(samples, best_idx)
          )
  
imports: import re
  from copy import deepcopy
  import matplotlib.pyplot
  import numpy
  import pytest
  from pytest_lazyfixture import lazy_fixture
  from sklearn.metrics import accuracy_score, f1_score, max_error
  from alibi.api.defaults import DEFAULT_DATA_PERMUTATION_IMPORTANCE, DEFAULT_META_PERMUTATION_IMPORTANCE
  from alibi.api.interfaces import Explanation
  from alibi.explainers import PermutationImportance, plot_permutation_importance
label_desc: Use image node_id 15 for calling a global function with example usage: test_explain_exact(target_col, method, kind) without return types