<commit_before>/*global window, global*/
var util = require("util")
var assert = require("assert")
var now = require("date-now")

var slice = Array.prototype.slice
var console
var times = {}

if (typeof global !== "undefined" && global.console) {
    console = global.console
} else if (typeof window !== "undefined" && window.console) {
    console = window.console
} else {
    console = {}
}

var functions = [
    [log, "log"],
    [info, "info"],
    [warn, "warn"],
    [error, "error"],
    [time, "time"],
    [timeEnd, "timeEnd"],
    [trace, "trace"],
    [dir, "dir"],
    [consoleAssert, "assert"]
]

for (var i = 0; i < functions.length; i++) {
    var tuple = functions[i]
    var f = tuple[0]
    var name = tuple[1]

    if (!console[name]) {
        console[name] = f
    }
}

module.exports = console

function log() {}

function info() {
    console.log.apply(console, arguments)
}

function warn() {
    console.log.apply(console, arguments)
}

function error() {
    console.warn.apply(console, arguments)
}

function time(label) {
    times[label] = now()
}

function timeEnd(label) {
    var time = times[label]
    if (!time) {
        throw new Error("No such label: " + label)
    }

    var duration = now() - time
    console.log(label + ": " + duration + "ms")
}

function trace() {
    var err = new Error()
    err.name = "Trace"
    err.message = util.format.apply(null, arguments)
    console.error(err.stack)
}

function dir(object) {
    console.log(util.inspect(object) + "\n")
}

function consoleAssert(expression) {
    if (!expression) {
        var arr = slice.call(arguments, 1)
        assert.ok(false, util.format.apply(null, arr))
    }
}<commit_msg>formatting<commit_after>/*global window, global*/
var util = require("util");
var assert = require("assert");
var now = require("date-now");

var console;
var times = {};

if (typeof global !== "undefined" && global.console) {
	console = global.console;
} else if (typeof window !== "undefined" && window.console) {
	console = window.console;
} else {
	console = {};
}

var functions = [
	[log, "log"],
	[info, "info"],
	[warn, "warn"],
	[error, "error"],
	[time, "time"],
	[timeEnd, "timeEnd"],
	[trace, "trace"],
	[dir, "dir"],
	[consoleAssert, "assert"]
];

for (var i = 0; i < functions.length; i++) {
	var tuple = functions[i];
	var f = tuple[0];
	var name = tuple[1];

	if (!console[name]) {
		console[name] = f;
	}
}

module.exports = console;

function log() {}

function info() {
	console.log.apply(console, arguments);
}

function warn() {
	console.log.apply(console, arguments);
}

function error() {
	console.warn.apply(console, arguments);
}

function time(label) {
	times[label] = now();
}

function timeEnd(label) {
	var time = times[label];
	if (!time) {
		throw new Error("No such label: " + label);
	}

	var duration = now() - time;
	console.log(label + ": " + duration + "ms");
}

function trace() {
	var err = new Error();
	err.name = "Trace";
	err.message = util.format.apply(null, arguments);
	console.error(err.stack);
}

function dir(object) {
	console.log(util.inspect(object) + "\n");
}

function consoleAssert(expression) {
	if (!expression) {
		var arr = Array.prototype.slice.call(arguments, 1);
		assert.ok(false, util.format.apply(null, arr));
	}
}
{'fraction_non_alphanumeric': 0.18148487626031165, 'fraction_numerical': 0.002444240757714635, 'mean_word_length': 3.522099447513812, 'pattern_counts': {'":': 2, '<': 5, '<?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': '1280873', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1115, 'n_words': 283}