def colorize_ansi(msg, color=None, style=None):
<EOL>if color is None and style is None:<EOL><INDENT>return msg<EOL><DEDENT>escape_code = _get_ansi_code(color, style)<EOL>if escape_code:<EOL><INDENT>return "<STR_LIT>" % (escape_code, msg, ANSI_RESET)<EOL><DEDENT>return msg<EOL>
colorize message by wrapping it with ansi escape codes

    :type msg: str or unicode
    :param msg: the message string to colorize

    :type color: str or None
    :param color:
      the color identifier (see `ANSI_COLORS` for available values)

    :type style: str or None
    :param style:
      style string (see `ANSI_COLORS` for available values). To get
      several style effects at the same time, use a coma as separator.

    :raise KeyError: if an unexistent color or style identifier is given

    :rtype: str or unicode
    :return: the ansi escaped string