code: def auroc(
      preds: Tensor,
      target: Tensor,
      task: Literal["binary", "multiclass", "multilabel"],
      thresholds: Optional[Union[int, List[float], Tensor]] = None,
      num_classes: Optional[int] = None,
      num_labels: Optional[int] = None,
      average: Optional[Literal["macro", "weighted", "none"]] = "macro",
      max_fpr: Optional[float] = None,
      ignore_index: Optional[int] = None,
      validate_args: bool = True,
  ) -> Optional[Tensor]:
      r"""Compute Area Under the Receiver Operating Characteristic Curve (`ROC AUC`_).
  
      The AUROC score summarizes the ROC curve into an single number that describes the performance of a model for
      multiple thresholds at the same time. Notably, an AUROC score of 1 is a perfect score and an AUROC score of 0.5
      corresponds to random guessing.
  
      This function is a simple wrapper to get the task specific versions of this metric, which is done by setting the
      ``task`` argument to either ``'binary'``, ``'multiclass'`` or ``multilabel``. See the documentation of
      :func:`~torchmetrics.functional.classification.binary_auroc`,
      :func:`~torchmetrics.functional.classification.multiclass_auroc` and
      :func:`~torchmetrics.functional.classification.multilabel_auroc` for the specific details of
      each argument influence and examples.
  
      Legacy Example:
          >>> preds = torch.tensor([0.13, 0.26, 0.08, 0.19, 0.34])
          >>> target = torch.tensor([0, 0, 1, 1, 1])
          >>> auroc(preds, target, task='binary')
          tensor(0.5000)
  
          >>> preds = torch.tensor([[0.90, 0.05, 0.05],
          ...                       [0.05, 0.90, 0.05],
          ...                       [0.05, 0.05, 0.90],
          ...                       [0.85, 0.05, 0.10],
          ...                       [0.10, 0.10, 0.80]])
          >>> target = torch.tensor([0, 1, 1, 2, 2])
          >>> auroc(preds, target, task='multiclass', num_classes=3)
          tensor(0.7778)
  
      """
      task = ClassificationTask.from_str(task)
      if task == ClassificationTask.BINARY:
          return binary_auroc(
              preds,
              target,
              max_fpr,
              thresholds,
              ignore_index,
              validate_args,
          )
      if task == ClassificationTask.MULTICLASS:
          if not isinstance(num_classes, int):
              raise ValueError(
                  f"`num_classes` is expected to be `int` but `{type(num_classes)} was passed.`"
              )
          return multiclass_auroc(
              preds,
              target,
              num_classes,
              average,
              thresholds,
              ignore_index,
              validate_args,
          )
      if task == ClassificationTask.MULTILABEL:
          if not isinstance(num_labels, int):
              raise ValueError(
                  f"`num_labels` is expected to be `int` but `{type(num_labels)} was passed.`"
              )
          return multilabel_auroc(
              preds,
              target,
              num_labels,
              average,
              thresholds,
              ignore_index,
              validate_args,
          )
      return None
  
imports: from typing import List, Optional, Tuple, Union
  import torch
  from torch import Tensor, tensor
  from typing_extensions import Literal
  from torchmetrics.functional.classification.precision_recall_curve import _binary_precision_recall_curve_arg_validation, _binary_precision_recall_curve_format, _binary_precision_recall_curve_tensor_validation, _binary_precision_recall_curve_update, _multiclass_precision_recall_curve_arg_validation, _multiclass_precision_recall_curve_format, _multiclass_precision_recall_curve_tensor_validation, _multiclass_precision_recall_curve_update, _multilabel_precision_recall_curve_arg_validation, _multilabel_precision_recall_curve_format, _multilabel_precision_recall_curve_tensor_validation, _multilabel_precision_recall_curve_update
  from torchmetrics.functional.classification.roc import _binary_roc_compute, _multiclass_roc_compute, _multilabel_roc_compute
  from torchmetrics.utilities.compute import _auc_compute_without_check, _safe_divide
  from torchmetrics.utilities.data import _bincount
  from torchmetrics.utilities.enums import ClassificationTask
  from torchmetrics.utilities.prints import rank_zero_warn
label_desc: Use image node_id 11 for calling a global function with example usage: auroc(preds, target, task, thresholds, num_classes, num_labels, average, max_fpr, ignore_index, validate_args) and returns: None, binary_auroc, multiclass_auroc, multilabel_auroc