docstr: Converts the scale request generated by BatchingNodeProvider into
  a patch that modifies the RayCluster CR's replicas and/or workersToDelete
  fields. Then submits the patch to the K8s API server.
docstr_tok: ["Converts","the","scale","request","generated","by","BatchingNodeProvider","into","a","patch","that","modifies","the","RayCluster","CR","'s","replicas","and\/or","workersToDelete","fields",".","Then","submits","the","patch","to","the","K8s","API","server","."]
code: def submit_scale_request(self, scale_request: ScaleRequest):
      """Converts the scale request generated by BatchingNodeProvider into
      a patch that modifies the RayCluster CR's replicas and/or workersToDelete
      fields. Then submits the patch to the K8s API server.
      """
      # Transform the scale request into a patch payload.
      patch_payload = self._scale_request_to_patch_payload(
          scale_request, self._raycluster
      )
  
      # Submit the patch to K8s.
      logger.info(
          "Autoscaler is submitting the following patch to RayCluster "
          f"{self.cluster_name} in namespace {self.namespace}."
      )
      logger.info(patch_payload)
      self._submit_raycluster_patch(patch_payload)
  
imports: import json
  import logging
  import os
  from collections import defaultdict
  from typing import Any, Dict, List, Optional, Tuple
  import requests
  from ray.autoscaler._private.constants import WORKER_LIVENESS_CHECK_KEY, WORKER_RPC_DRAIN_KEY
  from ray.autoscaler._private.util import NodeID, NodeIP, NodeKind, NodeStatus, NodeType
  from ray.autoscaler.batching_node_provider import BatchingNodeProvider, NodeData, ScaleRequest
  from ray.autoscaler.tags import NODE_KIND_HEAD, NODE_KIND_WORKER, STATUS_UP_TO_DATE, STATUS_UPDATE_FAILED, TAG_RAY_USER_NODE_TYPE
label_desc: Use image node_id 3 for calling the KubeRayNodeProvider obj's underlying member method code with example usage: obj.submit_scale_request(scale_request) without return types