<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def resolve_elements(self):
 """Get element of this node recursively Compute rules with OR or AND rule then NOT rules. :return: set of element :rtype: set """

        # If it's a leaf, we just need to dump a set with the content of the node
        if self.leaf:
            if not self.content:
                return set()

            return set(self.content)

        # first got the not ones in a list, and the other in the other list
        not_nodes = [s for s in self.sons if s.not_value]
        positiv_nodes = [s for s in self.sons if not s.not_value]  # ok a not not is hard to read..

        # By default we are using a OR rule
        if not self.operand:
            self.operand = '|'

        res = set()

        # The operand will change the positiv loop only
        i = 0
        for node in positiv_nodes:
            node_members = node.resolve_elements()
            if self.operand == '|':
                res = res.union(node_members)
            elif self.operand == '&':
                # The first elements of an AND rule should be used
                if i == 0:
                    res = node_members
                else:
                    res = res.intersection(node_members)
            i += 1

        # And we finally remove all NOT elements from the result
        for node in not_nodes:
            node_members = node.resolve_elements()
            res = res.difference(node_members)
        return res