Given data in chunks, yield lines of text

def lines_from_stream(chunks):
    """
    Given data in chunks, yield lines of text
    """
    buf = buffer.DecodingLineBuffer()
    for chunk in chunks:
        buf.feed(chunk)
        # when Python 3, yield from buf
        for _ in buf:
            yield _