code: def test_cluster_status_parser_autoscaler_state():
      test_data = {
          "cluster_resource_state": {},
          "autoscaling_state": {
              "pending_instance_requests": [
                  {
                      "instance_type_name": "m5.large",
                      "ray_node_type_name": "head_node",
                      "count": 1,
                      "request_ts": 29999,
                  },
                  {
                      "instance_type_name": "m5.large",
                      "ray_node_type_name": "worker_node",
                      "count": 2,
                      "request_ts": 19999,
                  },
              ],
              "pending_instances": [
                  {
                      "instance_type_name": "m5.large",
                      "ray_node_type_name": "head_node",
                      "instance_id": "instance1",
                      "ip_address": "10.10.10.10",
                      "details": "Starting Ray",
                  },
              ],
              "failed_instance_requests": [
                  {
                      "instance_type_name": "m5.large",
                      "ray_node_type_name": "worker_node",
                      "count": 2,
                      "reason": "Insufficient capacity",
                      "start_ts": 10000,
                      "failed_ts": 20000,
                  }
              ],
              "autoscaler_state_version": 10,
          },
      }
      reply = _gen_cluster_status_reply(test_data)
      stats = Stats(gcs_request_time_s=0.1)
      cluster_status = (
          ClusterStatusParser.from_get_cluster_status_reply(
              reply, stats
          )
      )
  
      # Assert on the pending requests
      assert len(cluster_status.pending_launches) == 2
      assert (
          cluster_status.pending_launches[0].instance_type_name
          == "m5.large"
      )
      assert (
          cluster_status.pending_launches[0].ray_node_type_name
          == "head_node"
      )
      assert cluster_status.pending_launches[0].count == 1
      assert cluster_status.pending_launches[0].request_ts_s == 29999
      assert (
          cluster_status.pending_launches[1].instance_type_name
          == "m5.large"
      )
      assert (
          cluster_status.pending_launches[1].ray_node_type_name
          == "worker_node"
      )
      assert cluster_status.pending_launches[1].count == 2
      assert cluster_status.pending_launches[1].request_ts_s == 19999
  
      # Assert on the failed requests
      assert len(cluster_status.failed_launches) == 1
      assert (
          cluster_status.failed_launches[0].instance_type_name
          == "m5.large"
      )
      assert (
          cluster_status.failed_launches[0].ray_node_type_name
          == "worker_node"
      )
      assert cluster_status.failed_launches[0].count == 2
      assert (
          cluster_status.failed_launches[0].details
          == "Insufficient capacity"
      )
      assert cluster_status.failed_launches[0].request_ts_s == 10000
      assert cluster_status.failed_launches[0].failed_ts_s == 20000
  
      # Assert on the pending nodes
      assert len(cluster_status.pending_nodes) == 1
      assert (
          cluster_status.pending_nodes[0].instance_type_name
          == "m5.large"
      )
      assert (
          cluster_status.pending_nodes[0].ray_node_type_name
          == "head_node"
      )
      assert cluster_status.pending_nodes[0].instance_id == "instance1"
      assert cluster_status.pending_nodes[0].ip_address == "10.10.10.10"
      assert cluster_status.pending_nodes[0].details == "Starting Ray"
  
      # Assert on stats
      assert cluster_status.stats.autoscaler_version == "10"
      assert cluster_status.stats.gcs_request_time_s == 0.1
  
file_path: ray/python/ray/autoscaler/v2/tests/test_utils.py
imports: import os
  import sys
  from typing import Dict
  import pytest
  from google.protobuf.json_format import ParseDict
  from ray.autoscaler.v2.schema import ClusterConstraintDemand, ClusterStatus, LaunchRequest, NodeInfo, NodeUsage, PlacementGroupResourceDemand, RayTaskActorDemand, ResourceDemandSummary, ResourceRequestByCount, ResourceUsage, Stats
  from ray.autoscaler.v2.utils import ClusterStatusFormatter, ClusterStatusParser
  from ray.core.generated.autoscaler_pb2 import GetClusterStatusReply
label_desc: Use image node_id 3 for calling a global function with example usage: test_cluster_status_parser_autoscaler_state() without return types