<commit_before>
/**
 * Module dependencies
 */

var _ = require('lodash');
var Bluebird = require('bluebird');
var Model = require('./lib/model');
var defaultMethods = require('./lib/defaultMethods');
var internalMethods = require('./lib/internalMethods');

/**
 * Build Extended Model Prototype
 *
 * @param {Object} context
 * @param {Object} mixins
 * @return {Object}
 * @api public
 */

module.exports = function(context, mixins) {

  /**
   * Extend the model prototype with default instance methods
   */

  var prototypeFns = {

    _loadQuery: function(query) {
      if (query && query.transaction) {
        this.save = function(options, cb) {
          return new defaultMethods.save(context._loadQuery(query), this, options, cb);
        };
      }
      return this;
    },

    toObject: function() {
      return new defaultMethods.toObject(context, this);
    },

    toRawData: function() {
      return new defaultMethods.toRawData(context, this);
    },
<commit_msg>Update index.js<commit_after>
/**
 * Module dependencies
 */

var _ = require('lodash');
var Bluebird = require('bluebird');
var Model = require('./lib/model');
var defaultMethods = require('./lib/defaultMethods');
var internalMethods = require('./lib/internalMethods');

/**
 * Build Extended Model Prototype
 *
 * @param {Object} context
 * @param {Object} mixins
 * @return {Object}
 * @api public
 */

module.exports = function(context, mixins) {

  /**
   * Extend the model prototype with default instance methods
   */

  var prototypeFns = {

    _loadQuery: function(query) {
      if (query) {
        this.save = function(options, cb) {
          return new defaultMethods.save(context._loadQuery(query), this, options, cb);
        };
      }
      return this;
    },

    toObject: function() {
      return new defaultMethods.toObject(context, this);
    },

    toRawData: function() {
      return new defaultMethods.toRawData(context, this);
    },

{'fraction_non_alphanumeric': 0.13927291346646187, 'fraction_numerical': 0.0, 'mean_word_length': 3.1223628691983123, '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': '1332444', 'n_tokens_mistral': 568, 'n_tokens_neox': 553, 'n_words': 144}