code: def kl_divergence(
      y_true,
      y_pred=None,
      *,
      prot_attr=None,
      priv_group=1,
      sample_weight=None,
  ):
      r"""Compute the Kullback-Leibler divergence, :math:`KL(P_p||P_u) = \sum_y
      P_p(y)\log\left(\frac{P_p(y)}{P_u(y)}\right)`
  
      where :math:`P_p` is the probability distribution over labels of the
      privileged group and, similiarly, :math:`P_u` is the distribution of the
      unprivileged group.
  
      Args:
          y_true (pandas.Series): Ground truth (correct) target values. If y_pred
              is provided, this is ignored.
          y_pred (array-like, optional): Estimated targets as returned by a
              classifier.
          prot_attr (array-like, keyword-only): Protected attribute(s). If
              ``None``, all protected attributes in y_true are used.
          priv_group (scalar): The label of the privileged group.
          sample_weight (array-like, optional): Sample weights.
  
      Returns:
          float: KL divergence.
      """
      rate = base_rate if y_pred is None else selection_rate
      support = np.unique(
          y_true
      )  # TODO: is it correct to always use y_true?
      groups, _ = check_groups(y_true, prot_attr, ensure_binary=True)
      priv = np.unique(groups).tolist().index(priv_group)
      P1, P2 = zip(
          *[
              intersection(
                  rate,
                  y_true,
                  y_pred,
                  prot_attr=prot_attr,
                  pos_label=i,
                  sample_weight=sample_weight,
              )
              for i in support
          ]
      )
      return (
          sum(rel_entr(P1, P2)) if priv == 0 else sum(rel_entr(P2, P1))
      )
  
imports: from itertools import permutations
  from typing import Union
  import warnings
  import numpy
  import pandas
  from scipy.special import rel_entr
  from sklearn.metrics import make_scorer, recall_score, precision_score
  from sklearn.metrics import multilabel_confusion_matrix
  from sklearn.metrics._classification import _prf_divide, _check_zero_division
  from sklearn.neighbors import NearestNeighbors
  from sklearn.utils import check_X_y
  from aif360.metrics import ot_metric
  from aif360.sklearn.utils import check_inputs, check_groups
  from aif360.detectors.mdss.ScoringFunctions import BerkJones, Bernoulli
  from aif360.detectors.mdss.MDSS import MDSS
label_desc: Use image node_id 24 for calling a global function with example usage: kl_divergence(y_true, y_pred) and returns: unknown