class_docstr: A abstraction of a node that can be scheduled on by the resource scheduler.
  
  A scheduling node is expected to be used as:
  
      node  = SchedulingNode.from_node_config(node_config)
      remaining, score = node.try_schedule(requests)
  
      .... do something with the score ....
  
  NOTE:
      One could also extend the scheduling behavior by overriding `try_schedule`
class_docstr_tok: ["A","abstraction","of","a","node","that","can","be","scheduled","on","by","the","resource","scheduler",".","A","scheduling","node","is","expected","to","be","used","as",":","node","=","SchedulingNode.from_node_config","(","node_config",")","remaining",",","score","=","node.try_schedule","(","requests",")","....","do","something","with","the","score","....","NOTE",":","One","could","also","extend","the","scheduling","behavior","by","overriding","`","try_schedule","`"]
docstr: Try to schedule the resource requests on this node.
  
  This modifies the node's available resources if the requests are schedulable.
  When iterating through the requests, the requests are sorted by the
  `_sort_resource_request` function. The requests are scheduled one by one in
  the sorted order, and no backtracking is done.
  
  Args:
      requests: The resource requests to be scheduled.
  
  Returns:
      A tuple of:
          - list of remaining requests that cannot be scheduled on this node.
          - the utilization score for this node with respect to the current
          resource requests being scheduled.
docstr_tok: ["Try","to","schedule","the","resource","requests","on","this","node",".","This","modifies","the","node","'s","available","resources","if","the","requests","are","schedulable",".","When","iterating","through","the","requests",",","the","requests","are","sorted","by","the","`","_sort_resource_request","`","function",".","The","requests","are","scheduled","one","by","one","in","the","sorted","order",",","and","no","backtracking","is","done",".","Args",":","requests",":","The","resource","requests","to","be","scheduled",".","Returns",":","A","tuple","of",":","-","list","of","remaining","requests","that","can","not","be","scheduled","on","this","node",".","-","the","utilization","score","for","this","node","with","respect","to","the","current","resource","requests","being","scheduled","."]
code: def try_schedule(
      self, requests: List[ResourceRequest]
  ) -> Tuple[List[ResourceRequest], UtilizationScore]:
      """
      Try to schedule the resource requests on this node.
  
      This modifies the node's available resources if the requests are schedulable.
      When iterating through the requests, the requests are sorted by the
      `_sort_resource_request` function. The requests are scheduled one by one in
      the sorted order, and no backtracking is done.
  
      Args:
          requests: The resource requests to be scheduled.
  
      Returns:
          A tuple of:
              - list of remaining requests that cannot be scheduled on this node.
              - the utilization score for this node with respect to the current
              resource requests being scheduled.
      """
      pass
  
imports: import copy
  import logging
  from abc import ABC, abstractmethod
  from collections import defaultdict
  from dataclasses import dataclass, field
  from enum import Enum
  from typing import Dict, List, Optional, Tuple
  from google.protobuf.json_format import MessageToDict
  from ray.autoscaler._private.resource_demand_scheduler import UtilizationScore
  from ray.autoscaler.v2.instance_manager.config import NodeTypeConfig
  from ray.autoscaler.v2.schema import NodeType
  from ray.autoscaler.v2.utils import is_pending, resource_requests_by_count
  from ray.core.generated.autoscaler_pb2 import ClusterResourceConstraint, GangResourceRequest, NodeState, ResourceRequest, ResourceRequestByCount
  from ray.core.generated.instance_manager_pb2 import Instance
label_desc: Use image node_id 2 for calling the SchedulingNode obj's underlying member method code with example usage: obj.try_schedule(requests) without return types