<commit_before>(function() {
    var bgPage = chrome.extension.getBackgroundPage();
    var player = bgPage.player;

    /*
     * Player Options
     */
    $('input[name=playmode]:radio').each(function() {
        var mode = player.playmode();
        if ($(this).val() == mode)
            $(this).attr('checked', 'true')
    });

    $('input[name=playmode]:radio').click(function() {
        var mode = $(this).val();
        player.playmode(mode);
    });

    /*
     * Export / Import
     */
    exportPlaylist();
    $('#submit-import').click(importPlaylist);
    $('#refresh-export').click(exportPlaylist);

    $('#sidebar li').click(function() {
        $('.current').removeClass('current');

        var targetId = $(this).attr('rel');
        $(this).addClass('current');
        $('#' + targetId).addClass('current');
    });

    $('#sidebar li:first').click();

    function importPlaylist() {
        var msg = $('#import-export-page .msg');
        msg.removeClass('success error');

        var json = $('#import').val();
        var result;
        try {
            result = JSON.parse(json);
        }
        catch (error) {
            msg.addClass('error')
                .text('The imported text is not a valid JSON string.');
            return;
        }

        if (!$.isArray(result)) {
            msg.addClass('error')
                .text('The imported object is not a array of video id-title pair.');
            return;
        }

        const idPattern = /^[a-zA-Z0-9\-_]{11}$/;
        var playlist = new Array();
        for (var index = 0; index < result.length; index++)
        {
            var id = result[index].id;
            var title = result[index].title;<commit_msg>Reorder some lines of code.<commit_after>(function() {
    var bgPage = chrome.extension.getBackgroundPage();
    var player = bgPage.player;

    /*
     * Sidebar Control
     */
    $('#sidebar li').click(function() {
        $('.current').removeClass('current');

        var targetId = $(this).attr('rel');
        $(this).addClass('current');
        $('#' + targetId).addClass('current');
    });

    $('#sidebar li:first').click();

    /*
     * Player Options
     */
    $('input[name=playmode]:radio').each(function() {
        var mode = player.playmode();
        if ($(this).val() == mode)
            $(this).attr('checked', 'true')
    });

    $('input[name=playmode]:radio').click(function() {
        var mode = $(this).val();
        player.playmode(mode);
    });

    /*
     * Export / Import
     */
    exportPlaylist();
    $('#submit-import').click(importPlaylist);
    $('#refresh-export').click(exportPlaylist);

    function importPlaylist() {
        var msg = $('#import-export-page .msg');
        msg.removeClass('success error');

        var json = $('#import').val();
        var result;
        try {
            result = JSON.parse(json);
        }
        catch (error) {
            msg.addClass('error')
                .text('The imported text is not a valid JSON string.');
            return;
        }

        if (!$.isArray(result)) {
            msg.addClass('error')
                .text('The imported object is not a array of video id-title pair.');
            return;
        }

        const idPattern = /^[a-zA-Z0-9\-_]{11}$/;
        var playlist = new Array();
        for (var index = 0; index < result.length; index++)
        {
            var id = result[index].id;
            var title = result[index].title;
{'fraction_non_alphanumeric': 0.17963386727688788, 'fraction_numerical': 0.002860411899313501, 'mean_word_length': 1.9263598326359832, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '318650', 'n_tokens_mistral': 996, 'n_tokens_neox': 976, 'n_words': 209}