<commit_before>;(function(window, undefined) {
  'use strict';

  /** Use a single load function */
  var load = typeof require == 'function' ? require : window.load;

  /** The `platform` object to check */
  var platform =
    window.platform ||
    load('../vendor/platform.js/platform.js') ||
    window.platform;

  /** The unit testing framework */
  var QUnit =
    window.QUnit || (
      window.setTimeout || (window.addEventListener = window.setTimeout = / /),
      window.QUnit = load('../vendor/qunit/qunit/qunit' + (platform.name == 'Narwhal' ? '-1.8.0' : '') + '.js') || window.QUnit,
      load('../vendor/qunit-clib/qunit-clib.js'),
      (window.addEventListener || 0).test && delete window.addEventListener,
      window.QUnit
    );

  /** The `lodash` function to test */
  var _ =
    window._ || (
      _ = load('../lodash.js') || window._,
      _._ || _
    );

  /** Used to pass falsey values to methods */
  var falsey = [
    ,
    '',
    0,
    false,
    NaN,
    null,
    undefined
  ];

  /** Shortcut used to make object properties immutable */
  var freeze = Object.freeze;

  /** Shortcut used to convert array-like objects to arrays */
  var slice = [].slice;

  /** Used to check problem JScript properties (a.k.a. the [[DontEnum]] bug) */
  var shadowed = {
    'constructor': 1,
    'hasOwnProperty': 2,
    'isPrototypeOf': 3,
    'propertyIsEnumerable': 4,
    'toLocaleString': 5,
    'toString': 6,
    'valueOf': 7
  };

  /** Used to check problem JScript properties too */
  var shadowedKeys = [
    'constructor',
    'hasOwnProperty',
    'isPrototypeOf',
    'propertyIsEnumerable',
    'toLocaleString',
    'toString',
    'valueOf'
  ];

  /*--------------------------------------------------------------------------*/

  /**
   * Skips a given number of tests with a passing result.
   *
   * @private
   * @param {Number} [count=1] The number of tests to skip.
   */
  function skipTest(count) {
    count || (count = 1);
    while (count--) {
      ok(true, 'test skipped');
    }
  }

  /*--------------------------------------------------------------------------*/

  // explicitly call `QUnit.module()` instead of `module()`
  // in case we are in a CLI environment
  QUnit.module('lodash');

  (function() {
    // ensure this test is executed before any other template tests to avoid false positives
    test('should initialize `reEvaluateDelimiter` correctly (test with production build)', function() {
      var data = { 'a': [1, 2] },
          settings = _.templateSettings;

      _.templateSettings = { 'interpolate': /\{\{(.+?)\}\}/g };
      equal(_.template('{{ a.join(",") }}', data), '1,2');
      _.templateSettings = settings;
    });

    test('supports loading lodash.js as the "lodash" module', function() {
      if (window.document && window.require) {
        equal((lodashModule || {}).moduleName, 'lodash');
      } else {
        skipTest()
      }
    });

    test('supports loading lodash.js as the "underscore" module', function() {
      if (window.document && window.require) {
        equal((underscoreModule || {}).moduleName, 'underscore');
      } else {
        skipTest()
      }
    });

    test('avoids overwritten native methods', function() {
      if (window.document) {
        notDeepEqual(lodashBadShim.keys({ 'a': 1 }), []);
      } else {
        skipTest();
      }
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('lodash constructor');

  (function() {
    test('creates a new instance when called without the `new` operator', function() {
      ok(_() instanceof _);
    });

    test('should return passed LoDash instances', function() {
      var wrapped = _([]);
      equal(_(wrapped), wrapped);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('lodash.bind');

  (function() {
    test('should correctly append array arguments to partially applied arguments (test in IE < 9)', function() {
      var args,
          bound = _.bind(function() { args = slice.call(arguments); }, null, 'a');

      bound(['b'], 'c');
      deepEqual(args, ['a', ['b'], 'c']);
    });

    test('supports lazy bind', function() {
      var object = {
        'name': 'moe',
        'greet': function(greeting) {
          return greeting + ': ' + this.name;
        }
      };

      var func = _.bind(object, 'greet', 'hi');
      equal(func(), 'hi: moe');

      object.greet = function(greeting) {
        return greeting + ' ' + this.name + '!';
      };
      equal(func(), 'hi moe!');<commit_msg>Tweak to `_.bind` unit test for Narwhal.<commit_after>;(function(window, undefined) {
  'use strict';

  /** Use a single load function */
  var load = typeof require == 'function' ? require : window.load;

  /** The `platform` object to check */
  var platform =
    window.platform ||
    load('../vendor/platform.js/platform.js') ||
    window.platform;

  /** The unit testing framework */
  var QUnit =
    window.QUnit || (
      window.setTimeout || (window.addEventListener = window.setTimeout = / /),
      window.QUnit = load('../vendor/qunit/qunit/qunit' + (platform.name == 'Narwhal' ? '-1.8.0' : '') + '.js') || window.QUnit,
      load('../vendor/qunit-clib/qunit-clib.js'),
      (window.addEventListener || 0).test && delete window.addEventListener,
      window.QUnit
    );

  /** The `lodash` function to test */
  var _ =
    window._ || (
      _ = load('../lodash.js') || window._,
      _._ || _
    );

  /** Used to pass falsey values to methods */
  var falsey = [
    ,
    '',
    0,
    false,
    NaN,
    null,
    undefined
  ];

  /** Shortcut used to make object properties immutable */
  var freeze = Object.freeze;

  /** Shortcut used to convert array-like objects to arrays */
  var slice = [].slice;

  /** Used to check problem JScript properties (a.k.a. the [[DontEnum]] bug) */
  var shadowed = {
    'constructor': 1,
    'hasOwnProperty': 2,
    'isPrototypeOf': 3,
    'propertyIsEnumerable': 4,
    'toLocaleString': 5,
    'toString': 6,
    'valueOf': 7
  };

  /** Used to check problem JScript properties too */
  var shadowedKeys = [
    'constructor',
    'hasOwnProperty',
    'isPrototypeOf',
    'propertyIsEnumerable',
    'toLocaleString',
    'toString',
    'valueOf'
  ];

  /*--------------------------------------------------------------------------*/

  /**
   * Skips a given number of tests with a passing result.
   *
   * @private
   * @param {Number} [count=1] The number of tests to skip.
   */
  function skipTest(count) {
    count || (count = 1);
    while (count--) {
      ok(true, 'test skipped');
    }
  }

  /*--------------------------------------------------------------------------*/

  // explicitly call `QUnit.module()` instead of `module()`
  // in case we are in a CLI environment
  QUnit.module('lodash');

  (function() {
    // ensure this test is executed before any other template tests to avoid false positives
    test('should initialize `reEvaluateDelimiter` correctly (test with production build)', function() {
      var data = { 'a': [1, 2] },
          settings = _.templateSettings;

      _.templateSettings = { 'interpolate': /\{\{(.+?)\}\}/g };
      equal(_.template('{{ a.join(",") }}', data), '1,2');
      _.templateSettings = settings;
    });

    test('supports loading lodash.js as the "lodash" module', function() {
      if (window.document && window.require) {
        equal((lodashModule || {}).moduleName, 'lodash');
      } else {
        skipTest()
      }
    });

    test('supports loading lodash.js as the "underscore" module', function() {
      if (window.document && window.require) {
        equal((underscoreModule || {}).moduleName, 'underscore');
      } else {
        skipTest()
      }
    });

    test('avoids overwritten native methods', function() {
      if (window.document) {
        notDeepEqual(lodashBadShim.keys({ 'a': 1 }), []);
      } else {
        skipTest();
      }
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('lodash constructor');

  (function() {
    test('creates a new instance when called without the `new` operator', function() {
      ok(_() instanceof _);
    });

    test('should return passed LoDash instances', function() {
      var wrapped = _([]);
      equal(_(wrapped), wrapped);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('lodash.bind');

  (function() {
    test('should correctly append array arguments to partially applied arguments (test in IE < 9)', function() {
      var args,
          bound = _.bind(function() { args = slice.call(arguments); }, {}, 'a');

      bound(['b'], 'c');
      deepEqual(args, ['a', ['b'], 'c']);
    });

    test('supports lazy bind', function() {
      var object = {
        'name': 'moe',
        'greet': function(greeting) {
          return greeting + ': ' + this.name;
        }
      };

      var func = _.bind(object, 'greet', 'hi');
      equal(func(), 'hi: moe');

      object.greet = function(greeting) {
        return greeting + ' ' + this.name + '!';
      };
      equal(func(), 'hi moe!');
{'fraction_non_alphanumeric': 0.22574044157242865, 'fraction_numerical': 0.004308023694130318, 'mean_word_length': 1.977236293683873, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6761331', 'n_tokens_mistral': 2776, 'n_tokens_neox': 2673, 'n_words': 702}