code: def test_worker_paused_actor(shutdown_only, actor_concurrency):
      ray.init(_system_config=_SYSTEM_CONFIG)
  
      @ray.remote
      class TestActor:
          def main_task(self, i):
              if i == 0:
                  import time
  
                  # Pause 5 seconds inside debugger
                  with ray._private.worker.global_worker.worker_paused_by_debugger():
                      time.sleep(5)
  
      def verify(num_paused):
          workers = list_workers(
              filters=[("num_paused_threads", "=", num_paused)],
              detail=True,
          )
          if len(workers) == 0:
              return False
          worker = workers[0]
          return worker.num_paused_threads == num_paused
  
      test_actor = TestActor.options(
          max_concurrency=actor_concurrency
      ).remote()
      refs = [  # noqa
          test_actor.main_task.options(
              name=f"TestActor.main_task_{i}"
          ).remote(i)
          for i in range(20)
      ]
  
      wait_for_condition(verify, num_paused=1)
  
file_path: ray/python/ray/tests/test_worker_state.py
imports: import os
  import pytest
  import sys
  import threading
  import ray
  from ray._private.test_utils import wait_for_condition
  from ray.util.state import list_workers
label_desc: Use image node_id 2 for calling a global function with example usage: test_worker_paused_actor(shutdown_only, actor_concurrency) and returns: unknown, False