code: def test_actor_deletion(ray_start_regular_shared):
      # Make sure that when an actor handles goes out of scope, the actor
      # destructor is called.
  
      @ray.remote
      class Actor:
          def getpid(self):
              return os.getpid()
  
      a = Actor.remote()
      pid = ray.get(a.getpid.remote())
      a = None
      wait_for_pid_to_exit(pid)
  
      actors = [Actor.remote() for _ in range(10)]
      pids = ray.get([a.getpid.remote() for a in actors])
      a = None
      actors = None
      [wait_for_pid_to_exit(pid) for pid in pids]
  
imports: import datetime
  import os
  import random
  import sys
  import tempfile
  import numpy
  import pytest
  import ray
  from ray import cloudpickle
  from ray._private import ray_constants
  from ray._private.test_utils import client_test_enabled, wait_for_condition, wait_for_pid_to_exit
  from ray.actor import ActorClassInheritanceException
  from ray.tests.client_test_utils import create_remote_signal_actor
  from ray._private.test_utils import SignalActor
  import setproctitle
label_desc: Use image node_id 29 for calling a global function with example usage: test_actor_deletion(ray_start_regular_shared) and returns: os