<commit_before>var data_user, data_priv,
	rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
	rmultiDash = /([A-Z])/g;

function Data() {
	// Nodes|Objects
	this.owners = [];
	// Data objects
	this.cache = [];
}

Data.index = function( array, node ) {
	return array.indexOf( node );
};


Data.prototype = {
	add: function( owner ) {
		return (this.cache[ this.owners.push( owner ) - 1 ] = {});
	},
	set: function( owner, data, value ) {
		var prop,
				index = Data.index( this.owners, owner );

		// If there is no entry for this "owner", create one inline
		// and set the index as though an owner entry had always existed
		if ( index === -1 ) {
			this.add( owner );
			index = this.owners.length - 1;
		}
		// Handle: [ owner, key, value ] args
		if ( typeof data === "string" ) {
			this.cache[ index ][ data ] = value;

		// Handle: [ owner, { properties } ] args
		} else {
			// In the case where there was actually no "owner" entry and
			// this.add( owner ) was called to create one, there will be
			// a corresponding empty plain object in the cache.
			if ( jQuery.isEmptyObject( this.cache[ index ] ) ) {
				this.cache[ index ] = data;

			// Otherwise, copy the properties one-by-one to the cache object
			} else {
				for ( prop in data ) {
					this.cache[ index ][ prop ] = data[ prop ];
				}
			}
		}
		return this;
	},
	get: function( owner, key ) {
		var cache,
				index = Data.index( this.owners, owner );

		// A valid cache is found, or needs to be created.
		// New entries will be added and return the current
		// empty data object to be used as a return reference
		// return this.add( owner );
		// This logic was required by expectations made of the
		// old data system.
		cache = index === -1 ?
			this.add( owner ) : this.cache[ index ];

		return key === undefined ?
			cache : cache[ key ];
	},
	access: function( owner, key, value ) {
		if ( value === undefined && (key && typeof key !== "object") ) {
			// Assume this is a request to read the cached data
			return this.get( owner, key );
		} else {

			// If only an owner was specified, return the entire
			// cache object.
			if ( key === undefined ) {
				return this.get( owner );
			}

			// Allow setting or extending (existing objects) with an
			// object of properties, or a key and val
			this.set( owner, key, value );
			return value !== undefined ? value : key;
		}
		// Otherwise, this is a read request.
		return this.get( owner, key );
	},
	remove: function( owner, key ) {
		var i, l, name,
				camel = jQuery.camelCase,
				index = Data.index( this.owners, owner ),
				cache = this.cache[ index ];

		if ( key === undefined ) {
			cache = {};
		} else {
			if ( cache ) {
				// Support array or space separated string of keys
				if ( !Array.isArray( key ) ) {
					// Try the string as a key before any manipulation
					//

					if ( key in cache ) {
						name = [ key ];
					} else {
						// If a key with the spaces exists, use it.
						// Otherwise, create an array by matching non-whitespace
						name = camel( key );
						name = name in cache ?
							[ name ] : ( name.match( core_rnotwhite ) || [] );
					}
				} else {
					// If "name" is an array of keys...
					// When data is initially created, via ("key", "val") signature,
					// keys will be converted to camelCase.
					// Since there is no way to tell _how_ a key was added, remove
					// both plain key and camelCase key. #12786
					// This will only penalize the array argument path.
					name = key.concat( key.map( camel ) );
				}
				i = 0;
				l = name.length;

				for ( ; i < l; i++ ) {
					delete cache[ name[i] ];
				}
			}
		}
		this.cache[ index ] = cache;
	},
	hasData: function( owner ) {
		var index = Data.index( this.owners, owner );

		return index !== -1 && jQuery.isEmptyObject( this.cache[ index ] );
	},
	discard: function( owner ) {
		var index = Data.index( this.owners, owner );

		if ( index !== -1 ) {
			this.owners.splice( index, 1 );<commit_msg>Ref fd43865c: restore correct logic<commit_after>var data_user, data_priv,
	rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
	rmultiDash = /([A-Z])/g;

function Data() {
	// Nodes|Objects
	this.owners = [];
	// Data objects
	this.cache = [];
}

Data.index = function( array, node ) {
	return array.indexOf( node );
};


Data.prototype = {
	add: function( owner ) {
		return (this.cache[ this.owners.push( owner ) - 1 ] = {});
	},
	set: function( owner, data, value ) {
		var prop,
				index = Data.index( this.owners, owner );

		// If there is no entry for this "owner", create one inline
		// and set the index as though an owner entry had always existed
		if ( index === -1 ) {
			this.add( owner );
			index = this.owners.length - 1;
		}
		// Handle: [ owner, key, value ] args
		if ( typeof data === "string" ) {
			this.cache[ index ][ data ] = value;

		// Handle: [ owner, { properties } ] args
		} else {
			// In the case where there was actually no "owner" entry and
			// this.add( owner ) was called to create one, there will be
			// a corresponding empty plain object in the cache.
			if ( jQuery.isEmptyObject( this.cache[ index ] ) ) {
				this.cache[ index ] = data;

			// Otherwise, copy the properties one-by-one to the cache object
			} else {
				for ( prop in data ) {
					this.cache[ index ][ prop ] = data[ prop ];
				}
			}
		}
		return this;
	},
	get: function( owner, key ) {
		var cache,
				index = Data.index( this.owners, owner );

		// A valid cache is found, or needs to be created.
		// New entries will be added and return the current
		// empty data object to be used as a return reference
		// return this.add( owner );
		// This logic was required by expectations made of the
		// old data system.
		cache = index === -1 ?
			this.add( owner ) : this.cache[ index ];

		return key === undefined ?
			cache : cache[ key ];
	},
	access: function( owner, key, value ) {
		if ( value === undefined && (key && typeof key !== "object") ) {
			// Assume this is a request to read the cached data
			return this.get( owner, key );
		} else {

			// If only an owner was specified, return the entire
			// cache object.
			if ( key === undefined ) {
				return this.get( owner );
			}

			// Allow setting or extending (existing objects) with an
			// object of properties, or a key and val
			this.set( owner, key, value );
			return value !== undefined ? value : key;
		}
		// Otherwise, this is a read request.
		return this.get( owner, key );
	},
	remove: function( owner, key ) {
		var i, l, name,
				camel = jQuery.camelCase,
				index = Data.index( this.owners, owner ),
				cache = this.cache[ index ];

		if ( key === undefined ) {
			cache = {};
		} else {
			if ( cache ) {
				// Support array or space separated string of keys
				if ( !Array.isArray( key ) ) {
					// Try the string as a key before any manipulation
					//

					if ( key in cache ) {
						name = [ key ];
					} else {
						// If a key with the spaces exists, use it.
						// Otherwise, create an array by matching non-whitespace
						name = camel( key );
						name = name in cache ?
							[ name ] : ( name.match( core_rnotwhite ) || [] );
					}
				} else {
					// If "name" is an array of keys...
					// When data is initially created, via ("key", "val") signature,
					// keys will be converted to camelCase.
					// Since there is no way to tell _how_ a key was added, remove
					// both plain key and camelCase key. #12786
					// This will only penalize the array argument path.
					name = key.concat( key.map( camel ) );
				}
				i = 0;
				l = name.length;

				for ( ; i < l; i++ ) {
					delete cache[ name[i] ];
				}
			}
		}
		this.cache[ index ] = cache;
	},
	hasData: function( owner ) {
		var index = Data.index( this.owners, owner );

		return index !== -1 && !jQuery.isEmptyObject( this.cache[ index ] );
	},
	discard: function( owner ) {
		var index = Data.index( this.owners, owner );

		if ( index !== -1 ) {
			this.owners.splice( index, 1 );
{'fraction_non_alphanumeric': 0.14161740661552005, 'fraction_numerical': 0.003898880643944158, 'mean_word_length': 2.3147144643601503, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3039945', 'n_tokens_mistral': 2999, 'n_tokens_neox': 2495, 'n_words': 938}