<commit_before>var summary_filter_link = '<a href="javascript:hide_non_summary()">show only summary lines</a>';
$(document).ready(function() {
        $('#summary_container').html('<a href="javascript:save_summary_changes()">Save summary changes</a>, <span id="toggle_summary">' + summary_filter_link + '</span>');
});

function save_summary_changes() {
    var newly_checked = [];
    var was_checked = [];
    $('.originally_checked').each(function(index, element) {
            if (! $(element).is(':checked')) {
                was_checked.push(
                    $(element).attr('name').split('_')[2]
                );
            }
    });
    $('.summary_checkbox:checked').each(function(index, element) {
            if (! $(element).attr('class').match(/originally_checked/)) {
                newly_checked.push(
                    $(element).attr('name').split('_')[2]
                );
            }
    });
    if (was_checked.length != 0 || newly_checked.length != 0) {
        $.post("/save_summary.pl", { check: newly_checked.join('.'), uncheck: was_checked.join('.') } );
    }
}

function hide_non_summary() {
    $('.summary_checkbox:not(:checked)').parent().parent().hide();
    $('#toggle_summary').html('<a href="javascript:show_all_rows()">show all lines</a>');
}

function show_all_rows() {
    $('.summary_checkbox').parent().parent().show();
    $('#toggle_summary').html(summary_filter_link);
}
<commit_msg>make parent lookup more robust<commit_after>var summary_filter_link = '<a href="javascript:hide_non_summary()">show only summary lines</a>';
$(document).ready(function() {
        $('#summary_container').html('<a href="javascript:save_summary_changes()">Save summary changes</a>, <span id="toggle_summary">' + summary_filter_link + '</span>');
});

function save_summary_changes() {
    var newly_checked = [];
    var was_checked = [];
    $('.originally_checked').each(function(index, element) {
            if (! $(element).is(':checked')) {
                was_checked.push(
                    $(element).attr('name').split('_')[2]
                );
            }
    });
    $('.summary_checkbox:checked').each(function(index, element) {
            if (! $(element).attr('class').match(/originally_checked/)) {
                newly_checked.push(
                    $(element).attr('name').split('_')[2]
                );
            }
    });
    if (was_checked.length != 0 || newly_checked.length != 0) {
        $.post("/save_summary.pl", { check: newly_checked.join('.'), uncheck: was_checked.join('.') } );
    }
}

function hide_non_summary() {
    $('.summary_checkbox:not(:checked)').parents('tr').hide();
    $('#toggle_summary').html('<a href="javascript:show_all_rows()">show all lines</a>');
}

function show_all_rows() {
    $('.summary_checkbox').parents('tr').show();
    $('#toggle_summary').html(summary_filter_link);
}

{'fraction_non_alphanumeric': 0.20297887080013854, 'fraction_numerical': 0.0027710426047800486, 'mean_word_length': 3.1198288159771757, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '1146436', 'n_tokens_mistral': 853, 'n_tokens_neox': 840, 'n_words': 114}