<commit_before>function get(url, parameters, options) {

    options = typeof options !== "undefined" ? options : {withCredentials: false};
    return new Promise(function(resolve, reject) {

        let xhr = new XMLHttpRequest();
        xhr.responseType = "json";
        xhr.withCredentials = options.withCredentials;

        xhr.addEventListener("readystatechange", function() {
            if (xhr.readyState === 4 && xhr.status == 200) {
                // Resolve the promise with the response.
                resolve(xhr.response);
            }
        });

        xhr.addEventListener("error", function() {
            reject(Error(xhr));
        });

        xhr.open("GET", `${url}?${serialize(parameters)}`);
        xhr.send();
    });

}

function post(url, data, options) {

    options = typeof options !== "undefined" ? options : {withCredentials: false};

    return new Promise(function(resolve, reject) {

        let xhr = new XMLHttpRequest();
        xhr.responseType = "json";
        xhr.withCredentials = options.withCredentials;

        xhr.addEventListener("readystatechange", function() {
            if (xhr.readyState === 4 && xhr.status == 200) {
                // Resolve the promise with the response.
                resolve(xhr.response);
            }
        });

        xhr.addEventListener("error", function() {
            reject(Error(xhr));
        });

        xhr.open("POST", url);
        xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");
        xhr.send(serialize(data));
    });

}

function serialize(obj, prefix) {
    let str = [];
    for (let p in obj) {<commit_msg>fixed bug with IE11 responseType = json is not valid in IE11. The workaround results in a much larger block of code.<commit_after>function get(url, parameters, options) {

    options = typeof options !== "undefined" ? options : {withCredentials: false};
    return new Promise(function(resolve, reject) {

        let xhr = new XMLHttpRequest();
        // xhr.responseType = "json"; // Can't use this until IE11 supports it.
        xhr.withCredentials = options.withCredentials;

        xhr.addEventListener("readystatechange", function() {
            if (xhr.readyState === 4 && xhr.status == 200) {
                // Handle empty responses.
                let response;
                if (xhr.response === "") {
                    response = null;
                } else {
                    response = JSON.parse(xhr.response);
                }

                // Resolve the promise with the response.
                resolve(response);
            }
        });

        xhr.addEventListener("error", function() {
            reject(Error(xhr));
        });

        xhr.open("GET", `${url}?${serialize(parameters)}`);
        xhr.send();
    });

}

function post(url, data, options) {

    options = typeof options !== "undefined" ? options : {withCredentials: false};

    return new Promise(function(resolve, reject) {

        let xhr = new XMLHttpRequest();
        // xhr.responseType = "json"; // Can't use this until IE11 supports it.
        xhr.withCredentials = options.withCredentials;

        xhr.addEventListener("readystatechange", function() {
            if (xhr.readyState === 4 && xhr.status == 200) {
                // Handle empty responses.
                let response;
                if (xhr.response === "") {
                    response = null;
                } else {
                    response = JSON.parse(xhr.response);
                }

                // Resolve the promise with the response.
                resolve(response);
            }
        });

        xhr.addEventListener("error", function() {
            reject(Error(xhr));
        });

        xhr.open("POST", url);
        xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");
        xhr.send(serialize(data));
    });

}

function serialize(obj, prefix) {
    let str = [];
    for (let p in obj) {
{'fraction_non_alphanumeric': 0.1327168207948013, 'fraction_numerical': 0.005998500374906273, 'mean_word_length': 1.9297218155197657, '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': '5596887', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1045, 'n_words': 254}