code: def test_actor_pool_strategy_default_num_actors(shutdown_only):
      import time
  
      class UDFClass:
          def __call__(self, x):
              time.sleep(1)
              return x
  
      num_cpus = 5
      ray.init(num_cpus=num_cpus)
      compute_strategy = ray.data.ActorPoolStrategy()
      ray.data.range(10, parallelism=10).map_batches(
          UDFClass, compute=compute_strategy, batch_size=1
      ).materialize()
  
      # The new execution backend is not using the ActorPoolStrategy under
      # the hood, so the expectation here applies only to the old backend.
      # TODO(https://github.com/ray-project/ray/issues/31723): we should check
      # the num of workers once we have autoscaling in new execution backend.
      if not DataContext.get_current().new_execution_backend:
          expected_max_num_workers = math.ceil(
              num_cpus
              * (1 / compute_strategy.ready_to_total_workers_ratio)
          )
          assert (
              compute_strategy.num_workers >= num_cpus
              and compute_strategy.num_workers
              <= expected_max_num_workers
          ), "Number of actors is out of the expected bound"
  
imports: import itertools
  import math
  import os
  import signal
  import threading
  import time
  from typing import Iterator
  import numpy
  import pandas
  import pyarrow
  import pyarrow.parquet
  import pytest
  import ray
  from ray._private.test_utils import wait_for_condition
  from ray.data.block import BlockAccessor
  from ray.data.context import DataContext
  from ray.data.tests.conftest import *
  from ray.data.tests.util import column_udf, column_udf_class, extract_values
  from ray.tests.conftest import *
label_desc: Use image node_id 26 for calling a global function with example usage: test_actor_pool_strategy_default_num_actors(shutdown_only) and returns: x