def recv_reply(self):
        code = None
        message_lines = []
        incomplete = True
        input = self.recv_buffer

        while incomplete:
            start_i = 0
            while start_i is not None:
                match = reply_line_pattern.match(input, start_i)
                if match:
                    if code and code != match.group(2):
                        raise BadReply(match.group(1))
                    code = match.group(2)
                    message_lines.append(match.group(4))
                    self.recv_buffer = input[match.end(0):]

                    if match.group(3) != b'-':
                        incomplete = False
                        start_i = None
                    else:
                        start_i = match.end(0)
                else:
                    match = line_pattern.match(input, start_i)
                    if match:
                        self.recv_buffer = input[match.end(0):]
                        message_lines.append(match.group(1))
                        raise BadReply(b'\r\n'.join(message_lines))
                    else:
                        start_i = None

            if incomplete:
                self.buffered_recv()
                input = self.recv_buffer
            body = b'\r\n'.join(message_lines)

        try:
            return code.decode('ascii'), body.decode('utf-8')
        except __HOLE__:
            raise BadReply(b'\r\n'.join(message_lines))
dataset/ETHPy150Open slimta/python-slimta/slimta/smtp/io.py/IO.recv_reply