code: def test_deleted_actor_no_restart(ray_start_regular):
      @ray.remote(resources={"actor": 1}, max_restarts=3)
      class Actor:
          def method(self):
              return 1
  
          def getpid(self):
              return os.getpid()
  
      @ray.remote
      def f(actor, signal):
          ray.get(signal.wait.remote())
          return ray.get(actor.method.remote())
  
      signal = SignalActor.remote()
      a = Actor.remote()
      pid = ray.get(a.getpid.remote())
      # Pass the handle to another task that cannot run yet.
      x_id = f.remote(a, signal)
      # Delete the original handle. The actor should not get killed yet.
      del a
  
      # Once the task finishes, the actor process should get killed.
      ray.get(signal.send.remote())
      assert ray.get(x_id) == 1
      wait_for_pid_to_exit(pid)
  
      # Create another actor with the same resource requirement to make sure the
      # old one was not restarted.
      a = Actor.remote()
      pid = ray.get(a.getpid.remote())
  
imports: import os
  import sys
  import time
  import numpy
  import pytest
  import ray
  import ray._private.gcs_utils
  from ray.util.state import list_actors
  import ray.cluster_utils
  from ray._private.test_utils import SignalActor, convert_actor_state, kill_actor_and_wait_for_failure, make_global_state_accessor, run_string_as_driver, wait_for_condition, wait_for_pid_to_exit
  from ray._private.ray_constants import gcs_actor_scheduling_enabled
  from ray.experimental.internal_kv import _internal_kv_get, _internal_kv_put
label_desc: Use image node_id 5 for calling a global function with example usage: test_deleted_actor_no_restart(ray_start_regular) and returns: ray, int, os