def remove(self, item):
        """Removes and disposes the first occurrence of a disposable from the
        CompositeDisposable."""

        if self.is_disposed:
            return

        should_dispose = False
        with self.lock:
            if item in self.disposables:
                self.disposables.remove(item)
                should_dispose = True

        if should_dispose:
            item.dispose()

        return should_dispose
dataset/ETHPy150Open ReactiveX/RxPY/rx/disposables/compositedisposable.py/CompositeDisposable.remove/original