<commit_before>//Change Qimessaging connection if robot name is passed in URL
if (robotAddress != '') {
    $.qim = new QiSession(robotAddress);
}

function get_robot_name() {
    $.getService('ALSystem', function(ALSystem) {
        ALSystem.robotName().done(
            function (name){
                get_robot_color(name);
                $('#robot_name').html("DJ " + name ).css({'color': colors[robot_color]});
            })
    });
}

function get_robot_icon() {
    $.getService('ALSystem', function(ALSystem) {
        ALSystem.robotIcon().done(
            function (buffer){
                $('#logo').html("<img src=data:image/png;base64," + buffer + "></img>");
            })
    });
}

function get_robot_color(name) {
    name = name.toLowerCase();
    switch (name) {
    case "raphael":
        robot_color = "red";
        break;
    case "michelangelo":
        robot_color = "orange";
        break;
    case "donatello":
        robot_color = "dpurp";
        break;
    case "leonardo":
        robot_color = "blue";
        break;
    default:
        var sum = $.map(name.split(""), function(c) {return c.charCodeAt()}).reduce(function(a, b) {return a + b})
        color_idx = sum % Object.keys(colors).length
        robot_color = Object.keys(colors)[color_idx]           
    }
    $('body').css('background-color', colors[robot_color]);
    $('<style>a:active{color:' + colors[robot_color] + '}</style>').appendTo("head");
}

function get_language() {
    $.getService('ALSpeechRecognition', function(ALSpeechRecognition) {
        ALSpeechRecognition.getLanguage().done(function (lang){
            var clang = $('#language_value').text();
            if (lang != clang) {
                $('#language_value').html(lang);
                switch(lang) {
                case "English":
                    switch_to_english();
                    break;
                case "Spanish":
                    switch_to_spanish();
                    break;
                case "French":
                    switch_to_french();
                    break;
                default:
                    console.log("Language currently unsupported; default to english");
                    switch_to_english();
                }
            }
        })
    });
}

function switch_to_english() {
    //
}

function switch_to_french() {
    //
}

function switch_to_spanish() {
    //
}

function generateQueue() {
    // Do stuff with queue
    $.getService('ALMusic', function(ALMusic) {
        ALMusic.getQueue().done(
            function(queue) {

                var id;
                var title;
                var artist;
                var album;
                var cover;

                $('#active_song').fadeOut().empty();
                for (song in queue['active']) {
                    id = queue['active'][song]['id'];
                    title = queue['active'][song]['title'];
                    artist = queue['active'][song]['artist'];
                    album = queue['active'][song]['album'];
                    cover = queue['active'][song]['cover'];
                    
                    $('#active_song').append(
                        '<img class="asong_cover" src="' + cover + '" alt="' + title + '"/>'+
                            '<div class="asong_info" id="song_data">' +
                            '<ul>' +
                            '<li class="asong_title"><span class="asong_title_label">' + title + '</span></li>'+
                            '<li class="asong_artist"><span class="asong_artist_label">' + artist + '</span></li>'+
                            '<li class="asong_album"><span class="asong_album_label">' + album + '</span></li>'+
                            '</ul>').fadeIn();
                }
                $('#dynamic_c').empty();
                for (song in queue['queue']) {
                    id = queue['queue'][song]['id'];
                    title = queue['queue'][song]['title'];
                    artist = queue['queue'][song]['artist'];

                    $('#dynamic_c').append(
                        '<div id="' + id + '" class="queue_card card card_shadow">' +
                            '<div class="queue_card_info">' +
                            '<div class="qc_info_field">' +
                            '<span class="title_label">' + title + '</span></div>' +
                            '<div class="qc_info_field">' + 
                            '<span class="artist_label">' + artist + '</span></div></div>' +
                            '<div class="queue_card_controls">' +
                            '<div class="qc_controls_reorder">' +
                            '<div><a id="' + id + '-Move_Up" class="btn" href="#">' +
                            '<i class="fa fa-sort-asc"></i></a></div>' +
                            '<div><a id="' + id + '-Move_Down" class="btn" href="#">' +
                            '<i class="fa fa-sort-desc"></i></a></div></div>' +
                            '<div id="' + id + '-controls-remove" class="qc_controls_remove">' +
                            '<a id="' + id + '-Remove" class="btn" href="#"><i class="fa fa-remove"></i>');
                }
            })
    });
}



////////////////////<commit_msg>more fixed width icons<commit_after>//Change Qimessaging connection if robot name is passed in URL
if (robotAddress != '') {
    $.qim = new QiSession(robotAddress);
}

function get_robot_name() {
    $.getService('ALSystem', function(ALSystem) {
        ALSystem.robotName().done(
            function (name){
                get_robot_color(name);
                $('#robot_name').html("DJ " + name ).css({'color': colors[robot_color]});
            })
    });
}

function get_robot_icon() {
    $.getService('ALSystem', function(ALSystem) {
        ALSystem.robotIcon().done(
            function (buffer){
                $('#logo').html("<img src=data:image/png;base64," + buffer + "></img>");
            })
    });
}

function get_robot_color(name) {
    name = name.toLowerCase();
    switch (name) {
    case "raphael":
        robot_color = "red";
        break;
    case "michelangelo":
        robot_color = "orange";
        break;
    case "donatello":
        robot_color = "dpurp";
        break;
    case "leonardo":
        robot_color = "blue";
        break;
    default:
        var sum = $.map(name.split(""), function(c) {return c.charCodeAt()}).reduce(function(a, b) {return a + b})
        color_idx = sum % Object.keys(colors).length
        robot_color = Object.keys(colors)[color_idx]           
    }
    $('body').css('background-color', colors[robot_color]);
    $('<style>a:active{color:' + colors[robot_color] + '}</style>').appendTo("head");
}

function get_language() {
    $.getService('ALSpeechRecognition', function(ALSpeechRecognition) {
        ALSpeechRecognition.getLanguage().done(function (lang){
            var clang = $('#language_value').text();
            if (lang != clang) {
                $('#language_value').html(lang);
                switch(lang) {
                case "English":
                    switch_to_english();
                    break;
                case "Spanish":
                    switch_to_spanish();
                    break;
                case "French":
                    switch_to_french();
                    break;
                default:
                    console.log("Language currently unsupported; default to english");
                    switch_to_english();
                }
            }
        })
    });
}

function switch_to_english() {
    //
}

function switch_to_french() {
    //
}

function switch_to_spanish() {
    //
}

function generateQueue() {
    // Do stuff with queue
    $.getService('ALMusic', function(ALMusic) {
        ALMusic.getQueue().done(
            function(queue) {

                var id;
                var title;
                var artist;
                var album;
                var cover;

                $('#active_song').fadeOut().empty();
                for (song in queue['active']) {
                    id = queue['active'][song]['id'];
                    title = queue['active'][song]['title'];
                    artist = queue['active'][song]['artist'];
                    album = queue['active'][song]['album'];
                    cover = queue['active'][song]['cover'];
                    
                    $('#active_song').append(
                        '<img class="asong_cover" src="' + cover + '" alt="' + title + '"/>'+
                            '<div class="asong_info" id="song_data">' +
                            '<ul>' +
                            '<li class="asong_title"><span class="asong_title_label">' + title + '</span></li>'+
                            '<li class="asong_artist"><span class="asong_artist_label">' + artist + '</span></li>'+
                            '<li class="asong_album"><span class="asong_album_label">' + album + '</span></li>'+
                            '</ul>').fadeIn();
                }
                $('#dynamic_c').empty();
                for (song in queue['queue']) {
                    id = queue['queue'][song]['id'];
                    title = queue['queue'][song]['title'];
                    artist = queue['queue'][song]['artist'];

                    $('#dynamic_c').append(
                        '<div id="' + id + '" class="queue_card card card_shadow">' +
                            '<div class="queue_card_info">' +
                            '<div class="qc_info_field">' +
                            '<span class="title_label">' + title + '</span></div>' +
                            '<div class="qc_info_field">' + 
                            '<span class="artist_label">' + artist + '</span></div></div>' +
                            '<div class="queue_card_controls">' +
                            '<div class="qc_controls_reorder">' +
                            '<div><a id="' + id + '-Move_Up" class="btn" href="#">' +
                            '<i class="fa fa-sort-asc fa-fw"></i></a></div>' +
                            '<div><a id="' + id + '-Move_Down" class="btn" href="#">' +
                            '<i class="fa fa-sort-desc fa-fw"></i></a></div></div>' +
                            '<div id="' + id + '-controls-remove" class="qc_controls_remove">' +
                            '<a id="' + id + '-Remove" class="btn" href="#"><i class="fa fa-remove fa-fw"></i>');
                }
            })
    });
}



////////////////////
{'fraction_non_alphanumeric': 0.17099424039278632, 'fraction_numerical': 0.00037767916155226133, 'mean_word_length': 1.491063029162747, 'pattern_counts': {'":': 14, '<': 103, '<?xml version=': 0, '>': 103, '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': '4637961', 'n_tokens_mistral': 2980, 'n_tokens_neox': 2892, 'n_words': 514}