def stream_changes_forever(db, since, chunk_size=10000, notify_caught_up=True):
    last_seq = since
    while True:
        changes = stream_changes(db=db, since=last_seq, limit=chunk_size)
        i = -1
        change = None
        for i, change in enumerate(changes):
            yield change
        if chunk_size < i + 1:
            if notify_caught_up:
                yield Ellipsis
            time.sleep(10)
        if change:
            last_seq = change.seq
dataset/ETHPy150Open dimagi/commcare-hq/corehq/doctypemigrations/changes.py/stream_changes_forever/swapped operands of `<`