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

(function() {
	var juicer={
		version:'0.2.2'
	};

	this.__cache={};

	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);
		}
	};

	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,
		interpolate:/\${([\s\S]+?)}/igm,
		noneencode:/\$\${([\s\S]+?)}/igm
	};

	juicer.template=function() {
		var __this=this;
	
		this.__interpolate=function(varname,escape) {
			var __define=varname.split('|'),fn='';
			if(__define.length>1) {
				varname=__define.shift();
				func=__define.shift();
			}
			return '<%= '+
						(escape?'__escapehtml.__escape':'')+
							'('+
								fn+
									'('+
										(varname!=='.'?varname:'i')+
									')'+
							')'+
					' %>';
		};
	
		this.__shell=function(tpl) {
			tpl=tpl
				//for expression
				.replace(juicer.settings.forstart,function($,varname,alias,key) {
					var alias=alias||'value',key=key && key.substr(1);
					return '<% for(var i=0,l='+varname+'.length;i<l;i++) {var '+
								alias+'='+varname+'[i];'+
								(key?(key+'='+'i;'):'')+
							' %>';
				})
				.replace(juicer.settings.forend,'<% } %>')
				//if expression
				.replace(juicer.settings.ifstart,function($,condition) {
					return '<% if('+condition+') { %>';
				})
				.replace(juicer.settings.ifend,'<% } %>')<commit_msg>modified to var key=k.<commit_after>/*
	@author: guokai
	@email/gtalk: <EMAIL>
	@blog/website: http://benben.cc
	@license: apache license,version 2.0
	@version: 0.2.2
*/

(function() {
	var juicer={
		version:'0.2.2'
	};

	this.__cache={};

	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);
		}
	};

	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,
		interpolate:/\${([\s\S]+?)}/igm,
		noneencode:/\$\${([\s\S]+?)}/igm
	};

	juicer.template=function() {
		var __this=this;
	
		this.__interpolate=function(varname,escape) {
			var __define=varname.split('|'),fn='';
			if(__define.length>1) {
				varname=__define.shift();
				func=__define.shift();
			}
			return '<%= '+
						(escape?'__escapehtml.__escape':'')+
							'('+
								fn+
									'('+
										(varname!=='.'?varname:'i')+
									')'+
							')'+
					' %>';
		};
	
		this.__shell=function(tpl) {
			tpl=tpl
				//for expression
				.replace(juicer.settings.forstart,function($,varname,alias,key) {
					var alias=alias||'value',key=key && key.substr(1);
					return '<% for(var i=0,l='+varname+'.length;i<l;i++) {'+
								'var '+alias+'='+varname+'[i];'+
								(key?('var '+key+'='+'i;'):'')+
							' %>';
				})
				.replace(juicer.settings.forend,'<% } %>')
				//if expression
				.replace(juicer.settings.ifstart,function($,condition) {
					return '<% if('+condition+') { %>';
				})
				.replace(juicer.settings.ifend,'<% } %>')
{'fraction_non_alphanumeric': 0.27087405752583077, 'fraction_numerical': 0.006143535325328121, 'mean_word_length': 3.1943793911007026, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '6973324', 'n_tokens_mistral': 1832, 'n_tokens_neox': 1455, 'n_words': 148}