<commit_before>new function() {
	var keys = ['windingRule', 'resolution', 'strokeColor',
		'strokeWidth', 'strokeCap', 'strokeJoin', 'dashOffset','dashArray',
		'miterLimit', 'strokeOverprint', 'fillColor', 'fillOverprint'];

	PathStyle = Base.extend({
		initialize: function(item, style) {
			this.item = item;
			if(style) {
				for (var i = 0, l = keys.length; i < l; i++) {
					var key = keys[i];
					if(style[key])
						this[key] = style[key];
				}
			}
		},

		_setChildrenStyle: function(name, value) {
			for (var i = 0, l = this.item.children.length; i < l; i++) {
				this.item.children[i].style[name] = value;
			}
		},

		_getChildrenStyle: function(name) {
			var style;
			for (var i = 0, l = this.item.children.length; i < l; i++) {
				if(!style) {
					style = this.item.children[i].style[name];
				} else if(style != this.item.children[i].style[name]) {
					// If there is another item with a different style:
					return null;
				}
			}
			return style;
		}
	});

	var pathStyleProps = { beans: true };
	var itemProps = { beans: true };

	function addStyleBean(key) {
		pathStyleProps['set' + key.capitalize()] = function(value) {
			if(this.item && this.item.children) {
				this._setChildrenStyle(key, value);
			} else {
				this['_' + key] = value;
			}
		};
		pathStyleProps['get' + key.capitalize()] = function() {
			if(this.item && this.item.children) {
				return this._getChildrenStyle(key);
			} else {
				return this['_' + key];
			}
		};
	}

	function addItemBean(key) {
		itemProps['set' + key.capitalize()] = function(value) {
			this.style[key] = value;
		};
		itemProps['get' + key.capitalize()] = function() {
			return this.style[key];
		};
	}

	for (var i = 0, l = keys.length; i < l; i++) {
		var key = keys[i];
		addStyleBean(key);
		addItemBean(key);
	}
	PathStyle.inject(pathStyleProps);
	Item.inject(itemProps);
};<commit_msg>Use the same simplifications in PathStyle as in CompoundPath, and rely on Base.each as well to provide the scope for closure injection.<commit_after>PathStyle = Base.extend(new function() {
	var keys = ['windingRule', 'resolution', 'strokeColor', 'strokeWidth',
			'strokeCap', 'strokeJoin', 'dashOffset','dashArray', 'miterLimit',
			'strokeOverprint', 'fillColor', 'fillOverprint'];

	var fields = {
		beans: true,

		initialize: function(item, style) {
			this.item = item;
			if(style) {
				for (var i = 0, l = keys.length; i < l; i++) {
					var key = keys[i];
					if(style[key])
						this[key] = style[key];
				}
			}
		},

		_setChildrenStyle: function(name, value) {
			for (var i = 0, l = this.item.children.length; i < l; i++) {
				this.item.children[i].style[name] = value;
			}
		},

		_getChildrenStyle: function(name) {
			var style;
			for (var i = 0, l = this.item.children.length; i < l; i++) {
				if(!style) {
					style = this.item.children[i].style[name];
				} else if(style != this.item.children[i].style[name]) {
					// If there is another item with a different style:
					return null;
				}
			}
			return style;
		}
	}

	var itemProps = { beans: true };

	Base.each(keys, function(key) {

		fields['set' + key.capitalize()] = function(value) {
			if(this.item && this.item.children) {
				this._setChildrenStyle(key, value);
			} else {
				this['_' + key] = value;
			}
		};

		fields['get' + key.capitalize()] = function() {
			if(this.item && this.item.children) {
				return this._getChildrenStyle(key);
			} else {
				return this['_' + key];
			}
		};

		itemProps['set' + key.capitalize()] = function(value) {
			this.style[key] = value;
		};

		itemProps['get' + key.capitalize()] = function() {
			return this.style[key];
		};
	});

	Item.inject(itemProps);

	return fields;
});
{'fraction_non_alphanumeric': 0.1755002704164413, 'fraction_numerical': 0.0018929150892374256, 'mean_word_length': 3.174943566591422, 'pattern_counts': {'":': 0, '<': 10, '<?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': '5357214', 'n_tokens_mistral': 1545, 'n_tokens_neox': 1301, 'n_words': 293}