code: def _add_test(
      self,
      category: str,
      test_name: str,
      test_func: Callable[..., Any],
      report_item: list[ModelProto | NodeProto | None],
      devices: Iterable[str] = ("CPU", "CUDA"),
      **kwargs: Any,
  ) -> None:
      # We don't prepend the 'test_' prefix to improve greppability
      if not test_name.startswith("test_"):
          raise ValueError(
              f"Test name must start with test_: {test_name}"
          )
  
      def add_device_test(device: str) -> None:
          device_test_name = f"{test_name}_{device.lower()}"
          if device_test_name in self._test_items[category]:
              raise ValueError(
                  f'Duplicated test name "{device_test_name}" in category "{category}"'
              )
  
          @unittest.skipIf(  # type: ignore
              not self.backend.supports_device(device),
              f"Backend doesn't support device {device}",
          )
          @functools.wraps(test_func)
          def device_test_func(
              *args: Any, **device_test_kwarg: Any
          ) -> Any:
              try:
                  merged_kwargs = {**kwargs, **device_test_kwarg}
                  return test_func(*args, device, **merged_kwargs)
              except BackendIsNotSupposedToImplementIt as e:
                  # hacky verbose reporting
                  if "-v" in sys.argv or "--verbose" in sys.argv:
                      print(
                          f"Test {device_test_name} is effectively skipped: {e}"
                      )
  
          self._test_items[category][device_test_name] = TestItem(
              device_test_func, report_item
          )
  
      for device in devices:
          add_device_test(device)
  
imports: from __future__ import annotations
  import functools
  import glob
  import os
  import re
  import shutil
  import sys
  import tarfile
  import tempfile
  import time
  import unittest
  from collections import defaultdict
  from typing import Any, Callable, Iterable, Pattern, Sequence
  from urllib.request import urlretrieve
  import numpy
  import onnx
  import onnx.reference
  from onnx import ONNX_ML, ModelProto, NodeProto, TypeProto, ValueInfoProto, numpy_helper
  from onnx.backend.base import Backend
  from onnx.backend.test.case.test_case import TestCase
  from onnx.backend.test.loader import load_model_tests
  from onnx.backend.test.runner.item import TestItem
label_desc: Use image node_id 14 for calling the Runner obj's underlying member method code with example usage: obj._add_test(category, test_name, test_func, report_item, devices) and returns: test_func