<commit_before>/*!
 * VisualEditor UserInterface GroupElement class.
 *
 * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
 * @license The MIT License (MIT); see LICENSE.txt
 */

/**
 * Group element.
 *
 * @class
 * @abstract
 *
 * @constructor
 * @param {jQuery} $group Group element
 */
ve.ui.GroupElement = function VeUiGroupElement( $group ) {
	// Properties
	this.$group = $group;
	this.items = [];
	this.$items = this.$$( [] );
};

/* Methods */

/**
 * Get items.
 *
 * @method
 * @returns {ve.ui.Element[]} Items
 */
ve.ui.GroupElement.prototype.getItems = function () {
	return this.items.slice( 0 );
};

/**
 * Add items.
 *
 * @method
 * @param {ve.ui.Element[]} items Item
 * @chainable
 */
ve.ui.GroupElement.prototype.addItems = function ( items ) {
	var i, len;
	for ( i = 0, len = items.length; i < len; i++ ) {
		this.addItem( items[i] );
	}
	return this;
};

/**
 * Add item.
 *
 * @method
 * @param {ve.ui.Widget} item Item
 * @chainable
 */
ve.ui.GroupElement.prototype.addItem = function ( item ) {
	// Check if item exists then remove it first, effectively "moving" it
	if ( this.items.indexOf( item ) !== -1 ) {
		this.removeItems( [item] );
	}
	// Add the item
	this.items.push( item );
	this.$.append( item.$ );
	this.$items = this.$items.add( item.$ );

	return this;
};

/**<commit_msg>Remove singular adding for ve.ui.GroupElement<commit_after>/*!
 * VisualEditor UserInterface GroupElement class.
 *
 * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
 * @license The MIT License (MIT); see LICENSE.txt
 */

/**
 * Group element.
 *
 * @class
 * @abstract
 *
 * @constructor
 * @param {jQuery} $group Group element
 */
ve.ui.GroupElement = function VeUiGroupElement( $group ) {
	// Properties
	this.$group = $group;
	this.items = [];
	this.$items = this.$$( [] );
};

/* Methods */

/**
 * Get items.
 *
 * @method
 * @returns {ve.ui.Element[]} Items
 */
ve.ui.GroupElement.prototype.getItems = function () {
	return this.items.slice( 0 );
};

/**
 * Add items.
 *
 * @method
 * @param {ve.ui.Element[]} items Item
 * @chainable
 */
ve.ui.GroupElement.prototype.addItems = function ( items ) {
	var i, len, item;

	for ( i = 0, len = items.length; i < len; i++ ) {
		item = items[i];

		// Check if item exists then remove it first, effectively "moving" it
		if ( this.items.indexOf( item ) !== -1 ) {
			this.removeItems( [item] );
		}
		// Add the item
		this.items.push( item );
		this.$.append( item.$ );
		this.$items = this.$items.add( item.$ );
	}

	return this;
};

/**
{'fraction_non_alphanumeric': 0.18081761006289307, 'fraction_numerical': 0.008647798742138365, 'mean_word_length': 3.04610492845787, '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': '3303681', 'n_tokens_mistral': 911, 'n_tokens_neox': 870, 'n_words': 228}