<commit_before>var interlace = (function () {

    var exports = {};
    var prefix = 'interlace_';
    var count = 0;

    var bodyOverflow = '';

    var preventDefault = function (e) {
        e.preventDefault();
    };

    function isElement(o) {
        return (
            typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2
            o && typeof o === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string"
        );
    }

    var hashToParams = function (hash) {
        var search = hash ? '?' : '';
        for (var k in hash) {
            if (hash[k].isArray) {
                for (var i = 0; i < hash[k].length; i++) {
                    search += search === '?' ? '' : '&';
                    search += encodeURIComponent(k) + '=' + encodeURIComponent(hash[k][i]);
                }
            } else {
                search += search === '?' ? '' : '&';
                search += encodeURIComponent(k) + '=' + encodeURIComponent(hash[k]);
            }
        }
        return search;
    };

    var getParam = function (name, from) {
        from = from || window.location.search;
        var regexS = '[?&]' + name + '=([^&#]*)';
        var regex = new RegExp(regexS);
        var results = regex.exec(from);
        if (results === null) {
            return '';
        }
        return decodeURIComponent(results[1].replace(/\+/g, ' '));
    };

    var styleToString = function (obj) {
        var str = '';
        for (var e in obj) {
            if (obj.hasOwnProperty(e)) {
                str += e + ':' + obj[e] + ';';
            }
        }
        return str;
    };

    exports.prefix = function (value) {
        prefix = value;
    };

    exports.load = function (payload) {
        var frameId = prefix + (count += 1);
        var iframe = document.createElement('iframe');

        var params = payload.params || {};
        params.interlace = frameId;

        var url = payload.url + hashToParams(params);

        payload.options = payload.options || {};

        // Append the initial width as a querystring parameter, and the fragment id
        iframe.id = frameId;
        iframe.src = url;

        // Set some attributes to this proto-iframe.
        iframe.setAttribute('width', typeof payload.options.width === 'undefined' ? '100%' : payload.options.width);
        iframe.setAttribute('height', typeof payload.options.height === 'undefined' ? '100%' : payload.options.height);
        iframe.setAttribute('scrolling', 'no');
        iframe.setAttribute('marginheight', '0');
        iframe.setAttribute('frameborder', '0');
        iframe.setAttribute('allowtransparency', 'true');
        iframe.setAttribute('style', 'display:none');

        iframe.send = function (event, data) {
            data = data || {};
            data.$$id = this.id;
            data.$$event = event;
            var json = JSON.stringify(data);

            this.contentWindow.postMessage(json, '*');
        };

        iframe.show = function () {
            if (iframe.parentNode.style.display === 'none') {
                iframe.parentNode.style.display = iframe.$$display;
            }
        };

        iframe.hide = function () {
            if (!iframe.$$display) {
                iframe.$$display = iframe.parentNode.style.display;
                iframe.parentNode.style.display = 'none';
            }
        };

        iframe.destroy = function () {
            document.body.style.overflow = bodyOverflow;
            document.body.removeEventListener('touchstart', preventDefault);
            document.body.removeEventListener('touchmove', preventDefault);
            if (iframe.parentNode.getAttribute('data-interlace')) { // if this id exist, we created it
                iframe.parentNode.parentNode.removeChild(iframe.parentNode);
            } else {
                iframe.parentNode.removeChild(iframe);
            }
            iframe.fire('destroyed');<commit_msg>fix missing payload in interlace<commit_after>var interlace = (function () {

    var exports = {};
    var prefix = 'interlace_';
    var count = 0;

    var bodyOverflow = '';

    var preventDefault = function (e) {
        e.preventDefault();
    };

    function isElement(o) {
        return (
            typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2
            o && typeof o === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string"
        );
    }

    var hashToParams = function (hash) {
        var search = hash ? '?' : '';
        for (var k in hash) {
            if (hash[k].isArray) {
                for (var i = 0; i < hash[k].length; i++) {
                    search += search === '?' ? '' : '&';
                    search += encodeURIComponent(k) + '=' + encodeURIComponent(hash[k][i]);
                }
            } else {
                search += search === '?' ? '' : '&';
                search += encodeURIComponent(k) + '=' + encodeURIComponent(hash[k]);
            }
        }
        return search;
    };

    var getParam = function (name, from) {
        from = from || window.location.search;
        var regexS = '[?&]' + name + '=([^&#]*)';
        var regex = new RegExp(regexS);
        var results = regex.exec(from);
        if (results === null) {
            return '';
        }
        return decodeURIComponent(results[1].replace(/\+/g, ' '));
    };

    var styleToString = function (obj) {
        var str = '';
        for (var e in obj) {
            if (obj.hasOwnProperty(e)) {
                str += e + ':' + obj[e] + ';';
            }
        }
        return str;
    };

    exports.prefix = function (value) {
        prefix = value;
    };

    exports.load = function (payload) {
        var frameId = prefix + (count += 1);
        var iframe = document.createElement('iframe');

        var params = payload.params || {};
        params.interlace = frameId;

        var url = payload.url + hashToParams(params);

        payload.options = payload.options || {};

        // Append the initial width as a querystring parameter, and the fragment id
        iframe.id = frameId;
        iframe.src = url;

        // Set some attributes to this proto-iframe.
        iframe.setAttribute('width', typeof payload.options.width === 'undefined' ? '100%' : payload.options.width);
        iframe.setAttribute('height', typeof payload.options.height === 'undefined' ? '100%' : payload.options.height);
        iframe.setAttribute('scrolling', 'no');
        iframe.setAttribute('marginheight', '0');
        iframe.setAttribute('frameborder', '0');
        iframe.setAttribute('allowtransparency', 'true');
        iframe.setAttribute('style', 'display:none');

        iframe.send = function (event, data) {
            var payload = {};
            payload.id = this.id;
            payload.event = event;
            payload.data = data;
            var json = JSON.stringify(payload);

            this.contentWindow.postMessage(json, '*');
        };

        iframe.show = function () {
            if (iframe.parentNode.style.display === 'none') {
                iframe.parentNode.style.display = iframe.$$display;
            }
        };

        iframe.hide = function () {
            if (!iframe.$$display) {
                iframe.$$display = iframe.parentNode.style.display;
                iframe.parentNode.style.display = 'none';
            }
        };

        iframe.destroy = function () {
            document.body.style.overflow = bodyOverflow;
            document.body.removeEventListener('touchstart', preventDefault);
            document.body.removeEventListener('touchmove', preventDefault);
            if (iframe.parentNode.getAttribute('data-interlace')) { // if this id exist, we created it
                iframe.parentNode.parentNode.removeChild(iframe.parentNode);
            } else {
                iframe.parentNode.removeChild(iframe);
            }
            iframe.fire('destroyed');
{'fraction_non_alphanumeric': 0.14704415066101273, 'fraction_numerical': 0.003492142678972312, 'mean_word_length': 1.827574047954866, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6685510', 'n_tokens_mistral': 2259, 'n_tokens_neox': 2132, 'n_words': 477}