<commit_before>#!/usr/bin/python

'''
Given:
1. status code: (0 - OK, other value - BAD)
2. terminal window width

shows red/green bar to visualize return code of previous command
'''

import sys

if len(sys.argv) >= 2:
    value = int(sys.argv[1])
    cols_limit = int(sys.argv[2])
    esc = chr(27)
    if value:
        col_char = '1'
    else:
        col_char = '2'
    print ''.join((
        esc,
        '[4',
        col_char,
        'm',
        ' ' * (cols_limit - 2),
        esc,
        '[0m',
        ))
else:
    print '''
Usage: status_code number_of_columns

1. status code: 0 - OK (green color), other values - BAD (red color)
2. number of columns: the width of text console
''' % dict(
        prog_name=sys.argv[0],
        )<commit_msg>Use prog_name<commit_after>#!/usr/bin/python

'''
Given:
1. status code: (0 - OK, other value - BAD)
2. terminal window width

shows red/green bar to visualize return code of previous command
'''

import sys

if len(sys.argv) >= 2:
    value = int(sys.argv[1])
    cols_limit = int(sys.argv[2])
    esc = chr(27)
    if value:
        col_char = '1'
    else:
        col_char = '2'
    print ''.join((
        esc,
        '[4',
        col_char,
        'm',
        ' ' * (cols_limit - 2),
        esc,
        '[0m',
        ))
else:
    print '''
Usage: %(prog_name)s status_code number_of_columns

1. status code: 0 - OK (green color), other values - BAD (red color)
2. number of columns: the width of text console
''' % dict(
        prog_name=sys.argv[0],
        )
{'fraction_non_alphanumeric': 0.1429503916449086, 'fraction_numerical': 0.022193211488250653, 'mean_word_length': 2.084507042253521, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5151158', 'n_tokens_mistral': 557, 'n_tokens_neox': 537, 'n_words': 162}