<commit_before>!(function () {
    /* =================================================================== */

    function UUID() {
        var uuid = localStorage.getItem('__jsinspector_uuid__');
        if (uuid) return uuid;
        else {
            uuid = UUID.generate();
            localStorage.setItem('__jsinspector_uuid__', uuid);
            return uuid;
        }
    }

    UUID.generate = function () {
        return 'xxxx-yxxyx'.replace(/[xy]/g, function(c) {
            var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
            return v.toString(16);
        }).toUpperCase();
    }

    function createScript () {
        var script = '<script src="{{host}}/inspector?{{inspectId}}"></script>',
            $scriptContainer = document.querySelector('#script'),
            code = script.replace('{{host}}', window.location.origin)
                        .replace('{{inspectId}}', UUID())
                        .replace(/</g, '&lt;')
                        .replace(/>/g, '&gt;')
                        .replace(/"/g, '&quot;')
                        .replace(/\s+([a-zA-Z\-]+?)\=&quot;/g, ' <span class="attr"> $1</span><span class="equal">=</span>&quot;')
                        .replace(/=&quot;(.+?)&quot;/g, '=<span class="string">&quot;$1&quot;</span>')
                        .replace(/&lt;([a-zA-Z]+?)\s/g, '&lt;<span class="tagname">$1 </span>')
                        .replace(/\/([a-zA-Z]+?)&gt;/g, '<span class="tagclose">/</span><span class="tagname">$1</span>&gt;')
                        .replace(/&lt;/g, '<span class="tag">&lt;</span>')
                        .replace(/&gt;/g, '<span class="tag">&gt;</span>')
                         // inspector highligt
                        .replace(/\?([a-zA-Z0-9]+)\-([a-zA-Z0-9]+)/g, '<span class="inspid">?$1-$2</span>')

        $scriptContainer.innerHTML = code;
    }

    createScript();
    
    var $devtoolsButton = document.querySelector('#devtoolsButton');
    function updateDevtoolsLink () {
        $devtoolsButton.href = window.location.origin + '/devtools?' + UUID();
    }

    document.querySelector('#createButton').onclick = function () {
        localStorage.removeItem('__jsinspector_uuid__')
        createScript();
        updateDevtoolsLink();
    }

})();<commit_msg>init update devtools link<commit_after>!(function () {
    /* =================================================================== */

    function UUID() {
        var uuid = localStorage.getItem('__jsinspector_uuid__');
        if (uuid) return uuid;
        else {
            uuid = UUID.generate();
            localStorage.setItem('__jsinspector_uuid__', uuid);
            return uuid;
        }
    }

    UUID.generate = function () {
        return 'xxxx-yxxyx'.replace(/[xy]/g, function(c) {
            var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
            return v.toString(16);
        }).toUpperCase();
    }

    function createScript () {
        var script = '<script src="{{host}}/inspector?{{inspectId}}"></script>',
            $scriptContainer = document.querySelector('#script'),
            code = script.replace('{{host}}', window.location.origin)
                        .replace('{{inspectId}}', UUID())
                        .replace(/</g, '&lt;')
                        .replace(/>/g, '&gt;')
                        .replace(/"/g, '&quot;')
                        .replace(/\s+([a-zA-Z\-]+?)\=&quot;/g, ' <span class="attr"> $1</span><span class="equal">=</span>&quot;')
                        .replace(/=&quot;(.+?)&quot;/g, '=<span class="string">&quot;$1&quot;</span>')
                        .replace(/&lt;([a-zA-Z]+?)\s/g, '&lt;<span class="tagname">$1 </span>')
                        .replace(/\/([a-zA-Z]+?)&gt;/g, '<span class="tagclose">/</span><span class="tagname">$1</span>&gt;')
                        .replace(/&lt;/g, '<span class="tag">&lt;</span>')
                        .replace(/&gt;/g, '<span class="tag">&gt;</span>')
                         // inspector highligt
                        .replace(/\?([a-zA-Z0-9]+)\-([a-zA-Z0-9]+)/g, '<span class="inspid">?$1-$2</span>')

        $scriptContainer.innerHTML = code;
    }

    createScript();
    
    function updateDevtoolsLink () {
        var $devtoolsButton = document.querySelector('#devtoolsButton');
        $devtoolsButton.href = window.location.origin + '/devtools?' + UUID();
    }

    document.querySelector('#createButton').onclick = function () {
        localStorage.removeItem('__jsinspector_uuid__')
        createScript();
        updateDevtoolsLink();
    }
    // initialize update
    updateDevtoolsLink();

})();
{'fraction_non_alphanumeric': 0.23225391378940596, 'fraction_numerical': 0.008149260132961612, 'mean_word_length': 2.0051546391752577, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, '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': '5356893', 'n_tokens_mistral': 1449, 'n_tokens_neox': 1386, 'n_words': 198}