code: def _binary_auroc_compute(
      state: Union[Tensor, Tuple[Tensor, Tensor]],
      thresholds: Optional[Tensor],
      max_fpr: Optional[float] = None,
      pos_label: int = 1,
  ) -> Tensor:
      fpr, tpr, _ = _binary_roc_compute(state, thresholds, pos_label)
      if (
          max_fpr is None
          or max_fpr == 1
          or fpr.sum() == 0
          or tpr.sum() == 0
      ):
          return _auc_compute_without_check(fpr, tpr, 1.0)
  
      _device = fpr.device if isinstance(fpr, Tensor) else fpr[0].device
      max_area: Tensor = tensor(max_fpr, device=_device)
      # Add a single point at max_fpr and interpolate its tpr value
      stop = torch.bucketize(max_area, fpr, out_int32=True, right=True)
      weight = (max_area - fpr[stop - 1]) / (fpr[stop] - fpr[stop - 1])
      interp_tpr: Tensor = torch.lerp(tpr[stop - 1], tpr[stop], weight)
      tpr = torch.cat([tpr[:stop], interp_tpr.view(1)])
      fpr = torch.cat([fpr[:stop], max_area.view(1)])
  
      # Compute partial AUC
      partial_auc = _auc_compute_without_check(fpr, tpr, 1.0)
  
      # McClish correction: standardize result to be 0.5 if non-discriminant and 1 if maximal
      min_area: Tensor = 0.5 * max_area**2
      return 0.5 * (
          1 + (partial_auc - min_area) / (max_area - min_area)
      )
  
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 3 for calling a global function with example usage: _binary_auroc_compute(state, thresholds, max_fpr, pos_label) and returns: unknown, _auc_compute_without_check