code: def test_initial_replicas_new_configs(
      self, shutdown_ray_and_serve, client: ServeControllerClient
  ):
      deployment_name = "start_at_ten"
      min_replicas = 0
      initial_replicas = 20
      config_target_capacity = 40
  
      config = ServeDeploySchema(
          target_capacity=config_target_capacity,
          applications=[
              ServeApplicationSchema(
                  name="app1",
                  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": initial_replicas * 2,
                  },
              ),
          ],
      )
  
      # When deploying first config, initial_replicas * target_capacity
      # should be treated as floor
      client.deploy_apps(config)
      wait_for_condition(
          lambda: serve.status().target_capacity
          == config_target_capacity
      )
      wait_for_condition(
          check_expected_num_replicas,
          deployment_to_num_replicas={
              deployment_name: int(
                  initial_replicas * config_target_capacity / 100
              )
          },
          app_name="app1",
      )
  
      # When deploying a new config, initial_replicas * target_capacity
      # should be treated as floor for all deployments, even if
      # target_capacity is lower
      new_deployment_name = f"new_{deployment_name}"
      new_config_target_capacity = config_target_capacity / 2
  
      new_config = deepcopy(config)
      new_config.applications.append(
          ServeApplicationSchema(
              name="app2",
              import_path="ray.serve.tests.test_target_capacity:create_hang_app",
              args={
                  "name": new_deployment_name,
                  "min_replicas": min_replicas,
                  "initial_replicas": initial_replicas,
                  "max_replicas": initial_replicas * 2,
              },
          ),
      )
      new_config.target_capacity = new_config_target_capacity
  
      client.deploy_apps(new_config)
      wait_for_condition(
          lambda: serve.status().target_capacity
          == new_config_target_capacity
      )
      wait_for_condition(
          check_expected_num_replicas,
          deployment_to_num_replicas={
              deployment_name: int(
                  initial_replicas * new_config_target_capacity / 100
              )
          },
          app_name="app1",
      )
      wait_for_condition(
          check_expected_num_replicas,
          deployment_to_num_replicas={
              new_deployment_name: int(
                  initial_replicas * new_config_target_capacity / 100
              )
          },
          app_name="app2",
      )
  
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 5 for calling the TestInitialReplicasHandling obj's underlying member method code with example usage: obj.test_initial_replicas_new_configs(shutdown_ray_and_serve, client) without return types