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

def _apply_dvportgroup_security_policy(pg_name, sec_policy, sec_policy_conf):
    '''
    Applies the values in sec_policy_conf to a security policy object

    pg_name
        The name of the portgroup

    sec_policy
        The vim.DVSTrafficShapingPolicy to apply the config to

    sec_policy_conf
        The out shaping config
    '''
    log.trace('Building portgroup\'s \'%s\' security policy ', pg_name)
    if 'allow_promiscuous' in sec_policy_conf:
        sec_policy.allowPromiscuous = vim.BoolPolicy()
        sec_policy.allowPromiscuous.value = \
                sec_policy_conf['allow_promiscuous']
    if 'forged_transmits' in sec_policy_conf:
        sec_policy.forgedTransmits = vim.BoolPolicy()
        sec_policy.forgedTransmits.value = sec_policy_conf['forged_transmits']
    if 'mac_changes' in sec_policy_conf:
        sec_policy.macChanges = vim.BoolPolicy()
        sec_policy.macChanges.value = sec_policy_conf['mac_changes']