<commit_before>/**
 * Returns date object
 *
 * @param int value  Time in seconds counted from midnight
 * @returns Date Date object based on input value
 */
function parseInterval(value) {
    var result = new Date(1, 1, 1);
    result.setMilliseconds(value * 1000);
    return result;
}


jQuery(function($) {
    loading = $('#loading');

    $.getJSON('/api/v1/users', function(result) {
        var $dropdown = $('#user_id');
        $.each(result, function(item) {
            $dropdown.append(
                $('<option />').data('image_url', this.image_url)
                               .val(this.user_id)
                               .text(this.name)
            );
        });

        $dropdown.change(function(e) {
            var $option = $('option:selected', this);
            $('#user_info').html(
                $('<img/>').attr('src', $option.data('image_url'))
                           .attr('alt', $option.text())
                           .attr('title', $option.text())
            );
        });

        $dropdown.show();
        loading.hide();
    });
});<commit_msg>Added comments to javascript code.<commit_after>/**
 * Returns date object
 *
 * @param int value  Time in seconds counted from midnight
 * @returns Date Date object based on input value
 */
function parseInterval(value) {
    var result = new Date(1, 1, 1);
    result.setMilliseconds(value * 1000);
    return result;
}


jQuery(function($) {
    loading = $('#loading');

    /**
     * Get users list after the page DOM is loaded
     */
    $.getJSON('/api/v1/users', function(result) {
        var $dropdown = $('#user_id');

        // Populate users dropdown with data
        $.each(result, function(item) {
            $dropdown.append(
                $('<option />').data('image_url', this.image_url)
                               .val(this.user_id)
                               .text(this.name)
            );
        });

        // Display user image when dropdown value changes
        $dropdown.change(function(e) {
            var $option = $('option:selected', this);
            $('#user_info').html(
                $('<img/>').attr('src', $option.data('image_url'))
                           .attr('alt', $option.text())
                           .attr('title', $option.text())
            );
        });

        $dropdown.show();
        loading.hide();
    });
});
{'fraction_non_alphanumeric': 0.15984974958263773, 'fraction_numerical': 0.00667779632721202, 'mean_word_length': 1.6962879640044994, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1774120', 'n_tokens_mistral': 667, 'n_tokens_neox': 637, 'n_words': 151}