<commit_before>var events = require('events'),
    util = require('util'),
    fs = require('fs'),
    path = require('path'),
    async = require('async'),
    utils = exports.utils = {
        freeze: function freeze(o) {
            Object.freeze(o);

            for (var prop in o) {
                if (!o.hasOwnProperty(prop) || typeof o !== "object" || Object.isFrozen(o)) continue;
                utils.freeze(o[prop]);
            }

            return o;
        }
    };

/*
 * Registry
 */
function Registry(options) {
    var self = this;
    this._tasks = {};

    this.load({dirname: __dirname + '/tasks'});

    if (options) {
        this.load(options);
    }

    this.__defineGetter__('tasks', function() {
        return Object.keys(self._tasks);
    });
}

var registry = exports.registry = function registry(options) {
    return new Registry(options);
};

Registry.prototype = {
    load: function(options) {
        options = options || {};
<commit_msg>using defineProperty instead of __defineGetter__<commit_after>var events = require('events'),
    util = require('util'),
    fs = require('fs'),
    path = require('path'),
    async = require('async'),
    utils = exports.utils = {
        freeze: function freeze(o) {
            Object.freeze(o);

            for (var prop in o) {
                if (!o.hasOwnProperty(prop) || typeof o !== "object" || Object.isFrozen(o)) continue;
                utils.freeze(o[prop]);
            }

            return o;
        }
    };

/*
 * Registry
 */
function Registry(options) {
    var self = this;
    this._tasks = {};

    this.load({dirname: __dirname + '/tasks'});

    if (options) {
        this.load(options);
    }

    Object.defineProperty(this, 'tasks', {get: function() {
        return Object.keys(self._tasks);
    }});
}

var registry = exports.registry = function registry(options) {
    return new Registry(options);
};

Registry.prototype = {
    load: function(options) {
        options = options || {};

{'fraction_non_alphanumeric': 0.15453639082751744, 'fraction_numerical': 0.0, 'mean_word_length': 2.2318840579710146, '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': '5120513', 'n_tokens_mistral': 595, 'n_tokens_neox': 580, 'n_words': 130}