code: def test_initial_replicas_scales_down(
      self, shutdown_ray_and_serve, client: ServeControllerClient
  ):
      deployment_name = "start_at_ten"
      min_replicas = 5
      initial_replicas = 10
  
      config = ServeDeploySchema(
          applications=[
              ServeApplicationSchema(
                  import_path="ray.serve.tests.test_target_capacity:create_hang_app",
                  args={
                      "name": deployment_name,
                      "min_replicas": min_replicas,
                      "initial_replicas": initial_replicas,
                      "max_replicas": 15,
                  },
              ),
          ],
      )
  
      client.deploy_apps(config)
      wait_for_condition(lambda: len(serve.status().applications) == 1)
      assert serve.status().target_capacity is None
  
      # Kick off downscaling pattern.
      test_target_capacities = [100, 60, 40, 0]
      expected_num_replicas = [
          int(min_replicas * capacity / 100)
          for capacity in test_target_capacities
      ]
  
      for target_capacity, num_replicas in zip(
          test_target_capacities, expected_num_replicas
      ):
          print(
              f"target_capacity: {target_capacity}, num_replicas: {num_replicas}"
          )
          config.target_capacity = target_capacity
          client.deploy_apps(config)
          wait_for_condition(
              lambda: serve.status().target_capacity == target_capacity
          )
          wait_for_condition(
              check_expected_num_replicas,
              deployment_to_num_replicas={
                  deployment_name: num_replicas
              },
          )
  
imports: import asyncio
  import sys
  from copy import deepcopy
  from typing import Dict, Optional
  import pytest
  import ray
  from ray import serve
  from ray._private.pydantic_compat import BaseModel
  from ray._private.test_utils import SignalActor, wait_for_condition
  from ray.exceptions import RayActorError
  from ray.serve import Application
  from ray.serve._private.client import ServeControllerClient
  from ray.serve._private.common import ApplicationStatus, DeploymentStatus, DeploymentStatusTrigger, ReplicaState, TargetCapacityDirection
  from ray.serve._private.constants import SERVE_DEFAULT_APP_NAME, SERVE_NAMESPACE
  from ray.serve.config import AutoscalingConfig
  from ray.serve.context import _get_global_client
  from ray.serve.schema import ServeApplicationSchema, ServeDeploySchema
label_desc: Use image node_id 2 for calling the TestInitialReplicasHandling obj's underlying member method code with example usage: obj.test_initial_replicas_scales_down(shutdown_ray_and_serve, client) without return types