code: def test_grid_points(adult_data, rf_classifier, use_int):
      """Checks whether the grid points provided are used for computing the partial dependencies."""
      rf, preprocessor = rf_classifier
      prediction_fn = lambda x: rf.predict_proba(
          preprocessor.transform(x)
      )  # noqa E731
  
      feature_names = adult_data["metadata"]["feature_names"]
      categorical_names = adult_data["metadata"]["category_map"]
      X_train = adult_data["X_train"]
  
      # construct random grid_points by choosing random values between min and max for each numerical feature,
      # and sampling at random from the categorical names for each categorical feature.
      grid_points = {}
      for i in range(len(feature_names)):
          if i not in categorical_names:
              min_val, max_val = (
                  X_train[:, i].min(),
                  X_train[:, i].max(),
              )
              size = np.random.randint(
                  low=1, high=len(np.unique(X_train[:, i]))
              )
              vals = np.random.uniform(min_val, max_val, size=size)
          else:
              size = np.random.randint(
                  low=1, high=len(categorical_names[i])
              )
              categorical_values = (
                  np.arange(len(categorical_names[i]))
                  if use_int
                  else categorical_names[i]
              )
              vals = np.random.choice(
                  categorical_values, size=size, replace=False
              )
  
          grid_points[i] = vals
  
      # define explainer
      explainer = PartialDependence(
          predictor=prediction_fn,
          feature_names=feature_names,
          categorical_names=categorical_names,
      )
  
      # compute explanation for every feature using the grid_points
      exp = explainer.explain(
          X=X_train[:100],
          features=None,
          kind="average",
          grid_points=grid_points,
      )
  
      for i in range(len(feature_names)):
          np.testing.assert_allclose(
              exp.data["feature_values"][i], grid_points[i]
          )
  
imports: import re
  import sys
  from copy import deepcopy
  from typing import Dict, List, Optional, Tuple, Union
  from packaging import version
  import matplotlib.pyplot
  import numpy
  import pandas
  import pytest
  from pytest_lazyfixture import lazy_fixture
  from sklearn.base import BaseEstimator
  from sklearn.datasets import make_classification
  from sklearn.ensemble import GradientBoostingClassifier
  from sklearn.exceptions import NotFittedError
  from sklearn.inspection import partial_dependence
  from sklearn.model_selection import train_test_split
  from sklearn.multioutput import MultiOutputClassifier
  from sklearn.pipeline import Pipeline
  from sklearn.utils import Bunch, shuffle
  import sklearn
  from alibi.api.defaults import DEFAULT_DATA_PD, DEFAULT_META_PD
  from alibi.api.interfaces import Explanation
  from alibi.explainers import PartialDependence, TreePartialDependence, plot_pd
  from alibi.explainers.partial_dependence import _plot_one_pd_cat, _plot_one_pd_num, _plot_two_pd_cat_cat, _plot_two_pd_num_cat, _plot_two_pd_num_num, _process_pd_ice, _sample_ice
label_desc: Use image node_id 11 for calling a global function with example usage: test_grid_points(adult_data, rf_classifier, use_int) without return types