code: def test__plot_two_pd_num_cat(feature, explanation):
      """Test the `__plot_two_pd_num_cat` function."""
      target_idx = 0
  
      _, ax = plt.subplots()
      ax, _ = _plot_two_pd_num_cat(
          exp=explanation, feature=feature, target_idx=target_idx, ax=ax
      )
  
      feat0, feat1 = explanation.data["feature_names"][feature]
      feature_names = explanation.meta["params"]["feature_names"]
      categorical_names = explanation.meta["params"][
          "categorical_names"
      ]
  
      num_feat = (
          feat0
          if feature_names.index(feat0) not in categorical_names
          else feat1
      )
      cat_feat = (
          feat0
          if feature_names.index(feat0) in categorical_names
          else feat1
      )
  
      legend = ax.get_legend()
      legend_title = legend.get_texts()[0].get_text()
      legend_entries = sorted(
          [int(entry.get_text()) for entry in legend.get_texts()[1:]]
      )
  
      cat_idx = 0 if cat_feat == feat0 else 1
      cat_values = sorted(
          [
              int(val)
              for val in explanation.data["feature_values"][feature][
                  cat_idx
              ]
          ]
      )
  
      assert ax.get_xlabel() == num_feat
      assert legend_title == cat_feat
      assert legend_entries == cat_values
  
      num_idx = 0 if num_feat == feat0 else 1
      assert_deciles(
          xsegments=ax.collections[0].get_segments(),
          expected_xdeciles=explanation.data["feature_deciles"][
              feature
          ][num_idx],
      )
  
      pd_values = explanation.data["pd_values"][feature][target_idx]
      if num_idx == 0:
          pd_values = pd_values.T
  
      for i in range(
          1,
          len(explanation.data["feature_values"][feature][cat_idx]) + 1,
      ):
          x, y = ax.lines[i].get_xydata().T
          assert np.allclose(
              x, explanation.data["feature_values"][feature][num_idx]
          )
          assert np.allclose(y, pd_values[i - 1])
  
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 28 for calling a global function with example usage: test__plot_two_pd_num_cat(feature, explanation) without return types