Colorize the text
    kwargs arguments:
    style=, bg=
341753
def colorize(text, color=None, **kwargs):
    
    style = None
    bg = None
    # ================ #
    # Keyword checking #
    # ================ #
    if 'style' in kwargs:
        if kwargs['style'] not in STYLE:
            raise WrongStyle('"{}" is wrong argument for {}'.format(kwargs['style'], 'style'))
        style = kwargs['style']

    if 'bg' in kwargs:
        if kwargs['bg'] not in BACKGROUND:
            raise WrongBackground('"{}" is wrong argument for {}'.format(kwargs['bg'], 'bg'))
        bg = kwargs['bg']

    if color not in COLOR:
        raise WrongColor('"{}" is wrong argument for {}'.format(color, 'color'))
    # ===================== #
    # Colorizing the string #
    # ===================== #
    if '\x1b[0m' not in text:
        text = '\x1b[' + ';'.join([str(STYLE[style]), str(COLOR[color]), str(BACKGROUND[bg])])\
               + 'm' + text + '\x1b[0m'
    else:
        lst = text.split('\x1b[0m')
        text = ''
        for x in lst:
            if not x.startswith('\x1b['):
                x = '\x1b[' + ';'.join([str(STYLE[style]), str(COLOR[color]), str(BACKGROUND[bg])])\
                     + 'm' + x + '\x1b[0m'
            else:
                x += '\x1b[0m'
            text += x
    return text
1142382
def bk_red(cls):
        ""
        wAttributes = cls._get_text_attributes()
        wAttributes &= ~win32.BACKGROUND_MASK
        wAttributes |=  win32.BACKGROUND_RED
        cls._set_text_attributes(wAttributes)
863740
function formatArgs(args) {
	const {namespace: name, useColors} = this;

	if (useColors) {
		const c = this.color;
		const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
		const prefix = `  ${colorCode};1m${name} \u001B[0m`;

		args[0] = prefix + args[0].split('\n').join('\n' + prefix);
		args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
	} else {
		args[0] = getDate() + name + ' ' + args[0];
	}
}
588061
def get_kwargs(self):
        """"""

        kwargs = {}

        if self.font_face:
            kwargs["fontname"] = repr(self.font_face)
        if self.font_size:
            kwargs["fontsize"] = repr(self.font_size)
        if self.font_style in self.style_wx2mpl:
            kwargs["fontstyle"] = repr(self.style_wx2mpl[self.font_style])
        if self.font_weight in self.weight_wx2mpl:
            kwargs["fontweight"] = repr(self.weight_wx2mpl[self.font_weight])

        kwargs["color"] = color2code(self.colorselect.GetValue())

        code = ", ".join(repr(key) + ": " + kwargs[key] for key in kwargs)

        code = "{" + code + "}"

        return code
356582
def bgblack(cls, string, auto=False):
        
        return cls.colorize('bgblack', string, auto=auto)
1021289
def bgmagenta(cls, string, auto=False):
        
        return cls.colorize('bgmagenta', string, auto=auto)
1111703
function styleColor(sq, color) {
  if (!sq.hasFormat('PRE')) {
    if (color === RESET_COLOR) {
      sq.changeFormat(null, {
        class: 'colour',
        tag: 'span'
      });
    } else {
      sq.setTextColour(color);
    }
  }
}
1241636
def OnTextColor(self, event):
        """"""

        color = event.GetValue().GetRGB()

        post_command_event(self, self.TextColorMsg, color=color)
45291
def set_colors(self, text='black', background='white'):
        
        if self._multiline: self._widget.setStyleSheet("QTextEdit {background-color: "+str(background)+"; color: "+str(text)+"}")
        else:               self._widget.setStyleSheet("QLineEdit {background-color: "+str(background)+"; color: "+str(text)+"}")
643271
def _(text, *args, **kwargs):
    """"""
    msg = _t.gettext(text)
    if args or kwargs:
        return msg.format(*args, **kwargs)
    else:
        return msg
537884
def bk_white(cls):
        ""
        wAttributes = cls._get_text_attributes()
        wAttributes &= ~win32.BACKGROUND_MASK
        wAttributes |=  win32.BACKGROUND_GREY
        cls._set_text_attributes(wAttributes)
830804
def bold(text: str) -> str:
    '''
    
    '''
    return (style(text, bold=True, reset=False) +
            style('', bold=False, reset=False))
796836
def fmt_text(text, bg = None, fg = None, attr = None, plain = False):
        
        if not plain:
            if fg is not None:
                text = TEXT_FORMATING['fg'][fg] + text
            if bg is not None:
                text = TEXT_FORMATING['bg'][bg] + text
            if attr is not None:
                text = TEXT_FORMATING['attr'][attr] + text
            if (fg is not None) or (bg is not None) or (attr is not None):
                text += TEXT_FORMATING['rst']
        return text
1119016
def bgred(cls, string, auto=False):
        
        return cls.colorize('bgred', string, auto=auto)
342865
def :
    
    s=''
    for _t in text:
        if _t in kword:
            s += colorize(BgColor.Null, Base.Null, color, _t)
        else:
            s += _t
    return s
471819
def get_text_style(text):
    """"""
    style = {}
    style['alpha'] = text.get_alpha()
    if style['alpha'] is None:
        style['alpha'] = 1
    style['fontsize'] = text.get_size()
    style['color'] = color_to_hex(text.get_color())
    style['halign'] = text.get_horizontalalignment()  # left, center, right
    style['valign'] = text.get_verticalalignment()  # baseline, center, top
    style['malign'] = text._multialignment  # text alignment when '\n' in text
    style['rotation'] = text.get_rotation()
    style['zorder'] = text.get_zorder()
    return style
852742
def colorize(style, msg, resp):
    
    code = resp.status.split(maxsplit=1)[0]
    if code[0] == '2':
        # Put 2XX first, since it should be the common case
        msg = style.HTTP_SUCCESS(msg)
    elif code[0] == '1':
        msg = style.HTTP_INFO(msg)
    elif code == '304':
        msg = style.HTTP_NOT_MODIFIED(msg)
    elif code[0] == '3':
        msg = style.HTTP_REDIRECT(msg)
    elif code == '404':
        msg = style.HTTP_NOT_FOUND(msg)
    elif code[0] == '4':
        msg = style.HTTP_BAD_REQUEST(msg)
    else:
        # Any 5XX, or any other response
        msg = style.HTTP_SERVER_ERROR(msg)
    return msg