code: def test_class_value(
      self, y_pred, y, softmax, to_onehot, average, expected_value
  ):
      y_pred_trans = Compose([ToTensor(), Activations(softmax=softmax)])
      y_trans = Compose([ToTensor(), AsDiscrete(to_onehot=to_onehot)])
      y_pred = [y_pred_trans(i) for i in decollate_batch(y_pred)]
      y = [y_trans(i) for i in decollate_batch(y)]
      metric = ROCAUCMetric(average=average)
      metric(y_pred=y_pred, y=y)
      result = metric.aggregate()
      np.testing.assert_allclose(expected_value, result, rtol=1e-5)
      result = metric.aggregate(
          average=average
      )  # test optional argument
      metric.reset()
      np.testing.assert_allclose(expected_value, result, rtol=1e-5)
  
file_path: MONAI/tests/test_compute_roc_auc.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from monai.data import decollate_batch
  from monai.metrics import ROCAUCMetric, compute_roc_auc
  from monai.transforms import Activations, AsDiscrete, Compose, ToTensor
label_desc: Use image node_id 2 for calling the TestComputeROCAUC obj's underlying member method code with example usage: obj.test_class_value(y_pred, y, softmax, to_onehot, average, expected_value) without return types