<commit_before>/*!
 * expand-utils <https://github.com/jonschlinkert/expand-utils>
 *
 * Copyright (c) 2015, <NAME>.
 * Licensed under the MIT License.
 */

'use strict';

/**
 * Module dependencies
 */

var utils = require('lazy-cache')(require);

/**
 * Temporarily re-assign `require` to trick browserify and
 * webpack into reconizing lazy dependencies.
 *
 * This tiny bit of ugliness has the huge dual advantage of
 * only loading modules that are actually called at some
 * point in the lifecycle of the application, whilst also
 * allowing browserify and webpack to find modules that
 * are depended on but never actually called.
 */

var fn = require;
require = utils;

/**
 * Lazily required module dependencies
 */

require('isobject', 'isObject');
require('extend-shallow', 'extend');
require('define-property', 'define');

/**
 * Restore `require`
 */

require = fn;

/**
 * Utils
 */

utils.run = function(parent, key, child) {
  if (!parent.hasOwnProperty('run') || typeof parent.run !== 'function') {
    var val = JSON.stringify(parent);
    throw new TypeError('expected `' + val + '` to have a "run" method');
  }

  utils.define(child, 'parent', parent);
  utils.define(child, 'orig', utils.extend({}, child));
  utils.define(child, 'is', key);

  utils.define(child, key, true);
  parent.run(child);
  delete child[key];
};<commit_msg>adds `is` util<commit_after>/*!
 * expand-utils <https://github.com/jonschlinkert/expand-utils>
 *
 * Copyright (c) 2015, <NAME>.
 * Licensed under the MIT License.
 */

'use strict';

/**
 * Module dependencies
 */

var utils = require('lazy-cache')(require);

/**
 * Temporarily re-assign `require` to trick browserify and
 * webpack into reconizing lazy dependencies.
 *
 * This tiny bit of ugliness has the huge dual advantage of
 * only loading modules that are actually called at some
 * point in the lifecycle of the application, whilst also
 * allowing browserify and webpack to find modules that
 * are depended on but never actually called.
 */

var fn = require;
require = utils;

/**
 * Lazily required module dependencies
 */

require('isobject', 'isObject');
require('extend-shallow', 'extend');
require('define-property', 'define');

/**
 * Restore `require`
 */

require = fn;

/**
 * Utils
 */

utils.is = function(obj, name) {
  utils.define(obj, '_name', name);
  utils.define(obj, 'is' + name, true);
};

/**
 * Run plugins on `child` in the `parent`'s' context.
 */

utils.run = function(parent, key, child) {
  if (!parent.hasOwnProperty('run') || typeof parent.run !== 'function') {
    var val = JSON.stringify(parent);
    throw new TypeError('expected `' + val + '` to have a "run" method');
  }

  utils.define(child, 'parent', parent);
  utils.define(child, 'orig', utils.extend({}, child));
  utils.define(child, 'is', key);

  utils.define(child, key, true);
  parent.run(child);
  delete child[key];
};
{'fraction_non_alphanumeric': 0.15645552094150225, 'fraction_numerical': 0.0027691242644513675, 'mean_word_length': 3.9656357388316152, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '6968917', 'n_tokens_mistral': 903, 'n_tokens_neox': 894, 'n_words': 284}