<commit_before><% scope[:exclude_columns] ||= []
   scope[:sortable_columns] = true if scope[:sortable_columns].nil?
   scope[:show_only_disabled] = false if scope[:show_only_disabled].nil?
   scope[:selector_name] ||= 'selected[]'
   scope[:selected] ||= params[:selected]
   scope[:agents] ||= @agents
%>

<script type="text/javascript">
Util.on_load(function() {
    jQuery("#select_all_agents").live('click',function() {
        var val = this.checked;
        jQuery(".agent_select").each(function() {
            this.checked = val;
        });
    });

    jQuery("input.agent_select").live("click", function() {
        var unchecked_check_boxes = jQuery("input.agent_select:not(:checked)");
        if(unchecked_check_boxes.length > 0) {
            jQuery("#select_all_agents").removeAttr("checked");
        }
    });
})

</script>


<table id='agent_details' class='agents list_table <%=" sortable_table" if scope[:sortable_columns]%> selectable_table'>
    <thead>
    <tr class='agent_header'>
        <% if has_operate_permission_for_agents? %>
            <th class='selector'>
                <%= check_box_tag 'accept', '', false, {:id => 'select_all_agents', :class => 'agent_select'} -%>
            </th>
        <% end -%>

        <% unless scope[:exclude_columns].include?('hostname') -%>
            <th class='hostname'><%== column_header("Agent Name",  "hostname", scope[:sortable_columns]) %></th>
        <% end -%>

        <% unless scope[:exclude_columns].include?('location') -%>
            <th class='location'><%== column_header("Sandbox", "location", scope[:sortable_columns]) %></th>
        <% end -%>
<commit_msg>Select a range of agents via shift-clicking checkboxes<commit_after><% scope[:exclude_columns] ||= []
   scope[:sortable_columns] = true if scope[:sortable_columns].nil?
   scope[:show_only_disabled] = false if scope[:show_only_disabled].nil?
   scope[:selector_name] ||= 'selected[]'
   scope[:selected] ||= params[:selected]
   scope[:agents] ||= @agents
%>

<script type="text/javascript">
Util.on_load(function() {
    jQuery("#select_all_agents").live('click',function() {
        var val = this.checked;
        jQuery(".agent_select").each(function() {
            this.checked = val;
        });
    });

    var lastChecked = null;

    jQuery(document).ready(function() {
        jQuery('.agent_select').live('click', function(e) {
            if (!this.checked) {
                jQuery("#select_all_agents").removeAttr("checked");
            }

            if (!lastChecked) {
                lastChecked = this;
                return;
            }

            var $checkboxes = jQuery('.agent_select');
            var start = $checkboxes.index(this);
            var end = $checkboxes.index(lastChecked);

            if (e.shiftKey) {
                $checkboxes.slice(Math.min(start, end), Math.max(start, end) + 1).prop('checked', lastChecked.checked);
            }

            lastChecked = this;
        });
    });
})

</script>


<table id='agent_details' class='agents list_table <%=" sortable_table" if scope[:sortable_columns]%> selectable_table'>
    <thead>
    <tr class='agent_header'>
        <% if has_operate_permission_for_agents? %>
            <th class='selector'>
                <%= check_box_tag 'accept', '', false, {:id => 'select_all_agents', :class => 'agent_select'} -%>
            </th>
        <% end -%>

        <% unless scope[:exclude_columns].include?('hostname') -%>
            <th class='hostname'><%== column_header("Agent Name",  "hostname", scope[:sortable_columns]) %></th>
        <% end -%>

        <% unless scope[:exclude_columns].include?('location') -%>
            <th class='location'><%== column_header("Sandbox", "location", scope[:sortable_columns]) %></th>
        <% end -%>

{'fraction_non_alphanumeric': 0.1789280084077772, 'fraction_numerical': 0.0005254860746190226, 'mean_word_length': 2.8966223132036846, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 52, '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': '983569', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1127, 'n_words': 188}