docstr: Aggregate resource requests by shape.
  Args:
      requests: the list of resource requests
  Returns:
      resource_requests_by_count: the aggregated resource requests by count
docstr_tok: ["Aggregate","resource","requests","by","shape",".","Args",":","requests",":","the","list","of","resource","requests","Returns",":","resource_requests_by_count",":","the","aggregated","resource","requests","by","count"]
code: def _aggregate_resource_requests_by_shape(
      cls,
      requests: List[ResourceRequest],
  ) -> List[ResourceRequestByCount]:
      """
      Aggregate resource requests by shape.
      Args:
          requests: the list of resource requests
      Returns:
          resource_requests_by_count: the aggregated resource requests by count
      """
  
      resource_requests_by_count = defaultdict(int)
      for request in requests:
          bundle = frozenset(request.resources_bundle.items())
          resource_requests_by_count[bundle] += 1
  
      return [
          ResourceRequestByCount(dict(bundle), count)
          for bundle, count in resource_requests_by_count.items()
      ]
  
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 4 for calling the ClusterStatusParser obj's underlying member method code with example usage: obj._aggregate_resource_requests_by_shape(cls, requests) and returns: unknown