code: def node_stats(
      node_manager_address=None,
      node_manager_port=None,
      include_memory_info=True,
  ):
      """Returns NodeStats object describing memory usage in the cluster."""
  
      from ray.core.generated import (
          node_manager_pb2,
          node_manager_pb2_grpc,
      )
  
      # We can ask any Raylet for the global memory info.
      assert (
          node_manager_address is not None
          and node_manager_port is not None
      )
      raylet_address = "{}:{}".format(
          node_manager_address, node_manager_port
      )
      channel = utils.init_grpc_channel(
          raylet_address,
          options=[
              ("grpc.max_send_message_length", MAX_MESSAGE_LENGTH),
              ("grpc.max_receive_message_length", MAX_MESSAGE_LENGTH),
          ],
      )
  
      stub = node_manager_pb2_grpc.NodeManagerServiceStub(channel)
      node_stats = stub.GetNodeStats(
          node_manager_pb2.GetNodeStatsRequest(
              include_memory_info=include_memory_info
          ),
          timeout=30.0,
      )
      return node_stats
  
file_path: ray/python/ray/_private/internal_api.py
imports: import ray
  import ray._private.profiling
  import ray._private.services
  import ray._private.utils
  import ray._private.worker
  from ray._private import ray_constants
  from ray._private.state import GlobalState
  from ray._raylet import GcsClientOptions
label_desc: Use image node_id 5 for calling a global function with example usage: node_stats(node_manager_address, node_manager_port, include_memory_info) and returns: node_stats