def __init__(self, effect=None, act=None, obj=None, dict=None):
if dict is not None:<EOL><INDENT>effect = dict['<STR_LIT>']<EOL>if isinstance(dict['<STR_LIT:action>'], str):<EOL><INDENT>act = [Action(dict['<STR_LIT:action>'])]<EOL><DEDENT>else:<EOL><INDENT>act = [Action(a) for a in dict['<STR_LIT:action>']]<EOL><DEDENT>obj = [Object(o)<EOL>for o in dict['<STR_LIT:object>']] if '<STR_LIT:object>' in dict else []<EOL><DEDENT>if effect not in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>raise EffectException(effect)<EOL><DEDENT>if any(a1.match(a2) for a1 in act for a2 in act if a1 != a2):<EOL><INDENT>raise PatternOverlapException('<STR_LIT:action>')<EOL><DEDENT>if any(o1.match(o2) for o1 in obj for o2 in obj if o1 != o2):<EOL><INDENT>raise PatternOverlapException('<STR_LIT:object>')<EOL><DEDENT>self.effect = effect<EOL>self.action = act<EOL>self.object = obj<EOL>
A clause can be created either by giving explicit lists of
        ``Action`` and ``Object`` objects or by giving a dictionary
        with ``effect``, ``action`` and ``object`` keys pulled out of
        the JSON representation of a policy.