<commit_before>steal('can/util/can.js', function (can) {
	// Given a list of elements, check if they are in the dom, if they 
	// are in the dom, trigger inserted on them.
	can.inserted = function (elems) {
		// prevent mutations from changing the looping
		elems = can.makeArray(elems);
		var inDocument = false,
			// Not all browsers implement document.contains (Android)
			doc = can.$(document.contains ? document : document.body),
			children;
		for (var i = 0, elem;
			(elem = elems[i]) !== undefined; i++) {
			if (!inDocument) {
				if (elem.getElementsByTagName) {
					if (can.has(doc, elem)
						.length) {
						inDocument = true;
					} else {
						return;
					}
				} else {
					continue;
				}
			}

			if (inDocument && elem.getElementsByTagName) {
				children = can.makeArray(elem.getElementsByTagName("*"));
				can.trigger(elem, "inserted", [], false);
				for (var j = 0, child;
					(child = children[j]) !== undefined; j++) {
					// Trigger the destroyed event
					can.trigger(child, "inserted", [], false);
				}
			}
		}
	};

	can.appendChild = function (el, child) {
		var children;
		if (child.nodeType === 11) {
			children = can.makeArray(child.childNodes);
		} else {
			children = [child];
		}
		el.appendChild(child);
		can.inserted(children);
	};
	can.insertBefore = function (el, child, ref) {
		var children;
		if (child.nodeType === 11) {
			children = can.makeArray(child.childNodes);
		} else {
			children = [child];
		}
		el.insertBefore(child, ref);
		can.inserted(children);
	};

});<commit_msg>Inline documentation for can.inserted<commit_after>steal('can/util/can.js', function (can) {
	// # can.inserted
	// Given a list of elements, check if they are in the dom, if they 
	// are in the dom, trigger the `inserted` event on them.
	can.inserted = function (elems) {
		// Prevent mutations from changing the looping
		elems = can.makeArray(elems);
		var inDocument = false,
			// Not all browsers implement document.contains (Android)
			doc = can.$(document.contains ? document : document.body),
			children;
		// Go through `elems` and trigger the `inserted` event.
		// If the first element is not in the document (a Document Fragment)
		// exit the function.
		for (var i = 0, elem;
			(elem = elems[i]) !== undefined; i++) {
			// If we haven't already found an element in the document
			if (!inDocument) {
				if (elem.getElementsByTagName) {
					// If it is in the document
					if (can.has(doc, elem)
						.length) {
						inDocument = true;
					} else {
						// Document Fragment, exit the function
						return;
					}
				} else {
					// Continue on to the next element
					continue;
				}
			}

			if (inDocument && elem.getElementsByTagName) {
				// We've found an element in the document and will now
				// trigger `inserted` for `elem` and all of its children.
				children = can.makeArray(elem.getElementsByTagName("*"));
				can.trigger(elem, "inserted", [], false);
				for (var j = 0, child;
					(child = children[j]) !== undefined; j++) {
					// Trigger the inserted event
					can.trigger(child, "inserted", [], false);
				}
			}
		}
	};

	// ## Create can.appendChild and can.insertBefore
	can.appendChild = function (el, child) {
		var children;
		// Document Fragment
		if (child.nodeType === 11) {
			children = can.makeArray(child.childNodes);
		} else {
			children = [child];
		}
		el.appendChild(child);
		// Trigger the inserted event on the children
		can.inserted(children);
	};
	can.insertBefore = function (el, child, ref) {
		var children;
		// Document Fragment
		if (child.nodeType === 11) {
			children = can.makeArray(child.childNodes);
		} else {
			children = [child];
		}
		el.insertBefore(child, ref);
		// Trigger the inserted event on the children
		can.inserted(children);
	};
});
{'fraction_non_alphanumeric': 0.1395778364116095, 'fraction_numerical': 0.0031662269129287598, 'mean_word_length': 2.852642276422764, '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': '5970871', 'n_tokens_mistral': 1471, 'n_tokens_neox': 1203, 'n_words': 359}