code: def test_assign_partitions_to_actors(orca_context_fixture):
      ray_xshards, _ = get_ray_xshards()
      part_num = ray_xshards.num_partitions()
  
      actor_num = 3
      actors = [Add1Actor.remote() for i in range(actor_num)]
      parts_list, _, _ = ray_xshards.assign_partitions_to_actors(actors)
  
      assert len(parts_list) == actor_num
  
      div, mod = divmod(part_num, actor_num)
      for counter in range(actor_num):
          if counter < mod:
              assert len(parts_list[counter]) == div + 1
          else:
              assert len(parts_list[counter]) == div
  
file_path: BigDL/python/orca/test/bigdl/orca/data/ray/test_ray_xshards.py
imports: import pytest
  import ray
  from bigdl.orca.data.ray_xshards import RayXShards
label_desc: Use image node_id 5 for calling a global function with example usage: test_assign_partitions_to_actors(orca_context_fixture) without return types