code: def run_cuda_tests(
      tests: Union[unittest.TestCase, unittest.TestSuite]
  ) -> bool:
      """Function for running all tests on cuda (except TestBotorchCUDA itself)"""
      if isinstance(tests, BotorchTestCase):
          tests.device = torch.device("cuda")
          test_result = tests.run()
          if test_result is None:
              # some test runners may return None on skipped tests
              return True
          passed = test_result.wasSuccessful()
          if not passed:
              # print test name
              print(f"test: {tests}")
              for error in chain(
                  test_result.errors, test_result.failures
              ):
                  # print traceback
                  print(f"error: {error[1]}")
          return passed
      elif isinstance(tests, unittest.TestSuite):
          return all(run_cuda_tests(tests_) for tests_ in tests)
      elif (
          isinstance(tests, unittest.TestCase)
          and tests.id() == "test_cuda.TestBotorchCUDA.test_cuda"
      ):
          # ignore TestBotorchCUDA
          return True
      elif isinstance(tests, unittest.loader._FailedTest):
          # test failed to load, often import error
          print(f"test: {tests}")
          print(f"exception: {tests._exception}")
          return False
      else:
          raise ValueError(f"Unexpected type for test: {tests}")
  
file_path: botorch/test/test_cuda.py
imports: import unittest
  from itertools import chain
  from pathlib import Path
  from typing import Union
  import torch
  from botorch.utils.testing import BotorchTestCase
label_desc: Use image node_id 1 for calling a global function with example usage: run_cuda_tests(tests) and returns: passed, True, all, True, False