code: def test_constant_feature(
      extrapolate_constant,
      extrapolate_constant_perc,
      extrapolate_constant_min,
      constant_value,
      feature,
  ):
      X = np.random.normal(size=(100, 2))
      X[:, feature] = constant_value
      predict = lambda x: x.sum(axis=1)  # dummy predictor # noqa
  
      q, ale, ale0 = ale_num(
          predictor=predict,
          X=X,
          feature=feature,
          extrapolate_constant=extrapolate_constant,
          extrapolate_constant_perc=extrapolate_constant_perc,
          extrapolate_constant_min=extrapolate_constant_min,
      )
      if extrapolate_constant:
          delta = max(
              constant_value * extrapolate_constant_perc / 100,
              extrapolate_constant_min,
          )
          assert_allclose(
              q,
              np.array(
                  [constant_value - delta, constant_value + delta]
              ),
          )
      else:
          assert_allclose(q, np.array([constant_value]))
          assert_allclose(ale, np.array([[0.0]]))
          assert_allclose(ale0, np.array([0.0]))
  
imports: import re
  from copy import deepcopy
  import matplotlib.pyplot
  import numpy
  import pytest
  from numpy.testing import assert_allclose
  from pytest_lazyfixture import lazy_fixture
  from alibi.api.defaults import DEFAULT_DATA_ALE, DEFAULT_META_ALE
  from alibi.api.interfaces import Explanation
  from alibi.explainers.ale import _plot_one_ale_num, adaptive_grid, ale_num, get_quantiles, minimum_satisfied, plot_ale
label_desc: Use image node_id 7 for calling a global function with example usage: test_constant_feature(extrapolate_constant, extrapolate_constant_perc, extrapolate_constant_min, constant_value, feature) without return types