code: def test_basic_actors(shutdown_only):
      ray.init(num_cpus=6)
      n = 5
      ds = ray.data.range(n)
      assert sorted(
          extract_values(
              "id",
              ds.map(
                  column_udf_class("id", lambda x: x + 1),
                  concurrency=1,
              ).take(),
          )
      ) == list(range(1, n + 1))
  
      # Should still work even if num actors > num cpus.
      ds = ray.data.range(n)
      assert sorted(
          extract_values(
              "id",
              ds.map(
                  column_udf_class("id", lambda x: x + 1),
                  concurrency=4,
              ).take(),
          )
      ) == list(range(1, n + 1))
  
      # Test setting custom max inflight tasks.
      ds = ray.data.range(10, parallelism=5)
      assert sorted(
          extract_values(
              "id",
              ds.map(
                  column_udf_class("id", lambda x: x + 1),
                  compute=ray.data.ActorPoolStrategy(
                      max_tasks_in_flight_per_actor=3
                  ),
              ).take(),
          )
      ) == list(range(1, 11))
  
      # Test invalid max tasks inflight arg.
      with pytest.raises(ValueError):
          ray.data.range(10).map(
              column_udf_class("id", lambda x: x),
              compute=ray.data.ActorPoolStrategy(
                  max_tasks_in_flight_per_actor=0
              ),
          )
  
      # Test min no more than max check.
      with pytest.raises(ValueError):
          ray.data.range(10).map(
              column_udf_class("id", lambda x: x),
              concurrency=(8, 4),
          )
  
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 1 for calling a global function with example usage: test_basic_actors(shutdown_only) without return types