<commit_before>BR.Util = {

    get: function(url, cb) {
        var xhr = new XMLHttpRequest();

        xhr.open('GET', url, true);
        xhr.onload = function() {
            if ((xhr.status === 200 || xhr.status === 0) && xhr.responseText) {
                cb(null, xhr.responseText);
            } else {
                cb(BR.Util.getError(xhr));
            }
        };
        xhr.onerror = function() {
            cb(BR.Util.getError(xhr));
        };
        xhr.send();
    },

    getError: function(xhr) {
        var msg = 'no response from server';
        if (xhr.responseText) {
          msg = xhr.responseText;
        } else if (xhr.status || xhr.statusText) {
          msg = xhr.status + ': ' + xhr.statusText;
        }
        return new Error(msg);
    }

};<commit_msg>catch cross-origin exception for local file:// urls (profiles)<commit_after>BR.Util = {

    get: function(url, cb) {
        var xhr = new XMLHttpRequest();

        xhr.open('GET', url, true);
        xhr.onload = function() {
            if ((xhr.status === 200 || xhr.status === 0) && xhr.responseText) {
                cb(null, xhr.responseText);
            } else {
                cb(BR.Util.getError(xhr));
            }
        };
        xhr.onerror = function() {
            cb(BR.Util.getError(xhr));
        };
        try {
            xhr.send();
        } catch(e) {
            cb(e);
        }
    },

    getError: function(xhr) {
        var msg = 'no response from server';
        if (xhr.responseText) {
          msg = xhr.responseText;
        } else if (xhr.status || xhr.statusText) {
          msg = xhr.status + ': ' + xhr.statusText;
        }
        return new Error(msg);
    }

};
{'fraction_non_alphanumeric': 0.15084449621432733, 'fraction_numerical': 0.004659289458357601, 'mean_word_length': 1.4826589595375723, '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': '6216563', 'n_tokens_mistral': 568, 'n_tokens_neox': 546, 'n_words': 108}