code: def test_compute_metric_error():
      """Test if an error is raised when the metric function does not have the `y_true` or
      `y_pred` or `y_score` arguments."""
      with pytest.raises(ValueError) as err1:
          PermutationImportance._compute_metric(
              metric_fn=lambda y, y_pred: None, y=None, y_hat=None
          )
  
      with pytest.raises(ValueError) as err2:
          PermutationImportance._compute_metric(
              metric_fn=lambda y_true, y_hat: None, y=None, y_hat=None
          )
  
      assert (
          "The `scoring` function must have the argument `y_true` in its definition."
          in str(err1.value)
      )
      assert (
          "The `scoring` function must have the argument `y_pred` or `y_score` in its definition."
          in str(err2.value)
      )
  
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 7 for calling a global function with example usage: test_compute_metric_error() without return types