<commit_before>

cdb.admin.File = cdb.core.Model.extend({
    urlRoot: '/api/v1/upload'
});

cdb.admin.Files = Backbone.Collection.extend({
    url: '/api/v1/upload'
});

cdb.admin.Import = cdb.core.Model.extend({

  idAttribute: 'item_queue_id',
  urlRoot: '/api/v1/imports',

  initialize: function() {
    this.bind('change', this._checkFinish, this);
  },

  /**
   * checks for poll to finish
   */
  pollCheck: function(i) {
    var self = this;
    var tries = 0;
    this.pollTimer = setInterval(function() {
      cdb.log.debug("checking job for finish: " + tries);
      self.fetch({
        error: function(e) {
          self.trigger("change");
        }
      });
      ++tries;
    }, i || 1500);
  },

  destroyCheck: function() {
    clearInterval(this.pollTimer);
  },

  _checkFinish: function() {
    cdb.log.info("state: " + this.get('state'), "success: " + this.get("success"));

    if(this.get('success') === true) {
      cdb.log.debug("job finished");
      clearInterval(this.pollTimer);
      this.trigger('importComplete');
    } else if (this.get('success') === false) {
      cdb.log.debug("job failure");
      clearInterval(this.pollTimer);
      this.trigger('importError', this);
    }
  }
});


cdb.admin.Imports = cdb.core.Model.extend({
  url: '/api/v1/imports',

  initialize: function() {
    this.bind('change', this._checkImports, this);
    this.activeImports;       // Active imports
    this.failedImports = [];  // Failed imports
    this.lastImport;          // Last import being checked 
  },

  /**
   * checks for poll to finish
   */
  pollCheck: function(i) {
    var self = this;
    var tries = 0;
    this.pollTimer = setInterval(function() {
      cdb.log.debug("checking imports: " + tries);
      self.fetch({
        error: function(e) {
          self.trigger("change");
        }
      });
      ++tries;
    }, i || 2000);
  },

  destroyCheck: function() {
    clearInterval(this.pollTimer);
  },

  _checkImports: function() {

    // Check if there will be any imports
    if (this.get("imports").length == 0 && !this.activeImports) {
      this.trigger("importsEmpty");<commit_msg>commented all logs from importer<commit_after>

cdb.admin.File = cdb.core.Model.extend({
    urlRoot: '/api/v1/upload'
});

cdb.admin.Files = Backbone.Collection.extend({
    url: '/api/v1/upload'
});

cdb.admin.Import = cdb.core.Model.extend({

  idAttribute: 'item_queue_id',
  urlRoot: '/api/v1/imports',

  initialize: function() {
    this.bind('change', this._checkFinish, this);
  },

  /**
   * checks for poll to finish
   */
  pollCheck: function(i) {
    var self = this;
    var tries = 0;
    this.pollTimer = setInterval(function() {
      // cdb.log.debug("checking job for finish: " + tries);
      self.fetch({
        error: function(e) {
          self.trigger("change");
        }
      });
      ++tries;
    }, i || 1500);
  },

  destroyCheck: function() {
    clearInterval(this.pollTimer);
  },

  _checkFinish: function() {
    cdb.log.info("state: " + this.get('state'), "success: " + this.get("success"));

    if(this.get('success') === true) {
      // cdb.log.debug("job finished");
      clearInterval(this.pollTimer);
      this.trigger('importComplete');
    } else if (this.get('success') === false) {
      // cdb.log.debug("job failure");
      clearInterval(this.pollTimer);
      this.trigger('importError', this);
    }
  }
});


cdb.admin.Imports = cdb.core.Model.extend({
  url: '/api/v1/imports',

  initialize: function() {
    this.bind('change', this._checkImports, this);
    this.activeImports;       // Active imports
    this.failedImports = [];  // Failed imports
    this.lastImport;          // Last import being checked 
  },

  /**
   * checks for poll to finish
   */
  pollCheck: function(i) {
    var self = this;
    var tries = 0;
    this.pollTimer = setInterval(function() {
      // cdb.log.debug("checking imports: " + tries);
      self.fetch({
        error: function(e) {
          self.trigger("change");
        }
      });
      ++tries;
    }, i || 2000);
  },

  destroyCheck: function() {
    clearInterval(this.pollTimer);
  },

  _checkImports: function() {

    // Check if there will be any imports
    if (this.get("imports").length == 0 && !this.activeImports) {
      this.trigger("importsEmpty");
{'fraction_non_alphanumeric': 0.17164006476983576, 'fraction_numerical': 0.006939625260235947, 'mean_word_length': 2.552999178307313, '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': '4930138', 'n_tokens_mistral': 1465, 'n_tokens_neox': 1406, 'n_words': 269}