<commit_before># -*- coding: utf-8 -*-

"""
clint.colored
~~~~~~~~~~~~~

This module provides a simple and elegant wrapper for colorama.

"""


from __future__ import absolute_import

from ..packages import colorama



colorama.init(autoreset=True)


__all__ = (
    'black', 'red', 'green', 'yellow', 'blue', 
    'black', 'megenta', 'cyan', 'white'
)


class ColoredString(object):
    """Enhanced string for __len__ operations on Colored output."""
    def __init__(self, color, s):
        super(ColoredString, self).__init__()
        self.s = s
        self.color = color
        self.color_str = '%s%s%s' % (
            getattr(colorama.Fore, self.color), self.s, colorama.Fore.RESET)
        
    def __len__(self):
        return len(self.s)
        
    def __repr__(self):
        return "<%s-string: '%s'>" % (self.color, self.s)
        
    def __str__(self):
        return self.__unicode__().encode('utf8')
        
    def __unicode__(self):
        return self.color_str
        
    def __add__(self, other):
        return str(self.color_str) + str(other)
        
    def __radd__(self, other):
        return str(other) + str(self.color_str)
        
    def __mul__(self, other):
        return (self.color_str * other)



def black(string):
    return ColoredString('BLACK', string)

def red(string):
    return ColoredString('RED', string)

def green(string):
    return ColoredString('GREEN', string)

def yellow(string):
    return ColoredString('YELLOW', string)

def blue(string):
    return ColoredString('BLUE', string)

def magenta(string):
    return ColoredString('MAGENTA', string)

def cyan(string):
    return ColoredString('CYAN', string)

def white(string):
    return ColoredString('STRING', string)<commit_msg>white output typo<commit_after># -*- coding: utf-8 -*-

"""
clint.colored
~~~~~~~~~~~~~

This module provides a simple and elegant wrapper for colorama.

"""


from __future__ import absolute_import

from ..packages import colorama



colorama.init(autoreset=True)


__all__ = (
    'red', 'green', 'yellow', 'blue',
    'black', 'magenta', 'cyan', 'white'
)


class ColoredString(object):
    """Enhanced string for __len__ operations on Colored output."""
    def __init__(self, color, s):
        super(ColoredString, self).__init__()
        self.s = s
        self.color = color
        self.color_str = '%s%s%s' % (
            getattr(colorama.Fore, self.color), self.s, colorama.Fore.RESET)
        
    def __len__(self):
        return len(self.s)
        
    def __repr__(self):
        return "<%s-string: '%s'>" % (self.color, self.s)
        
    def __str__(self):
        return self.__unicode__().encode('utf8')
        
    def __unicode__(self):
        return self.color_str
        
    def __add__(self, other):
        return str(self.color_str) + str(other)
        
    def __radd__(self, other):
        return str(other) + str(self.color_str)
        
    def __mul__(self, other):
        return (self.color_str * other)



def black(string):
    return ColoredString('BLACK', string)

def red(string):
    return ColoredString('RED', string)

def green(string):
    return ColoredString('GREEN', string)

def yellow(string):
    return ColoredString('YELLOW', string)

def blue(string):
    return ColoredString('BLUE', string)

def magenta(string):
    return ColoredString('MAGENTA', string)

def cyan(string):
    return ColoredString('CYAN', string)

def white(string):
    return ColoredString('WHITE', string)
{'fraction_non_alphanumeric': 0.1392622247640835, 'fraction_numerical': 0.001143837575064341, 'mean_word_length': 2.925925925925926, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4084483', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1107, 'n_words': 272}