<commit_before>define([
], function () {

    /**
     * A module to allow for cross-browser AJAX calls
     * @exports ajax
     */

    function Ajax () {}

    Ajax.prototype = {
        /**
         * Execute ajax request
         *
         * @memberOf module:ajax
         *
         * @param {string} url Location of json file
         * @param {string} method Defaults to get
         * @param {function} onload Success callback
         * @param {function} onerror Error callback
         *
         * @returns {object} XMLHTTP request object
         */
        load: function (url, method, onload, onerror) {
            var $this = this,
                xhr = $this.getRequest();

            if (xhr) {
                method = method ? method : 'get';
                xhr.onreadystatechange = function () {
                    if (xhr.readyState == 4) {
                        if (xhr.status == 200) {
                            if (onload) {
                                onload(xhr);
                            }
                        } else {
                            if (onerror) {
                                onerror(xhr);
                            }
                        }
                    }
                };
                xhr.open(method, url, true);
                xhr.send(null);
            }
            return xhr;
        },
        /**
         * Retrieves the correct XMLHTTP object
         *
         * @memberOf module:ajax
         *
         * @returns {object} XMLHTTP request object
         */
        getRequest: function () {
            var xhr = false;
            if (typeof ActiveXObject !== 'undefined') {
                try {
                    xhr = new ActiveXObject('Msxml2.XMLHTTP');
                } catch (e) {
                    try {
                        xhr = new ActiveXObject('Microsoft.XMLHTTP');
                    } catch (err) {
                        xhr = false;
                    }
                }
            } else if (window.XMLHttpRequest) {
                try {
                    xhr = new XMLHttpRequest();
                } catch (e) {
                    xhr = false;
                }
            }
            return xhr;
        },
        /**<commit_msg>Fix a bug with AJAX cross-domain on ie<commit_after>define([
], function () {

    /**
     * A module to allow for cross-browser AJAX calls
     * @exports ajax
     */

    function Ajax () {}

    Ajax.prototype = {
        /**
         * Execute ajax request
         *
         * @memberOf module:ajax
         *
         * @param {string} url Location of json file
         * @param {string} method Defaults to get
         * @param {function} onload Success callback
         * @param {function} onerror Error callback
         *
         * @returns {object} XMLHTTP request object
         */
        load: function (url, method, onload, onerror) {
            var $this = this,
                xhr = $this.getRequest();

            if (xhr) {
                method = method ? method : 'get';
                xhr.onload = function () {
                    if (onload) {
                        onload(xhr);
                    }
                };
                xhr.onerror = function () {
                    if (onerror) {
                        onerror(xhr);
                    }
                };
                xhr.open(method, url, true);
                xhr.send(null);
            }
            return xhr;
        },
        /**
         * Retrieves the correct XMLHTTP object
         *
         * @memberOf module:ajax
         *
         * @returns {object} XMLHTTP request object
         */
        getRequest: function () {
            var xhr = false;
            if (typeof XDomainRequest !== 'undefined') {
                try {
                    xhr = new XDomainRequest();
                } catch (e) {
                    xhr = false;
                }
            } else if (window.XMLHttpRequest) {
                try {
                    xhr = new XMLHttpRequest();
                } catch (e) {
                    xhr = false;
                }
            }
            return xhr;
        },
        /**
{'fraction_non_alphanumeric': 0.0961401847028179, 'fraction_numerical': 0.0011839924224484964, 'mean_word_length': 0.895870736086176, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '6107066', 'n_tokens_mistral': 1087, 'n_tokens_neox': 1013, 'n_words': 264}