<commit_before>/**
 * Automtn.js
 *
 * @date        2013-09-21
 * @author     	<NAME>
 * @link        https://github.com/lcnvdl/automtn
 * @copyright   Copyright(c) 2013 <NAME>
 * @licence     MIT Licensed
 */
"undefined"===typeof String.prototype.replaceAll&&(String.prototype.replaceAll=function(b,c){for(var a=this;-1!==a.toString().indexOf(b);)a=a.toString().replace(b,c);return a});"undefined"===typeof Array.prototype.getKey&&(Array.prototype.getKey=function(){for(var b in this)if(this.propertyIsEnumerable(b))return b});
(function(b){b.fn.appendStr=function(c){var a=b(this);a.html(a.html()+c);return a};b.fn.automtn=function(c){var a;a=this instanceof b?this:b(this);if(a.length==0)throw"Automtn element is null because your jQuery selector matches with 0 elements.";var d=String(c.action||"init").toLowerCase(),f=a.attr("id");if(typeof f==="undefined"||f==""){f="auto-"+Automtn.id++;a.attr("id",f)}if(d=="init"){if(a.data("init"))return a;a.data("init",true);var c=b.extend({},Automtn.defaults,c||{}),g=function(b){var d=
a.data(b)||c[b];a.data(b,typeof d==="undefined"?"":d);return d},d=g("fetch");if(!d||d=="")throw"You cant fetch data from a null url.";b.each(["external","key","method","mode","onlyvalue","parsechild","parsemode","tpl","value","loadstart","loadfinish","loadsuccess","loaderror"],function(b,a){g(a)});var e=g("fill"),d=g("events"),h=g("subscript"),f=g("filltype");typeof h!=="undefined"&&h!=""&&eval(h);if(e!=""){if(e.toLowerCase()=="self")e=a;else{e=b(e);if(e.length==0){a.data("init",false);return a}}a.data("element",
e);if(f==""){f=e[0].tagName.toLowerCase();a.data("filltype",f)}}if(typeof d!=="undefined"&&d!="")for(var d=d.split(","),i=function(){a.automtn({action:"fetch"})},f=0;f<d.length;f++){e=d[f].trim();if(e=="document-ready")b(document).ready(function(){i()});else if(e=="now")i();else{e=e.split("-");h=b(e[0]);if(h.length>0)h.on(e[1],function(){i()})}}}else if(a.data("init"))if(d=="fill"){d=c.data||{};f=a.data("filltype");e=a.data("mode");Automtn.fill(a,d,f,e);a.trigger("onfill")}else{var e=a.data("request"),
h=a.data("fetch"),f=String(a.data("external"))=="true",j=a.data("beforefill"),k=a.data("loadstart"),l=a.data("loadfinish"),m=a.data("loaderror"),n=a.data("loadsuccess"),o=a.data("method"),d={};e&&e.abort();try{a.trigger("onloadstart",[a]);Automtn.call(this,k,a)}catch(p){}d={type:o,url:h,data:d,context:a,success:function(b){try{this.trigger("beforefill",[b]);Automtn.call(this,j,b);this.automtn({action:"fill",data:b});this.trigger("onloadsuccess",[this]);Automtn.call(this,n)}catch(a){this.trigger("onloaderror",
[this]);Automtn.call(this,m,a)}finally{Automtn.call(this,l);this.trigger("onloadfinish",[this,true,b])}},error:function(b,a,c){b=[a,c,b];this.trigger("onloaderror",[this]);this.trigger("onloadfinish",[this,false,b]);Automtn.call(this,m,{error:a,result:b});Automtn.call(this,l)},async:true};if(f)d.dataType="jsonp";else{d.dataType="json";d.contentType="application/json; charset=utf-8"}e=b.ajax(d);a.data("request",e)}return a};b(document).ready(function(){b("[data-fetch]").each(function(){b(this).automtn({action:"init"})})})})(jQuery||
$);
var Automtn={id:1,defaults:{action:"init",fetch:"",fill:"self",filltype:"",events:"document-ready",method:"POST",mode:"overwrite",external:!1,onlyvalue:!1,parsechild:"auto",parsemode:"none",tpl:"{value}",key:null,value:null,beforefill:null,loadstart:null,loadfinish:null,loaderror:null,loadsuccess:null,subscript:null},mode:{Overwrite:"overwrite",Append:"append"},parsers:{None:"none",KvAsValues:"kv-as-values",KvAsArray:"kv-as-array"},get:function(b,c,a){return typeof a=="undefined"?b.data(c):b.data(c,a)},
toDict:function(b,c,a){for(var d={},f=0;f<b.length;f++){var g=b[f];typeof g==="object"?d[c?g[c]:f]=a?g[a]:g:d[f]=g}return d},each:function(b,c,a){var d=Automtn.get(b,"key"),f=Automtn.get(b,"value"),g=Automtn.get(b,"parsemode"),e;if(String(Automtn.get(b,"onlyvalue")).toLowerCase()=="false"){$.isArray(c)&&(c=Automtn.toDict(c,d,f));e=c}else if($.isArray(c))e=Automtn.toDict(c,d,f);else{e={};$.each(c,function(b,a){if(typeof a==="string"||typeof a==="number")e[b]=a})}if(g=="kv-as-values"){var h=0,i={};
$.each(e,function(b,a){i[h++]=b;i[h++]=a});e=i}else if(g=="kv-as-array"){h=0;i={};$.each(e,function(b,a){i[h++]=[b,a]});e=i}$.each(e,a)},fill:function(b,c,a,d){var d=d||Automtn.mode.Overwrite,c=typeof c=="string"?{"?":c}:c,f=Automtn.get(b,"parsechild").toLowerCase();if(f=="auto"&&c.length==1||f=="yes")c=c[c.getKey()];(Automtn._fill[a]||Automtn._fill.div)(b,c,d)},call:function(b,c,a){if(typeof c==="string"){if(c=="")return null;c=c.indexOf("function")===0?eval(c):typeof a==="undefined"?new Function(c):
new Function("args",c)}else if(typeof c!=="function")return null;return c?c.call(b,a):null},_val:function(b,c,a,d){return(d||Automtn.get(b,"tpl")).replaceAll("{key}",c).replaceAll("{value}",a)},_fill:{ol:function(b,c,a){return Automtn._fill.ul(b,c,a)},ul:function(b,c,a){a==Automtn.mode.Overwrite&&b.html("");var d=Automtn.get(b,"tpl");if(d=="{value}"){d="<li>{value}</li>";Automtn.get(b,"tpl",d)}Automtn.each(b,c,function(a,c){var e=Automtn._val(b,a,c,d);b.appendStr(e)})},select:function(b,c,a){a==Automtn.mode.Overwrite&&
b.html("");var d=Automtn.get(b,"tpl");if(d=="{value}"){d="<option value='{key}'>{value}</li>";Automtn.get(b,"tpl",d)}Automtn.each(b,c,function(a,c){var e=Automtn._val(b,a,c,d);b.appendStr(e)})},table:function(b,c,a){var d=b.children("tbody"),f=d.length>0?d:b;a==Automtn.mode.Overwrite&&f.html("");a=Automtn.get(b,"tpl");a=="{value}"&&Automtn.get(b,"tpl","<td>{value}</td>");var g=Automtn.get(b,"tpl-tr");if(typeof g==="undefined"){g="<tr data-key='{key}'>{value}</td>";Automtn.get(b,"tpl-tr",g)}Automtn.each(b,
c,function(a,c){var d=$("<tr>"),j;j=$.isArray(c)?c:[c];(String(Automtn.get(b,"showkey"))=="1"||String(Automtn.get(b,"showkey"))=="true")&&$("<td>").attr("data-key",a).html(a).appendTo(d);for(var k=0;k<j.length;k++){var l=Automtn._val(b,a,j[k]);d.appendStr(l)}$(Automtn._val(b,a,d.html(),g)).appendTo(f);d.remove()})},div:function(b,c,a){typeof c=="string"&&(c={"?":c});a==Automtn.mode.Overwrite&&b.html("");Automtn.each(b,c,function(a,c){var g=Automtn._val(b,a,c);b.appendStr(g)})}}};<commit_msg>Min updated<commit_after>/**
 * Automtn.js
 *
 * @date        2013-09-26
 * @author     	<NAME>
 * @link        https://github.com/lcnvdl/automtn
 * @copyright   Copyright(c) 2013 <NAME>
 * @licence     MIT Licensed
 */
 "undefined"===typeof String.prototype.replaceAll&&(String.prototype.replaceAll=function(b,c){for(var a=this;-1!==a.toString().indexOf(b);)a=a.toString().replace(b,c);return a});"undefined"===typeof Array.prototype.getKey&&(Array.prototype.getKey=function(){for(var b in this)if(this.propertyIsEnumerable(b))return b});
(function(b){b.fn.appendStr=function(c){var a=b(this);a.html(a.html()+c);return a};b.fn.automtn=function(c){var c=c||{},a;a=this instanceof b?this:b(this);if(a.length==0)throw"Automtn element is null because your jQuery selector matches with 0 elements.";var d=String(c.action||"init").toLowerCase(),f=a.attr("id");if(typeof f==="undefined"||f==""){f="auto-"+Automtn.id++;a.attr("id",f)}if(d=="init"){if(a.data("init"))return a;a.data("init",true);var c=b.extend({},Automtn.defaults,c||{}),g=function(b){var d=
a.data(b)||c[b];a.data(b,typeof d==="undefined"?"":d);return d},d=g("fetch");if(!d||d=="")throw"You cant fetch data from a null url.";b.each(["external","key","method","mode","onlyvalue","parsechild","parsemode","tpl","value","loadstart","loadfinish","loadsuccess","loaderror"],function(b,a){g(a)});var e=g("fill"),d=g("events"),h=g("subscript"),f=g("filltype");typeof h!=="undefined"&&h!=""&&eval(h);if(e!=""){if(e.toLowerCase()=="self")e=a;else{e=b(e);if(e.length==0){a.data("init",false);return a}}a.data("element",
e);if(f==""){f=e[0].tagName.toLowerCase();a.data("filltype",f)}}if(typeof d!=="undefined"&&d!="")for(var d=d.split(","),i=function(){a.automtn({action:"fetch"})},f=0;f<d.length;f++){e=d[f].trim();if(e=="document-ready")b(document).ready(function(){i()});else if(e=="now")i();else{e=e.split("-");h=b(e[0]);if(h.length>0)h.on(e[1],function(){i()})}}}else if(a.data("init"))if(d=="fill"){d=c.data||{};f=a.data("filltype");e=a.data("mode");Automtn.fill(a,d,f,e);a.trigger("onfill")}else{var e=a.data("request"),
h=a.data("fetch"),f=String(a.data("external"))=="true",j=a.data("beforefill"),k=a.data("loadstart"),l=a.data("loadfinish"),m=a.data("loaderror"),n=a.data("loadsuccess"),o=a.data("method"),d={};e&&e.abort();try{a.trigger("onloadstart",[a]);Automtn.call(this,k,a)}catch(p){}d={type:o,url:h,data:d,context:a,success:function(a){var c={ajax:this,success:typeof a.success==="undefined"?true:a.success,result:a};if(!c.success&&typeof a.error!=="undefined")c.error=a.error;try{this.trigger("beforefill",c);Automtn.call(this,
j,c);this.automtn({action:"fill",data:a});this.trigger("onloadsuccess",c);Automtn.call(this,n,c)}catch(d){a=b.extend(c,{success:false,error:d});this.trigger("onloaderror",a);Automtn.call(this,m,a)}finally{Automtn.call(this,l,c);this.trigger("onloadfinish",c)}},error:function(a,b,c){a={success:false,error:a&&a.responseJSON&&a.responseJSON.error?a.responseJSON.error:c};this.trigger("onloaderror",a);this.trigger("onloadfinish",a);Automtn.call(this,m,a);Automtn.call(this,l)},async:true};if(f)d.dataType=
"jsonp";else{d.dataType="json";d.contentType="application/json; charset=utf-8"}e=b.ajax(d);a.data("request",e)}return a};b(document).ready(function(){b("[data-fetch]").each(function(){b(this).automtn({action:"init"})})})})(jQuery||$);
var Automtn={id:1,defaults:{action:"init",fetch:"",fill:"self",filltype:"",events:"document-ready",method:"POST",mode:"overwrite",external:!1,onlyvalue:!1,parsechild:"auto",parsemode:"none",tpl:"{value}",key:null,value:null,beforefill:null,loadstart:null,loadfinish:null,loaderror:null,loadsuccess:null,subscript:null},mode:{Overwrite:"overwrite",Append:"append"},parsers:{None:"none",KvAsValues:"kv-as-values",KvAsArray:"kv-as-array",ArrayAsKv:"array-as-kv"},get:function(b,c,a){return typeof a=="undefined"?
b.data(c):b.data(c,a)},toDict:function(b,c,a){for(var d={},f=0;f<b.length;f++){var g=b[f];typeof g==="object"?d[c?g[c]:f]=a?g[a]:g:d[f]=g}return d},each:function(b,c,a){var d=Automtn.get(b,"key"),f=Automtn.get(b,"value"),g=Automtn.get(b,"parsemode"),e;if(String(Automtn.get(b,"onlyvalue")).toLowerCase()=="false"){$.isArray(c)&&(c=Automtn.toDict(c,d,f));e=c}else if($.isArray(c))e=Automtn.toDict(c,d,f);else{e={};$.each(c,function(a,b){if(typeof b==="string"||typeof b==="number")e[a]=b})}if(g=="kv-as-values"){var h=
0,i={};$.each(e,function(a,b){i[h++]=a;i[h++]=b});e=i}else if(g=="kv-as-array"){h=0;i={};$.each(e,function(a,b){i[h++]=[a,b]});e=i}else if(g=="array-as-kv"){h=0;i={};$.each(e,function(a,b){i[b[0]]=b[1]});e=i}$.each(e,a)},fill:function(b,c,a,d){var d=d||Automtn.mode.Overwrite,c=typeof c=="string"?{"?":c}:c,f=Automtn.get(b,"parsechild").toLowerCase();if(f=="auto"&&c.length==1||f=="yes")c=c[c.getKey()];(Automtn._fill[a]||Automtn._fill.div)(b,c,d)},call:function(b,c,a){if(typeof c==="string"){if(c=="")return null;
c=c.indexOf("function")===0?eval(c):typeof a==="undefined"?new Function(c):new Function("args",c)}else if(typeof c!=="function")return null;return c?c.call(b,a):null},_val:function(b,c,a,d){return(d||Automtn.get(b,"tpl")).replaceAll("{key}",c).replaceAll("{value}",a)},_fill:{ol:function(b,c,a){return Automtn._fill.ul(b,c,a)},ul:function(b,c,a){a==Automtn.mode.Overwrite&&b.html("");var d=Automtn.get(b,"tpl");if(d=="{value}"){d="<li>{value}</li>";Automtn.get(b,"tpl",d)}Automtn.each(b,c,function(a,c){var e=
Automtn._val(b,a,c,d);b.appendStr(e)})},select:function(b,c,a){a==Automtn.mode.Overwrite&&b.html("");var d=Automtn.get(b,"tpl");if(d=="{value}"){d="<option value='{key}'>{value}</li>";Automtn.get(b,"tpl",d)}Automtn.each(b,c,function(a,c){var e=Automtn._val(b,a,c,d);b.appendStr(e)})},table:function(b,c,a){var d=b.children("tbody"),f=d.length>0?d:b;a==Automtn.mode.Overwrite&&f.html("");a=Automtn.get(b,"tpl");a=="{value}"&&Automtn.get(b,"tpl","<td>{value}</td>");var g=Automtn.get(b,"tpl-tr");if(typeof g===
"undefined"){g="<tr data-key='{key}'>{value}</td>";Automtn.get(b,"tpl-tr",g)}Automtn.each(b,c,function(a,c){var d=$("<tr>"),j;j=$.isArray(c)?c:[c];(String(Automtn.get(b,"showkey"))=="1"||String(Automtn.get(b,"showkey"))=="true")&&$("<td>").attr("data-key",a).html(a).appendTo(d);for(var k=0;k<j.length;k++){var l=Automtn._val(b,a,j[k]);d.appendStr(l)}$(Automtn._val(b,a,d.html(),g)).appendTo(f);d.remove()})},div:function(b,c,a){typeof c=="string"&&(c={"?":c});a==Automtn.mode.Overwrite&&b.html("");Automtn.each(b,
c,function(a,c){var g=Automtn._val(b,a,c);b.appendStr(g)})}}};
{'fraction_non_alphanumeric': 0.31268786584401204, 'fraction_numerical': 0.005457997152349312, 'mean_word_length': 16.248294679399727, 'pattern_counts': {'":': 6, '<': 33, '<?xml version=': 0, '>': 31, 'https://': 2, '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': '7615194', 'n_tokens_mistral': 5314, 'n_tokens_neox': 5326, 'n_words': 234}