<commit_before>define([
	'../on',
	'./add',
	'./modify',
	'./remove'
], function (on, add, modify, remove) {
	'use strict';

	var nodeListDescriptors = {
		on: {
			value: function (type, listener) {
				var handles = this.map(function (node) {
					return on(node, type, listener);
				});
				handles.remove = function () {
					handles.forEach(function (handle) {
						handle.remove();
					});
				};
				return handles;
			},
			configurable: true
		},
		add: {
			value: function (/* selectors... */) {
				var self = this,
					args = Array.prototype.slice.call(arguments);
				return decorate.call(self, self.map(function (node) {
					return add.apply(self, [ node ].concat(args));
				}));
			},
			configurable: true
		},
		modify: {
			value: function (/* selectors... */) {
				var self = this,
					args = Array.prototype.slice.call(arguments);
				return self.map(function (node) {
					return modify.apply(self, [ node ].concat(args));
				});
			},
			configurable: true
		},
		remove: {
			value: function () {
				this.forEach(function (node) {
					remove(node);
				});
			},
			configurable: true
		}
	};

	function decorate(nodes) {
		if (!nodes) {
			return nodes;
		}
		Object.defineProperties(nodes, nodeListDescriptors);
		if (this && this.doc) {
			Object.defineProperty(nodes, 'doc', {
				value: this.doc,<commit_msg>Refactor dom/decorate slightly.<commit_after>define([
	'../on',
	'./add',
	'./modify',
	'./remove'
], function (on, add, modify, remove) {
	'use strict';

	var slice = Array.prototype.slice;

	var nodeListDescriptors = {
		on: {
			value: function (type, listener) {
				var handles = this.map(function (node) {
					return on(node, type, listener);
				});
				handles.remove = function () {
					handles.forEach(function (handle) {
						handle.remove();
					});
				};
				return handles;
			},
			configurable: true
		},
		add: {
			value: function (/* selectors... */) {
				var self = this,
					args = slice.call(arguments);
				return decorate.call(self, self.map(function (node) {
					return add.apply(self, [ node ].concat(args));
				}));
			},
			configurable: true
		},
		modify: {
			value: function (/* selectors... */) {
				var self = this,
					args = slice.call(arguments);
				return self.map(function (node) {
					return modify.apply(self, [ node ].concat(args));
				});
			},
			configurable: true
		},
		remove: {
			value: function () {
				this.forEach(function (node) {
					remove(node);
				});
			},
			configurable: true
		}
	};

	function decorate(nodes) {
		if (!nodes) {
			return nodes;
		}
		Object.defineProperties(nodes, nodeListDescriptors);
		if (this && this.doc) {
			Object.defineProperty(nodes, 'doc', {
				value: this.doc,
{'fraction_non_alphanumeric': 0.17065097462302317, 'fraction_numerical': 0.0, 'mean_word_length': 2.660834454912517, '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': '178740', 'n_tokens_mistral': 1153, 'n_tokens_neox': 913, 'n_words': 196}