<commit_before><script type="text/javascript">
var RCAS = (function () {
    function captureSVG (that, selector) {
        var container = document.querySelector(selector).parentNode,
            height = container.offsetHeight,
            width  = container.offsetWidth,
            svgs = container.querySelectorAll('svg.main-svg'),
            prefix = 'data:image/svg+xml;base64,',
            data = '',
            draglayers = [];

        for (var i = 0; i < svgs.length; i++) {
            // Remove drag layer because it looks like a black box
            // when rendered in Inkscape.  This won't remove the
            // element from the DOM because we use querySelectorAll,
            // which returns a static node list.
            draglayers = svgs[i].getElementsByClassName('draglayer');
            while (draglayers.length > 0) {
                draglayers[0].parentNode.removeChild(draglayers[0]);
            }
            data = data + svgs[i].innerHTML;
        }
        data = prefix + btoa('<?xml version="1.0" standalone="yes"?>'+
                             '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="' + width +'" ' +
                             'height="' + height + '"' + '>' +
                             data + '</svg>');

        // override link target
        that.href = data;
        return true;
    }

    function generateModebarButton (selector) {
        var el     = document.createElement('div'),
            button = '<a href=# download="rcas.svg" onClick=\'RCAS.captureSVG(this, "'+
            selector + '")\' ' +
            'data-gravity="n" data-toggle="false" data-title="Download plot as a SVG" class="modebar-btn" rel="tooltip">' +
            '<svg viewBox="0 0 1000 1000" width="1em" height="1em">'+
            '<path transform="matrix(1 0 0 -1 0 850)" d="m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z"></path>'+
            '</svg>'+
            '</a>';

        el.innerHTML = button;
        el.className = 'modebar-group';
        return el;
    }

    function injectLink (pathToWidget) {<commit_msg>footer: Strip non UTF-8 characters from plots.<commit_after><script type="text/javascript">
var RCAS = (function () {
    function captureSVG (that, selector) {
        var container = document.querySelector(selector).parentNode,
            height = container.offsetHeight,
            width  = container.offsetWidth,
            svgs = container.querySelectorAll('svg.main-svg'),
            prefix = 'data:image/svg+xml;base64,',
            data = '',
            draglayers = [];

        for (var i = 0; i < svgs.length; i++) {
            // Remove drag layer because it looks like a black box
            // when rendered in Inkscape.  This won't remove the
            // element from the DOM because we use querySelectorAll,
            // which returns a static node list.
            draglayers = svgs[i].getElementsByClassName('draglayer');
            while (draglayers.length > 0) {
                draglayers[0].parentNode.removeChild(draglayers[0]);
            }
            // Some plots may contain non UTF-8 characters that cause
            // btoa to fail in Firefox, so we remove them with a call
            // to "replace".
            data = data + svgs[i].innerHTML.replace(/[\u0100-\uFFFF]/g,'');
        }
        data = prefix + btoa('<?xml version="1.0" standalone="yes"?>'+
                             '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="' + width +'" ' +
                             'height="' + height + '"' + '>' +
                             data + '</svg>');

        // override link target
        that.href = data;
        return true;
    }

    function generateModebarButton (selector) {
        var el     = document.createElement('div'),
            button = '<a href=# download="rcas.svg" onClick=\'RCAS.captureSVG(this, "'+
            selector + '")\' ' +
            'data-gravity="n" data-toggle="false" data-title="Download plot as a SVG" class="modebar-btn" rel="tooltip">' +
            '<svg viewBox="0 0 1000 1000" width="1em" height="1em">'+
            '<path transform="matrix(1 0 0 -1 0 850)" d="m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z"></path>'+
            '</svg>'+
            '</a>';

        el.innerHTML = button;
        el.className = 'modebar-group';
        return el;
    }

    function injectLink (pathToWidget) {
{'fraction_non_alphanumeric': 0.1425317897134181, 'fraction_numerical': 0.1336116910229645, 'mean_word_length': 1.9424902289223898, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 2, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3726877', 'n_tokens_mistral': 2178, 'n_tokens_neox': 1640, 'n_words': 439}