def read(fd):

    output = six.binary_type()
    while True:
        line = readline(fd)
        if line:
            output = output + line
        else:
            return output.decode()
Read all output from the PTY at `fd`, or nothing if no data to read.
dataset/ETHPy150Open d11wtq/dockerpty/tests/util.py/read