<commit_before>from __future__ import absolute_import
from module_base import *

colors = {
    'black':'0',
    'red':'1',
    'green':'2',
    'yellow':'3',
    'blue':'4',
    'purple':'5',
    'cyan':'6',
    'white':'7'
}

class BashrcPromptColors(ModuleBase):
    @before('Bashrc')
    def do_build(self):
        with open(self.build_file('gen/51-bash-colors.bash'), 'w') as f:
            def def_color(name, code):
                color_string = '\e['+code+'m'
                f.write("bash_prompt_"+name+"='\["+color_string+"\]'\n")
                f.write("bash_"+name+"='"+color_string+"'\n")

            for color in colors:
                def_color('normal', '0')
                def_color(color, '0;3'+colors[color])
                def_color('bold_'+color, "1;3"+colors[color])
                def_color('underline_'+color, "4;3"+colors[color])
                def_color('background_'+color, "4"+colors[color])
<commit_msg>Prevented bash normal color from being repeated<commit_after>from __future__ import absolute_import
from module_base import *

colors = {
    'black':'0',
    'red':'1',
    'green':'2',
    'yellow':'3',
    'blue':'4',
    'purple':'5',
    'cyan':'6',
    'white':'7'
}

class BashrcPromptColors(ModuleBase):
    @before('Bashrc')
    def do_build(self):
        with open(self.build_file('gen/51-bash-colors.bash'), 'w') as f:
            def def_color(name, code):
                color_string = '\e['+code+'m'
                f.write("bash_prompt_"+name+"='\["+color_string+"\]'\n")
                f.write("bash_"+name+"='"+color_string+"'\n")

            def_color('normal', '0')
            for color in colors:
                def_color(color, '0;3'+colors[color])
                def_color('bold_'+color, "1;3"+colors[color])
                def_color('underline_'+color, "4;3"+colors[color])
                def_color('background_'+color, "4"+colors[color])

{'fraction_non_alphanumeric': 0.19142259414225943, 'fraction_numerical': 0.01882845188284519, 'mean_word_length': 2.5623836126629422, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5361279', 'n_tokens_mistral': 677, 'n_tokens_neox': 628, 'n_words': 100}