def set_rules(self, rules, overwrite=True, use_conf=False):

        if not isinstance(rules, dict):
            raise TypeError(_("Rules must be an instance of dict or Rules, "
                            "got %s instead") % type(rules))
        self.use_conf = use_conf
        if overwrite:
            self.rules = Rules(rules, self.default_rule)
        else:
            self.rules.update(rules)
Create a new Rules object based on the provided dict of rules.
dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/openstack/common/policy.py/Enforcer.set_rules