def source(target, inputstream=sys.stdin):
    for line in inputstream:

        while len(line) > 600:
            init, sep, line = line.partition(' ')
            assert len(init) <= 600
            target.send(''.join([init, sep]))

        target.send(line)

    inputstream.close()

    return target.close()
Coroutine starting point. Produces text stream and forwards to consumers
dataset/ETHPy150Open jjangsangy/py-translate/translate/coroutines.py/source