code: def test_compute(self, input_params, y_pred, y, expected_value):
      input_params["output_transform"] = from_engine(["pred", "label"])
      metric = MetricsReloadedCategoricalHandler(**input_params)
  
      # set up engine
  
      def _val_func(engine, batch):
          pass
  
      engine = Engine(_val_func)
      metric.attach(engine=engine, name=input_params["metric_name"])
      engine.state.output = {"pred": y_pred, "label": y}
      engine.fire_event(Events.ITERATION_COMPLETED)
  
      engine.state.output = {"pred": y_pred, "label": y}
      engine.fire_event(Events.ITERATION_COMPLETED)
  
      engine.fire_event(Events.EPOCH_COMPLETED)
      assert_allclose(
          engine.state.metrics[input_params["metric_name"]],
          expected_value,
          atol=1e-4,
          rtol=1e-4,
          type_test=False,
      )
  
file_path: MONAI/tests/test_handler_metrics_reloaded.py
imports: from __future__ import annotations
  import unittest
  import torch
  from ignite.engine import Engine, Events
  from parameterized import parameterized
  from monai.handlers import MetricsReloadedBinaryHandler, MetricsReloadedCategoricalHandler, from_engine
  from monai.utils import optional_import
  from tests.utils import assert_allclose
label_desc: Use image node_id 1 for calling the TestMetricsReloadedCategorical obj's underlying member method code with example usage: obj.test_compute(input_params, y_pred, y, expected_value) without return types