<commit_before>/**
 * Utilities; usefull scripts
 *
 * @author	<NAME> <<EMAIL>>
 */
var utils =
{
	// datamembers
	debug: false,
	eoo: true
}


/**
 * Functions related to arrays
 *
 * @author	<NAME> <<EMAIL>>
 */
utils.array =
{
	/**
	 * Is the given value present in the array
	 *
	 * @return	bool
	 */
	inArray: function(needle, array)
	{
		// loop values
		for(var i in array)
		{
			if(array[i] == needle) return true;
		}

		// fallback
		return false;
	},


	// end
	eoo: true
},


/**
 * Function related to cookies
 *
 * @author	<NAME> <<EMAIL>>
 */
utils.cookies =
{
	/**
	 * Are cookies enabled?
	 *
	 * @return	bool
	 */
	isEnabled: function()
	{
		// try to grab the property
		var cookiesEnabled = (navigator.cookieEnabled) ? true : false;

		// unknown property?
		if(typeof navigator.cookieEnabled == 'undefined' && !cookiesEnabled)
		{
			// try to set a cookie
			document.cookie = 'testcookie';
			cookiesEnabled = ($.inArray('testcookie', document.cookie) != -1);
		}

		// return
		return cookiesEnabled;
	},


	/**
	 * Read a cookie
	 *
	 * @return	mixed
	 */
	readCookie: function(name)
	{
		// get cookies
		var cookies = document.cookie.split(';');
		name = name + '=';

		for(var i = 0; i < cookies.length; i++)
		{
			var cookie = cookies[i];
			while(cookie.charAt(0) == ' ') cookie = cookie.substring(1, cookie.length);
			if(cookie.indexOf(name) == 0) return cookie.substring(name.lenght, cookie.length);
		}

		// fallback
		return null;
	},


	// end
	eoo: true
},


/**
 * Functions related to forms
 *
 * @author	<NAME> <<EMAIL>>
 */
utils.form =<commit_msg>corrected a typo<commit_after>/**
 * Utilities; usefull scripts
 *
 * @author	<NAME> <<EMAIL>>
 */
var utils =
{
	// datamembers
	debug: false,
	eoo: true
}


/**
 * Functions related to arrays
 *
 * @author	<NAME> <<EMAIL>>
 */
utils.array =
{
	/**
	 * Is the given value present in the array
	 *
	 * @return	bool
	 */
	inArray: function(needle, array)
	{
		// loop values
		for(var i in array)
		{
			if(array[i] == needle) return true;
		}

		// fallback
		return false;
	},


	// end
	eoo: true
},


/**
 * Function related to cookies
 *
 * @author	<NAME> <<EMAIL>>
 */
utils.cookies =
{
	/**
	 * Are cookies enabled?
	 *
	 * @return	bool
	 */
	isEnabled: function()
	{
		// try to grab the property
		var cookiesEnabled = (navigator.cookieEnabled) ? true : false;

		// unknown property?
		if(typeof navigator.cookieEnabled == 'undefined' && !cookiesEnabled)
		{
			// try to set a cookie
			document.cookie = 'testcookie';
			cookiesEnabled = ($.inArray('testcookie', document.cookie) != -1);
		}

		// return
		return cookiesEnabled;
	},


	/**
	 * Read a cookie
	 *
	 * @return	mixed
	 */
	readCookie: function(name)
	{
		// get cookies
		var cookies = document.cookie.split(';');
		name = name + '=';

		for(var i = 0; i < cookies.length; i++)
		{
			var cookie = cookies[i];
			while(cookie.charAt(0) == ' ') cookie = cookie.substring(1, cookie.length);
			if(cookie.indexOf(name) == 0) return cookie.substring(name.length, cookie.length);
		}

		// fallback
		return null;
	},


	// end
	eoo: true
},


/**
 * Functions related to forms
 *
 * @author	<NAME> <<EMAIL>>
 */
utils.form =
{'fraction_non_alphanumeric': 0.1675556950109821, 'fraction_numerical': 0.0031377470975839346, 'mean_word_length': 2.7373974208675262, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 27, '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': '4922589', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1125, 'n_words': 286}