<commit_before>var ajax = {
    init: function(){
        return new XMLHttpRequest();
        },
    send: function(url,method,args,cookies,async,_callback){
        var q=ajax.init();
        q.open(method,url,async);
        q.onreadystatechange=function(){
                if(this.readyState==4 && this.status==200) {
                    _callback(this.responseText);
                }
            };
        if (cookies) {
            q.setRequestHeader('Cookie',cookies);
        }
        if(method=='POST') {
            q.setRequestHeader('Content-type','application/x-www-form-urlencoded');
            q.send(args);
        } else {
            q.send(null);
        }
    }
}
<commit_msg>add arrayToString method for pack any array to send as a string<commit_after>var ajax = {
    init: function(){
        return new XMLHttpRequest();
        },
    arrayToString: function (ar,prefix) {
        var out="";
        for (var i in ar) {
            if (ar[i] instanceof Array) {
                ar[i]=this.arrayToString(ar[i], prefix+"["+i+"]");
            } else {
                ar[i]="&"+prefix+"["+i+"]="+encodeURIComponent(ar[i]);
            }
        }
        for (var i in ar) { out+=ar[i]; }
        return out;
        },

    send: function(url,method,args,cookies,async,_callback){
        var q=ajax.init();
        q.open(method,url,async);
        q.onreadystatechange=function(){
                if(this.readyState==4 && this.status==200) {
                    _callback(this.responseText);
                }
            };
        if (cookies) {
            q.setRequestHeader('Cookie',cookies);
        }
        if(method=='POST') {
            q.setRequestHeader('Content-type','application/x-www-form-urlencoded');
            q.send(args);
        } else {
            q.send(null);
        }
    }
}

{'fraction_non_alphanumeric': 0.15171288743882544, 'fraction_numerical': 0.004350190320826536, 'mean_word_length': 1.6822157434402332, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '990507', 'n_tokens_mistral': 556, 'n_tokens_neox': 539, 'n_words': 85}