<commit_before>/**
 * Default model configuration
 * (sails.config.models)
 *
 * Unless you override them, the following properties will be included
 * in each of your models.
 *
 * For more info on Sails models, see:
 * http://sailsjs.org/#/documentation/concepts/ORM
 */

module.exports.models = {

  /***************************************************************************
  *                                                                          *
  * Your app's default connection. i.e. the name of one of your app's        *
  * connections (see `config/connections.js`)                                *
  *                                                                          *
  ***************************************************************************/
  connection: 'oseam',

  /***************************************************************************
  *                                                                          *
  * How and whether Sails will attempt to automatically rebuild the          *
  * tables/collections/etc. in your schema.                                  *
  *                                                                          *
  * See http://sailsjs.org/#/documentation/concepts/ORM/model-settings.html  *
  *                                                                          *
  ***************************************************************************/
  migrate: 'safe',

  seed: function (callback) {
    var self = this;
    var modelName = self.adapter.identity.charAt(0).toUpperCase() + self.adapter.identity.slice(1);
    if (!self.seedData) {
      sails.log.debug('No data avaliable to seed ' + modelName);
      callback();
      return;
    }
    self.count().exec(function (err, count) {
      if (!err && count === 0) {
        sails.log.debug('Seeding ' + modelName + '...');
        if (self.seedData instanceof Array) {
          self.seedArray(callback);
        }else{
          self.seedObject(callback);
        }
      } else {
        sails.log.debug(modelName + ' had models, so no seed needed');
        callback();
      }
    });
  },
  seedArray: function (callback) {
    var self = this;
    var modelName = self.adapter.identity.charAt(0).toUpperCase() + self.adapter.identity.slice(1);
    self.createEach(self.seedData).exec(function (err, results) {
      if (err) {
        sails.log.debug(err);
        callback();
      } else {
        sails.log.debug(modelName + ' seed planted');
        callback();
      }
    });
  },
  seedObject: function (callback) {
    var self = this;
    var modelName = self.adapter.identity.charAt(0).toUpperCase() + self.adapter.identity.slice(1);
    self.create(self.seedData).exec(function (err, results) {
      if (err) {
        sails.log.debug(err);
        callback();
      } else {
        sails.log.debug(modelName + ' seed planted');
        callback();
      }
    });
 
  }
};<commit_msg>Tested<commit_after>/**
 * Default model configuration
 * (sails.config.models)
 *
 * Unless you override them, the following properties will be included
 * in each of your models.
 *
 * For more info on Sails models, see:
 * http://sailsjs.org/#/documentation/concepts/ORM
 */

module.exports.models = {

  /***************************************************************************
  *                                                                          *
  * Your app's default connection. i.e. the name of one of your app's        *
  * connections (see `config/connections.js`)                                *
  *                                                                          *
  ***************************************************************************/
  connection: 'oseam',

  /***************************************************************************
  *                                                                          *
  * How and whether Sails will attempt to automatically rebuild the          *
  * tables/collections/etc. in your schema.                                  *
  *                                                                          *
  * See http://sailsjs.org/#/documentation/concepts/ORM/model-settings.html  *
  *                                                                          *
  ***************************************************************************/
  migrate: 'safe',

  // seed: function (callback) {
  //   var self = this;
  //   var modelName = self.adapter.identity.charAt(0).toUpperCase() + self.adapter.identity.slice(1);
  //   if (!self.seedData) {
  //     sails.log.debug('No data avaliable to seed ' + modelName);
  //     callback();
  //     return;
  //   }
  //   self.count().exec(function (err, count) {
  //     if (!err && count === 0) {
  //       sails.log.debug('Seeding ' + modelName + '...');
  //       if (self.seedData instanceof Array) {
  //         self.seedArray(callback);
  //       }else{
  //         self.seedObject(callback);
  //       }
  //     } else {
  //       sails.log.debug(modelName + ' had models, so no seed needed');
  //       callback();
  //     }
  //   });
  // },
  // seedArray: function (callback) {
  //   var self = this;
  //   var modelName = self.adapter.identity.charAt(0).toUpperCase() + self.adapter.identity.slice(1);
  //   self.createEach(self.seedData).exec(function (err, results) {
  //     if (err) {
  //       sails.log.debug(err);
  //       callback();
  //     } else {
  //       sails.log.debug(modelName + ' seed planted');
  //       callback();
  //     }
  //   });
  // },
  // seedObject: function (callback) {
  //   var self = this;
  //   var modelName = self.adapter.identity.charAt(0).toUpperCase() + self.adapter.identity.slice(1);
  //   self.create(self.seedData).exec(function (err, results) {
  //     if (err) {
  //       sails.log.debug(err);
  //       callback();
  //     } else {
  //       sails.log.debug(modelName + ' seed planted');
  //       callback();
  //     }
  //   });
 
  // }
};
{'fraction_non_alphanumeric': 0.2241007790485662, 'fraction_numerical': 0.002320570197248467, 'mean_word_length': 1.5930382466695316, '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': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1151090', 'n_tokens_mistral': 1574, 'n_tokens_neox': 1509, 'n_words': 306}