def strip_caret_codes(text):
    """Strip out any caret codes from a string.

    :param str text: The text to strip the codes from
    :returns str: The clean text

    """
    text = text.replace('^^', '\x00')
    for token, foo in ANSI_CODES.items():
        text = text.replace(token, '')
    return text.replace('\x00', '^')