code: def test_debug(self):
      # Turn on debug.
      settings.debug._set_state(True)
      # Check that debug warnings are suppressed when it is turned off.
      with settings.debug(False):
          with warnings.catch_warnings(record=True) as ws:
              if settings.debug.on():
                  warnings.warn("test", BotorchWarning)
          self.assertEqual(len(ws), 0)
      # Check that warnings are not suppressed outside of context manager.
      with warnings.catch_warnings(record=True) as ws:
          if settings.debug.on():
              warnings.warn("test", BotorchWarning)
      self.assertEqual(len(ws), 1)
  
      # Turn off debug.
      settings.debug._set_state(False)
      # Check that warnings are not suppressed within debug.
      with settings.debug(True):
          with warnings.catch_warnings(record=True) as ws:
              if settings.debug.on():
                  warnings.warn("test", BotorchWarning)
          self.assertEqual(len(ws), 1)
      # Check that warnings are suppressed outside of context manager.
      with warnings.catch_warnings(record=True) as ws:
          if settings.debug.on():
              warnings.warn("test", BotorchWarning)
      self.assertEqual(len(ws), 0)
  
file_path: botorch/test/test_settings.py
imports: import warnings
  import gpytorch.settings
  import linear_operator.settings
  from botorch import settings
  from botorch.exceptions import BotorchWarning
  from botorch.utils.testing import BotorchTestCase
label_desc: Use image node_id 2 for calling the TestSettings obj's underlying member method code with example usage: obj.test_debug() without return types