<commit_before>window.onload = function () {
    var $container = $('body > div.container');
    var observer;

    $container.imagesLoaded(function () {
        //Apply initial masonry
        applyMasonry($container);

        //Create a MutationObserver which will watch for changes to the DOM and re-apply masonry
        MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
        observer = new MutationObserver(function (mutations, observer) {
            applyMasonry($container);
        });

        // define what element should be observed by the observer
        // and what types of mutations trigger the callback
        observer.observe(document, {
            subtree: true,
            attributes: false, // causes an infinite loop, as masonry itself triggers the MutationObserver if this is true
            childList: true,
            characterData: true,
            attributeOldValue: false,
            characterDataOldValue: false
        });
    });

    // re-apply masonry onClick, useful for checkboxes that toggle controls
    $container.click(function () {
        applyMasonry($container);
    });

    // TODO: have masonry re-apply when a textarea is resized
    function applyMasonry(selector) {
        selector.masonry({
            columnWidth: 128 + 8, //.panel-span-1 width = 128, +8 for 4px pad on each side
            itemSelector: '.panel'
        })
    }

    // Add informational "popover" tooltips to the header of each panel
    $('.panel-heading').append(
        '<button type="button" class="btn btn-xs btn-info panel-info"><i class="fa fa-info"></i></button>'
    );
    $('.panel-info').each(function (index) {
        pkgName = $(this).closest('.panel').attr("id");
        $(this).popover({
            title: pkgName,<commit_msg>Only apply masonry to direct child panels of the dashboard panels container.<commit_after>window.onload = function () {
    var $container = $('body > div.container');
    var observer;

    $container.imagesLoaded(function () {
        //Apply initial masonry
        applyMasonry($container);

        //Create a MutationObserver which will watch for changes to the DOM and re-apply masonry
        MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
        observer = new MutationObserver(function (mutations, observer) {
            applyMasonry($container);
        });

        // define what element should be observed by the observer
        // and what types of mutations trigger the callback
        observer.observe(document, {
            subtree: true,
            attributes: false, // causes an infinite loop, as masonry itself triggers the MutationObserver if this is true
            childList: true,
            characterData: true,
            attributeOldValue: false,
            characterDataOldValue: false
        });
    });

    // re-apply masonry onClick, useful for checkboxes that toggle controls
    $container.click(function () {
        applyMasonry($container);
    });

    // TODO: have masonry re-apply when a textarea is resized
    function applyMasonry(selector) {
        selector.masonry({
            columnWidth: 128 + 8, //.panel-span-1 width = 128, +8 for 4px pad on each side
            itemSelector: '.dashboard-panels > .panel'
        })
    }

    // Add informational "popover" tooltips to the header of each panel
    $('.panel-heading').append(
        '<button type="button" class="btn btn-xs btn-info panel-info"><i class="fa fa-info"></i></button>'
    );
    $('.panel-info').each(function (index) {
        pkgName = $(this).closest('.panel').attr("id");
        $(this).popover({
            title: pkgName,
{'fraction_non_alphanumeric': 0.11012145748987855, 'fraction_numerical': 0.005398110661268556, 'mean_word_length': 2.415668202764977, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, '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': '2116119', 'n_tokens_mistral': 997, 'n_tokens_neox': 958, 'n_words': 299}