<commit_before>module.exports = {
	
	process : function(ctx, step, next) {
		if(typeof step.end != 'undefined') {
			processLoop(ctx, step, next);
		}
		else if(typeof step.array != 'undefined') {
			processArray(ctx, step, next);
		}
		else {
			setTimeout(next, 1);
		}
	}
}

var processLoop = function(ctx, step, next) {
	var start = 0;
	if(typeof step.start != 'undefined') start = parseInt(step.start);
	var end = parseInt(step.end);
	var step = 1;
	if(typeof step.step != 'undefined') step = parseInt(step.step);
	var i = start; // for start
	var checkNext = function() {
		if(i < end) { // for end condition
			var inputVars = {};
			for(var i in ctx._vars) {
				inputVars[i] = ctx._vars[i];
			}
			inputVars[itemName] = array[i];
			ctx.createFlowEngine(step.flow).setInputVars(inputVars).execute(function(outputVars) {
				if(typeof outputVars != 'undefined') {
					for(var i in outputVars) {
						ctx._vars[i] = outputVars[i];
					}
				}
				i += step; // for step
				setTimeout(checkNext, 1);
			});
		}
		else {
			setTimeout(next, 1);
		}
	}
	setTimeout(checkNext, 1);
}

var processArray = function(ctx, step, next) {
	var array = ctx.vars[step.array];
	if(array && array.length) {<commit_msg>fix _step<commit_after>module.exports = {
	
	process : function(ctx, step, next) {
		if(typeof step.end != 'undefined') {
			processLoop(ctx, step, next);
		}
		else if(typeof step.array != 'undefined') {
			processArray(ctx, step, next);
		}
		else {
			setTimeout(next, 1);
		}
	}
}

var processLoop = function(ctx, step, next) {
	var start = 0;
	if(typeof step.start != 'undefined') start = parseInt(step.start);
	var end = parseInt(step.end);
	var _step = 1;
	if(typeof step.step != 'undefined') _step = parseInt(step.step);
	var i = start; // for start
	var checkNext = function() {
		if(i < end) { // for end condition
			var inputVars = {};
			for(var i in ctx._vars) {
				inputVars[i] = ctx._vars[i];
			}
			inputVars[itemName] = array[i];
			ctx.createFlowEngine(step.flow).setInputVars(inputVars).execute(function(outputVars) {
				if(typeof outputVars != 'undefined') {
					for(var i in outputVars) {
						ctx._vars[i] = outputVars[i];
					}
				}
				i += _step; // for step
				setTimeout(checkNext, 1);
			});
		}
		else {
			setTimeout(next, 1);
		}
	}
	setTimeout(checkNext, 1);
}

var processArray = function(ctx, step, next) {
	var array = ctx.vars[step.array];
	if(array && array.length) {
{'fraction_non_alphanumeric': 0.16234033786567778, 'fraction_numerical': 0.004944375772558714, 'mean_word_length': 3.3049645390070923, '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': '229454', 'n_tokens_mistral': 994, 'n_tokens_neox': 885, 'n_words': 199}