<commit_before>/*
	@author: guokai
	@email/gtalk: <EMAIL>
	@blog/website: http://benben.cc
	@license: apache license, version 2.0
	@version: 0.4.0-dev
*/

(function() {
	var juicer = function() {
		var args = [].slice.call(arguments);
		args.push(juicer.options);
		if(arguments.length == 1) return juicer.compile.apply(juicer, args);
		if(arguments.length >= 2) return juicer.to_html.apply(juicer, args);
	};

	this.__escapehtml = {
		__escapehash: {
			'<': '&lt;',
			'>': '&gt;',
			'"': '&quot;',
			'&': '&amp;'
		},
		__escapereplace: function(k) {
			return __escapehtml.__escapehash[k];
		},
		__escape: function(str) {
			return typeof(str) !== 'string' ? str : str.replace(/[&<>"]/igm, __escapehtml.__escapereplace);
		},
		__detection: function(data) {
			return typeof(data) === 'undefined' ? '' : data;
		}
	};

	juicer.__cache = {};
	juicer.version = '0.4.0-dev';

	juicer.settings = {
		forstart:		/{@each\s*([\w\.]*?)\s*as\s*(\w*?)(,\w*?)?}/igm,
		forend:			/{@\/each}/igm,
		ifstart:		/{@if\s*([^}]*?)}/igm,
		ifend:			/{@\/if}/igm,
		elsestart:		/{@else}/igm,
		elseifstart:	/{@else if\s*([^}]*?)}/igm,
		interpolate:	/\${([\s\S]+?)}/igm,
		noneencode:		/\$\${([\s\S]+?)}/igm,
		inlinecomment:  /{#[^}]*?}/igm,
		rangestart:		/{@each\s*(\w*?)\s*in\s*range\((\d+?),(\d+?)\)}/igm
	};

	juicer.options = {
		cache: true,
		strip: true,
		errorhandling: true
	};

	juicer.set = function(conf, value) {
		this.options[conf] = value;
	};

	juicer.template = function() {
		var __this = this;

		this.__interpolate = function(varname, escape, options) {
			var __define = varname.split('|'), fn = '';
			if(__define.length > 1) {
				varname = __define.shift();
				fn = __define.shift();
			}
			return '<%= '+
						(escape?'__escapehtml.__escape':'') +
							'(' +
								(!options || options.detection !== false ? '__escapehtml.__detection' : '') +
									'(' +
										fn +
											'(' +
												varname +
											')' +
									')' +
							')' +
					' %>';
		};

		this.__shell = function(tpl, options) {
			var iterate_count = 0;
			tpl = tpl
				//for expression
				.replace(juicer.settings.forstart, function($, varname, alias, key) {
					var alias = alias || 'value', key = key && key.substr(1);
					var iterate_var = 'i' + iterate_count++;
					return '<% for(var ' + iterate_var + '=0, l' + iterate_var + '=' + varname + '.length;' + iterate_var + '<l' + iterate_var + ';' + iterate_var + '++) {' +
								'var ' + alias + '=' + varname + '[' + iterate_var + '];' +
								(key?('var ' + key + '=' + iterate_var + ';'):'') +
							' %>';
				})
				.replace(juicer.settings.forend, '<% } %>')<commit_msg>re-format the code style.<commit_after>/*
	@author: guokai
	@email/gtalk: <EMAIL>
	@blog/website: http://benben.cc
	@license: apache license, version 2.0
	@version: 0.4.0-dev
*/

(function() {
	var juicer = function() {
		var args = [].slice.call(arguments);
		args.push(juicer.options);
		if(arguments.length == 1) return juicer.compile.apply(juicer, args);
		if(arguments.length >= 2) return juicer.to_html.apply(juicer, args);
	};

	this.__escapehtml = {
		__escapehash: {
			'<': '&lt;',
			'>': '&gt;',
			'"': '&quot;',
			'&': '&amp;'
		},
		__escapereplace: function(k) {
			return __escapehtml.__escapehash[k];
		},
		__escape: function(str) {
			return typeof(str) !== 'string' ? str : str.replace(/[&<>"]/igm, __escapehtml.__escapereplace);
		},
		__detection: function(data) {
			return typeof(data) === 'undefined' ? '' : data;
		}
	};

	juicer.__cache = {};
	juicer.version = '0.4.0-dev';

	juicer.settings = {
		forstart:		/{@each\s*([\w\.]*?)\s*as\s*(\w*?)(,\w*?)?}/igm,
		forend:			/{@\/each}/igm,
		ifstart:		/{@if\s*([^}]*?)}/igm,
		ifend:			/{@\/if}/igm,
		elsestart:		/{@else}/igm,
		elseifstart:	/{@else if\s*([^}]*?)}/igm,
		interpolate:	/\${([\s\S]+?)}/igm,
		noneencode:		/\$\${([\s\S]+?)}/igm,
		inlinecomment:  /{#[^}]*?}/igm,
		rangestart:		/{@each\s*(\w*?)\s*in\s*range\((\d+?),(\d+?)\)}/igm
	};

	juicer.options = {
		cache: true,
		strip: true,
		errorhandling: true
	};

	juicer.set = function(conf, value) {
		this.options[conf] = value;
	};

	juicer.template = function() {
		var __this = this;

		this.__interpolate = function(varname, escape, options) {
			var __define = varname.split('|'), fn = '';
			if(__define.length > 1) {
				varname = __define.shift();
				fn = __define.shift();
			}
			return '<%= '+
						(escape ? '__escapehtml.__escape' : '') +
							'(' +
								(!options || options.detection !== false ? '__escapehtml.__detection' : '') +
									'(' +
										fn +
											'(' +
												varname +
											')' +
									')' +
							')' +
					' %>';
		};

		this.__shell = function(tpl, options) {
			var iterate_count = 0;
			tpl = tpl
				//for expression
				.replace(juicer.settings.forstart, function($, varname, alias, key) {
					var alias = alias || 'value', key = key && key.substr(1);
					var iterate_var = 'i' + iterate_count++;
					return '<% for(var ' + iterate_var + '=0, l' + iterate_var + '=' + varname + '.length;' + iterate_var + '<l' + iterate_var + ';' + iterate_var + '++) {' +
								'var ' + alias + '=' + varname + '[' + iterate_var + '];' +
								(key?('var ' + key + '=' + iterate_var + ';'):'') +
							' %>';
				})
				.replace(juicer.settings.forend, '<% } %>')
{'fraction_non_alphanumeric': 0.24097744360902257, 'fraction_numerical': 0.005263157894736842, 'mean_word_length': 2.773758865248227, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, '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': '1236405', 'n_tokens_mistral': 2555, 'n_tokens_neox': 2073, 'n_words': 336}