<commit_before>"ues strict";

var RAND_ALPHABET = "0123456789abcdef"
function randId(bits) {
    var n = bits / Math.log2(RAND_ALPHABET.length);
    var chars = []
    for (var i = 0; i < n; i++) {
        var randIndex = Math.floor(Math.random() * RAND_ALPHABET.length);
        chars.push(RAND_ALPHABET[randIndex]);
    }
    return chars.join('');
}

var pageid = randId(128);

new EventSource('/events/' + pageid).onmessage = function(e) { eval(e.data); }

function call(method /*, elements*/) {
    var data = [];
    Array.prototype.slice.call(arguments, 1).forEach(function (elementId) {
        data.push(get(elementId));
    });

    var r = new XMLHttpRequest();
    r.open('POST', '/call/' + pageid, true);
    r.setRequestHeader('Content-Type', 'application/json');
    r.send(JSON.stringify({'method': method, 'params': data}));
}
<commit_msg>Add 'page' before pageid<commit_after>"ues strict";

var RAND_ALPHABET = "0123456789abcdef"
function randId(bits) {
    var n = bits / Math.log2(RAND_ALPHABET.length);
    var chars = []
    for (var i = 0; i < n; i++) {
        var randIndex = Math.floor(Math.random() * RAND_ALPHABET.length);
        chars.push(RAND_ALPHABET[randIndex]);
    }
    return chars.join('');
}

var pageid = "page" + randId(128);

new EventSource('/events/' + pageid).onmessage = function(e) { eval(e.data); }

function call(method /*, elements*/) {
    var data = [];
    Array.prototype.slice.call(arguments, 1).forEach(function (elementId) {
        data.push(get(elementId));
    });

    var r = new XMLHttpRequest();
    r.open('POST', '/call/' + pageid, true);
    r.setRequestHeader('Content-Type', 'application/json');
    r.send(JSON.stringify({'method': method, 'params': data}));
}

{'fraction_non_alphanumeric': 0.17956120092378752, 'fraction_numerical': 0.018475750577367205, 'mean_word_length': 3.5130208333333335, 'pattern_counts': {'":': 0, '<': 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': '1226859', 'n_tokens_mistral': 633, 'n_tokens_neox': 602, 'n_words': 120}