<commit_before>steal('can/view', function(can){
// text node expando test
var canExpando = true;
try {
	document.createTextNode()._ = 0;
} catch (ex) {
	canExpando = false;
}
/**
 * Helper(s)
 */
var attrMap = {
		"class" : "className",
		"value": "value",
		"textContent" : "textContent"
	},
	tagMap = {
		"": "span", 
		table: "tr", 
		tr: "td", 
		ol: "li", 
		ul: "li", 
		tbody: "tr",
		thead: "tr",
		tfoot: "tr",
		select: "option",
		optgroup: "option"
	},	
	attributePlaceholder = '__!!__',
	attributeReplace = /__!!__/g,
	tagToContentPropMap= {
		option: "textContent",
		textarea: "value"
	},
	bool = can.each(["checked","disabled","readonly","required"], function(n){
		attrMap[n] = n;
	}),
	// a helper to get the parentNode for a given element el
	// if el is in a documentFragment, it will return defaultParentNode
	getParentNode = function(el, defaultParentNode){
		return defaultParentNode && el.parentNode.nodeType === 11 ? defaultParentNode : el.parentNode;
	},
	setAttr = function(el, attrName, val){
		// if this is a special property
		if ( attrMap[attrName] ) {
			// set the value as true / false
			el[attrMap[attrName]] = can.inArray(attrName,bool) > -1 ? true  : val;
		} else {
			el.setAttribute(attrName, val);
		}
	},
	getAttr = function(el, attrName){
		return attrMap[attrName]?
			el[attrMap[attrName]]:
			el.getAttribute(attrName);
	},
	removeAttr = function(el, attrName){
		if(can.inArray(attrName,bool) > -1){
			el[attrName] = false;
		} else{
			el.removeAttribute(attrName);
		}
	},
	pendingHookups = [],
	// Returns text content for anything other than a live-binding 
	contentText =  function( input ) {	
		
		// If it's a string, return.
		if ( typeof input == 'string' ) {
			return input;
		}
		// If has no value, return an empty string.
		if ( !input && input !== 0 ) {
			return '';
		}

		// If it's an object, and it has a hookup method.
		var hook = (input.hookup &&

		// Make a function call the hookup method.
		function( el, id ) {
			input.hookup.call(input, el, id);
		}) ||

		// Or if it's a `function`, just use the input.
		(typeof input == 'function' && input);

		// Finally, if there is a `function` to hookup on some dom,
		// add it to pending hookups.
		if ( hook ) {
			pendingHookups.push(hook);
			return '';
		}

		// Finally, if all else is `false`, `toString()` it.
		return "" + input;
	},
	// Returns escaped/sanatized content for anything other than a live-binding
	contentEscape = function( txt ) {
		return (typeof txt == 'string' || typeof txt == 'number') ?
			can.esc( txt ) :
			contentText(txt);
	},
	// a mapping of element ids to nodeList ids
	nodeMap = {},
	// a mapping of ids to text nodes
	textNodeMap = {},
	// a mapping of nodeList ids to nodeList
	nodeListMap = {},
	expando = "ejs_"+Math.random(),
	_id=0,
	id = function(node){
		if(canExpando || node.nodeType !== 3) {
			if(node[expando]) {
				return node[expando];
			}
			else {
				return node[expando] = (node.nodeName ? "element_" : "obj_")+(++_id);
			}
		}
		else {
			for(var textNodeID in textNodeMap) {
				if(textNodeMap[textNodeID] === node) {
					return textNodeID;
				}
			}

			textNodeMap["text_" + (++_id)] = node;
			return "text_" + _id;
		}
	},
	// removes a nodeListId from a node's nodeListIds
	removeNodeListId= function(node, nodeListId){
		var nodeListIds = nodeMap[id(node)];
		if( nodeListIds ) {
			var index = can.inArray(nodeListId, nodeListIds);
		
			if ( index >= 0 ) {
				nodeListIds.splice( index ,  1 );
			}
			if(!nodeListIds.length){
				delete nodeMap[id(node)];
			}
		}
	},
	addNodeListId = function(node, nodeListId){
		var nodeListIds = nodeMap[id(node)];
			if(!nodeListIds){
				nodeListIds = nodeMap[id(node)] = [];
			}
			nodeListIds.push(nodeListId);
	};
	
// Fix option text content in IE7/8
if (typeof document.createElement('option').textContent == 'undefined') {
	tagToContentPropMap.option = 'innerText';
}

can.extend(can.view, {

	pending: function() {
		// TODO, make this only run for the right tagName
		var hooks = pendingHookups.slice(0);
		lastHookups = hooks;
		pendingHookups = [];
		return can.view.hook(function(el){
			can.each(hooks, function(fn){
				fn(el);
			});
		});
	},

	registerNode: function(nodeList){
		var nLId = id(nodeList);
		nodeListMap[nLId] = nodeList;
		
		can.each(nodeList, function(node){
			addNodeListId(node, nLId);
		});
	},

	unregisterNode: function(nodeList){
		var nLId = id(nodeList);<commit_msg>Alternate fix for the option's textContent issue.<commit_after>steal('can/view', function(can){
// text node expando test
var canExpando = true;
try {
	document.createTextNode()._ = 0;
} catch (ex) {
	canExpando = false;
}
/**
 * Helper(s)
 */
var attrMap = {
		"class" : "className",
		"value": "value",
		"textContent" : "textContent"
	},
	tagMap = {
		"": "span", 
		table: "tr", 
		tr: "td", 
		ol: "li", 
		ul: "li", 
		tbody: "tr",
		thead: "tr",
		tfoot: "tr",
		select: "option",
		optgroup: "option"
	},	
	attributePlaceholder = '__!!__',
	attributeReplace = /__!!__/g,
	tagToContentPropMap= {
		option: "textContent",
		textarea: "value"
	},
	bool = can.each(["checked","disabled","readonly","required"], function(n){
		attrMap[n] = n;
	}),
	// a helper to get the parentNode for a given element el
	// if el is in a documentFragment, it will return defaultParentNode
	getParentNode = function(el, defaultParentNode){
		return defaultParentNode && el.parentNode.nodeType === 11 ? defaultParentNode : el.parentNode;
	},
	setAttr = function(el, attrName, val){
		// if this is a special property
		if ( attrMap[attrName] ) {
			// set the value as true / false
			el[attrMap[attrName]] = can.inArray(attrName,bool) > -1 ? true  : val;
		} else {
			el.setAttribute(attrName, val);
		}
	},
	getAttr = function(el, attrName){
		// Default to a blank string for IE7/8
		return (attrMap[attrName]?
			el[attrMap[attrName]]:
			el.getAttribute(attrName)) || '';
	},
	removeAttr = function(el, attrName){
		if(can.inArray(attrName,bool) > -1){
			el[attrName] = false;
		} else{
			el.removeAttribute(attrName);
		}
	},
	pendingHookups = [],
	// Returns text content for anything other than a live-binding 
	contentText =  function( input ) {	
		
		// If it's a string, return.
		if ( typeof input == 'string' ) {
			return input;
		}
		// If has no value, return an empty string.
		if ( !input && input !== 0 ) {
			return '';
		}

		// If it's an object, and it has a hookup method.
		var hook = (input.hookup &&

		// Make a function call the hookup method.
		function( el, id ) {
			input.hookup.call(input, el, id);
		}) ||

		// Or if it's a `function`, just use the input.
		(typeof input == 'function' && input);

		// Finally, if there is a `function` to hookup on some dom,
		// add it to pending hookups.
		if ( hook ) {
			pendingHookups.push(hook);
			return '';
		}

		// Finally, if all else is `false`, `toString()` it.
		return "" + input;
	},
	// Returns escaped/sanatized content for anything other than a live-binding
	contentEscape = function( txt ) {
		return (typeof txt == 'string' || typeof txt == 'number') ?
			can.esc( txt ) :
			contentText(txt);
	},
	// a mapping of element ids to nodeList ids
	nodeMap = {},
	// a mapping of ids to text nodes
	textNodeMap = {},
	// a mapping of nodeList ids to nodeList
	nodeListMap = {},
	expando = "ejs_"+Math.random(),
	_id=0,
	id = function(node){
		if(canExpando || node.nodeType !== 3) {
			if(node[expando]) {
				return node[expando];
			}
			else {
				return node[expando] = (node.nodeName ? "element_" : "obj_")+(++_id);
			}
		}
		else {
			for(var textNodeID in textNodeMap) {
				if(textNodeMap[textNodeID] === node) {
					return textNodeID;
				}
			}

			textNodeMap["text_" + (++_id)] = node;
			return "text_" + _id;
		}
	},
	// removes a nodeListId from a node's nodeListIds
	removeNodeListId= function(node, nodeListId){
		var nodeListIds = nodeMap[id(node)];
		if( nodeListIds ) {
			var index = can.inArray(nodeListId, nodeListIds);
		
			if ( index >= 0 ) {
				nodeListIds.splice( index ,  1 );
			}
			if(!nodeListIds.length){
				delete nodeMap[id(node)];
			}
		}
	},
	addNodeListId = function(node, nodeListId){
		var nodeListIds = nodeMap[id(node)];
			if(!nodeListIds){
				nodeListIds = nodeMap[id(node)] = [];
			}
			nodeListIds.push(nodeListId);
	};

can.extend(can.view, {

	pending: function() {
		// TODO, make this only run for the right tagName
		var hooks = pendingHookups.slice(0);
		lastHookups = hooks;
		pendingHookups = [];
		return can.view.hook(function(el){
			can.each(hooks, function(fn){
				fn(el);
			});
		});
	},

	registerNode: function(nodeList){
		var nLId = id(nodeList);
		nodeListMap[nLId] = nodeList;
		
		can.each(nodeList, function(node){
			addNodeListId(node, nLId);
		});
	},

	unregisterNode: function(nodeList){
		var nLId = id(nodeList);
{'fraction_non_alphanumeric': 0.15763825929283773, 'fraction_numerical': 0.0029465095194922937, 'mean_word_length': 3.286061194754735, 'pattern_counts': {'":': 4, '<': 3, '<?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': '5954361', 'n_tokens_mistral': 3517, 'n_tokens_neox': 3120, 'n_words': 808}