<commit_before>$(window).ready(function() {
/*
    Bind the divs to load on AJAX calls.
    For performance, we first determine which kingdoms have content, then load them all

    An optional table attribute data-address is used to define additional filters
*/
  $('table.metrics').each(function() {
      var baseAddress = $(this).attr("data-address");
      //console.debug(baseAddress);
      $(this).find('td.total div').each(function() {
        refresh(baseAddress, $(this), true);
      });
  });

  function refresh(baseAddress, target, nest) {
    var $target = $(target);

    // always add the datasetKey to the cube address
    var address = "?" + baseAddress;

    if ($target.closest("tr").attr("data-kingdom") != null) {
      address = address + "&taxonKey=" + $target.closest("tr").attr("data-kingdom");
    }

    if ($target.closest("td").attr("data-bor") != null) {
      address = address + "&basisOfRecord=" + $target.closest("td").attr("data-bor");
    }

    if ($target.hasClass("geo")) {
      address = address + "&IS_GEOREFERENCED=true";
    }
    var ws = cfg.wsMetrics + 'occurrence/count' + address;
    //console.debug(ws);
    $.getJSON(ws + '&callback=?', function (data) {
      $(target).html(data);
      if (nest && data!=0) {
        // load the rest of the row
        $target.closest('tr').find('div').each(function() {
          refresh(baseAddress, $(this), false);
        });
      } else if (nest) {
        // set the rest of the row to 0
        $target.closest('tr').find('div').each(function() {
          $(this).html("0");<commit_msg>Use underscore less cube parameter<commit_after>$(window).ready(function() {
/*
    Bind the divs to load on AJAX calls.
    For performance, we first determine which kingdoms have content, then load them all

    An optional table attribute data-address is used to define additional filters
*/
  $('table.metrics').each(function() {
      var baseAddress = $(this).attr("data-address");
      //console.debug(baseAddress);
      $(this).find('td.total div').each(function() {
        refresh(baseAddress, $(this), true);
      });
  });

  function refresh(baseAddress, target, nest) {
    var $target = $(target);

    // always add the datasetKey to the cube address
    var address = "?" + baseAddress;

    if ($target.closest("tr").attr("data-kingdom") != null) {
      address = address + "&taxonKey=" + $target.closest("tr").attr("data-kingdom");
    }

    if ($target.closest("td").attr("data-bor") != null) {
      address = address + "&basisOfRecord=" + $target.closest("td").attr("data-bor");
    }

    if ($target.hasClass("geo")) {
      address = address + "&isGeoreferenced=true";
    }
    var ws = cfg.wsMetrics + 'occurrence/count' + address;
    //console.debug(ws);
    $.getJSON(ws + '&callback=?', function (data) {
      $(target).html(data);
      if (nest && data!=0) {
        // load the rest of the row
        $target.closest('tr').find('div').each(function() {
          refresh(baseAddress, $(this), false);
        });
      } else if (nest) {
        // set the rest of the row to 0
        $target.closest('tr').find('div').each(function() {
          $(this).html("0");
{'fraction_non_alphanumeric': 0.18033813400125234, 'fraction_numerical': 0.001878522229179712, 'mean_word_length': 2.8915956151035322, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2343628', 'n_tokens_mistral': 994, 'n_tokens_neox': 960, 'n_words': 237}