def lowestCommonAncestor(self, lnode, rnode, stop=None):
        if not stop:
            stop = self.root
        if lnode is stop:
            return lnode
        if rnode is stop:
            return rnode

        if lnode is rnode:
            return lnode
        if (lnode.level > rnode.level):
            return self.lowestCommonAncestor(lnode.parent, rnode, stop)
        if (rnode.level > lnode.level):
            return self.lowestCommonAncestor(lnode, rnode.parent, stop)
        if lnode.parent is rnode.parent:
            return lnode.parent
        else:
            return self.lowestCommonAncestor(lnode.parent, rnode.parent, stop)
dataset/ETHPy150Open kevinw/pyflakes/pyflakes/checker.py/Checker.lowestCommonAncestor/original