<commit_before>function fakeObject(obj){
	var w = new Communist();
	var promises = [];
	var rejectPromises = function(msg){
		if(typeof msg!=="string" && msg.preventDefault){
			msg.preventDefault();
			msg=msg.message;
		}
		promises.forEach(function(p){
			if(p){
				p.reject(msg);
			}
		});
	};
	if(!("initialize" in obj)){
		obj.initialize=function(){};
	}
	var keyFunc=function(key){
		var result;
		var out = function(data){
			var i = promises.length;
			promises[i] = c.deferred();
			var callback = function(data){
				promises[i].resolve(data);
			};
			try{
				result = obj[key](data,callback);
				if(typeof result !== "undefined"){
					callback(result);
				}
			} catch (e){
				promises[i].reject(e);
			}
			return promises[i].promise;
		};
		return out;
		};
	for(var key in obj){
		w[key]=keyFunc(key);
	}
	w._close = function(){
		return c.resolve();
	};
	if(!('close' in w)){
		w.close=w._close;
	}
w.initialize();
	return w;
}

function fakeMapWorker(fun,callback,onerr){
	var w = new Communist();
	var worker = fakeObject({data:fun});
	w.data=function(data){
		worker.data(data).then(callback,onerr);
		return w;
	};
	w.close=worker.close;
	return w;
}

function fakeReducer(fun,callback){
	var w = new Communist();<commit_msg>result was in weird scope<commit_after>function fakeObject(obj){
	var w = new Communist();
	var promises = [];
	var rejectPromises = function(msg){
		if(typeof msg!=="string" && msg.preventDefault){
			msg.preventDefault();
			msg=msg.message;
		}
		promises.forEach(function(p){
			if(p){
				p.reject(msg);
			}
		});
	};
	if(!("initialize" in obj)){
		obj.initialize=function(){};
	}
	var keyFunc=function(key){
		return function(data){
			var result;
			var i = promises.length;
			promises[i] = c.deferred();
			var callback = function(data){
				promises[i].resolve(data);
			};
			try{
				result = obj[key](data,callback);
				if(typeof result !== "undefined"){
					callback(result);
				}
			} catch (e){
				promises[i].reject(e);
			}
			return promises[i].promise;
		};
	};
	for(var key in obj){
		w[key]=keyFunc(key);
	}
	w._close = function(){
		return c.resolve();
	};
	if(!('close' in w)){
		w.close=w._close;
	}
w.initialize();
	return w;
}

function fakeMapWorker(fun,callback,onerr){
	var w = new Communist();
	var worker = fakeObject({data:fun});
	w.data=function(data){
		worker.data(data).then(callback,onerr);
		return w;
	};
	w.close=worker.close;
	return w;
}

function fakeReducer(fun,callback){
	var w = new Communist();
{'fraction_non_alphanumeric': 0.18152738904438226, 'fraction_numerical': 0.0, 'mean_word_length': 3.802303262955854, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6915859', 'n_tokens_mistral': 1029, 'n_tokens_neox': 907, 'n_words': 182}