def unregister(self):

        if self.unregister_pending or self.parent is self:
            return self

        # tick shouldn't be called anymore, although component is still in tree
        self._unregister_pending = True
        self.root._cache_needs_refresh = True

        # Give components a chance to prepare for unregister
        evt = prepare_unregister(self)
        evt.complete_channels = (self,)
        self.fire(evt)

        return self
Removes this component from the component tree.
dataset/ETHPy150Open circuits/circuits/circuits/core/components.py/BaseComponent.unregister