

def _rule_list(request, expand_policy, **kwargs):
    rules = neutronclient(request).list_firewall_rules(**kwargs).get('firewall_rules')
    if (expand_policy and rules):
        policies = _policy_list(request, expand_rule=False)
        policy_dict = OrderedDict(((p.id, p) for p in policies))
        for rule in rules:
            rule['policy'] = policy_dict.get(rule['firewall_policy_id'])
    return [Rule(r) for r in rules]

dataset/ETHPy150Open openstack/horizon/openstack_dashboard/api/fwaas.py _rule_list/original