def readline(self, raise_exception=False):
buf = self.buffer<EOL>if self.socket:<EOL><INDENT>recv = self.socket.recv<EOL><DEDENT>else:<EOL><INDENT>recv = lambda bufsize: '<STR_LIT>'<EOL><DEDENT>while True:<EOL><INDENT>index = buf.find('<STR_LIT:\r\n>')<EOL>if index >= <NUM_LIT:0>:<EOL><INDENT>break<EOL><DEDENT>data = recv(<NUM_LIT>)<EOL>if not data:<EOL><INDENT>self.mark_dead('<STR_LIT>')<EOL>if raise_exception:<EOL><INDENT>raise _ConnectionDeadError()<EOL><DEDENT>else:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT><DEDENT>buf += data<EOL><DEDENT>self.buffer = buf[index+<NUM_LIT:2>:]<EOL>return buf[:index]<EOL>
Read a line and return it.  If "raise_exception" is set,
        raise _ConnectionDeadError if the read fails, otherwise return
        an empty string.