def zauto(zero, loops, wait=False):
    try:
        if zero.setup.replies:
            for rep, msg in izip(loops, zero):
                yield msg
                zero(rep)
        elif zero.setup.transmits:
            for msg in loops:
                res = zero(msg)
                if zero.setup.yields:
                    yield res
        else:
            for _, msg in izip(loops, zero):
                yield msg
    except KeyboardInterrupt:
        zero.setup.debug('Quit by user')
    except StopIteration:
        zero.setup.debug('Loop ended')
    finally:
        if wait:
            raw_input('Press enter when done.')
        zero.setup.debug('Closing: %r', zero)
        zero.close()
Keep listening and sending until the loop ends. All received objects are yielded.
dataset/ETHPy150Open philipbergen/zero/py/zero/__init__.py/zauto