code: def test_nested_schedulers():
      class MyCallback(Callback):
          def _start(self, dsk):
              self.dsk = dsk
  
          def _pretask(self, key, dsk, state):
              assert key in self.dsk
  
      inner_callback = MyCallback()
      inner_dsk = {"x": (add, 1, 2), "y": (add, "x", 3)}
  
      def nested_call(x):
          assert not Callback.active
          with inner_callback:
              return get_threaded(inner_dsk, "y") + x
  
      outer_callback = MyCallback()
      outer_dsk = {"a": (nested_call, 1), "b": (add, "a", 2)}
  
      with outer_callback:
          get_threaded(outer_dsk, "b")
  
      assert not Callback.active
      assert outer_callback.dsk == outer_dsk
      assert inner_callback.dsk == inner_dsk
      assert not Callback.active
  
file_path: dask/dask/tests/test_callbacks.py
imports: from __future__ import annotations
  from dask.callbacks import Callback
  from dask.local import get_sync
  from dask.threaded import get
  from dask.utils_test import add
label_desc: Use image node_id 4 for calling a global function with example usage: test_nested_schedulers() and returns: unknown