code: def from_get_cluster_status_reply(
      cls, proto: GetClusterStatusReply, stats: Stats
  ) -> ClusterStatus:
      # parse nodes info
      active_nodes, idle_nodes, failed_nodes = cls._parse_nodes(
          proto.cluster_resource_state
      )
  
      # parse pending nodes info
      pending_nodes = cls._parse_pending(proto.autoscaling_state)
  
      # parse launch requests
      pending_launches, failed_launches = cls._parse_launch_requests(
          proto.autoscaling_state
      )
  
      # parse cluster resource usage
      cluster_resource_usage = cls._parse_cluster_resource_usage(
          proto.cluster_resource_state
      )
  
      # parse resource demands
      resource_demands = cls._parse_resource_demands(
          proto.cluster_resource_state
      )
  
      # parse stats
      stats = cls._parse_stats(proto, stats)
  
      return ClusterStatus(
          active_nodes=active_nodes,
          idle_nodes=idle_nodes,
          pending_launches=pending_launches,
          failed_launches=failed_launches,
          pending_nodes=pending_nodes,
          failed_nodes=failed_nodes,
          cluster_resource_usage=cluster_resource_usage,
          resource_demands=resource_demands,
          stats=stats,
      )
  
imports: from collections import Counter, defaultdict
  from copy import deepcopy
  from datetime import datetime
  from itertools import chain
  from typing import Any, Dict, List, Tuple
  import ray
  from ray._private.ray_constants import AUTOSCALER_NAMESPACE, AUTOSCALER_V2_ENABLED_KEY
  from ray._private.utils import binary_to_hex
  from ray.autoscaler._private.autoscaler import AutoscalerSummary
  from ray.autoscaler._private.node_provider_availability_tracker import NodeAvailabilityRecord, NodeAvailabilitySummary, UnavailableNodeInformation
  from ray.autoscaler._private.util import LoadMetricsSummary, format_info_string
  from ray.autoscaler.v2.schema import NODE_DEATH_CAUSE_RAYLET_DIED, ClusterConstraintDemand, ClusterStatus, LaunchRequest, NodeInfo, NodeUsage, PlacementGroupResourceDemand, RayTaskActorDemand, ResourceDemand, ResourceDemandSummary, ResourceRequestByCount, ResourceUsage, Stats
  from ray.core.generated.autoscaler_pb2 import AutoscalingState, ClusterResourceState, GetClusterStatusReply, NodeState, NodeStatus, ResourceRequest
  from ray.core.generated.autoscaler_pb2 import ResourceRequestByCount
  from ray.core.generated.instance_manager_pb2 import Instance
  from ray.experimental.internal_kv import _internal_kv_get, _internal_kv_initialized
label_desc: Use image node_id 1 for calling the ClusterStatusParser obj's underlying member method code with example usage: obj.from_get_cluster_status_reply(cls, proto, stats) and returns: ClusterStatus