<commit_before>/*jshint browser: true */
/*jshint unused: false */
/*global window, Backbone, $, arangoHelper, frontendConfig */
(function () {
  "use strict";

  window.GraphCollection = Backbone.Collection.extend({
    model: window.Graph,

    sortOptions: {
      desc: false
    },

    url: frontendConfig.basePath + "/_api/gharial",

    dropAndDeleteGraph: function(name, callback) {
      $.ajax({
        type: "DELETE",
        url: frontendConfig.basePath + "/_api/gharial/" + encodeURIComponent(name) + "?dropCollections=true",
        contentType: "application/json",
        processData: true,
        success: function() {
          callback(true);
        },
        error: function() {
          callback(false);
        }
      });
    },

    comparator: function(item, item2) {
      var a = item.get('_key') || "";
      var b = item2.get('_key') || "";
      a = a.toLowerCase();
      b = b.toLowerCase();
      if (this.sortOptions.desc === true) {
        return a < b ? 1 : a > b ? -1 : 0;
      }
      return a > b ? 1 : a < b ? -1 : 0;
    },<commit_msg>fixed wrong gharial api route<commit_after>/*jshint browser: true */
/*jshint unused: false */
/*global window, Backbone, $, arangoHelper, frontendConfig */
(function () {
  "use strict";

  window.GraphCollection = Backbone.Collection.extend({
    model: window.Graph,

    sortOptions: {
      desc: false
    },

    //url: frontendConfig.basePath + "/_api/gharial",
    url: arangoHelper.databaseUrl('/_api/gharial'),

    dropAndDeleteGraph: function(name, callback) {
      $.ajax({
        type: "DELETE",
        url: arangoHelper.databaseUrl('/_api/gharial/') + encodeURIComponent(name) + "?dropCollections=true",
        contentType: "application/json",
        processData: true,
        success: function() {
          callback(true);
        },
        error: function() {
          callback(false);
        }
      });
    },

    comparator: function(item, item2) {
      var a = item.get('_key') || "";
      var b = item2.get('_key') || "";
      a = a.toLowerCase();
      b = b.toLowerCase();
      if (this.sortOptions.desc === true) {
        return a < b ? 1 : a > b ? -1 : 0;
      }
      return a > b ? 1 : a < b ? -1 : 0;
    },
{'fraction_non_alphanumeric': 0.16085790884718498, 'fraction_numerical': 0.0071492403932082215, 'mean_word_length': 2.2169540229885056, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5046667', 'n_tokens_mistral': 718, 'n_tokens_neox': 713, 'n_words': 159}