code: def test_pick_max_tasks_in_flight(self, ray_start_regular_shared):
      # Test that we can't pick an actor beyond the max_tasks_in_flight cap.
      pool = _ActorPool(max_tasks_in_flight=2)
      actor = self._add_ready_worker(pool)
      assert pool.num_free_slots() == 2
      assert pool.pick_actor() == actor
      assert pool.num_free_slots() == 1
      assert pool.pick_actor() == actor
      assert pool.num_free_slots() == 0
      # Check that the 3rd pick doesn't return the actor.
      assert pool.pick_actor() is None
  
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 6 for calling the TestActorPool obj's underlying member method code with example usage: obj.test_pick_max_tasks_in_flight(ray_start_regular_shared) without return types