'recvlines(numlines, keepends = False, timeout = default) -> str list
Receive up to ``numlines`` lines.
A "line" is any sequence of bytes terminated by the byte sequence
set by :attr:`newline`, which defaults to ``\'\n\'``.
If the request is not satisfied before ``timeout`` seconds pass,
all data is buffered and an empty string (``\'\'``) is returned.
Arguments:
numlines(int): Maximum number of lines to receive
keepends(bool): Keep newlines at the end of each line (:const:`False`).
timeout(int): Maximum timeout
Raises:
exceptions.EOFError: The connection closed before the request could be satisfied
Returns:
A string containing bytes received from the socket,
or ``\'\'`` if a timeout occurred while waiting.
Examples:
>>> t = tube()
>>> t.recv_raw = lambda n: \'\n\'
>>> t.recvlines(3)
>>> t.recv_raw = lambda n: \'Foo\nBar\nBaz\n\'
>>> t.recvlines(3)
[\'Foo\', \'Bar\', \'Baz\']
>>> t.recvlines(3, True)
[\'Foo\n\', \'Bar\n\', \'Baz\n\']'

def recvlines(self, numlines=(2 ** 20), keepends=False, timeout=default):

    lines = []
    with self.countdown(timeout):
        for _ in xrange(numlines):
            try:
                res = self.recvline(keepends=True, timeout=timeout)
            except Exception:
                self.unrecv(''.join(lines))
                raise
            if res:
                lines.append(res)
            else:
                break
    if (not keepends):
        lines = [line.rstrip(self.newline) for line in lines]
    return lines
