<commit_before>;(function(NR) {


var DOC = document;
var HEAD = DOC.getElementsByTagName('head')[0];


var neuron_script = DOC.getElementById('G_NR');
var base = ( neuron_script.getAttribute('data-base') || 'mod' ).replace(/^\/|\/$/, '') + '/';
var server = parseServer( neuron_script.getAttribute('data-server') || location.origin );


function parseServer(server){
    if(server.indexOf('://') === -1){
        server = 'http://' + server;
    }

    return server.replace(/\/$/, '');
};


function hasher(str){
    return str.length % 3 + 1;
};


function loadJS(src){
    var node = DOC.createElement('script');
    
    node.src = src;
    node.async = true;

    HEAD.insertBefore(node, HEAD.firstChild);
}


function generateModuleURL(mod){
    var path = mod.id.replace('@', '/') + '/main.js';

    return server.replace('{n}', hasher(path) ) + '/' + base + path;
}


NR.Loader.on({
    provide: function(mod) {
        loadJS( generateModuleURL(mod) );
    }
});


})(NR);<commit_msg>fixes #28: change data-base -> data-path<commit_after>;(function(NR) {


var DOC = document;
var HEAD = DOC.getElementsByTagName('head')[0];


var neuron_script = DOC.getElementById('G_NR');
var path = ( neuron_script.getAttribute('data-path') || 'mod' ).replace(/^\/|\/$/, '') + '/';
var server = parseServer( neuron_script.getAttribute('data-server') || location.origin );


function parseServer(server){
    if(server.indexOf('://') === -1){
        server = 'http://' + server;
    }

    return server.replace(/\/$/, '');
};


function hasher(str){
    return str.length % 3 + 1;
};


function loadJS(src){
    var node = DOC.createElement('script');
    
    node.src = src;
    node.async = true;

    HEAD.insertBefore(node, HEAD.firstChild);
}


function generateModuleURL(mod){
    var rel = mod.id.replace('@', '/') + '/main.js';

    return server.replace('{n}', hasher(rel) ) + '/' + path + rel;
}


NR.Loader.on({
    provide: function(mod) {
        loadJS( generateModuleURL(mod) );
    }
});


})(NR);
{'fraction_non_alphanumeric': 0.2077534791252485, 'fraction_numerical': 0.004970178926441352, 'mean_word_length': 3.2921108742004264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '330685', 'n_tokens_mistral': 712, 'n_tokens_neox': 668, 'n_words': 129}