<commit_before>import textwrap

    
class Console(object):

    def __init__(self, color_on):
        self.color_on = True
        self.theme = {
            'HEADER': '\033[95m',
            'OKBLUE': '\033[34m',
            'OKGREEN': '\033[32m',
            'FAIL': '\033[31m',
            'WARNING': '\033[31m',
            'ENDC': '\033[m',
            'BOLD': "\033[1m",
        }


    def theme(self, theme):
        self.theme = theme
        
    def color(self, on):
        self.color_on = on
                
    def _msg(self, message, width=90):
        return textwrap.fill(message, width=width)

    def msg(self, message):
        print (message)

    def error(self, message):
        if self.color_on:
            print self.theme['FAIL'] + self._msg("ERROR: " + message) + self.theme['ENDC']
        else:
            print self._msg("ERROR: " + message)

    def info(self, message):
        if self.color_on:
            print self.theme['OKBLUE'] + self._msg("INFO: " + message) + self.theme['ENDC']
        else:
            print self._msg("INFO: " + message)

    def warning(self, message):
        if self.color_on:
            print self.theme['WARNING'] + self._msg("WARNING: " + message) + self.theme['ENDC']
        else:
            print self._msg("WARNING: " + message)

    def ok(self, message):
        if self.color_on:
            print self.theme['OKGREEN'] + self._msg(message) + self.theme['ENDC']
        else:
            print self._msg(message)

#
# Example
#

"""
from cmd3.console import Console

console = Console()

console.warning("Warning")
console.error("Error")
console.info("Info")
console.msg("msg")
"""<commit_msg>changing the console method to be static<commit_after>import textwrap


class Console(object):

    color = True
    
    theme = {
            'HEADER': '\033[95m',
            'BLACK': '\033[30m',
            'PURPLE': '\033[35m',
            'CYAN': '\033[36m',
            'WHITE': '\033[37m',
            'OKBLUE': '\033[34m',
            'OKGREEN': '\033[32m',
            'FAIL': '\033[31m',
            'WARNING': '\033[31m',
            'RED': '\033[31m',
            'ENDC': '\033[0m',
            'BOLD': "\033[1m",
    }

    @staticmethod
    def get(name):
        if name in Console.theme:
            Console.theme[name]
        else:
            Console.theme['BLACK']

    @staticmethod
    def _msg(message, width=90):
        return textwrap.fill(message, width=width)

    @staticmethod
    def msg(message):
        print (message)

    @staticmethod
    def error(message):
        if Console.color:
            Console._print ('FAIL', "ERROR: ", message)                                    
        else:
            print Console._msg("ERROR: " + message)

    @staticmethod
    def info(message):
        if Console.color:
            Console._print ('OKBLUE', "INFO: ", message)                        
        else:
            print Console._msg("INFO: " + message)

    @staticmethod            
    def warning(message):
        if Console.color:
            Console._print ('WARNING', "WARNING: ", message)            
        else:
            print Console._msg("WARNING: " + message)

    @staticmethod            
    def ok(message):
        if Console.color:
            Console._print ('OKGREEN', "", message)
        else:
            print Console._msg(message)

    @staticmethod            
    def _print(color, prefix, message):
        print (Console.theme[color] +
               prefix + 
               Console._msg(message) +
               Console.theme['ENDC'])
        
#
# Example
#

"""
from cmd3.console import Console


print Console.color

print Console.theme

Console.warning("Warning")
Console.error("Error")
Console.info("Info")
Console.msg("msg")
Console.ok("Success")

print Console.color = False
Console.error("Error")

"""
{'fraction_non_alphanumeric': 0.14322714322714322, 'fraction_numerical': 0.024864024864024864, 'mean_word_length': 1.7784172661870503, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3462056', 'n_tokens_mistral': 1210, 'n_tokens_neox': 1130, 'n_words': 248}