

def _policy_get(request, policy_id, expand_rule):
    policy = neutronclient(request).show_firewall_policy(policy_id).get('firewall_policy')
    if expand_rule:
        policy_rules = policy['firewall_rules']
        if policy_rules:
            rules = _rule_list(request, expand_policy=False, firewall_policy_id=policy_id)
            rule_dict = OrderedDict(((rule.id, rule) for rule in rules))
            policy['rules'] = [rule_dict.get(rule) for rule in policy_rules]
        else:
            policy['rules'] = []
    return Policy(policy)

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