code: def test_kill_all_inactive_idle_actor_killed(
      self, ray_start_regular_shared
  ):
      # Test that idle actors are killed on the kill_all_inactive_actors() call.
      pool = _ActorPool()
      actor = self._add_ready_worker(pool)
      # Kill inactive actors.
      pool.kill_all_inactive_actors()
      # Check that actor is not in pool.
      assert pool.pick_actor() is None
      # Check that actor was killed.
      # Wait a few seconds to let actor killing happen.
      time.sleep(1)
      with pytest.raises(ray.exceptions.RayActorError):
          ray.get(actor.get_location.remote())
      # Check that the per-state pool sizes are as expected.
      assert pool.num_total_actors() == 0
      assert pool.num_pending_actors() == 0
      assert pool.num_running_actors() == 0
      assert pool.num_active_actors() == 0
      assert pool.num_idle_actors() == 0
      assert pool.num_free_slots() == 0
  
imports: import collections
  import time
  import pytest
  import ray
  from ray.data._internal.compute import ActorPoolStrategy
  from ray.data._internal.execution.operators.actor_pool_map_operator import AutoscalingConfig, AutoscalingPolicy, _ActorPool
  from ray.data._internal.execution.util import make_ref_bundles
  from ray.tests.conftest import *
label_desc: Use image node_id 16 for calling the TestActorPool obj's underlying member method code with example usage: obj.test_kill_all_inactive_idle_actor_killed(ray_start_regular_shared) without return types