<commit_before>function lerp_int(from, to, t) {
    return Math.round(from + t * (to - from));
}

function lerp_int_triple(from, to, t) {
    return [
        lerp_int(from[0], to[0], t),
        lerp_int(from[1], to[1], t),
        lerp_int(from[2], to[2], t),
    ];
}

function rgb_string(values) {
    return "rgb(" + values[0] + ", " + values[1] + ", " + values[2] + ")";
}

function animate_bgcolor(elem, from, to, duration) {
    var start = new Date().getTime();
    timer = setInterval(function() {
        var now = new Date().getTime();
        var elapsed = now - start;
        var t = Math.min(1, elapsed / duration);
        var rgb = lerp_int_triple(from, to, t);
        elem.style.backgroundColor = rgb_string(rgb);
        if (t == 1) {
            clearInterval(timer);
        }
    }, 25);
    elem.style.backgroundColor = rgb_string(from);
}

function make_range(maximum) {
    range = []
    for (var i = 0; i < maximum; ++i) {
        range.push(i);
    }
    return range;
}

function choose_n_excluding(choices, n, index) {
    var indices = make_range(choices.length);
    indices.splice(index, 1);
    var chosen = []
    for (var i = 0; i < n; ++i) {<commit_msg>util.js: fix timer to not be global<commit_after>function lerp_int(from, to, t) {
    return Math.round(from + t * (to - from));
}

function lerp_int_triple(from, to, t) {
    return [
        lerp_int(from[0], to[0], t),
        lerp_int(from[1], to[1], t),
        lerp_int(from[2], to[2], t),
    ];
}

function rgb_string(values) {
    return "rgb(" + values[0] + ", " + values[1] + ", " + values[2] + ")";
}

function animate_bgcolor(elem, from, to, duration) {
    var start = new Date().getTime();
    var timer = setInterval(function() {
        var now = new Date().getTime();
        var elapsed = now - start;
        var t = Math.min(1, elapsed / duration);
        var rgb = lerp_int_triple(from, to, t);
        elem.style.backgroundColor = rgb_string(rgb);
        if (t == 1) {
            clearInterval(timer);
        }
    }, 25);
    elem.style.backgroundColor = rgb_string(from);
}

function make_range(maximum) {
    range = []
    for (var i = 0; i < maximum; ++i) {
        range.push(i);
    }
    return range;
}

function choose_n_excluding(choices, n, index) {
    var indices = make_range(choices.length);
    indices.splice(index, 1);
    var chosen = []
    for (var i = 0; i < n; ++i) {
{'fraction_non_alphanumeric': 0.16597510373443983, 'fraction_numerical': 0.013278008298755186, 'mean_word_length': 2.5508100147275403, 'pattern_counts': {'":': 0, '<': 7, '<?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': '268389', 'n_tokens_mistral': 899, 'n_tokens_neox': 856, 'n_words': 205}