<commit_before>var accessTypes = ['set', 'get', 'getPrevious'],
    getMap = {
        get: false,
        getPrevious: true
    };

var CustomAccessor = new Class({
    _accessors: {
        /*
        key: {
            // The buck stops here for this custom set method.
            // Any returned value goes into the ether because
            // the original set code block is ignored when this is invoked

            set: function(prop, val){},

            // isPrevious flag lets you choose whether to pull data from this._data or this._previousData
            get: function(isPrevious){
                //Example
                var data = isPrevious ? this._data : this._previousData;
                return data['somekey'];
            },

            getPrevious: function(){}
        }
        */
    },

    _accessorName: undefined,

    options: {
        accessors: {}
    },

    setupAccessors: function(){
        this.setAccessor(Object.merge({}, this._accessors, this.options.accessors));

        return this;
    },

    isAccessing: function(){
        return !!this._accessorName;
    },

    /**
     * Accessor functions pass through to trigger flags
     * to signify that an accessor is being used.
     */
    _processAccess: function(name, fnc){
        var value = undefined;

        if (name) {
            // this._accessing++;
            this._accessorName = name;

            value = fnc();

            // this._accessing--;
            this._accessorName = undefined;
        }

        return value;
    },

    setAccessor: function(name, obj){
        var accessors = {};

        if (!!name && Type.isObject(obj)) {

            /**
             * Decorate the functions in obj so that it will be easy to prevent
             * recursive calls to itself because the decorated function tracks
             * the name is.
             */
            Object.each(obj, function(fnc, type) {
                if (fnc && !accessors[type]) {
                    accessors[type] = function(){
                        return this._processAccess(name, fnc.pass(arguments, this));
                    }.bind(this);

                    accessors[type]._orig = fnc;
                }
            }, this);

            this._accessors[name] = accessors;
        }

        return this;
    }.overloadSetter(),

    getAccessor: function(name, type){
        var accessors = this._accessors[name];

        if (type) {
            return accessors && accessors[type] ? accessors[type] : undefined;
        }

        return accessors;
    },

    unsetAccessor: function(name, type){
        if (name && type) {
            delete this._accessors[name][type];
        } else {
            delete this._accessors[name];
            this._accessors[name] = undefined;
        }

        return this;
    }
});

exports.CustomAccessor = CustomAccessor<commit_msg>Update that name can not be undefined for unsetting an accessor.<commit_after>var accessTypes = ['set', 'get', 'getPrevious'],
    getMap = {
        get: false,
        getPrevious: true
    };

var CustomAccessor = new Class({
    _accessors: {
        /*
        key: {
            // The buck stops here for this custom set method.
            // Any returned value goes into the ether because
            // the original set code block is ignored when this is invoked

            set: function(prop, val){},

            // isPrevious flag lets you choose whether to pull data from this._data or this._previousData
            get: function(isPrevious){
                //Example
                var data = isPrevious ? this._data : this._previousData;
                return data['somekey'];
            },

            getPrevious: function(){}
        }
        */
    },

    _accessorName: undefined,

    options: {
        accessors: {}
    },

    setupAccessors: function(){
        this.setAccessor(Object.merge({}, this._accessors, this.options.accessors));

        return this;
    },

    isAccessing: function(){
        return !!this._accessorName;
    },

    /**
     * Accessor functions pass through to trigger flags
     * to signify that an accessor is being used.
     */
    _processAccess: function(name, fnc){
        var value = undefined;

        if (name) {
            // this._accessing++;
            this._accessorName = name;

            value = fnc();

            // this._accessing--;
            this._accessorName = undefined;
        }

        return value;
    },

    setAccessor: function(name, obj){
        var accessors = {};

        if (!!name && Type.isObject(obj)) {

            /**
             * Decorate the functions in obj so that it will be easy to prevent
             * recursive calls to itself because the decorated function tracks
             * the name is.
             */
            Object.each(obj, function(fnc, type) {
                if (fnc && !accessors[type]) {
                    accessors[type] = function(){
                        return this._processAccess(name, fnc.pass(arguments, this));
                    }.bind(this);

                    accessors[type]._orig = fnc;
                }
            }, this);

            this._accessors[name] = accessors;
        }

        return this;
    }.overloadSetter(),

    getAccessor: function(name, type){
        var accessors = this._accessors[name];

        if (type) {
            return accessors && accessors[type] ? accessors[type] : undefined;
        }

        return accessors;
    },

    unsetAccessor: function(name, type){
        if (name) {
            if (type) {
                delete this._accessors[name][type];
            } else {
                delete this._accessors[name];
                this._accessors[name] = undefined;
            }
        }

        return this;
    }
});

exports.CustomAccessor = CustomAccessor
{'fraction_non_alphanumeric': 0.10521842597314296, 'fraction_numerical': 0.0, 'mean_word_length': 1.5538194444444444, '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': '1647951', 'n_tokens_mistral': 1554, 'n_tokens_neox': 1474, 'n_words': 422}