<commit_before>"use strict";
Seed (
	{ 
		name : "Mold.Lib.Dom",
		dna : "class",
		author : "<NAME>",
		include : [
			"Mold.Lib.DomNode",
			"Mold.Lib.DomParser"
		],
		version : 0.1
	},
	function(markup){
		
		var _root = false,
			that = this;



		if(typeof markup === "function"){
			markup = markup.toString().replace(/(^function\s*\(\)\s*\{\s*\/\*\|)([\s\S]*)(\|\*\/\s*\})/g, function(){
				return arguments[2];
			});

		}

		

		var _getElementByPropertieValue = function(callback, elements){
			var output = [];
			elements = elements || _root.childNodes;
			Mold.each(elements, function(node){
				var value = node.nodeValue;
				if(callback.call(this, node)){

					if(node.nodeType === 2){
						output.push(node.parentNode);
					}else if(node.nodeType === 1){
						output.push(node);
					}
				}
				if(node.childNodes.length > 0 ){
					output = output.concat(_getElementByPropertieValue(callback, node.childNodes));
				}
				if(node.attributes.length > 0 ){
					output = output.concat(_getElementByPropertieValue(callback, node.attributes));
				}
			});
			return output;
		}

		var _createElement = function(name){
			return new Mold.Lib.DomNode(1, name);
		}

		var _createAttribute = function(name){
			return new Mold.Lib.DomNode(2, name);
		}

		var _createTextNode = function(text){
			var textNode = new Mold.Lib.DomNode(3);
			textNode.nodeValue = text;
			return textNode;
		}

		var _createDocumentFragment = function(){
			return new Mold.Lib.DomNode(11);
		}
		
		
		_root = Mold.Lib.DomParser.parse(markup);

		this.publics = {
			get : function(){
				return _root;
			},
			getElementById : function(id){
				var elements = _getElementByPropertieValue(function(node){
					if(node.nodeType === 1){
						var nodeId = node.getAttribute('id');
						if(nodeId === id){
							return true;
						}else{
							return false;
						}
					}
				});
				return (elements[0]) = elements[0] || false;
			},
			getElementsByTagName : function(tagname){
				var elements = _getElementByPropertieValue(function(node){
					if(node.nodeType === 1){
						if(node.nodeName === tagname){
							return true;
						}else{
							return false;
						}
					}
				});
				return elements
			},
			createElement : function(name){
				return _createElement(name);
			},
			createAttribute : function(name){
				return _createAttribute(name);
			},
			createTextNode : function(text){
				return _createTextNode(text);
			},
			createDocumentFragment : function(){
				return _createDocumentFragment();
			}

		}
	}
);<commit_msg>space removed<commit_after>"use strict";
Seed (
	{ 
		name : "Mold.Lib.Dom",
		dna : "class",
		author : "<NAME>",
		include : [
			"Mold.Lib.DomNode",
			"Mold.Lib.DomParser"
		],
		version : 0.1
	},
	function(markup){
		
		var _root = false,
			that = this;



		if(typeof markup === "function"){
			markup = markup.toString().replace(/(^function\s*\(\)\s*\{\s*\/\*\|)([\s\S]*)(\|\*\/\s*\})/g, function(){
				return arguments[2];
			});

		}


		var _getElementByPropertieValue = function(callback, elements){
			var output = [];
			elements = elements || _root.childNodes;
			Mold.each(elements, function(node){
				var value = node.nodeValue;
				if(callback.call(this, node)){

					if(node.nodeType === 2){
						output.push(node.parentNode);
					}else if(node.nodeType === 1){
						output.push(node);
					}
				}
				if(node.childNodes.length > 0 ){
					output = output.concat(_getElementByPropertieValue(callback, node.childNodes));
				}
				if(node.attributes.length > 0 ){
					output = output.concat(_getElementByPropertieValue(callback, node.attributes));
				}
			});
			return output;
		}

		var _createElement = function(name){
			return new Mold.Lib.DomNode(1, name);
		}

		var _createAttribute = function(name){
			return new Mold.Lib.DomNode(2, name);
		}

		var _createTextNode = function(text){
			var textNode = new Mold.Lib.DomNode(3);
			textNode.nodeValue = text;
			return textNode;
		}

		var _createDocumentFragment = function(){
			return new Mold.Lib.DomNode(11);
		}
		
		
		_root = Mold.Lib.DomParser.parse(markup);

		this.publics = {
			get : function(){
				return _root;
			},
			getElementById : function(id){
				var elements = _getElementByPropertieValue(function(node){
					if(node.nodeType === 1){
						var nodeId = node.getAttribute('id');
						if(nodeId === id){
							return true;
						}else{
							return false;
						}
					}
				});
				return (elements[0]) = elements[0] || false;
			},
			getElementsByTagName : function(tagname){
				var elements = _getElementByPropertieValue(function(node){
					if(node.nodeType === 1){
						if(node.nodeName === tagname){
							return true;
						}else{
							return false;
						}
					}
				});
				return elements
			},
			createElement : function(name){
				return _createElement(name);
			},
			createAttribute : function(name){
				return _createAttribute(name);
			},
			createTextNode : function(text){
				return _createTextNode(text);
			},
			createDocumentFragment : function(){
				return _createDocumentFragment();
			}

		}
	}
);
{'fraction_non_alphanumeric': 0.155053974484789, 'fraction_numerical': 0.006280667320902846, 'mean_word_length': 2.840241145440844, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1624919', 'n_tokens_mistral': 2215, 'n_tokens_neox': 1661, 'n_words': 309}