@extensionmethod(BlockingObservable, alias="to_string")  # noqa
def to_marbles(self, scheduler=None):

    latch = threading.Event()
    ret = [None]

    def on_next(value):
        ret[0] = value

    self.observable.to_marbles(scheduler=scheduler).subscribe(on_next, on_completed=latch.set)

    # Block until the subscription completes and then return
    latch.wait()

    return ret[0]
Convert an observable sequence into a marble diagram string
dataset/ETHPy150Open ReactiveX/RxPY/rx/testing/marbles.py/to_marbles