def add_rule(self, chain, rule, wrap=True, top=False):
        if wrap and chain not in self.chains:
            raise ValueError(_('Unknown chain: %r') % chain)

        if '$' in rule:
            rule = ' '.join(map(self._wrap_target_chain, rule.split(' ')))

        rule_obj = IptablesRule(chain, rule, wrap, top)
        if rule_obj in self.rules:
            LOG.debug("Skipping duplicate iptables rule addition. "
                      "%(rule)r already in %(rules)r",
                      {'rule': rule_obj, 'rules': self.rules})
        else:
            self.rules.append(IptablesRule(chain, rule, wrap, top))
            self.dirty = True
Return a Python object given a string describing it.
dataset/ETHPy150Open openstack/nova/nova/network/linux_net.py/IptablesTable.add_rule--crossover with--dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/trial/runner.py/TestLoader.findByName