code: def _plot_one_pd_cat(
      exp: Explanation,
      feature: int,
      target_idx: int,
      pd_limits: Optional[Tuple[float, float]] = None,
      center: bool = False,
      n_ice: Union[Literal["all"], int, List[str]] = 100,
      ax: Optional["plt.Axes"] = None,
      pd_cat_kw: Optional[dict] = None,
      ice_cat_kw: Optional[dict] = None,
  ) -> Tuple["plt.Axes", Optional[Tuple[float, float]]]:
      """
      Plots one way partial dependence curve for a single categorical feature.
  
      Parameters
      ----------
      exp, feature, center, pd_limits, n_ice, pd_cat_kw, ice_cat_kw
          See :py:meth:`alibi.explainers.partial_dependence.plot_pd` method.
      target_idx
          The target index for which to plot the partial dependence (PD) curves. An integer
          denoting target index in `exp.meta['params'].target_names`
      ax
          Pre-existing axes for the plot. Otherwise, call `matplotlib.pyplot.gca()` internally.
  
      Returns
      -------
      `matplotlib` axes and a tuple containing the minimum and maximum y-limits.
      """
      import matplotlib.pyplot as plt
  
      if ax is None:
          ax = plt.gca()
  
      feature_names = exp.data["feature_names"][feature]
      feature_values = exp.data["feature_values"][feature]
      pd_values = (
          exp.data["pd_values"][feature][target_idx]
          if (exp.data["pd_values"] is not None)
          else None
      )
      ice_values = (
          exp.data["ice_values"][feature][target_idx].T
          if (exp.data["ice_values"] is not None)
          else None
      )
  
      # process `pd_values` and `ice_values`
      pd_values, ice_values = _process_pd_ice(
          exp=exp,
          pd_values=pd_values,
          ice_values=ice_values,
          n_ice=n_ice,
          center=center,
      )
  
      feature_index = exp.meta["params"]["feature_names"].index(
          feature_names
      )
      labels = [
          exp.meta["params"]["categorical_names"][feature_index][i]
          for i in feature_values.astype(np.int32)
      ]
  
      if exp.meta["params"]["kind"] == Kind.AVERAGE:
          default_pd_graph_kw = {
              "markersize": 8,
              "marker": "s",
              "color": "tab:blue",
          }
          pd_cat_kw = (
              default_pd_graph_kw
              if pd_cat_kw is None
              else {**default_pd_graph_kw, **pd_cat_kw}
          )
          ax.plot(labels, pd_values, **pd_cat_kw)
  
      elif exp.meta["params"]["kind"] == Kind.INDIVIDUAL:
          default_ice_cat_kw = {
              "markersize": 4,
              "marker": "s",
              "color": "lightsteelblue",
          }
          ice_cat_kw = (
              default_ice_cat_kw
              if ice_cat_kw is None
              else {**default_ice_cat_kw, **ice_cat_kw}
          )
          ax.plot(labels, ice_values, **ice_cat_kw)
  
      else:
          default_pd_cat_kw = {
              "markersize": 8,
              "marker": "s",
              "color": "tab:orange",
              "label": "average",
          }
          pd_cat_kw = (
              default_pd_cat_kw
              if pd_cat_kw is None
              else {**default_pd_cat_kw, **pd_cat_kw}
          )
  
          default_ice_cat_kw = {
              "alpha": 0.6,
              "markersize": 4,
              "marker": "s",
              "color": "lightsteelblue",
          }
          ice_cat_kw = (
              default_ice_cat_kw
              if ice_cat_kw is None
              else {**default_ice_cat_kw, **ice_cat_kw}
          )
  
          ax.plot(labels, ice_values, **ice_cat_kw)
          ax.plot(labels, pd_values, **pd_cat_kw)
          ax.legend()
  
      # save `ylim`
      ylim = ax.get_ylim() if pd_limits is None else pd_limits
  
      # rotate xticks labels
      ax.tick_params(axis="x", rotation=90)
  
      # set axis labels
      ax.set_xlabel(feature_names)
      ax.set_ylabel(exp.meta["params"]["target_names"][target_idx])
      return ax, ylim
  
imports: import copy
  import logging
  import math
  import numbers
  import sys
  from abc import ABC, abstractmethod
  from enum import Enum
  from typing import Callable, Dict, Iterable, List, Optional, Tuple, Union, no_type_check
  import matplotlib.pyplot
  import numpy
  from scipy.stats.mstats import mquantiles
  from sklearn.base import BaseEstimator, is_classifier, is_regressor
  from sklearn.ensemble import RandomForestRegressor
  from sklearn.ensemble._gb import BaseGradientBoosting
  from sklearn.ensemble._hist_gradient_boosting.gradient_boosting import BaseHistGradientBoosting
  from sklearn.tree import DecisionTreeRegressor
  from sklearn.utils.extmath import cartesian
  from sklearn.utils.validation import check_is_fitted
  from tqdm import tqdm
  from alibi.api.defaults import DEFAULT_DATA_PD, DEFAULT_META_PD
  from alibi.api.interfaces import Explainer, Explanation
  from alibi.explainers.ale import get_quantiles
  from alibi.utils import _get_options_string
label_desc: Use image node_id 5 for calling a global function with example usage: _plot_one_pd_cat(exp, feature, target_idx, pd_limits, center, n_ice, ax, pd_cat_kw, ice_cat_kw) and returns: ax,  ylim