def get_prev_sibling(self):
        """Return the node immediately preceding the invocant in their
        parent's children list. If the invocant does not have a previous
        sibling, return None."""
        if self.parent is None:
            return None

        # Can't use index(); we need to test by identity
        for i, child in enumerate(self.parent.children):
            if child is self:
                if i == 0:
                    return None
                return self.parent.children[i-1]
dataset/ETHPy150Open anandology/pyjamas/pgen/lib2to3/pytree.py/Base.get_prev_sibling/original