code: def _binary_roc_auc_score(
      y_true, y_score, sample_weight=None, max_fpr=None
  ):
      """Binary roc auc score"""
      if len(np.unique(y_true)) != 2:
          raise ValueError(
              "Only one class present in y_true. ROC AUC score "
              "is not defined in that case."
          )
  
      fpr, tpr, _ = roc_curve(
          y_true, y_score, sample_weight=sample_weight
      )
      if max_fpr is None or max_fpr == 1:
          return auc(fpr, tpr)
      if max_fpr <= 0 or max_fpr > 1:
          raise ValueError(
              "Expected max_fpr in range (0, 1], got: %r".format(
                  max_fpr
              )
          )
  
      # Add a single point at max_fpr by linear interpolation
      stop = np.searchsorted(fpr, max_fpr, "right")
      x_interp = [fpr[stop - 1], fpr[stop]]
      y_interp = [tpr[stop - 1], tpr[stop]]
      tpr = np.append(
          tpr[:stop], np.interp(max_fpr, x_interp, y_interp)
      )
      fpr = np.append(fpr[:stop], max_fpr)
      partial_auc = auc(fpr, tpr)
  
      # McClish correction: standardize result to be 0.5 if non-discriminant
      # and 1 if maximal
      min_area = 0.5 * max_fpr**2
      max_area = max_fpr
      return 0.5 * (
          1 + (partial_auc - min_area) / (max_area - min_area)
      )
  
file_path: h2o-3/h2o-py/tests/pyunit_utils/sklearn_multinomial_auc_method.py
imports: import numpy
  from itertools import combinations
  from functools import partial
  from sklearn.utils import column_or_1d, check_consistent_length, check_array
  from sklearn.preprocessing import label_binarize
  from sklearn.metrics import auc, roc_curve
  from sklearn.utils.multiclass import type_of_target
label_desc: Use image node_id 9 for calling a global function with example usage: _binary_roc_auc_score(y_true, y_score, sample_weight, max_fpr) and returns: unknown, auc