code: def addresses_to_placement_group_info(address_to_resources):
      bundles = {}
      pg_name = None
      for address, bundle_resources in address_to_resources.items():
          name, bundle_index = node_address_to_placement(address)
          if pg_name is None:
              pg_name = name
          else:
              if name != pg_name:
                  raise ValueError(
                      "All addresses should have consistent placement group names."
                  )
          bundles[bundle_index] = bundle_resources
      sorted_bundle_keys = sorted(bundles.keys())
      if sorted_bundle_keys != list(range(len(address_to_resources))):
          raise ValueError("The addresses contains invalid bundle.")
      bundles = [bundles[k] for k in sorted_bundle_keys]
      if not pg_name:
          raise ValueError("Can't find a valid placement group name.")
      return pg_name, bundles
  
file_path: mars/mars/oscar/backends/ray/utils.py
imports: import asyncio
  import enum
  import logging
  import os
  import posixpath
  from urllib.parse import urlparse, unquote
  from ....utils import lazy_import, lazy_import_on_load
label_desc: Use image node_id 7 for calling a global function with example usage: addresses_to_placement_group_info(address_to_resources) and returns: pg_name,  bundles