<commit_before>/*!
 * template.js v0.2.0 (https://github.com/yanhaijing/template.js)
 * Copyright 2015 yanhaijing. All Rights Reserved
 * Licensed under MIT (https://github.com/yanhaijing/template.js/blob/master/MIT-LICENSE.txt)
 */
;(function(root, factory) {
    var template = factory(root);
    if (typeof define === 'function' && define.amd) {
        // AMD
        define('template', function() {
            return template;
        });
    } else if (typeof exports === 'object') {
        // Node.js
        module.exports = template;
    } else {
        // Browser globals
        var _template = root.template;

        template.noConflict = function() {
            if (root.template === template) {
                root.template = _template;
            }

            return template;
        };
        root.template = template;
    }
}(this, function(root) {
    'use strict';
    var o = {
        sTag: '<%',//开始标签
        eTag: '%>',//结束标签
        compress: false//是否压缩html
    };
    function isObj(obj) {
        return Object.prototype.toString.call(obj) === '[object Object]';
    }
    function extend() {
        var target = arguments[0] || {};
        var arrs = Array.prototype.slice.call(arguments, 1);
        var len = arrs.length;
     
        for (var i = 0; i < len; i++) {
            var arr = arrs[i];
            for (var name in arr) {
                target[name] = arr[name];
            }
     
        }
        return target;
    }
    function encodeHTML(source) {
        return String(source)
            .replace(/&/g,'&amp;')
            .replace(/</g,'&lt;')
            .replace(/>/g,'&gt;')
            .replace(/\\/g,'&#92;')
            .replace(/"/g,'&quot;')
            .replace(/'/g,'&#39;');
    };
    function compress(html) {
        return html.replace(/\s+/g, ' ').replace(/<!--[\w\W]*?-->/g, '');
    }
    function compiler(tpl, opt) {
        var reg = new RegExp(opt.sTag + '(.*?)' + opt.eTag, 'g');// /<%(.*?)%>/g;
        var match;
        var point = 0;
        var code = '';
        function add(line, js) {
            //非js
            if (!js) {
                code += '__r__.push("' + line.replace(/"/g, '\\"') + '");\n';
                return 0;
            }   
            //原生js
            if (line.search(/^(:|=)/) === -1) {
                code += line + '\n';
                return 1;
            }
            var html;
            if (line.search(/^=/) !== -1) {
                //默认输出
                html = line.slice(1);
                code += '__r__.push(__encodeHTML__(' + html + '));\n';
                return 2;
            } else if (line.search(/^:=/) !== -1) {
                //不转义
                html = line.slice(2);
                code += '__r__.push(' + html + ');\n';
                return 3;
            } else if (line.search(/^:u=/) !== -1) {
                //URL转义
                html = line.slice(3);
                code += '__r__.push(encodeURI(' + html + '));\n';
                return 4;
            }
            return 5;
        }
        while(match = reg.exec(tpl)){<commit_msg>容错处理 1.支持js语句末尾不加分号，会自动添加。如：<%var a = 1%><commit_after>/*!
 * template.js v0.2.0 (https://github.com/yanhaijing/template.js)
 * Copyright 2015 yanhaijing. All Rights Reserved
 * Licensed under MIT (https://github.com/yanhaijing/template.js/blob/master/MIT-LICENSE.txt)
 */
;(function(root, factory) {
    var template = factory(root);
    if (typeof define === 'function' && define.amd) {
        // AMD
        define('template', function() {
            return template;
        });
    } else if (typeof exports === 'object') {
        // Node.js
        module.exports = template;
    } else {
        // Browser globals
        var _template = root.template;

        template.noConflict = function() {
            if (root.template === template) {
                root.template = _template;
            }

            return template;
        };
        root.template = template;
    }
}(this, function(root) {
    'use strict';
    var o = {
        sTag: '<%',//开始标签
        eTag: '%>',//结束标签
        compress: false//是否压缩html
    };
    function isObj(obj) {
        return Object.prototype.toString.call(obj) === '[object Object]';
    }
    function extend() {
        var target = arguments[0] || {};
        var arrs = Array.prototype.slice.call(arguments, 1);
        var len = arrs.length;
     
        for (var i = 0; i < len; i++) {
            var arr = arrs[i];
            for (var name in arr) {
                target[name] = arr[name];
            }
     
        }
        return target;
    }
    function encodeHTML(source) {
        return String(source)
            .replace(/&/g,'&amp;')
            .replace(/</g,'&lt;')
            .replace(/>/g,'&gt;')
            .replace(/\\/g,'&#92;')
            .replace(/"/g,'&quot;')
            .replace(/'/g,'&#39;');
    };
    function compress(html) {
        return html.replace(/\s+/g, ' ').replace(/<!--[\w\W]*?-->/g, '');
    }
    function compiler(tpl, opt) {
        var reg = new RegExp(opt.sTag + '(.*?)' + opt.eTag, 'g');// /<%(.*?)%>/g;
        var match;
        var point = 0;
        var code = '';
        function add(line, js) {
            //非js
            if (!js) {
                code += '__r__.push("' + line.replace(/"/g, '\\"') + '");\n';
                return 0;
            }   
            //原生js
            if (line.search(/^(:|=)/) === -1) {
                code += line + ';\n';
                return 1;
            }
            var html;
            if (line.search(/^=/) !== -1) {
                //默认输出
                html = line.slice(1);
                code += '__r__.push(__encodeHTML__(' + html + '));\n';
                return 2;
            } else if (line.search(/^:=/) !== -1) {
                //不转义
                html = line.slice(2);
                code += '__r__.push(' + html + ');\n';
                return 3;
            } else if (line.search(/^:u=/) !== -1) {
                //URL转义
                html = line.slice(3);
                code += '__r__.push(encodeURI(' + html + '));\n';
                return 4;
            }
            return 5;
        }
        while(match = reg.exec(tpl)){
{'fraction_non_alphanumeric': 0.18274923987838054, 'fraction_numerical': 0.009281485037606016, 'mean_word_length': 1.3199703043801039, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 12, 'https://': 4, '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': '4955863', 'n_tokens_mistral': 2014, 'n_tokens_neox': 1963, 'n_words': 402}