<commit_before>/**
 * Created by mschwartz on 12/2/13.
 */

var decaf = {

    each: function (o, fn) {
        for (var key in o) {
            if (o.hasOwnProperty && o.hasOwnProperty(key)) {
                if (fn.call(o, o[key], key, o) === false) {
                    return;
                }
            }
        }
    },

    extend: function(me) {
        var args = Array.prototype.slice.call(arguments, 1);
        decaf.each(args, function (o) {
            for (var key in o) {
                if (o.hasOwnProperty(key)) {
                    var g = o.__lookupGetter__(key), s = o.__lookupSetter__(key);
                    if (g || s) {
                        if (g) {
                            me.__defineGetter__(key, g);
                        }
                        if (s) {
                            me.__defineSetter__(key, s);
                        }
                    }
                    else {
                        me[key] = o[key];
                    }
                }
            }
        });
        return me;
    },

    toJavaByteArray: function(thing, encoding) {
        if (typeof thing === 'string') {
            return encoding ? new java.lang.String(thing).getBytes(encoding) : new java.lang.String(thing).getBytes();
        }
        else {
            var len = thing.length;

            var v = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, len);
            try {
                for (var i = 0; i < len; i++) {
                    v[i] = thing[i];
                }
            }
            catch (e) {
                throw new Error('Array.toJavaByteArray - array contains invalid values');
            }<commit_msg>fix extend to not use deprecated methods<commit_after>/**
 * Created by mschwartz on 12/2/13.
 */

var decaf = {

    each: function (o, fn) {
        for (var key in o) {
            if (o.hasOwnProperty && o.hasOwnProperty(key)) {
                if (fn.call(o, o[key], key, o) === false) {
                    return;
                }
            }
        }
    },

    extend: function(me) {
        var args = Array.prototype.slice.call(arguments, 1);
        decaf.each(args, function (o) {
            for (var key in o) {
                if (o.hasOwnProperty(key)) {
                    var desc = Object.getOwnPropertyDescriptor(o, key),
                        g = desc.get, s = desc.set;
                    if (g || s) {
                        Object.defineProperty(me, key, { get: g, set: s, enumerable: true });
                    }
                    else {
                        me[key] = o[key];
                    }
                }
            }
        });
        return me;
    },

    toJavaByteArray: function(thing, encoding) {
        if (typeof thing === 'string') {
            return encoding ? new java.lang.String(thing).getBytes(encoding) : new java.lang.String(thing).getBytes();
        }
        else {
            var len = thing.length;

            var v = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, len);
            try {
                for (var i = 0; i < len; i++) {
                    v[i] = thing[i];
                }
            }
            catch (e) {
                throw new Error('Array.toJavaByteArray - array contains invalid values');
            }
{'fraction_non_alphanumeric': 0.12173128944995491, 'fraction_numerical': 0.004207995190862639, 'mean_word_length': 1.0761072988147224, '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': '184070', 'n_tokens_mistral': 947, 'n_tokens_neox': 895, 'n_words': 217}