code: def test_autoscaling_config_validation():
      # Check validation over publicly exposed options
  
      with pytest.raises(ValidationError):
          # min_replicas must be nonnegative
          AutoscalingConfig(min_replicas=-1)
  
      with pytest.raises(ValidationError):
          # max_replicas must be positive
          AutoscalingConfig(max_replicas=0)
  
      with pytest.raises(ValidationError):
          # max_replicas must be nonnegative
          AutoscalingConfig(target_num_ongoing_requests_per_replica=-1)
  
      # max_replicas must be greater than or equal to min_replicas
      with pytest.raises(ValueError):
          AutoscalingConfig(min_replicas=100, max_replicas=1)
      AutoscalingConfig(min_replicas=1, max_replicas=100)
      AutoscalingConfig(min_replicas=10, max_replicas=10)
  
      # initial_replicas must be greater than or equal to min_replicas
      with pytest.raises(ValueError):
          AutoscalingConfig(min_replicas=10, initial_replicas=1)
      with pytest.raises(ValueError):
          AutoscalingConfig(
              min_replicas=10, initial_replicas=1, max_replicas=15
          )
      AutoscalingConfig(
          min_replicas=5, initial_replicas=10, max_replicas=15
      )
      AutoscalingConfig(
          min_replicas=5, initial_replicas=5, max_replicas=15
      )
  
      # initial_replicas must be less than or equal to max_replicas
      with pytest.raises(ValueError):
          AutoscalingConfig(initial_replicas=10, max_replicas=8)
      with pytest.raises(ValueError):
          AutoscalingConfig(
              min_replicas=1, initial_replicas=10, max_replicas=8
          )
      AutoscalingConfig(
          min_replicas=1, initial_replicas=4, max_replicas=5
      )
      AutoscalingConfig(
          min_replicas=1, initial_replicas=5, max_replicas=5
      )
  
      # Default values should not raise an error
      AutoscalingConfig()
  
imports: import pytest
  from ray import cloudpickle
  from ray._private.pydantic_compat import ValidationError
  from ray._private.utils import import_attr
  from ray.serve._private.config import DeploymentConfig, ReplicaConfig, _proto_to_dict
  from ray.serve._private.constants import DEFAULT_AUTOSCALING_POLICY, DEFAULT_GRPC_PORT
  from ray.serve._private.utils import DEFAULT
  from ray.serve.autoscaling_policy import default_autoscaling_policy
  from ray.serve.config import AutoscalingConfig, DeploymentMode, HTTPOptions, ProxyLocation, gRPCOptions
  from ray.serve.generated.serve_pb2 import AutoscalingConfig
  from ray.serve.generated.serve_pb2 import DeploymentConfig
  from ray.serve.generated.serve_pb2 import DeploymentLanguage
  from ray.serve.generated.serve_pb2_grpc import add_UserDefinedServiceServicer_to_server
  from ray.serve.schema import DeploymentSchema, HTTPOptionsSchema, ServeApplicationSchema, ServeDeploySchema
label_desc: Use image node_id 2 for calling a global function with example usage: test_autoscaling_config_validation() without return types