code: def _sklearn_auroc_multiclass(
      preds, target, average="macro", ignore_index=None
  ):
      preds = np.moveaxis(preds.numpy(), 1, -1).reshape(
          (-1, preds.shape[1])
      )
      target = target.numpy().flatten()
      if not ((preds > 0) & (preds < 1)).all():
          preds = softmax(preds, 1)
      target, preds = remove_ignore_index(target, preds, ignore_index)
      return sk_roc_auc_score(
          target,
          preds,
          average=average,
          multi_class="ovr",
          labels=list(range(NUM_CLASSES)),
      )
  
imports: from functools import partial
  import numpy
  import pytest
  import torch
  from scipy.special import expit
  from scipy.special import softmax
  from sklearn.metrics import roc_auc_score
  from torchmetrics.classification.auroc import AUROC, BinaryAUROC, MulticlassAUROC, MultilabelAUROC
  from torchmetrics.functional.classification.auroc import binary_auroc, multiclass_auroc, multilabel_auroc
  from torchmetrics.functional.classification.roc import binary_roc
  from torchmetrics.metric import Metric
  from unittests import NUM_CLASSES
  from unittests.classification.inputs import _binary_cases, _multiclass_cases, _multilabel_cases
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
label_desc: Use image node_id 2 for calling a global function with example usage: _sklearn_auroc_multiclass(preds, target, average, ignore_index) and returns: sk_roc_auc_score