class_docstr: A class used to interface with the Ray control state.
  
  Attributes:
      global_state_accessor: The client used to query gcs table from gcs
          server.
class_docstr_tok: ["A","class","used","to","interface","with","the","Ray","control","state",".","Attributes",":","global_state_accessor",":","The","client","used","to","query","gcs","table","from","gcs","server","."]
code: def placement_group_table(self, placement_group_id=None):
      self._check_connected()
  
      if placement_group_id is not None:
          placement_group_id = ray.PlacementGroupID(
              hex_to_binary(placement_group_id.hex())
          )
          placement_group_info = (
              self.global_state_accessor.get_placement_group_info(
                  placement_group_id
              )
          )
          if placement_group_info is None:
              return {}
          else:
              placement_group_info = (
                  gcs_pb2.PlacementGroupTableData.FromString(
                      placement_group_info
                  )
              )
              return self._gen_placement_group_info(
                  placement_group_info
              )
      else:
          placement_group_table = (
              self.global_state_accessor.get_placement_group_table()
          )
          results = {}
          for placement_group_info in placement_group_table:
              placement_group_table_data = (
                  gcs_pb2.PlacementGroupTableData.FromString(
                      placement_group_info
                  )
              )
              placement_group_id = binary_to_hex(
                  placement_group_table_data.placement_group_id
              )
              results[
                  placement_group_id
              ] = self._gen_placement_group_info(
                  placement_group_table_data
              )
  
          return results
  
imports: import json
  import logging
  from collections import defaultdict
  from typing import Set
  from google.protobuf.json_format import MessageToDict
  import ray
  from ray._private.client_mode_hook import client_mode_hook
  from ray._private.resource_spec import NODE_ID_PREFIX, HEAD_NODE_RESOURCE_NAME
  from ray._private.utils import binary_to_hex, decode, hex_to_binary, validate_actor_state_name
  from ray._raylet import GlobalStateAccessor
  from ray.core.generated import common_pb2
  from ray.core.generated import gcs_pb2
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 13 for calling the GlobalState obj's underlying member method code with example usage: obj.placement_group_table(placement_group_id) and returns: results, dict, self