code: def _actor_killed_loop(worker_pid: str, timeout_secs=3) -> bool:
      dead = False
      for _ in range(timeout_secs):
          time.sleep(1)
          if _actor_killed(worker_pid):
              dead = True
              break
      return dead
  
file_path: ray/python/ray/dashboard/modules/snapshot/tests/test_actors.py
imports: import logging
  import os
  import sys
  import time
  import pytest
  import requests
  import ray
  from ray._private.test_utils import format_web_url, wait_until_server_available
  from ray.dashboard.tests.conftest import *
label_desc: Use image node_id 2 for calling a global function with example usage: _actor_killed_loop(worker_pid, timeout_secs) and returns: dead