<commit_before>(function ($) {
    "use strict";

    var
        instances = [];

    Object.defineProperties($.prototype, {
        singleton: {

            // Um ou dois parâmetros podem ser passados para Function.singleton()
            value: function singleton () {
                var
                    self = this,
                    Constructor = self,
                    i,
                    newInstance;

                for (i in instances) {
                    if (instances.hasOwnProperty(i)) {
                        if (self.prototype ===
                            Object.getPrototypeOf(instances[i])
                        ) {
                            return instances[i];
                        }
                    }
                }

                newInstance = new Constructor();
                instances.push(newInstance);
                return newInstance;
            }
        }
    });

})(Function);<commit_msg>adiciona suporte a singeton<commit_after>(function ($) {
    "use strict";

    var
        instances = [];

    //
    Object.defineProperties($.prototype, {
        singleton: {
            // Um ou dois parâmetros podem ser passados para Function.singleton()
            value: function singleton () {
                var
                    self = this,
                    Constructor = self,
                    args = Array.prototype.slice.call(arguments),
                    i,
                    newInstance,
                    resolvedArgs;

                for (i in instances) {
                    if (instances.hasOwnProperty(i)) {
                        if (self.prototype ===
                            Object.getPrototypeOf(instances[i])
                        ) {
                            return instances[i];
                        }
                    }
                }

                Constructor.apply(this, arguments);
                newInstance = new Constructor();
                instances.push(newInstance);
                return newInstance;
            }
        }
    });

})(Function);
{'fraction_non_alphanumeric': 0.08747609942638623, 'fraction_numerical': 0.0, 'mean_word_length': 0.9415584415584416, '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': '6433530', 'n_tokens_mistral': 489, 'n_tokens_neox': 448, 'n_words': 95}