<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_rule(self, rule_class, target_class=_Nothing):
 """Adds an authorization rule. :param rule_class: a class of authorization rule. :param target_class: (optional) a class or an iterable with classes to associate the rule with. """

        if isinstance(target_class, Iterable):
            for cls in target_class:
                self._rules[cls] = rule_class
        else:
            self._rules[target_class] = rule_class