code: def test_addresses_to_placement_group_info():
      # Missing bundle index 1
      with pytest.raises(ValueError):
          addresses_to_placement_group_info(
              {
                  "ray://127.0.0.1/0": {"CPU": 1},
                  "ray://127.0.0.1/2": {"CPU": 1},
              }
          )
      # The bundle index is not starts from 0
      with pytest.raises(ValueError):
          addresses_to_placement_group_info(
              {"ray://127.0.0.1/1": {"CPU": 1}}
          )
      pg_name, bundles = addresses_to_placement_group_info(
          {"ray://127.0.0.1/0": {"CPU": 1}}
      )
      assert pg_name == "127.0.0.1"
      assert bundles == [{"CPU": 1}]
      pg_name, bundles = addresses_to_placement_group_info(
          {
              "ray://127.0.0.1/4": {"CPU": 4},
              "ray://127.0.0.1/2": {"CPU": 2},
              "ray://127.0.0.1/1": {"CPU": 1},
              "ray://127.0.0.1/3": {"CPU": 3},
              "ray://127.0.0.1/0": {"CPU": 0},
          }
      )
      assert pg_name == "127.0.0.1"
      assert bundles == [
          {"CPU": 0},
          {"CPU": 1},
          {"CPU": 2},
          {"CPU": 3},
          {"CPU": 4},
      ]
      pg_name, bundles = addresses_to_placement_group_info(
          TEST_ADDRESS_TO_RESOURCES
      )
      assert pg_name == TEST_PLACEMENT_GROUP_NAME
      assert bundles == TEST_PLACEMENT_GROUP_BUNDLES
  
file_path: mars/mars/oscar/backends/ray/tests/test_ray_actor_driver.py
imports: import collections
  import os
  import pytest
  from .....None import oscar
  from .....tests.core import require_ray
  from .....utils import lazy_import
  from ..communication import RayServer
  from ..driver import RayActorDriver
  from ..utils import node_address_to_placement, process_placement_to_address, addresses_to_placement_group_info, placement_group_info_to_addresses, get_placement_group, process_address_to_placement
label_desc: Use image node_id 2 for calling a global function with example usage: test_addresses_to_placement_group_info() without return types