<commit_before>module.exports = {
  "bind" : function () {
    var t = this;
    var o = {};
    var f;

    // Call in scope of o.
    f = (function () {
      assert.eql(o, this);
    }).bind(o);

    // Call in scope of o passing args to bind.
    f = (function (a, b) {
      assert.eql(1, a);
      assert.eql(2, b);
      assert.strictEqual(o, this);
    }).bind(o, 1, 2);

    f();

    // Call in scope of o passing args to f.
    f = (function (a, b) {
      assert.eql(3, a);
      assert.eql(4, b);
      assert.strictEqual(o, this);
    }).bind(o);

    f(3, 4);

    // Call in scope of o passing args to bind and f.
    f = (function (a, b, c, d) {
      assert.eql(5, a);
      assert.eql(6, b);
      assert.eql(7, c);
      assert.eql(8, d);
      assert.eql(o, this);
    }).bind(o, 5, 6);

    f(7,8);

    // Make sure no extra arguments are passed.
    (function () {
      assert.eql(3, arguments.length);
    }).bind(null, 0, 1, 2)();

    // > Should pass along the scope from the bind call if first arg to bind
    // is null.
    var o = {};
    (function () {
      assert.eql(o, this);
    }).bind(null).call(o);
  },

  "curry" : function () {
    var o = {};
    var test = this;

    // Curry arg.
    (function (a, b) {
      assert.eql("a", a);
      assert.eql("b", b);
    }).curry("a", "b")();

    // Call in scope of curry call.
    (function () {
      assert.eql(o, this);
    }).curry().call(o);

    // Pass along args to curried function.
    (function (c, d) {
      assert.eql("c", c);
      assert.eql("d", d);
    }).curry()("c", "d");

    // Combine curried arguments and passed arguments.
    (function (a, b, c, d) {
      assert.eql("a", a);
      assert.eql("b", b);
      assert.eql("c", c);
      assert.eql("d", d);
    }).curry("a", "b")("c", "d");
  },

  "extend instanceof" : function () {
    function A() { }
    function B() { }
    B.extend(A);
    assert.ok(new A() instanceof A);
    assert.ok(new B() instanceof B);
    assert.ok(new B() instanceof A);
    assert.strictEqual(A, B.SuperClass);
    assert.strictEqual(A, new B().SuperClass);
  },

  // Test inheritance and overrides.
  "extend" : function () {
    function A() { }
    A.prototype.x = 1;
    A.prototype.y = 2;
    function B() { }
    B.prototype.y = 3;
    B.prototype.z = 4;
    B.extend(A);

    var a = new A();
    var b = new B();
    assert.eql(1, a.x);
    assert.eql(2, a.y);
    assert.eql(1, b.x);
    assert.eql(3, b.y);
    assert.eql(4, b.z);
  },

  // Classes should be able to intervene when they are subclassed.
  "extend subclassing" : function () {
    function A() {}
    A.__onExtend = function (SubClass) {
      SubClass.x = 1;
    };
    function B() {}
    B.extend(A);
    assert.eql(1, B.x);

    // Should propagate up the inheritance chain.
    B.__onExtend = function (SubClass) {
      SubClass.y = 2;
    };
    function C() {}
    C.extend(B);
    C.__onExtend = function (SubClass) {
      SubClass.y = 3;
    };
    function D() {}
    D.extend(C);
    assert.eql(1, D.x);
    assert.eql(3, D.y);
  },

  "empty" : function () {
    assert.ok(Function.empty instanceof Function);
    Function.empty();
  },

  "returning" : function () {
    assert.eql(2, (function () {
      return 1;
    }).returning(2)());
    assert.eql(3, Function.empty.returning(3)());
  },

  // Make sure that returning passes all arguments it gets through
  // to the inner function.
  "returning pass to inner" : function () {
    var test = this;
    assert.eql(4, (function (a, b, c) {
      assert.eql(1, a);
      assert.eql(2, b);
      assert.eql(3, c);
    }).returning(4)(1, 2, 3));
  },

  // Should call the inner function in the scope of the outer.
  "returning scope" : function () {
    var o = {};
    var test = this;
    (function () {
      assert.eql(o, this);
    }).returning(0).call(o);
  },

  "filter" : function () {
    var called = false;
    function f() {<commit_msg>Function:returning: Added assertions that values are passed along to inner function.<commit_after>module.exports = {
  "bind" : function () {
    var t = this;
    var o = {};
    var f;

    // Call in scope of o.
    f = (function () {
      assert.eql(o, this);
    }).bind(o);

    // Call in scope of o passing args to bind.
    f = (function (a, b) {
      assert.eql(1, a);
      assert.eql(2, b);
      assert.strictEqual(o, this);
    }).bind(o, 1, 2);

    f();

    // Call in scope of o passing args to f.
    f = (function (a, b) {
      assert.eql(3, a);
      assert.eql(4, b);
      assert.strictEqual(o, this);
    }).bind(o);

    f(3, 4);

    // Call in scope of o passing args to bind and f.
    f = (function (a, b, c, d) {
      assert.eql(5, a);
      assert.eql(6, b);
      assert.eql(7, c);
      assert.eql(8, d);
      assert.eql(o, this);
    }).bind(o, 5, 6);

    f(7,8);

    // Make sure no extra arguments are passed.
    (function () {
      assert.eql(3, arguments.length);
    }).bind(null, 0, 1, 2)();

    // > Should pass along the scope from the bind call if first arg to bind
    // is null.
    var o = {};
    (function () {
      assert.eql(o, this);
    }).bind(null).call(o);
  },

  "curry" : function () {
    var o = {};
    var test = this;

    // Curry arg.
    (function (a, b) {
      assert.eql("a", a);
      assert.eql("b", b);
    }).curry("a", "b")();

    // Call in scope of curry call.
    (function () {
      assert.eql(o, this);
    }).curry().call(o);

    // Pass along args to curried function.
    (function (c, d) {
      assert.eql("c", c);
      assert.eql("d", d);
    }).curry()("c", "d");

    // Combine curried arguments and passed arguments.
    (function (a, b, c, d) {
      assert.eql("a", a);
      assert.eql("b", b);
      assert.eql("c", c);
      assert.eql("d", d);
    }).curry("a", "b")("c", "d");
  },

  "extend instanceof" : function () {
    function A() { }
    function B() { }
    B.extend(A);
    assert.ok(new A() instanceof A);
    assert.ok(new B() instanceof B);
    assert.ok(new B() instanceof A);
    assert.strictEqual(A, B.SuperClass);
    assert.strictEqual(A, new B().SuperClass);
  },

  // Test inheritance and overrides.
  "extend" : function () {
    function A() { }
    A.prototype.x = 1;
    A.prototype.y = 2;
    function B() { }
    B.prototype.y = 3;
    B.prototype.z = 4;
    B.extend(A);

    var a = new A();
    var b = new B();
    assert.eql(1, a.x);
    assert.eql(2, a.y);
    assert.eql(1, b.x);
    assert.eql(3, b.y);
    assert.eql(4, b.z);
  },

  // Classes should be able to intervene when they are subclassed.
  "extend subclassing" : function () {
    function A() {}
    A.__onExtend = function (SubClass) {
      SubClass.x = 1;
    };
    function B() {}
    B.extend(A);
    assert.eql(1, B.x);

    // Should propagate up the inheritance chain.
    B.__onExtend = function (SubClass) {
      SubClass.y = 2;
    };
    function C() {}
    C.extend(B);
    C.__onExtend = function (SubClass) {
      SubClass.y = 3;
    };
    function D() {}
    D.extend(C);
    assert.eql(1, D.x);
    assert.eql(3, D.y);
  },

  "empty" : function () {
    assert.ok(Function.empty instanceof Function);
    Function.empty();
  },

  "returning" : function () {
    assert.eql(2, (function () {
      return 1;
    }).returning(2)());
    assert.eql(3, Function.empty.returning(3)());

    var called = false;
    (function (a, b) {
      called = true;
      assert.strictEqual(5, a);
      assert.strictEqual(6, b);
    }).returning(4)(5, 6);
    assert.ok(called);
  },

  // Make sure that returning passes all arguments it gets through
  // to the inner function.
  "returning pass to inner" : function () {
    var test = this;
    assert.eql(4, (function (a, b, c) {
      assert.eql(1, a);
      assert.eql(2, b);
      assert.eql(3, c);
    }).returning(4)(1, 2, 3));
  },

  // Should call the inner function in the scope of the outer.
  "returning scope" : function () {
    var o = {};
    var test = this;
    (function () {
      assert.eql(o, this);
    }).returning(0).call(o);
  },

  "filter" : function () {
    var called = false;
    function f() {
{'fraction_non_alphanumeric': 0.1855353634577603, 'fraction_numerical': 0.012647347740667976, 'mean_word_length': 2.074745186862967, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '940829', 'n_tokens_mistral': 3078, 'n_tokens_neox': 2969, 'n_words': 807}