code: def check_result(filename, num_signal, check_key):
      ray.init(num_cpus=1)
      session_dir = (
          ray._private.worker._global_node.get_session_dir_path()
      )
      raylet_out_path = filename.format(session_dir)
      pid = get_pid("raylet")
      assert pid > 0
      p = psutil.Process(pid)
      p.send_signal(num_signal)
      p.wait(timeout=15)
  
      def check_file():
          with open(raylet_out_path) as f:
              s = f.read()
              return check_key in s
  
      wait_for_condition(check_file)
  
file_path: ray/python/ray/tests/test_kill_raylet_signal_log.py
imports: import signal
  import sys
  import psutil
  import pytest
  import ray
  from ray._private.test_utils import wait_for_condition
label_desc: Use image node_id 2 for calling a global function with example usage: check_result(filename, num_signal, check_key) and returns: unknown