<commit_before>var Rectangle = this.Rectangle = Base.extend({
	beans: true,

	initialize: function() {
		if (arguments.length == 1) {
			var rect = arguments[0];
			this.x = rect.x;
			this.y = rect.y;
			this.width = rect.width;
			this.height = rect.height;
		} else if (arguments.length == 2) {
			if (arguments[1].x !== undefined) {
				// new Rectangle(point1, point2)
				var point1 = new Point(arguments[0]);
				var point2 = new Point(arguments[1]);
				this.x = point1.x;
				this.y = point1.y;
				this.width = point2.x - point1.x;
				this.height = point2.y - point1.y;
				if (this.width < 0) {
					this.x = point2.x;
					this.width = -this.width;
				}
				if (this.height < 0) {
					this.y = point2.y;
					this.height = -this.height;
				}
			} else {
				// new Rectangle(point, size)
				var point = new Point(arguments[0]);
				var size = new Size(arguments[1]);
				this.x = point.x;
				this.y = point.y;<commit_msg>Make sure rectangle dimensions are not undefined when creatig from a Point or Size.<commit_after>var Rectangle = this.Rectangle = Base.extend({
	beans: true,

	initialize: function() {
		if (arguments.length == 1) {
			var rect = arguments[0];
			// Use 0 as defaults, in case we're reading from a Point or Size
			this.x = rect.x || 0;
			this.y = rect.y || 0;
			this.width = rect.width || 0;
			this.height = rect.height || 0;
		} else if (arguments.length == 2) {
			if (arguments[1].x !== undefined) {
				// new Rectangle(point1, point2)
				var point1 = new Point(arguments[0]);
				var point2 = new Point(arguments[1]);
				this.x = point1.x;
				this.y = point1.y;
				this.width = point2.x - point1.x;
				this.height = point2.y - point1.y;
				if (this.width < 0) {
					this.x = point2.x;
					this.width = -this.width;
				}
				if (this.height < 0) {
					this.y = point2.y;
					this.height = -this.height;
				}
			} else {
				// new Rectangle(point, size)
				var point = new Point(arguments[0]);
				var size = new Size(arguments[1]);
				this.x = point.x;
				this.y = point.y;
{'fraction_non_alphanumeric': 0.15471512770137524, 'fraction_numerical': 0.02406679764243615, 'mean_word_length': 2.4177852348993287, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5660152', 'n_tokens_mistral': 909, 'n_tokens_neox': 729, 'n_words': 189}