<commit_before>function log(type, msg) {
    baidu('#J_console').append('<p><span class="' + type + '">' + type + '</span>' + msg + '</p>');
    baidu('#J_console').get(0).scrollTop = 999999;
}

baidu(function (){

    (function highlightCurrentNav() {
        var nameMatcher = /\/(.+\.html)/;
        function matchName( href ) {
            var nameMatch = nameMatcher.exec(href);
            return nameMatch && nameMatch[1];
        }
        var currentName = matchName( window.location.href );
        baidu('div.demo-list a').filter( function( index ) {
            return matchName( this.href ) === currentName;
        }).addClass('selected').removeAttr('href');
    })();

    (function makeNavigationInBlank() {
        baidu('div.demo-list a').each( function( index ) {
            baidu(this).after('<a class="open-blank" href="' + this.href + '" target="_blank" title="在新窗口打开"></a>');
        });
    })();

    (function autoHeightForIE() {        
        baidu.browser.ie < 8 && baidu('body').height() < 500 && baidu('body').height( 500 );
    })();

    (function recognizeIFrame() {        
        window.top != window && baidu('body').addClass('iframe');
    })();

    (function addClearButtonForLogger() {        
        baidu('<a>')
            .text('清空')
            .attr('title','清空日志内容')
            .addClass('clear-console')
            .click( function() {<commit_msg>[Demo] 合并 Demo.js 两个函数<commit_after>function log(type, msg) {
    baidu('#J_console').append('<p><span class="' + type + '">' + type + '</span>' + msg + '</p>');
    baidu('#J_console').get(0).scrollTop = 999999;
}

baidu(function (){

    /**
     * 1. 高亮当前超链接
     * 2. 给每个超链接加上“在新窗口打开”
     */
    (function processNavigation() {
        var nameMatcher = /\/(.+\.html)/;
        function matchName( href ) {
            var nameMatch = nameMatcher.exec(href);
            return nameMatch && nameMatch[1];
        }
        var currentName = matchName( window.location.href );
        baidu('div.demo-list a').each( function() {
            baidu(this).after('<a class="open-blank" href="' + this.href + '" target="_blank" title="在新窗口打开"></a>');
            if ( matchName( this.href ) === currentName ) {
                baidu(this).addClass('selected').removeAttr('href');
            }
        });
    })();

    (function autoHeightForIE() {        
        baidu.browser.ie < 8 && baidu('body').height() < 500 && baidu('body').height( 500 );
    })();

    (function recognizeIFrame() {        
        window.top != window && baidu('body').addClass('iframe');
    })();

    (function addClearButtonForLogger() {        
        baidu('<a>')
            .text('清空')
            .attr('title','清空日志内容')
            .addClass('clear-console')
            .click( function() {
{'fraction_non_alphanumeric': 0.1964093357271095, 'fraction_numerical': 0.011490125673249552, 'mean_word_length': 2.247086247086247, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 17, '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': '877646', 'n_tokens_mistral': 925, 'n_tokens_neox': 906, 'n_words': 146}