<commit_before>// ES6 endsWith polyfill
if (!String.prototype.endsWith) {
  String.prototype.endsWith = function(searchString, position) {
      var subjectString = this.toString();
      if (position === undefined || position > subjectString.length) {
        position = subjectString.length;
      }
      position -= searchString.length;
      var lastIndex = subjectString.indexOf(searchString, position);
      return lastIndex !== -1 && lastIndex === position;
  };
}

// Functions used by MIQ for the dhtmlxtree control

// Function to pass ajax request to server, to remember tree states
function miqTreeState(rowId, state) {
  miqJqueryRequest('/vm/compare_set_state?rowId=' + rowId + '&state=' + state);
  return true;
}

// Handle row click (ajax or normal html trans)
function miqRowClick(row_id, cell_idx) {
  var cell = this.cells(row_id, cell_idx);
  if (cell_idx && !cell.getAttribute('is_button')) {
    if (typeof row_url_ajax != "undefined" && row_url_ajax) {
      miqJqueryRequest(row_url + row_id, {beforeSend: true, complete: true});
    } else {
      if (!row_url.endsWith("/")) {
        row_url = row_url + "/";
      }
      DoNav(row_url + row_id);
    }
  }
}

// Handle row click - used by AE
function miqAeRowSelected(row_id, cell_idx) {
  if (cell_idx) {
    var selected_id = this.getSelectedRowId();
    if (selected_id != null) {
      if (selected_id.split("_")[0] == "Field") {
        this.clearSelection();
      } else {
        miqDynatreeActivateNode('ae_tree', row_id);
      }
    }
  }
}

// Method to hide flash_msg when folde ris being edited in menu editor
function miqMenuRowSelected(row_id, cell_idx) {
  $('#flash_msg_div_menu_list').hide();
  folder_list_grid.editCell();
}

// Handle row click
function miqRequestRowSelected(row_id) {
  if (row_id != null) {<commit_msg>No need to add "/" at the end of url when url ends with "="<commit_after>// ES6 endsWith polyfill
if (!String.prototype.endsWith) {
  String.prototype.endsWith = function(searchString, position) {
      var subjectString = this.toString();
      if (position === undefined || position > subjectString.length) {
        position = subjectString.length;
      }
      position -= searchString.length;
      var lastIndex = subjectString.indexOf(searchString, position);
      return lastIndex !== -1 && lastIndex === position;
  };
}

// Functions used by MIQ for the dhtmlxtree control

// Function to pass ajax request to server, to remember tree states
function miqTreeState(rowId, state) {
  miqJqueryRequest('/vm/compare_set_state?rowId=' + rowId + '&state=' + state);
  return true;
}

// Handle row click (ajax or normal html trans)
function miqRowClick(row_id, cell_idx) {
  var cell = this.cells(row_id, cell_idx);
  if (cell_idx && !cell.getAttribute('is_button')) {
    if (typeof row_url_ajax != "undefined" && row_url_ajax) {
      miqJqueryRequest(row_url + row_id, {beforeSend: true, complete: true});
    } else {
      if (!row_url.endsWith("/") && !row_url.endsWith("=")) {
        row_url = row_url + "/";
      }
      DoNav(row_url + row_id);
    }
  }
}

// Handle row click - used by AE
function miqAeRowSelected(row_id, cell_idx) {
  if (cell_idx) {
    var selected_id = this.getSelectedRowId();
    if (selected_id != null) {
      if (selected_id.split("_")[0] == "Field") {
        this.clearSelection();
      } else {
        miqDynatreeActivateNode('ae_tree', row_id);
      }
    }
  }
}

// Method to hide flash_msg when folde ris being edited in menu editor
function miqMenuRowSelected(row_id, cell_idx) {
  $('#flash_msg_div_menu_list').hide();
  folder_list_grid.editCell();
}

// Handle row click
function miqRequestRowSelected(row_id) {
  if (row_id != null) {
{'fraction_non_alphanumeric': 0.13198924731182796, 'fraction_numerical': 0.0016129032258064516, 'mean_word_length': 3.4350417163289633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3856236', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1209, 'n_words': 300}