def add_node(self, line):
        """Create a node. Set the level and text. Assigns the parent Node
        """
        match = self.NODE_RE.match(line)
        if match:
            level = match.group('level').count('*')
            text = match.group('text')
            newnode = Node(level=level, text=text)

            if level == 1:
                try:
                    self.nodes[level - 1].append(newnode)
                except IndexError:
                    self.nodes.append([newnode])
            else:
                parent = self.nodes[2 - level][-1]
                parent.add_child(newnode)
                try:
                    self.nodes[level - 1].append(newnode)
                except IndexError:
                    self.nodes.append([newnode])
dataset/ETHPy150Open semk/Org2OPML/org2opml.py/OrgParser.add_node/swapped operands of `-`