code: def roc_auc_score(
      y_true,
      y_score,
      *,
      average="macro",
      sample_weight=None,
      max_fpr=None,
      multi_class="raise",
      labels=None,
  ):
      y_type = _daal_type_of_target(y_true)
      y_true = check_array(y_true, ensure_2d=False, dtype=None)
      y_score = check_array(y_score, ensure_2d=False)
  
      _patching_status = PatchingConditionsChain(
          "sklearn.metrics.roc_auc_score"
      )
      _dal_ready = _patching_status.and_conditions(
          [
              (
                  y_type[0] == "binary"
                  and not (y_score.ndim == 2 and y_score.shape[1] > 2),
                  "y_true type is not one-dimensional binary.",
              )
          ]
      )
  
      _patching_status.write_log()
      if y_type[0] == "multiclass" or (
          y_type[0] == "binary"
          and y_score.ndim == 2
          and y_score.shape[1] > 2
      ):
          # do not support partial ROC computation for multiclass
          if max_fpr is not None and max_fpr != 1.0:
              raise ValueError(
                  "Partial AUC computation not available in "
                  "multiclass setting, 'max_fpr' must be"
                  " set to `None`, received `max_fpr={0}` "
                  "instead".format(max_fpr)
              )
          if multi_class == "raise":
              raise ValueError("multi_class must be in ('ovo', 'ovr')")
  
          return multiclass_roc_auc_score(
              y_true,
              y_score,
              labels,
              multi_class,
              average,
              sample_weight,
          )
  
      if y_type[0] == "binary":
          labels = y_type[1]
          _dal_ready = _patching_status.and_conditions(
              [
                  (
                      len(labels) == 2,
                      "Number of unique labels is not equal to 2.",
                  ),
                  (
                      max_fpr is None,
                      "Maximum false-positive rate is not supported.",
                  ),
                  (
                      sample_weight is None,
                      "Sample weights are not supported.",
                  ),
              ]
          )
          if _dal_ready:
              if (
                  not np.array_equal(labels, [0, 1])
                  or labels.dtype == bool
              ):
                  y_true = label_binarize(y_true, classes=labels)[:, 0]
                  if (
                      hasattr(y_score, "dtype")
                      and y_score.dtype == bool
                  ):
                      y_score = label_binarize(y_score, classes=labels)[
                          :, 0
                      ]
              result = d4p.daal_roc_auc_score(
                  y_true.reshape(-1, 1), y_score.reshape(-1, 1)
              )
              if result != -1:
                  return result
              logging.info(
                  "sklearn.metrics.roc_auc_score: "
                  + get_patch_message("sklearn_after_daal")
              )
          # return to sklearn implementation
          y_true = label_binarize(y_true, classes=labels)[:, 0]
  
      return _average_binary_score(
          partial(_binary_roc_auc_score, max_fpr=max_fpr),
          y_true,
          y_score,
          average,
          sample_weight=sample_weight,
      )
  
file_path: scikit-learn-intelex/daal4py/sklearn/metrics/_ranking.py
imports: import logging
  from collections.abc import Sequence
  from functools import partial
  import numpy
  from scipy import sparse
  from sklearn.preprocessing import label_binarize
  from sklearn.utils import check_array
  from sklearn.utils.multiclass import is_multilabel
  import daal4py
  from .._device_offload import support_usm_ndarray
  from .._utils import PatchingConditionsChain, get_patch_message, sklearn_check_version
  from ..utils.validation import _assert_all_finite
label_desc: Use image node_id 2 for calling a global function with example usage: roc_auc_score(y_true, y_score) and returns: _average_binary_score, multiclass_roc_auc_score, result