def insert_before(self, predecessor):
        if self is predecessor:
            raise ValueError("Can't insert an element before itself.")
        parent = self.parent
        if parent is None:
            raise ValueError(
                "Element has no parent, so 'before' has no meaning.")
        # Extract first so that the index won't be screwed up if they
        # are siblings.
        if isinstance(predecessor, PageElement):
            predecessor.extract()
        index = parent.index(self)
        parent.insert(index, predecessor)
File mode.
dataset/ETHPy150Open socketubs/pyhn/pyhn/lib/bs4_py3/element.py/PageElement.insert_before--crossover with--dataset/ETHPy150Open PyTables/PyTables/tables/nodes/filenode.py/RawPyTablesIO.mode