<commit_before>KM.define(function(K, require){

var 

ITEM_RENDERER = 'itemRenderer',

METHODS_OVERRIDEN = {
	_getItem: function(index){
		var self = this;
		
		return self.items[index] || (self.items[index] = self[ITEM_RENDERER].call(self, index));
	}
};


return {
	name: 'step',
	
	options: {
		// async: false,
		
		/**
		 * @type {function(index, callback)}
		 * @returns {string} the Neuron/DOM instance of the item with <index> index
		 */
		itemRenderer: null
	},
	
	init: function(self){
		var EVENTS = self.get('EVENTS');
	
		self.on(EVENTS.AFTER_INIT, function(){
			var t = this;
			
			K.mix(t, METHODS_OVERRIDEN);
			
			t[ITEM_RENDERER] = t.get(ITEM_RENDERER);
		});
	}
};


});<commit_msg>Switch plugin/step: complete<commit_after>KM.define(function(K, require){

var 

ITEM_RENDERER = 'itemRenderer',

METHODS_OVERRIDEN = {

	/**
	 * override the _getItem method
	 * so it could generate unexisted items
	 * @param {number} index
	 * @param {boolean=} dontSetPos if true, _getItem method will not set the position of newly created item
	 */
	_getItem: function(index, dontSetPos){
		var self = this,
			item = self.items[index];
			
		if(!item){
			item = 
			self.items[index] = self[ITEM_RENDERER].call(self, index).inject(self.container);
			
			dontSetPos || item.css(self.get('direction'), self._getOffset(index) * self.get('itemSpace'));
		}
		
		return item;
	},
	
	/**
	 * 
	 */
	_getOffset: function(index){
		return index;
	}
};


return {
	name: 'step',
	
	ATTRS: {
		// async: false,
		
		/**
		 * method to render the Neuron/DOM instance of the item of expected index
		 * @returns {string} the Neuron/DOM instance of the item with <index> index
		 */
		itemRenderer: {
		
			// type {function(index, callback)}
			// validator: K.isFunction
		},
		
		dataLength: {
			value: K.isNumber,
			getter: function(v){
				return v || 0;
			}
		},
		
		itemSpace: null
	},
	
	init: function(self){
		var EVENTS = self.get('EVENTS');
		
		self.on(EVENTS.BEFORE_INIT, function(){
			K.mix(this, METHODS_OVERRIDEN);
		});
	
		self.on(EVENTS.AFTER_INIT, function(){
			var self = this;
			
			self[ITEM_RENDERER] = self.get(ITEM_RENDERER);
			
			// set fake length value
			self._itemData(self.length + self.get('dataLength')); console.log(self.get('dataLength'))
		});
	}
};


});
{'fraction_non_alphanumeric': 0.15254237288135594, 'fraction_numerical': 0.000434593654932638, 'mean_word_length': 3.255083179297597, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6300095', 'n_tokens_mistral': 967, 'n_tokens_neox': 812, 'n_words': 180}