code: def _check_loop_runner():
      loops_before = LoopRunner._all_loops.copy()
      yield
      # Internal loops registry must the same as before cluster running.
      # This means loop runners in LocalCluster and Client correctly stopped.
      # See LoopRunner._stop_unlocked().
      assert loops_before == LoopRunner._all_loops
  
file_path: distributed/distributed/tests/test_client_loop.py
imports: from __future__ import annotations
  import contextlib
  from distributed import Client, LocalCluster
  from distributed.utils import LoopRunner
label_desc: Use image node_id 1 for calling a global function with example usage: _check_loop_runner() without return types