code: def test_botorch_warnings(self):
      for WarningClass in (
          BotorchTensorDimensionWarning,
          BotorchWarning,
          BadInitialCandidatesWarning,
          CostAwareWarning,
          InputDataWarning,
          OptimizationWarning,
          SamplingWarning,
          UserInputWarning,
      ):
          with warnings.catch_warnings(
              record=True
          ) as ws, settings.debug(True):
              warnings.warn("message", WarningClass)
              self.assertEqual(len(ws), 1)
              self.assertTrue(issubclass(ws[-1].category, WarningClass))
              self.assertTrue("message" in str(ws[-1].message))
  
file_path: botorch/test/exceptions/test_warnings.py
imports: import warnings
  from botorch import settings
  from botorch.exceptions.warnings import BadInitialCandidatesWarning, BotorchTensorDimensionWarning, BotorchWarning, CostAwareWarning, InputDataWarning, OptimizationWarning, SamplingWarning, UserInputWarning
  from botorch.utils.testing import BotorchTestCase
label_desc: Use image node_id 2 for calling the TestBotorchWarnings obj's underlying member method code with example usage: obj.test_botorch_warnings() without return types