<commit_before>var poolFactory = function( constr, init, onAcquired, onReleased, reset, capacity ) {

		if( !reset ) reset = idFunc;
		if( !capacity ) capacity = 20;
		
		var stack = [],
			count = 0,
			created= 0,
			dropped= 0,
			pool = {
				get count() { return count; },
				get capacity() {
					return capacity;
				},
				set capacity( val ) {
					if( val < stack.length ) {
						stack.length = val;
					}
					capacity = val;
				},
				drop: function( nb ) {
					if( nb === undefined || nb > count ) nb = count;
					while( nb-- > 0 ) {
						stack[ --count ] = null;
					}
				},
				get created() { return created; },
				set created( val ) { created = val; },
				get dropped() { return dropped; },
				set dropped( val ) { dropped = val; }
			};
		return {
			acquirer: function() {
				var obj;
				if( count > 0 ) {
					obj = stack[ --count ];
					stack[ count ] = null;
				}
				else {
					obj = constr();
					created++;
				}
				init.apply( obj, arguments );
				onAcquired( obj );
				return obj;
			},
			releaser: function( obj ) {
				onReleased( obj );
				if( count < capacity ) {
					reset( obj );
					stack[ count++ ] = obj;
				}
				else dropped++;
			},
			disposer: function() {
				onReleased( this );
				if( count < capacity ) {
					reset( this );
					stack[ count++ ] = this;
				}
				else dropped++;
			},
			pool: pool
		};
	},
	attachPool = function(klass, options) {
		if(klass._pool) throw "This is already a pool: " + klass;
		var def = poolFactory(options.constr, options.init, options.reset, options.capacity),
			acquireName = options.acquireName || "acquire",
			releaseName = options.releaseName || "release",
			disposeName = options.disposeName || "dispose",
			proto = options.proto;<commit_msg>Fix arguments parsing in attachPool()<commit_after>var poolFactory = function( constr, init, onAcquired, onReleased, reset, capacity ) {

		if( !reset ) reset = idFunc;
		if( !capacity ) capacity = 20;
		
		var stack = [],
			count = 0,
			created= 0,
			dropped= 0,
			pool = {
				get count() { return count; },
				get capacity() {
					return capacity;
				},
				set capacity( val ) {
					if( val < stack.length ) {
						stack.length = val;
					}
					capacity = val;
				},
				drop: function( nb ) {
					if( nb === undefined || nb > count ) nb = count;
					while( nb-- > 0 ) {
						stack[ --count ] = null;
					}
				},
				get created() { return created; },
				set created( val ) { created = val; },
				get dropped() { return dropped; },
				set dropped( val ) { dropped = val; }
			};
		return {
			acquirer: function() {
				var obj;
				if( count > 0 ) {
					obj = stack[ --count ];
					stack[ count ] = null;
				}
				else {
					obj = constr();
					created++;
				}
				init.apply( obj, arguments );
				onAcquired( obj );
				return obj;
			},
			releaser: function( obj ) {
				onReleased( obj );
				if( count < capacity ) {
					reset( obj );
					stack[ count++ ] = obj;
				}
				else dropped++;
			},
			disposer: function() {
				onReleased( this );
				if( count < capacity ) {
					reset( this );
					stack[ count++ ] = this;
				}
				else dropped++;
			},
			pool: pool
		};
	},
	attachPool = function( klass, options ) {
		if( klass._pool ) throw "This is already a pool: " + klass;
		var constr = options.constr,
			init = options.init || noopFunc,
			onAcquired = options.onAcquired || noopFunc,
			onReleased = options.onReleased || noopFunc,
			reset = options.reset || noopFunc,
			capacity = options.capacity || 32,
			def = poolFactory( constr, init, onAcquired,  onReleased, reset, capacity ),
			acquireName = options.acquireName || "acquire",
			releaseName = options.releaseName || "release",
			disposeName = options.disposeName || "dispose",
			proto = options.proto;
{'fraction_non_alphanumeric': 0.14705104469717006, 'fraction_numerical': 0.004231684739486909, 'mean_word_length': 2.282986111111111, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5350339', 'n_tokens_mistral': 1648, 'n_tokens_neox': 1232, 'n_words': 349}