def _create_scaling_policies(conn, as_name, scaling_policies):
 if scaling_policies:
  for policy in scaling_policies:
   policy = autoscale.policy.ScalingPolicy(name=policy['name'], as_name=as_name, adjustment_type=policy['adjustment_type'], scaling_adjustment=policy['scaling_adjustment'], min_adjustment_step=policy.get('min_adjustment_step', None), cooldown=policy['cooldown'])
   conn.create_scaling_policy(policy)

def _create_scaling_policies ( conn , as_name , scaling_policies ) : if scaling_policies : for policy in scaling_policies : policy = autoscale . policy . ScalingPolicy ( name = policy [ 'name' ] , as_name = as_name , adjustment_type = policy [ 'adjustment_type' ] , scaling_adjustment = policy [ 'scaling_adjustment' ] , min_adjustment_step = policy . get ( 'min_adjustment_step' , None ) , cooldown = policy [ 'cooldown' ] ) conn . create_scaling_policy ( policy )
helper function to create scaling policies .