<commit_before>/*global define*/
define([
        '../Core/AssociativeArray',
        '../Core/createGuid',
        '../Core/defined',
        '../Core/defineProperties',
        '../Core/DeveloperError',
        '../Core/Event',
        '../Core/Iso8601',
        '../Core/JulianDate',
        '../Core/RuntimeError',
        '../Core/TimeInterval',
        './Entity'
    ], function(
        AssociativeArray,
        createGuid,
        defined,
        defineProperties,
        DeveloperError,
        Event,
        Iso8601,
        JulianDate,
        RuntimeError,
        TimeInterval,
        Entity) {
    'use strict';

    var entityOptionsScratch = {
        id : undefined
    };

    function fireChangedEvent(collection) {
        if (collection._firing) {
            collection._refire = true;
            return;
        }

        if (collection._suspendCount === 0) {
            var added = collection._addedEntities;
            var removed = collection._removedEntities;
            var changed = collection._changedEntities;
            if (changed.length !== 0 || added.length !== 0 || removed.length !== 0) {
                collection._firing = true;
                do {
                    collection._refire = false;
                    var addedArray = collection._addedEntities.values.slice(0);
                    var removedArray = collection._removedEntities.values.slice(0);
                    var changedArray = collection._changedEntities.values.slice(0);

                    added.removeAll();
                    removed.removeAll();
                    changed.removeAll();
                    collection._collectionChanged.raiseEvent(collection, addedArray, removedArray, changedArray);
                } while (collection._refire);
                collection._firing = false;
            }
        }
    }

    /**
     * An observable collection of {@link Entity} instances where each entity has a unique id.
     * @alias EntityCollection
     * @constructor
     *
     * @param {DataSource|CompositeEntityCollection} [owner] The data source (or composite entity collection) which created this collection.
     */
    function EntityCollection(owner) {
        this._owner = owner;
        this._entities = new AssociativeArray();<commit_msg>Re-use existing variables.<commit_after>/*global define*/
define([
        '../Core/AssociativeArray',
        '../Core/createGuid',
        '../Core/defined',
        '../Core/defineProperties',
        '../Core/DeveloperError',
        '../Core/Event',
        '../Core/Iso8601',
        '../Core/JulianDate',
        '../Core/RuntimeError',
        '../Core/TimeInterval',
        './Entity'
    ], function(
        AssociativeArray,
        createGuid,
        defined,
        defineProperties,
        DeveloperError,
        Event,
        Iso8601,
        JulianDate,
        RuntimeError,
        TimeInterval,
        Entity) {
    'use strict';

    var entityOptionsScratch = {
        id : undefined
    };

    function fireChangedEvent(collection) {
        if (collection._firing) {
            collection._refire = true;
            return;
        }

        if (collection._suspendCount === 0) {
            var added = collection._addedEntities;
            var removed = collection._removedEntities;
            var changed = collection._changedEntities;
            if (changed.length !== 0 || added.length !== 0 || removed.length !== 0) {
                collection._firing = true;
                do {
                    collection._refire = false;
                    var addedArray = added.values.slice(0);
                    var removedArray = removed.values.slice(0);
                    var changedArray = changed.values.slice(0);

                    added.removeAll();
                    removed.removeAll();
                    changed.removeAll();
                    collection._collectionChanged.raiseEvent(collection, addedArray, removedArray, changedArray);
                } while (collection._refire);
                collection._firing = false;
            }
        }
    }

    /**
     * An observable collection of {@link Entity} instances where each entity has a unique id.
     * @alias EntityCollection
     * @constructor
     *
     * @param {DataSource|CompositeEntityCollection} [owner] The data source (or composite entity collection) which created this collection.
     */
    function EntityCollection(owner) {
        this._owner = owner;
        this._entities = new AssociativeArray();
{'fraction_non_alphanumeric': 0.10905485789821547, 'fraction_numerical': 0.006609385327164574, 'mean_word_length': 1.6800472255017709, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '114857', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1097, 'n_words': 243}