code: func (a *HorizontalController) normalizeDesiredReplicas(hpa *autoscalingv2.HorizontalPodAutoscaler, key string, currentReplicas int32, prenormalizedDesiredReplicas int32) int32 {
  	stabilizedRecommendation := a.stabilizeRecommendation(key, prenormalizedDesiredReplicas)
  	if stabilizedRecommendation != prenormalizedDesiredReplicas {
  		setCondition(hpa, autoscalingv2.AbleToScale, v1.ConditionTrue, "ScaleDownStabilized", "recent recommendations were higher than current one, applying the highest recent recommendation")
  	} else {
  		setCondition(hpa, autoscalingv2.AbleToScale, v1.ConditionTrue, "ReadyForNewScale", "recommended size matches current size")
  	}
  	var minReplicas int32
  	if hpa.Spec.MinReplicas != nil {
  		minReplicas = *hpa.Spec.MinReplicas
  	} else {
  		minReplicas = 0
  	}
  
  	desiredReplicas, condition, reason := convertDesiredReplicasWithRules(currentReplicas, stabilizedRecommendation, minReplicas, hpa.Spec.MaxReplicas)
  
  	if desiredReplicas == stabilizedRecommendation {
  		setCondition(hpa, autoscalingv2.ScalingLimited, v1.ConditionFalse, condition, reason)
  	} else {
  		setCondition(hpa, autoscalingv2.ScalingLimited, v1.ConditionTrue, condition, reason)
  	}
  
  	return desiredReplicas
  }
docs: // normalizeDesiredReplicas takes the metrics desired replicas value and normalizes it based on the appropriate conditions (i.e. < maxReplicas, >
  // minReplicas, etc...)