<commit_before>/* jshint globalstrict: true */
/* global exports */
'use strict';


function ensure(obj) {
  return (obj == void 0) ? Object.create(null) : obj;
}


function deepFreeze(obj) {
  Object.freeze(obj);
  Object.getOwnPropertyNames(obj).forEach(function (key) {
    if ( typeof obj === 'function' &&
         ( key === 'arguments' ||
           key === 'caller' ||
           key === 'callee' ||
           key === 'prototype')) {
      return;
    }

    var prop = obj[key];
    if ( prop !== null &&
         (typeof prop === 'object' || typeof prop === 'function')) {
      deepFreeze(prop);
    }
  });
  return obj;
}


function exists(obj) {
  // Because isNaN({}) == true
  return !(obj == void 0 || (typeof obj == 'number' && isNaN(obj)));
}


function stringify(obj) {
  // Because isNaN({}) == true
  if (obj == void 0 || (typeof obj == 'number' && isNaN(obj))) return '';
  if (typeof obj == 'function') return '[object Function]';
  if (typeof obj.toString == 'function') return obj.toString();
  return Object.prototype.toString.call(obj);
}


function createPrototype(mixins) {
  var
  proto = Object.create(null);
  proto.initialize = noop;
  proto.destroy = noop;

  proto = mixins.reduce(function (proto, mixin) {
    var
    childInitialize,
    childDestroy = typeof mixin.destroy === 'function' ? mixin.destroy : noop,
    parentInitialize = proto.initialize,
    parentDestroy = proto.destroy;

    if (typeof mixin === 'function') {
      childInitialize = mixin;
      mixin = mixin.prototype;
    } else {<commit_msg>Fix factory to use a constructor.prototype<commit_after>/* jshint globalstrict: true */
/* global exports */
'use strict';


function ensure(obj) {
  return (obj == void 0) ? Object.create(null) : obj;
}


function deepFreeze(obj) {
  Object.freeze(obj);
  Object.getOwnPropertyNames(obj).forEach(function (key) {
    if ( typeof obj === 'function' &&
         ( key === 'arguments' ||
           key === 'caller' ||
           key === 'callee' ||
           key === 'prototype')) {
      return;
    }

    var prop = obj[key];
    if ( prop !== null &&
         (typeof prop === 'object' || typeof prop === 'function')) {
      deepFreeze(prop);
    }
  });
  return obj;
}


function exists(obj) {
  // Because isNaN({}) == true
  return !(obj == void 0 || (typeof obj == 'number' && isNaN(obj)));
}


function stringify(obj) {
  // Because isNaN({}) == true
  if (obj == void 0 || (typeof obj == 'number' && isNaN(obj))) return '';
  if (typeof obj == 'function') return '[object Function]';
  if (typeof obj.toString == 'function') return obj.toString();
  return Object.prototype.toString.call(obj);
}


function createPrototype(mixins) {
  var
  // Use the final mixin (extension) as the prototype so that we
  // can get a useful instanceof
  proto = mixins[mixins.length - 1];
  if (typeof proto === 'function') {
    proto = proto.prototype;
  }
  proto.initialize = noop;
  proto.destroy = noop;

  proto = mixins.reduce(function (proto, mixin) {
    var
    childInitialize,
    childDestroy = typeof mixin.destroy === 'function' ? mixin.destroy : noop,
    parentInitialize = proto.initialize,
    parentDestroy = proto.destroy;

    if (typeof mixin === 'function') {
      childInitialize = mixin;
      mixin = mixin.prototype;
    } else {
{'fraction_non_alphanumeric': 0.16440012088244182, 'fraction_numerical': 0.0021154427319431852, 'mean_word_length': 2.954599761051374, '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': '2662550', 'n_tokens_mistral': 1032, 'n_tokens_neox': 1020, 'n_words': 278}