def __call__(self, stream):
    prev = (None, None, None)
    for ev in stream:
        if (prev[0] is START):
            if (ev[0] is END):
                prev = (EMPTY, prev[1], prev[2])
                (yield prev)
                continue
            else:
                (yield prev)
        if (ev[0] is not START):
            (yield ev)
        prev = ev
def __call__(self, stream):
    prev = (None, None, None)
    for ev in stream:
        if (prev[0] is START):
            if (ev[0] is END):
                prev = (EMPTY, prev[1], prev[2])
                (yield prev)
                continue
            else:
                (yield prev)
        if (ev[0] is not START):
            (yield ev)
        prev = ev