code: def test_worker_sigterm(shutdown_only):
      """Verify a worker process is killed by a sigterm."""
      ray.init(num_cpus=1)
  
      @ray.remote
      def f():
          return os.getpid(), ray.get_runtime_context().get_worker_id()
  
      pid, worker_id = ray.get(f.remote())
      os.kill(pid, signal.SIGTERM)
  
      def verify():
          w = get_worker(id=worker_id)
          alive = w.is_alive
          assert not alive
          assert "SIGTERM" in w.exit_detail
          assert w.exit_type == "SYSTEM_ERROR"
          return True
  
      wait_for_condition(verify)
  
      @ray.remote(num_cpus=1)
      class Actor:
          def pid(self):
              return (
                  os.getpid(),
                  ray.get_runtime_context().get_worker_id(),
              )
  
      a = Actor.remote()
      pid, worker_id = ray.get(a.pid.remote())
      os.kill(pid, signal.SIGTERM)
  
      def verify():
          w = get_worker(id=worker_id)
          alive = w.is_alive
          assert not alive
          assert "SIGTERM" in w.exit_detail
          assert w.exit_type == "SYSTEM_ERROR"
          return True
  
      wait_for_condition(verify)
  
imports: import sys
  import time
  import platform
  import os
  import signal
  import multiprocessing
  import pytest
  import ray
  import psutil
  from ray._private.test_utils import wait_for_condition, run_string_as_driver_nonblocking
  from ray.util.state import get_worker, list_tasks
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
label_desc: Use image node_id 13 for calling a global function with example usage: test_worker_sigterm(shutdown_only) and returns: os,  ray, True, True, os,  ray