<commit_before>describe('ax5.util.each TEST', function () {
    /* ax5.util.filter */
    //example 01
    it('ax5.util.each [object]', function () {
        var obj = {a_1: 1, b_2: 2, c_3: 3, d_4: 4, e_5: 5};
        var result = 0;
        ax5.util.each(obj, function (i, o) {
            result += Number(i.replace(/\D/g, ''));
            result += o;
        });
        _.isEqual(result, 30).should.equal(true);
    });

    //example 02
    it('ax5.util.each [array]', function () {
        var obj = [1, 2, 3, 4, 5];
        var result = 0;
        ax5.util.each(obj, function (i, o) {
            result += i;
            result += o;
        });
        _.isEqual(result, 25).should.equal(true);
    });

    //example 03
    it('ax5.util.each [function]', function () {
        var obj = function () {
            return 0;
        };
        var result = ax5.util.each(obj, function (i, o) {});
        _.isEqual(result, obj).should.equal(true);
    });
});

describe('ax5.util.filter TEST', function () {
    /* ax5.util.filter */
    //example 01
    var array = [5, 4, 3, 2, 1];
    it('ax5.util.filter([5,4,3,2,1],function(){return this%2;})', function () {
        var result = ax5.util.filter(array, function () {
            return this % 2;
        });

        _.isEqual(result, [5, 3, 1]).should.equal(true);
    });

    //example 02
    var list = [
        {isdel: 1, name: "ax5-1"},
        {name: "ax5-2"},
        {isdel: 1, name: "ax5-3"},
        {name: "ax5-4"},
        {name: "ax5-5"}
    ];

    it('ax5.util.filter([{isdel : 1 , name : "ax5-1"},{name : "ax5-2"},{isdel : 1 , name : "ax5-3"},{name : "ax5-4"},{name : "ax5-5"}] , function(){return (this.isdel !=1)})', function () {
        var result = ax5.util.filter(list, function () {
            return (this.isdel != 1);
        });
<commit_msg>update test code<commit_after>describe('ax5.util.each TEST', function () {
    /* ax5.util.filter */
    //example 01
    it('ax5.util.each [object]', function () {
        var obj = {a_1: 1, b_2: 2, c_3: 3, d_4: 4, e_5: 5};
        var result = 0;
        ax5.util.each(obj, function (i, o) {
            result += Number(i.replace(/\D/g, ''));
            result += o;
        });
        _.isEqual(result, 30).should.equal(true);
    });

    //example 02
    it('ax5.util.each [array]', function () {
        var obj = [1, 2, 3, 4, 5];
        var result = 0;
        ax5.util.each(obj, function (i, o) {
            result += i;
            result += o;
        });
        _.isEqual(result, 25).should.equal(true);
    });

    //example 03
    it('ax5.util.each [function]', function () {
        var obj = function () {
            return 0;
        };
        var result = ax5.util.each(obj, function (i, o) {
        });
        _.isEqual(result, obj).should.equal(true);
    });

    //example 04
    it('ax5.util.each [string]', function () {
        var obj = "12345";
        var result = 0;
        ax5.util.each(obj, function (i, o) {
            result += i;
            result += Number(o);
        });
        _.isEqual(result, 25).should.equal(true);
    });
});

describe('ax5.util.filter TEST', function () {
    /* ax5.util.filter */
    //example 01
    var array = [5, 4, 3, 2, 1];
    it('ax5.util.filter([5,4,3,2,1],function(){return this%2;})', function () {
        var result = ax5.util.filter(array, function () {
            return this % 2;
        });

        _.isEqual(result, [5, 3, 1]).should.equal(true);
    });

    //example 02
    var list = [
        {isdel: 1, name: "ax5-1"},
        {name: "ax5-2"},
        {isdel: 1, name: "ax5-3"},
        {name: "ax5-4"},
        {name: "ax5-5"}
    ];

    it('ax5.util.filter([{isdel : 1 , name : "ax5-1"},{name : "ax5-2"},{isdel : 1 , name : "ax5-3"},{name : "ax5-4"},{name : "ax5-5"}] , function(){return (this.isdel !=1)})', function () {
        var result = ax5.util.filter(list, function () {
            return (this.isdel != 1);
        });

{'fraction_non_alphanumeric': 0.2064971040040292, 'fraction_numerical': 0.046839587005791994, 'mean_word_length': 1.8330955777460771, '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': '5612251', 'n_tokens_mistral': 1520, 'n_tokens_neox': 1417, 'n_words': 309}