<commit_before>/*
 *  (c) AstroPrint Product Team. 3DaGoGo, Inc. (<EMAIL>)
 *
 *  Distributed under the GNU Affero General Public License http://www.gnu.org/licenses/agpl.html
 */

var USBFile = Backbone.Model.extend({
  defaults: {
    'name': '',
    'location': '',
    'image': null
  }
});

var USBFileCollection = Backbone.Collection.extend({
  model: USBFile,
  url: API_BASEURL + "files/folder-contents",
  extensionsAllowed: ['.gcode'],
  localStorages: [],
  initialize: function(){
    console.log('asldkfj;alskdjf')
    $.getJSON('/api/files/file-browsing-extensions')
      .done(function(data){
        this.extensionsAllowed = data;
      })
      .fail(function(error){
        console.error(error);
      });

    $.getJSON('/api/files/removable-drives')
      .done(_.bind(function(data){
        this.localStorages = data;
      },this))
      .fail(function(error){
        console.error(error);
      });
  },
  extensionMatched: function(file)
  {
    var matched = false;

    for(var i=0; !matched && i<this.extensionsAllowed.length; i++){
      matched = file.endsWith(this.extensionsAllowed[i]);
    }

    return matched;
  },
  topLocationMatched: function(location)<commit_msg>remove console log<commit_after>/*
 *  (c) AstroPrint Product Team. 3DaGoGo, Inc. (<EMAIL>)
 *
 *  Distributed under the GNU Affero General Public License http://www.gnu.org/licenses/agpl.html
 */

var USBFile = Backbone.Model.extend({
  defaults: {
    'name': '',
    'location': '',
    'image': null
  }
});

var USBFileCollection = Backbone.Collection.extend({
  model: USBFile,
  url: API_BASEURL + "files/folder-contents",
  extensionsAllowed: ['.gcode'],
  localStorages: [],
  initialize: function(){
    $.getJSON('/api/files/file-browsing-extensions')
      .done(function(data){
        this.extensionsAllowed = data;
      })
      .fail(function(error){
        console.error(error);
      });

    $.getJSON('/api/files/removable-drives')
      .done(_.bind(function(data){
        this.localStorages = data;
      },this))
      .fail(function(error){
        console.error(error);
      });
  },
  extensionMatched: function(file)
  {
    var matched = false;

    for(var i=0; !matched && i<this.extensionsAllowed.length; i++){
      matched = file.endsWith(this.extensionsAllowed[i]);
    }

    return matched;
  },
  topLocationMatched: function(location)
{'fraction_non_alphanumeric': 0.16036943744752308, 'fraction_numerical': 0.0016792611251049538, 'mean_word_length': 3.0458404074702887, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2643572', 'n_tokens_mistral': 779, 'n_tokens_neox': 770, 'n_words': 136}