<commit_before>(function () {

    function getParameterByName(name, url) {
        if (!url) url = window.location.href;
        name = name.replace(/[\[\]]/g, "\\$&");
        var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
            results = regex.exec(url);
        if (!results) return null;
        if (!results[2]) return '';
        return decodeURIComponent(results[2].replace(/\+/g, " "));
    }

    function getMframeContent() {
        var mframeUrl = getParameterByName('data');
        if (!mframeUrl) {
            mframeUrl = 'mframe.json';
        }

        var xhttp = new XMLHttpRequest();
        xhttp.onreadystatechange = function() {
            if (xhttp.readyState === 4 && xhttp.status === 200) {
                handleMframeJson(JSON.parse(xhttp.responseText));
            }
        };

        xhttp.open('GET', mframeUrl);
        xhttp.send();
    }

    var components = [];
    var callback = null;

    function handleMframeJson(data) {
        components = [];
        data.forEach(c => {
            components.push(new Component(c.type, c.params.value));
        });
        if (callback) {
            callback(components);
        }
    }

    class Component {
        constructor(type, value) {
            this.type = type;
            this.value = value;
        }

        getValue() {
            return this.valuel;
        }

        getType() {
            return this.type;
        }
    }

    window.getComponents = function (cb) {
        if (components) {
            cb(components);
        } else {
            cb = callback;
        }
    };

    window.onload = getMframeContent();

})();<commit_msg>Fixed ()<commit_after>(function () {

    function getParameterByName(name, url) {
        if (!url) url = window.location.href;
        name = name.replace(/[\[\]]/g, "\\$&");
        var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
            results = regex.exec(url);
        if (!results) return null;
        if (!results[2]) return '';
        return decodeURIComponent(results[2].replace(/\+/g, " "));
    }

    function getMframeContent() {
        var mframeUrl = getParameterByName('data');
        if (!mframeUrl) {
            mframeUrl = 'mframe.json';
        }

        var xhttp = new XMLHttpRequest();
        xhttp.onreadystatechange = function() {
            if (xhttp.readyState === 4 && xhttp.status === 200) {
                handleMframeJson(JSON.parse(xhttp.responseText));
            }
        };

        xhttp.open('GET', mframeUrl);
        xhttp.send();
    }

    var components = [];
    var callback = null;

    function handleMframeJson(data) {
        components = [];
        data.forEach(c => {
            components.push(new Component(c.type, c.params.value));
        });
        if (callback) {
            callback(components);
        }
    }

    class Component {
        constructor(type, value) {
            this.type = type;
            this.value = value;
        }

        getValue() {
            return this.valuel;
        }

        getType() {
            return this.type;
        }
    }

    window.getComponents = function (cb) {
        if (components) {
            cb(components);
        } else {
            cb = callback;
        }
    };

    window.onload = getMframeContent;

})();
{'fraction_non_alphanumeric': 0.15375411307209094, 'fraction_numerical': 0.0035895901884534847, 'mean_word_length': 1.6413902053712481, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4379038', 'n_tokens_mistral': 998, 'n_tokens_neox': 963, 'n_words': 181}