<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_firewall_rules(firewall_rules):
    '''
    Construct a list of optional firewall rules from the cloud profile.
    '''
    ret = []
    for key, value in six.iteritems(firewall_rules):
        # Verify the required 'protocol' property is present in the cloud
        # profile config
        if 'protocol' not in firewall_rules[key].keys():
            raise SaltCloudConfigError(
                'The firewall rule \'{0}\' is missing \'protocol\''.format(key)
            )
        ret.append(FirewallRule(
            name=key,
            protocol=firewall_rules[key].get('protocol', None),
            source_mac=firewall_rules[key].get('source_mac', None),
            source_ip=firewall_rules[key].get('source_ip', None),
            target_ip=firewall_rules[key].get('target_ip', None),
            port_range_start=firewall_rules[key].get('port_range_start', None),
            port_range_end=firewall_rules[key].get('port_range_end', None),
            icmp_type=firewall_rules[key].get('icmp_type', None),
            icmp_code=firewall_rules[key].get('icmp_code', None)
        ))

    return ret