Print colorize text.

    It accepts arguments of print function.
332452
def cprint(text, color=None, on_color=None, attrs=None, **kwargs):
    
    try:
        print((colored(text, color, on_color, attrs)), **kwargs)
    except TypeError:
        # flush is not supported by py2.7
        kwargs.pop("flush", None)
        print((colored(text, color, on_color, attrs)), **kwargs)
729774
public void println(String text, Color color) {
        final Label label = new Label(text, skin, "outputEntry");
        label.setColor(color);
        label.setWrap(true);
        addLabel(label);
    }
1162441
def output(self, msg, indent, status=None):
        
        color = None
        if self.use_color:
            color = get_color_from_status(status)
        print_indent_msg(msg, indent, color)
365617
def _color(self, msg, color):
        """"""
        kwargs = {'fg': color}
        return click.style(msg, **kwargs) if self.colorize else msg
144363
def success(text):
    ''''''
    print(' '.join((green('✔'), white(text))))
    sys.stdout.flush()
836202
def colorize (arg)
      arg = Yummi::Context::new(arg) unless arg.is_a? Context
      Yummi.colorize arg.value.to_s, color_for(arg)
    end
62106
def cprint(color, prefix, message):
        
        message = message or ""
        prefix = prefix or ""
        print((Console.theme[color] +
               prefix +
               message +
               Console.theme['ENDC']))
283267
def pretty_print(self, obj=None):
        
        print(self.pretty(obj if obj is not None else self.obj))
1302067
def print_warning(msg, color=True):
    
    if color and is_posix():
        safe_print(u"%s[WARN] %s%s" % (ANSI_WARNING, msg, ANSI_END))
    else:
        safe_print(u"[WARN] %s" % (msg))
593525
def pretty_print(self, obj):
        
        s = repr(obj)
        limit = output_limit()
        if len(s) > limit:
            if self.dom_term:
                s = self.color.py_syntax_highlight(s)
                s = self.dom_term.fold_text_string("", s)
            else:
                s = s[:limit - 3]  # cut before syntax highlighting, to avoid missing color endings
                s = self.color.py_syntax_highlight(s)
                s += "..."
        else:
            s = self.color.py_syntax_highlight(s)
        extra_info = self._pp_extra_info(obj)
        if extra_info != "":
            s += ", " + self.color.py_syntax_highlight(extra_info)
        return s
922376
def format_color(text, color, use_color_setting):
    
    if not use_color_setting:
        return text
    else:
        return '{}{}{}'.format(color, text, NORMAL)
996033
def print_diff(diff, color=True):
    """"""
    import colorama

    if not diff:
        return

    if not color:
        colorama.init = lambda autoreset: None
        colorama.Fore.RED = ''
        colorama.Back.RED = ''
        colorama.Fore.GREEN = ''
        colorama.deinit = lambda: None

    colorama.init(autoreset=True)  # TODO use context_manager
    for line in diff.splitlines():
        if line.startswith('+') and not line.startswith('+++ '):
            # Note there shouldn't be trailing whitespace
            # but may be nice to generalise this
            print(colorama.Fore.GREEN + line)
        elif line.startswith('-') and not line.startswith('--- '):
            split_whitespace = re.split('(\s+)$', line)
            if len(split_whitespace) > 1:  # claim it must be 3
                line, trailing, _ = split_whitespace
            else:
                line, trailing = split_whitespace[0], ''
            print(colorama.Fore.RED + line, end='')
            # give trailing whitespace a RED background
            print(colorama.Back.RED + trailing)
        elif line == '\ No newline at end of file':
            # The assumption here is that there is now a new line...
            print(colorama.Fore.RED + line)
        else:
            print(line)
    colorama.deinit()
1114574
def colourize(str)
     ''.tap { |res| Tokenizer.tokenize(str.to_s) { |token, value|
        res << colourize_string(value, colours[token])
      } }
    rescue => err
      Brice.error(self, __method__, err)
      str
    end
950840
def print_logs(self, logs, colorize=True, http=False, non_http=False, force_colorize=None):
        

        for log in logs:
            timestamp = log['timestamp']
            message = log['message']
            if "START RequestId" in message:
                continue
            if "REPORT RequestId" in message:
                continue
            if "END RequestId" in message:
                continue

            if not colorize and not force_colorize:
                if http:
                    if self.is_http_log_entry(message.strip()):
                        print("[" + str(timestamp) + "] " + message.strip())
                elif non_http:
                    if not self.is_http_log_entry(message.strip()):
                        print("[" + str(timestamp) + "] " + message.strip())
                else:
                    print("[" + str(timestamp) + "] " + message.strip())
            else:
                if http:
                    if self.is_http_log_entry(message.strip()):
                        click.echo(click.style("[", fg='cyan') + click.style(str(timestamp), bold=True) + click.style("]", fg='cyan') + self.colorize_log_entry(message.strip()), color=force_colorize)
                elif non_http:
                    if not self.is_http_log_entry(message.strip()):
                        click.echo(click.style("[", fg='cyan') + click.style(str(timestamp), bold=True) + click.style("]", fg='cyan') + self.colorize_log_entry(message.strip()), color=force_colorize)
                else:
                    click.echo(click.style("[", fg='cyan') + click.style(str(timestamp), bold=True) + click.style("]", fg='cyan') + self.colorize_log_entry(message.strip()), color=force_colorize)
1256137
def tprint(text, font=DEFAULT_FONT, chr_ignore=True):
    
    """
    result = text2art(text, font=font, chr_ignore=chr_ignore)
    print(result)
450628
def info(text, *args, **kwargs):
    ''''''
    text = text.format(*args, **kwargs)
    print(' '.join((purple('>>>'), text)))
    sys.stdout.flush()
342865
def :
    
    s=''
    for _t in text:
        if _t in kword:
            s += colorize(BgColor.Null, Base.Null, color, _t)
        else:
            s += _t
    return s