def strip_color(msg):
    """Strips specific ANSI color codes from an input string

    The color codes are hard-coded to those used above
    in userinfo() and in WARNING, ERROR, and CRITICAL.
    """
    nocolor_msg = ''
    a = msg.split('\x1b[1;34m')
    for b in a:
        c = b.split('\x1b[0m')
        for d in c:
            e = d.split('\x1b[31;1m')
            for f in e:
                nocolor_msg += f
    return nocolor_msg
