<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_signed_message(class_, msg_in):
 """ Take an "armoured" message and split into the message body, signing address and the base64 signature. Should work on all altcoin networks, and should accept both Inputs.IO and Multibit formats but not Armory. Looks like RFC2550 <https://www.ietf.org/rfc/rfc2440.txt> was an "inspiration" for this, so in case of confusion it's a reference, but I've never found a real spec for this. Should be a BIP really. """


        msg, hdr = class_.parse_sections(msg_in)

        # after message, expect something like an email/http headers, so split into lines
        hdr = list(filter(None, [i.strip() for i in hdr.split('\n')]))

        if '-----END' not in hdr[-1]:
            raise EncodingError("expecting END on last line")

        sig = hdr[-2]
        addr = None
        for line in hdr:
            line = line.strip()
            if not line:
                continue

            if line.startswith('-----END'):
                break

            if ':' in line:
                label, value = [i.strip() for i in line.split(':', 1)]

                if label.lower() == 'address':
                    addr = line.split(':')[1].strip()
                    break

                continue

            addr = line
            break

        if not addr or addr == sig:
            raise EncodingError("Could not find address")

        return msg, addr, sig