<commit_before>/*
 Copyright 2013 <NAME> (<EMAIL>)

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */

"use strict";
if(typeof(jQuery) === "undefined") {
	throw("Unable to find jQuery");
}
if(typeof(luga) === "undefined") {
	var luga = {};
}
luga.version = 0.1;

luga.CONST = {
	MESSAGES: {
		INVALID_EXTEND_PARAM: "luga.extend only accept functions as arguments"
	}
};

// Based on <NAME>'s code
luga.namespace = function(ns, rootObject) {
	var parts = ns.split(".");
	if (!rootObject) {
		rootObject = window;
	}
	var len;
	for (var i = 0, len = parts.length; i < len; i++) {
		if (!rootObject[parts[i]]) {
			rootObject[parts[i]] = {};
		}
		rootObject = rootObject[parts[i]];
	}
	return rootObject;
};

luga.extend = function(func, baseFunc) {
	if((!jQuery.isFunction(func)) || (!jQuery.isFunction(baseFunc))) {
		throw(luga.CONST.MESSAGES.INVALID_EXTEND_PARAM);
	}
};

/* Utilities */

luga.namespace("luga.utils");

/**
 * Given a string containing placeholders, it assembles a new string
 * replacing the placeholders with the strings contained inside the second argument
 * Loosely based on the .NET implementation: http://msdn.microsoft.com/en-us/library/system.string.format.aspx<commit_msg>Rollback an attempt to wrap basic extend<commit_after>/*
 Copyright 2013 <NAME> (<EMAIL>)

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */

"use strict";
if(typeof(jQuery) === "undefined") {
	throw("Unable to find jQuery");
}
if(typeof(luga) === "undefined") {
	var luga = {};
}
luga.version = 0.1;

// Based on <NAME>'s code
luga.namespace = function(ns, rootObject) {
	var parts = ns.split(".");
	if (!rootObject) {
		rootObject = window;
	}
	var len;
	for (var i = 0, len = parts.length; i < len; i++) {
		if (!rootObject[parts[i]]) {
			rootObject[parts[i]] = {};
		}
		rootObject = rootObject[parts[i]];
	}
	return rootObject;
};

/* Utilities */

luga.namespace("luga.utils");

/**
 * Given a string containing placeholders, it assembles a new string
 * replacing the placeholders with the strings contained inside the second argument
 * Loosely based on the .NET implementation: http://msdn.microsoft.com/en-us/library/system.string.format.aspx
{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.007051282051282051, 'mean_word_length': 4.227805695142378, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1912201', 'n_tokens_mistral': 973, 'n_tokens_neox': 928, 'n_words': 338}