class_docstr: Managing autoscaling policies and the lifecycle of the scaling function calls.
class_docstr_tok: ["Managing","autoscaling","policies","and","the","lifecycle","of","the","scaling","function","calls","."]
code: def __init__(self, config: Optional[AutoscalingConfig]):
      self.config = config
      self.policy = None
      self.policy_state = {}
      self._create_policy()
  
file_path: ray/python/ray/serve/_private/autoscaling_policy.py
imports: import logging
  from typing import List, Optional
  from ray.serve._private.common import TargetCapacityDirection
  from ray.serve._private.constants import SERVE_LOGGER_NAME
  from ray.serve._private.utils import get_capacity_adjusted_num_replicas
  from ray.serve.config import AutoscalingConfig
label_desc: Use image node_id 1 to create a new AutoscalingPolicyManager object  with example: obj = AutoscalingPolicyManager(config)