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","."]
docstr: Get the current available cluster resources.
  
  This is different from `cluster_resources` in that this will return
  idle (available) resources rather than total resources.
  
  Note that this information can grow stale as tasks start and finish.
  
  Returns:
      A dictionary mapping resource name to the total quantity of that
          resource in the cluster.
docstr_tok: ["Get","the","current","available","cluster","resources",".","This","is","different","from","`","cluster_resources","`","in","that","this","will","return","idle","(","available",")","resources","rather","than","total","resources",".","Note","that","this","information","can","grow","stale","as","tasks","start","and","finish",".","Returns",":","A","dictionary","mapping","resource","name","to","the","total","quantity","of","that","resource","in","the","cluster","."]
code: def available_resources(self):
      """Get the current available cluster resources.
  
      This is different from `cluster_resources` in that this will return
      idle (available) resources rather than total resources.
  
      Note that this information can grow stale as tasks start and finish.
  
      Returns:
          A dictionary mapping resource name to the total quantity of that
              resource in the cluster.
      """
      self._check_connected()
  
      available_resources_by_id = self._available_resources_per_node()
  
      # Calculate total available resources.
      total_available_resources = defaultdict(int)
      for available_resources in available_resources_by_id.values():
          for resource_id, num_available in available_resources.items():
              total_available_resources[resource_id] += num_available
  
      return dict(total_available_resources)
  
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 26 for calling the GlobalState obj's underlying member method code with example usage: obj.available_resources() and returns: dict