def colorize_ansi(msg, color=None, style=None):
 if ((color is None) and (style is None)):
  return msg
 escape_code = _get_ansi_code(color, style)
 if escape_code:
  return ('%s%s%s' % (escape_code, msg, ANSI_RESET))
 return msg

def colorize_ansi ( msg , color = None , style = None ) : if ( ( color is None ) and ( style is None ) ) : return msg escape_code = _get_ansi_code ( color , style ) if escape_code : return ( '%s%s%s' % ( escape_code , msg , ANSI_RESET ) ) return msg
colorize message by wrapping it with ansi escape codes :type msg: str or unicode .