<commit_before>$(function() {
  var add, change_buttons, checked_traits, deselect_all, invert, remove, removed_traits, select_all;

  checked_traits = null;
  select_all = function() {
    console.log("selected_all");
    $(".trait_checkbox").each(function() {
        $(this).prop('checked', true);
        if (!$(this).closest('tr').hasClass('selected')) {
            $(this).closest('tr').addClass('selected')
        }
    });
  };

  deselect_all = function() {
    $(".trait_checkbox").each(function() {
        $(this).prop('checked', false);
        if ($(this).closest('tr').hasClass('selected')) {
            $(this).closest('tr').removeClass('selected')
        }
    });
  };

  invert = function() {
    $(".trait_checkbox").each(function() {
        if ($(this).prop('checked') == true) {
            $(this).prop('checked', false)
        }
        else {
            $(this).prop('checked', true)
        }

        if ($(this).closest('tr').hasClass('selected')) {
            $(this).closest('tr').removeClass('selected')
        }
        else {<commit_msg>Fixed select_all and deselect_all to use DataTables API so they work with any tables that use Scroller<commit_after>$(function() {
  var add, change_buttons, checked_traits, deselect_all, invert, remove, removed_traits, select_all;

  checked_traits = null;
  select_all = function() {
    table_api = $('#trait_table').DataTable();

    check_cells = table_api.column(0).nodes().to$();
    for (let i = 0; i < check_cells.length; i++) {
      check_cells[i].childNodes[0].checked = true;
    }

    check_rows = table_api.rows().nodes();
    for (let i =0; i < check_rows.length; i++) {
      check_rows[i].classList.add("selected")
    }
  };

  deselect_all = function() {
    table_api = $('#trait_table').DataTable();

    check_cells = table_api.column(0).nodes().to$();
    for (let i = 0; i < check_cells.length; i++) {
      check_cells[i].childNodes[0].checked = false;
    }

    check_rows = table_api.rows().nodes();
    for (let i =0; i < check_rows.length; i++) {
      check_rows[i].classList.remove("selected")
    }
  };

  invert = function() {
    $(".trait_checkbox").each(function() {
        if ($(this).prop('checked') == true) {
            $(this).prop('checked', false)
        }
        else {
            $(this).prop('checked', true)
        }

        if ($(this).closest('tr').hasClass('selected')) {
            $(this).closest('tr').removeClass('selected')
        }
        else {
{'fraction_non_alphanumeric': 0.18973124749298034, 'fraction_numerical': 0.003208985158443642, 'mean_word_length': 2.750375939849624, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '5103969', 'n_tokens_mistral': 798, 'n_tokens_neox': 775, 'n_words': 137}