code: def test_pending_actor_removed_by_owner(ray_start_regular):
      # Verify when an owner of pending actors is killed, the actor resources
      # are correctly returned.
  
      @ray.remote(num_cpus=1, resources={"a": 1})
      class A:
          def __init__(self):
              self.actors = []
  
          def create_actors(self):
              self.actors = [B.remote() for _ in range(2)]
  
      @ray.remote(resources={"a": 1})
      class B:
          def ping(self):
              return True
  
      @ray.remote(resources={"a": 1})
      def f():
          return True
  
      a = A.remote()
      # Create pending actors
      ray.get(a.create_actors.remote())
  
      # Owner is dead. pending actors should be killed
      # and raylet should return workers correctly.
      del a
      a = B.remote()
      assert ray.get(a.ping.remote())
      ray.kill(a)
      assert ray.get(f.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 23 for calling a global function with example usage: test_pending_actor_removed_by_owner(ray_start_regular) and returns: True, True