code: def assert_pd_ice_values(
      feature: int,
      target_idx: int,
      kind: str,
      explanation: Explanation,
      ax: plt.Axes,
  ):
      """Checks if both the plotted pd and ice values are correct."""
      if kind in ["average", "both"]:
          # check the pd values
          line = ax.lines[0] if kind == "average" else ax.lines[2]
          assert_pd_values(
              feature_values=explanation.data["feature_values"][
                  feature
              ],
              pd_values=explanation.data["pd_values"][feature][
                  target_idx
              ],
              line=line,
          )
  
      if kind in ["individual", "both"]:
          # check the ice values
          lines = ax.lines if kind == "individual" else ax.lines[:2]
          assert_ice_values(
              feature_values=explanation.data["feature_values"][
                  feature
              ],
              ice_values=explanation.data["ice_values"][feature][
                  target_idx
              ],
              lines=lines,
          )
  
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 24 for calling a global function with example usage: assert_pd_ice_values(feature, target_idx, kind, explanation, ax) without return types