<commit_before>
/*=== below some hints for jslint ===*/
/*jslint nomen: true*/
/*global Uint8Array*/
/*global XMLHttpRequest*/
/*===================================*/

function Progress() {
    "use strict";

    this.size = null;
}

Progress.prototype = (function() {

    "use strict";

    function _get(url, onprogress, onerror, onload) {
        var self = this,
            request = new XMLHttpRequest();

        request.addEventListener("load", function() {
            if (!self.size) {
                self.size = Number(request.getResponseHeader("Content-Length"));
            }
            var data = new Uint8Array(request.response);
            onload(data);
        }, false);
        request.addEventListener("progress", onprogress, false);
        request.addEventListener("error", onerror, false);
        request.open("GET", url);
        request.responseType = "arraybuffer";
        request.send();
    }<commit_msg>added hack for opera<commit_after>
/*=== below some hints for jslint ===*/
/*jslint nomen: true*/
/*global Uint8Array*/
/*global XMLHttpRequest*/
/*global window*/
/*===================================*/

function Progress() {
    "use strict";

    this.size = null;
}

Progress.prototype = (function() {

    "use strict";

    function _get(url, onprogress, onerror, onload) {
        var self = this,
            request = new XMLHttpRequest();

        request.addEventListener("load", function() {
            if (!self.size) {
                self.size = Number(request.getResponseHeader("Content-Length"));
            }
            var data = new Uint8Array(request.response);

            // hack for opera opera sometimes does not fire progress with 100% - so we fire it here to make sure that last progress event will report 100%
            if (window.navigator.userAgent.indexOf("Opera") !== -1) {
                onprogress({
                    lengthComputable: true,
                    loaded: self.size,
                    total: self.size
                });
            }
            // end of a hack
            
            onload(data);
        }, false);
        request.addEventListener("progress", onprogress, false);
        request.addEventListener("error", onerror, false);
        request.open("GET", url);
        request.responseType = "arraybuffer";
        request.send();
    }
{'fraction_non_alphanumeric': 0.15717926932880205, 'fraction_numerical': 0.004672897196261682, 'mean_word_length': 2.1483957219251337, 'pattern_counts': {'":': 0, '<': 3, '<?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': '567153', 'n_tokens_mistral': 624, 'n_tokens_neox': 596, 'n_words': 159}