<commit_before>(function(oCanvas, window, document, undefined){

	// Define the class
	var style = function () {
		
		// Return an object when instantiated
		return {

			// Method for converting a stroke to either an object or a string
			// Fixes errors if found
			getStroke: function (value, return_type) {
				return_type = (return_type === "string") ? "string" : "object";
			
				// Convert object to string with default values if unspecified
				if (typeof value === "object" && return_type === "string") {
					var val = value;
					value = (typeof val.pos === "string") ? val.pos : "center";
					value += " " + (typeof val.width === "number" ? val.width+"px" : "1px");
					value += " " + (typeof val.color === "string" ? val.color : "#000000");
				}
			
				// Get stroke settings
				var stroke = value.split(" "),
					strokePositions = ["outside", "center", "inside"],
					fixed_color = '', i, num_splits = stroke.length,
					strokePos, width, color, only_color;
				
				// If there are more than 2 splits
				if (num_splits >= 3) {
					
					// If first split is not a valid stroke position
					if (!~strokePositions.indexOf(stroke[0])) {
					
						// Boolean that says if only a color is specified
						only_color = isNaN(parseInt(stroke[0]));
						
						// Loop through all the splits and concatenate the split color values
						for (i = (only_color ? 0 : 1); i < num_splits; i++) {
							fixed_color += stroke[i] + (i === num_splits - 1 ? " " : "");
						}
						
						// Set the fixed stroke array
						if (only_color) {
							stroke = [1, fixed_color];<commit_msg>(bugfix): Fix incorrect color parsing for strokes<commit_after>(function(oCanvas, window, document, undefined){

	// Define the class
	var style = function () {
		
		// Return an object when instantiated
		return {

			// Method for converting a stroke to either an object or a string
			// Fixes errors if found
			getStroke: function (value, return_type) {
				return_type = (return_type === "string") ? "string" : "object";
			
				// Convert object to string with default values if unspecified
				if (typeof value === "object" && return_type === "string") {
					var val = value;
					value = (typeof val.pos === "string") ? val.pos : "center";
					value += " " + (typeof val.width === "number" ? val.width+"px" : "1px");
					value += " " + (typeof val.color === "string" ? val.color : "#000000");
				}

				// Get stroke components
				var stroke = value.split(" ");

				// Handle color values with parentheses, because they can contain spaces,
				// that would be split by the line above. The color value needs to be in
				// one entry in the stroke array.
				var parenStart, parenEnd;
				for (var i = 0, l = stroke.length; i < l; i++) {
					if (stroke[i].indexOf("(") > -1) parenStart = i;
					if (stroke[i].indexOf(")") > -1) parenEnd = i;
				}
				var color = parenEnd ? stroke.splice(parenStart, parenEnd - parenStart + 1) : undefined;
				if (color) stroke.push(color.join(" "));
			
				// Get stroke settings
				var strokePositions = ["outside", "center", "inside"];
				var fixed_color = '', i, num_splits = stroke.length;
				var strokePos, width, color, only_color;
				
				// If there are more than 2 splits
				if (num_splits >= 3) {
					
					// If first split is not a valid stroke position
					if (!~strokePositions.indexOf(stroke[0])) {
					
						// Boolean that says if only a color is specified
						only_color = isNaN(parseInt(stroke[0]));
						
						// Loop through all the splits and concatenate the split color values
						for (i = (only_color ? 0 : 1); i < num_splits; i++) {
							fixed_color += stroke[i] + (i === num_splits - 1 ? " " : "");
						}
						
						// Set the fixed stroke array
						if (only_color) {
							stroke = [1, fixed_color];
{'fraction_non_alphanumeric': 0.1395165528113505, 'fraction_numerical': 0.008933263268523384, 'mean_word_length': 2.5579439252336447, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 7, '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': '3982508', 'n_tokens_mistral': 1497, 'n_tokens_neox': 1117, 'n_words': 397}