<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def get_scaling_policy_arn(as_group, scaling_policy_name, region=None,
                           key=None, keyid=None, profile=None):
    '''
    Return the arn for a scaling policy in a specific autoscale group or None
    if not found. Mainly used as a helper method for boto_cloudwatch_alarm, for
    linking alarms to scaling policies.

    CLI Example::

        salt '*' boto_asg.get_scaling_policy_arn mygroup mypolicy
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    retries = 30
    while retries > 0:
        retries -= 1
        try:
            policies = conn.get_all_policies(as_group=as_group)
            for policy in policies:
                if policy.name == scaling_policy_name:
                    return policy.policy_arn
            log.error('Could not convert: %s', as_group)
            return None
        except boto.exception.BotoServerError as e:
            if e.error_code != 'Throttling':
                raise
            log.debug('Throttled by API, will retry in 5 seconds')
            time.sleep(5)

    log.error('Maximum number of retries exceeded')
    return None