code: def mdss_bias_score(
      y_true,
      probas_pred,
      X=None,
      subset=None,
      *,
      pos_label=1,
      scoring="Bernoulli",
      overpredicted=True,
      penalty=1e-17,
      **kwargs,
  ):
      """Compute the bias score for a prespecified group of records using a
      given scoring function.
  
      Args:
          y_true (array-like): Ground truth (correct) target values.
          probas_pred (array-like): Probability estimates of the positive class.
          X (DataFrame, optional): The dataset (containing the features) that was
              used to predict `probas_pred`. If not specified, the subset is
              returned as indices.
          subset (dict, optional): Mapping of column names to list of values.
              Samples are included in the subset if they match any value in each
              of the columns provided. If `X` is not specified, `subset` may
              be of the form `{'index': [0, 1, ...]}` or `None`. If `None`, score
              over the full set (note: `penalty` is irrelevant in this case).
          pos_label (scalar, optional): Label of the positive class.
          scoring (str or class): One of 'Bernoulli' or 'BerkJones' or
              subclass of
              :class:`aif360.metrics.mdss.ScoringFunctions.ScoringFunction`.
          overpredicted (bool): Flag for which direction to scan: `True` means we
              scan for a group whose expectations/predictions are systematically
              higher than observed. In other words, we scan for a group whose
              observed is systematically lower than the expectations. `False`
              means we scan for a group whose expectations/predictions are
              systematically lower than observed (observed is systematically
              higher than the expectations).
          privileged (bool): Deprecated. Use overpredicted instead.
          penalty (scalar): Penalty coefficient. Should be positive. The higher
              the penalty, the less complex (number of features and feature
              values) the highest scoring subset that gets returned is.
          **kwargs: Additional kwargs to be passed to `scoring` (not including
              `direction`).
  
      Returns:
          float: Bias score for the given group.
  
      See also:
          :func:`mdss_bias_scan`
      """
  
      if X is None:
          X = pd.DataFrame({"index": range(len(y_true))})
      else:
          X = X.reset_index(drop=True)  # match all indices
  
      expected = pd.Series(probas_pred).reset_index(drop=True)
      outcomes = pd.Series(y_true == pos_label, dtype=int).reset_index(
          drop=True
      )
  
      # TODO: DEPRECATED. Remove in next version.
      if "privileged" in kwargs:
          warnings.warn(
              "privileged is deprecated. Use overpredicted instead.",
              category=FutureWarning,
          )
          overpredicted = kwargs["privileged"]
      direction = "negative" if overpredicted else "positive"
      kwargs["direction"] = direction
  
      if scoring == "Bernoulli":
          scoring_function = Bernoulli(**kwargs)
      elif scoring == "BerkJones":
          scoring_function = BerkJones(**kwargs)
      else:
          scoring_function = scoring(**kwargs)
      scanner = MDSS(scoring_function)
  
      return scanner.score_current_subset(
          X, expected, outcomes, subset or {}, penalty
      )
  
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 28 for calling a global function with example usage: mdss_bias_score(y_true, probas_pred, X, subset) and returns: scanner