code: def test_update_draining(all_nodes, number_of_worker_nodes):
      """Test update draining logics.
  
      When update nodes to inactive, head node http proxy should never be draining while
      worker node http proxy should change to draining. When update nodes to active, head
      node http proxy should continue to be healthy while worker node http proxy should
      be healthy.
      """
      manager, cluster_node_info_cache = _create_proxy_state_manager(
          HTTPOptions(location=DeploymentMode.EveryNode)
      )
      cluster_node_info_cache.alive_nodes = all_nodes
  
      for node_id, _ in all_nodes:
          manager._proxy_states[node_id] = _create_proxy_state(
              status=ProxyStatus.HEALTHY,
              node_id=node_id,
          )
      node_ids = [node_id for node_id, _ in all_nodes]
  
      # No target proxy nodes
      proxy_nodes = set()
  
      # Head node proxy should continue to be HEALTHY.
      # Worker node proxy should turn DRAINING.
      wait_for_condition(
          condition_predictor=_update_and_check_proxy_state_manager,
          proxy_state_manager=manager,
          node_ids=node_ids,
          statuses=[ProxyStatus.HEALTHY]
          + [ProxyStatus.DRAINING] * number_of_worker_nodes,
          proxy_nodes=proxy_nodes,
      )
  
      # All nodes are target proxy nodes
      proxy_nodes = set(node_ids)
  
      # Head node proxy should continue to be HEALTHY.
      # Worker node proxy should turn HEALTHY.
      wait_for_condition(
          condition_predictor=_update_and_check_proxy_state_manager,
          proxy_state_manager=manager,
          node_ids=node_ids,
          statuses=[ProxyStatus.HEALTHY] * (number_of_worker_nodes + 1),
          proxy_nodes=proxy_nodes,
      )
  
imports: import json
  import time
  from typing import List, Tuple
  from unittest.mock import patch
  import pytest
  from ray._private.test_utils import wait_for_condition
  from ray.serve._private.cluster_node_info_cache import ClusterNodeInfoCache
  from ray.serve._private.common import ProxyStatus
  from ray.serve._private.constants import PROXY_HEALTH_CHECK_UNHEALTHY_THRESHOLD
  from ray.serve._private.proxy_state import ProxyState, ProxyStateManager, ProxyWrapper, ProxyWrapperCallStatus
  from ray.serve._private.test_utils import MockTimer
  from ray.serve._private.utils import Timer
  from ray.serve.config import DeploymentMode, HTTPOptions
  from ray.serve.schema import LoggingConfig
label_desc: Use image node_id 21 for calling a global function with example usage: test_update_draining(all_nodes, number_of_worker_nodes) without return types