<commit_before>(function(ns) {
    function Labeler() {
        this._objectsLabels = Object.create(null);
        this._objects = Object.create(null);
        this._objectNamesIndex = Object.create(null);
        this._userDefinedLabels = Object.create(null);
    }

    Object.defineProperties(Labeler.prototype, {
        // hash(object) -> label
        _objectsLabels: {value: null, writable: true},
        _objects: {value: null, writable: true},
        // Labels generation sequence is "label", "label2", "label3", ..., hence
        // starting at 2.
        _INITIAL_LABEL_NUMBER: {value: 2},
        _objectNamesIndex: {value: null, writable: true},
        _userDefinedLabels: {value: null, writable: true},

        initWithObjects: {
            value: function(labels) {
                for (var label in labels) {
                    this.setObjectLabel(labels[label], label);
                    this._userDefinedLabels[label] = true;
                }
            }
        },

        cleanup: {
            value: function() {
                this._objectsLabels = null;
                this._objects = null;
                this._objectNamesIndex = null;
                this._userDefinedLabels = null;
            }
        },

        getObjectName: {
            value: function(object) {
                if (Array.isArray(object)) {
                    return "array";
                } else if (RegExp.isRegExp(object)) {
                    return "regexp";
                } else {
                    return "object";
                }
            }
        },

        generateObjectLabel: {
            value: function(object) {
                var objectName = this.getObjectName(object),
                    index = this._objectNamesIndex[objectName],
                    objectLabel;

                do {
                    if (index) {
                        objectLabel = objectName + index;
                        this._objectNamesIndex[objectName] = index = index + 1;
                    } else {
                        objectLabel = objectName;
                        this._objectNamesIndex[objectName] = index = this._INITIAL_LABEL_NUMBER;
                    }
                } while (objectLabel in this._objects);

                return objectLabel;
            }
        },
<commit_msg>Fix getObjectName for JavaScript native types<commit_after>(function(ns) {
    function Labeler() {
        this._objectsLabels = Object.create(null);
        this._objects = Object.create(null);
        this._objectNamesIndex = Object.create(null);
        this._userDefinedLabels = Object.create(null);
    }

    Object.defineProperties(Labeler.prototype, {
        // hash(object) -> label
        _objectsLabels: {value: null, writable: true},
        _objects: {value: null, writable: true},
        // Labels generation sequence is "label", "label2", "label3", ..., hence
        // starting at 2.
        _INITIAL_LABEL_NUMBER: {value: 2},
        _objectNamesIndex: {value: null, writable: true},
        _userDefinedLabels: {value: null, writable: true},

        initWithObjects: {
            value: function(labels) {
                for (var label in labels) {
                    this.setObjectLabel(labels[label], label);
                    this._userDefinedLabels[label] = true;
                }
            }
        },

        cleanup: {
            value: function() {
                this._objectsLabels = null;
                this._objects = null;
                this._objectNamesIndex = null;
                this._userDefinedLabels = null;
            }
        },

        getObjectName: {
            value: function(object) {
                if (Array.isArray(object)) {
                    return "array";
                } else if (RegExp.isRegExp(object)) {
                    return "regexp";
                } else {
                    return typeof object;
                }
            }
        },

        generateObjectLabel: {
            value: function(object) {
                var objectName = this.getObjectName(object),
                    index = this._objectNamesIndex[objectName],
                    objectLabel;

                do {
                    if (index) {
                        objectLabel = objectName + index;
                        this._objectNamesIndex[objectName] = index = index + 1;
                    } else {
                        objectLabel = objectName;
                        this._objectNamesIndex[objectName] = index = this._INITIAL_LABEL_NUMBER;
                    }
                } while (objectLabel in this._objects);

                return objectLabel;
            }
        },

{'fraction_non_alphanumeric': 0.09667161331354675, 'fraction_numerical': 0.00211999152003392, 'mean_word_length': 1.3391175012394645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '482210', 'n_tokens_mistral': 1194, 'n_tokens_neox': 1121, 'n_words': 240}