def extract_irc_colours(msg):
<EOL>fore, msg = _extract_irc_colour_code(msg)<EOL>if not fore:<EOL><INDENT>return '<STR_LIT>', msg<EOL><DEDENT>if not len(msg) or msg[<NUM_LIT:0>] != '<STR_LIT:U+002C>':<EOL><INDENT>return '<STR_LIT>'.format(_ctos(fore)), msg<EOL><DEDENT>msg = msg[<NUM_LIT:1>:]  <EOL>back, msg = _extract_irc_colour_code(msg)<EOL>if back:<EOL><INDENT>return '<STR_LIT>'.format(_ctos(fore), _ctos(back)), msg<EOL><DEDENT>else:<EOL><INDENT>return '<STR_LIT>'.format(_ctos(fore)), '<STR_LIT:U+002C>' + msg<EOL><DEDENT>
Extract the IRC colours from the start of the string.

    Extracts the colours from the start, and returns the colour code in our
    format, and then the rest of the message.