<commit_before>import sys

import lnkr

def fake_color(str):
    return str

class WinTerminal:
    def __init__(self):
        self.normal = fake_color
        self.red = fake_color
        self.green = fake_color
        self.blue = fake_color
        self.yellow = fake_color

windows_mode = sys.platform.startswith('win')

def get_terminal():
    if windows_mode:
        term = WinTerminal()
    else:
        from blessings import Terminal
        term = Terminal()
    return term

term = get_terminal()
verbose_mode = False

def set_verbose_mode(mode):
    global verbose_mode
    verbose_mode = mode

def info(msg):
    if windows_mode:
        print(msg)
    else:
        print(term.normal + msg)

def verbose(msg):
    if verbose_mode:
        info(msg)

def error(msg):
    if windows_mode:
        print(msg)
    else:
        print(term.red + msg)

def format_error(err):
    return term.red(err)

def format_path(path):
    return term.blue(path)

def format_param(param):
    return term.yellow(param)
<commit_msg>print stacktrace in error log<commit_after>import sys
import traceback

PRINT_STACK_LIMIT = 10

def fake_color(str):
    return str

class WinTerminal:
    def __init__(self):
        self.normal = fake_color
        self.red = fake_color
        self.green = fake_color
        self.blue = fake_color
        self.yellow = fake_color

windows_mode = sys.platform.startswith('win')

def get_terminal():
    if windows_mode:
        term = WinTerminal()
    else:
        from blessings import Terminal
        term = Terminal()
    return term

term = get_terminal()
verbose_mode = False

def set_verbose_mode(mode):
    global verbose_mode
    verbose_mode = mode

def info(msg):
    if windows_mode:
        print(msg)
    else:
        print(term.normal + msg)

def verbose(msg):
    if verbose_mode:
        info(msg)

def error(msg):
    if windows_mode:
        print(msg)
    else:
        print(term.red + msg)
    traceback.print_stack(limit=PRINT_STACK_LIMIT)

def format_error(err):
    return term.red(err)

def format_path(path):
    return term.blue(path)

def format_param(param):
    return term.yellow(param)

{'fraction_non_alphanumeric': 0.08762169680111266, 'fraction_numerical': 0.0009272137227630969, 'mean_word_length': 2.7079037800687287, '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': '4957684', 'n_tokens_mistral': 712, 'n_tokens_neox': 688, 'n_words': 171}