code: def test_close_loop_sync_use_running_loop(cleanup):
      with _check_loop_runner():
          # Start own loop or use current thread's one.
          loop_runner = LoopRunner()
          loop_runner.start()
  
          try:
              _check_cluster_and_client_loop(loop=loop_runner.loop)
          finally:
              # own loop must be explicitly stopped.
              loop_runner.stop()
  
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 4 for calling a global function with example usage: test_close_loop_sync_use_running_loop(cleanup) without return types