code: def test_debug_on(caplog):
      """Test that debug_on is working as expected."""
      from satpy.utils import debug, debug_off, debug_on
  
      def depwarn():
          logger = logging.getLogger("satpy.silly")
          logger.debug("But now it's just got SILLY.")
          warnings.warn(
              "Stop that! It's SILLY.", DeprecationWarning, stacklevel=2
          )
  
      warnings.filterwarnings("ignore", category=DeprecationWarning)
      debug_on(False)
      filts_before = warnings.filters.copy()
      # test that logging on, but deprecation warnings still off
      with caplog.at_level(logging.DEBUG):
          depwarn()
      assert warnings.filters == filts_before
      assert "But now it's just got SILLY." in caplog.text
      debug_on(True)
      # test that logging on and deprecation warnings on
      with pytest.warns(DeprecationWarning):
          depwarn()
      assert warnings.filters != filts_before
      debug_off()  # other tests assume debugging is off
      # test that filters were reset
      assert warnings.filters == filts_before
      with debug():
          assert warnings.filters != filts_before
      assert warnings.filters == filts_before
  
imports: from __future__ import annotations
  import datetime
  import logging
  import typing
  import unittest
  import warnings
  from math import sqrt
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  import xarray
  from satpy.tests.utils import xfail_skyfield_unstable_numpy2
  from satpy.utils import angle2xyz, get_legacy_chunk_size, get_satpos, import_error_helper, lonlat2xyz, proj_units_to_meters, xyz2angle, xyz2lonlat
label_desc: Use image node_id 2 for calling a global function with example usage: test_debug_on(caplog) without return types