def unrender(self):
        """
        Removes self from BlockContext if it has been rendered (otherwise does nothing).
        Removes self from the layout and collection of blocks, but does not delete any event triggers.
        """
        root_context = get_blocks_context()
        if hasattr(self, "parent") and self.parent is not None:
            try:
                self.parent.children.remove(self)
                self.parent = None
            except ValueError:
                pass
        if root_context is not None:
            try:
                del root_context.blocks[self._id]
                self.is_rendered = False
            except KeyError:
                pass
        return self

        Removes self from BlockContext if it has been rendered (otherwise does nothing).
        Removes self from the layout and collection of blocks, but does not delete any event triggers.
        
gradio/blocks.py