<commit_before>/**
 * language and OOP enhancement for non-ECMAScript5 standards
 */

;(function(K, undef){
	
/**
 * copy all properties in the supplier to the receiver
 * @param r {Object} receiver
 * @param s {Object} supplier
 * @param or {boolean=} whether override the existing property in the receiver
 * @param cl {(Array.<string>)=} copy list, an array of selected properties
 */
function mix(r, s, or, cl) {
	if (!s || !r) return r;
	var i = 0, c, len;
	or = or || or === undef;

	if (cl && (len = cl.length)) {
		for (; i < len; i++) {
			c = cl[i];
			if ( (c in s) && (or || !(c in r) ) ) {
				r[c] = s[c];
			}
		}
	} else {
		for (c in s) {
			if (or || !(c in r)) {
				r[c] = s[c];
			}
		}
	}
	return r;
};
	
	
// bind the this pointer of a function	
function bind_method(fn, bind){
	return function(){
		return fn.apply(bind, arguments);
	}
};

/**
 * transform functions that have the signature fn(key, value)
 * to 
 * functions that could accept object arguments
 * @adapter
 */
function overloadSetter(fn){
	return function(key, value){
		var self = this;
	
		if (!a && a !== 0){
			return self;
		}
		
		if (K.isString(key)){
			fn.call(self, key, value);
		
		}else if (K.isObject(key)){	
			K.each(key, function(v, k){
				fn.call(self, k, v);
			});
			
		}
		
		return self;
	};
};


/**
 * memoize static result of a complicated method to save time
 */
function memoizeMethod(fn){
	var stack = {};
	
	return function(){
		var arg = array_join.call(arguments, '~^_^~');<commit_msg>lang/enhance: fix a bug about overloadSetter, adjust code wrap<commit_after>/**
 * language and OOP enhancement for non-ECMAScript5 standards
 */

;(function(K, undef){
	
/**
 * copy all properties in the supplier to the receiver
 * @param r {Object} receiver
 * @param s {Object} supplier
 * @param or {boolean=} whether override the existing property in the receiver
 * @param cl {(Array.<string>)=} copy list, an array of selected properties
 */
function mix(r, s, or, cl) {
	if (!s || !r) return r;
	var i = 0, c, len;
	or = or || or === undef;

	if (cl && (len = cl.length)) {
		for (; i < len; i++) {
			c = cl[i];
			if ( (c in s) && (or || !(c in r) ) ) {
				r[c] = s[c];
			}
		}
	} else {
		for (c in s) {
			if (or || !(c in r)) {
				r[c] = s[c];
			}
		}
	}
	return r;
};
	
	
// bind the this pointer of a function	
function bind_method(fn, bind){
	return function(){
		return fn.apply(bind, arguments);
	}
};

/**
 * transform functions that have the signature fn(key, value)
 * to 
 * functions that could accept object arguments
 * @adapter
 */
function overloadSetter(fn){

	// @return {undefined} setter method will always return this, 
	// for the sake of potential chain-style invocations
	return function(key, value){
		var self = this;
	
		if (key || key === 0){
			if (K.isString(key)){
				fn.call(self, key, value);
			
			}else if (K.isObject(key)){	
				K.each(key, function(v, k){
					fn.call(self, k, v);
				});
			}
		}
		
		return self;
	};
};


/**
 * memoize static result of a complicated method to save time
 */
function memoizeMethod(fn){
	var stack = {};
	
	return function(){
		var arg = array_join.call(arguments, '~^_^~');
{'fraction_non_alphanumeric': 0.16509136735979837, 'fraction_numerical': 0.001890359168241966, 'mean_word_length': 2.919753086419753, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4121095', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1108, 'n_words': 383}