<commit_before>(function excon (console) {
    "use strict";
    if (!console) {
        return;
    }
    console.findType = function (text) {
        var type = typeof text;
        switch (type) {
            case 'number':
                if (isNaN(text)) {
                    text = text.toString();
                }
                break;
            case 'boolean' || 'function':
                text = text.toString();
                break;
            case 'object':
                type = text instanceof Array ? 'array' : 'object';
                text = JSON.stringify(text);
                break;
            case 'undefined':
                text = 'undefined';
                break;
        }
        type = type + ':';
        return {
            "type": type,
            "text": text
        }
    };

    console.out = function (rawText, opts) {
        opts = opts || {};
        var props = this.findType(rawText),
            type = props.type,
            text = props.text || '',
            typeColor = opts.fnName ? opts.color : 'gray';
        type = opts.error ? 'error' : type;
        type = opts.fnName ? opts.fnName + '(' + 
            opts.fnArgs.toString() + ') returns ' + type : type;
        console.log("%c" + type, "color:" + typeColor + ";font-weight:bold;");
        console.log("%c" + text, "color:" + opts.color + ";font-weight:bold;");
        if (opts.console) {
            console.log(rawText);<commit_msg>refactor coloring method to allow user override<commit_after>(function excon (console) {
    "use strict";
    if (!console) {
        return;
    }
    console.findType = function (text) {
        var type = typeof text;
        switch (type) {
            case 'number':
                if (isNaN(text)) {
                    text = text.toString();
                }
                break;
            case 'boolean' || 'function':
                text = text.toString();
                break;
            case 'object':
                type = text instanceof Array ? 'array' : 'object';
                text = JSON.stringify(text);
                break;
            case 'undefined':
                text = 'undefined';
                break;
        }
        type = type + ':';
        return {
            "type": type,
            "text": text
        }
    };

    console.out = function (rawText, opts) {
        opts = opts || {};
        var props = this.findType(rawText),
            type = props.type,
            text = props.text || '',
            typeColor = opts.color || 'gray';
        type = opts.error ? 'error' : type;
        type = opts.fnName ? opts.fnName + '(' + 
            opts.fnArgs.toString() + ') returns ' + type : type;
        console.log("%c" + type, "color:" + typeColor + ";font-weight:bold;");
        console.log("%c" + text, "color:" + opts.color + ";font-weight:bold;");
        if (opts.console) {
            console.log(rawText);
{'fraction_non_alphanumeric': 0.14110846650799047, 'fraction_numerical': 0.0, 'mean_word_length': 1.357371794871795, 'pattern_counts': {'":': 4, '<': 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': '7329273', 'n_tokens_mistral': 810, 'n_tokens_neox': 780, 'n_words': 192}