<commit_before>var main = function () {
    var datasetKey = getDatasetKeyFromURL();
    getMetrics(datasetKey,addMetricsToHomePage);
};

var addMetricsToHomePage = function (metrics) {
    var html = '';
    var anchor = $('#summary');
    
    // Add basis of record bar
    html = html + basisOfRecordBar(metrics);
    anchor.find('.content').prepend(html);

    // Add achievements
    html = '';
    html = html + occurrencesAchievement(metrics); // Occurrences achievement
    html = html + georeferenceAchievement(metrics); // Georeference achievement
    html = html + multimediaAchievement(metrics); // Multimedia achievement
    if (html !== '') {
        $('#firstContent').append('<p id="achievements">' + html + '</p>');
    }

    // Add image thumbnails
    html = imageThumbnails(metrics);
    anchor.after(html);

    // Activate tooltip
    $('[data-toggle="tooltip"]').tooltip();
};

var imageThumbnails = function (metrics) {
    var html = "",
        images = JSON.parse(metrics.images_sample),
        thumbnails = [];

    if (images !== null) {
        // Create list of thumbnails with non-empty links
        $.each (images, function (gbifID, url) {
            if (url !== '') {
                thumbnails.push('<a href="http://gbif.org/occurrence/' + gbifID + '" class="thumbnail"><img src="' + url + '" alt="Image for occurrence ' + gbifID + '"></a>');
            }
        });

        // If thumbnails available, add an images section
        if (thumbnails.length > 0) {
            html =  '<article id="imagesSample">' +
                            '<header></header>' +
                            '<div class="content">' +
                                '<div class="header"><div class="left"><h2>Sample of images</h2></div></div>' +
                                '<div class="fullwidth">' +
                                    '<div class="thumbnails clearfix">' +
                                        thumbnails.join('') +<commit_msg>Single quote<commit_after>var main = function () {
    var datasetKey = getDatasetKeyFromURL();
    getMetrics(datasetKey,addMetricsToHomePage);
};

var addMetricsToHomePage = function (metrics) {
    var html = '';
    var anchor = $('#summary');
    
    // Add basis of record bar
    html = html + basisOfRecordBar(metrics);
    anchor.find('.content').prepend(html);

    // Add achievements
    html = '';
    html = html + occurrencesAchievement(metrics); // Occurrences achievement
    html = html + georeferenceAchievement(metrics); // Georeference achievement
    html = html + multimediaAchievement(metrics); // Multimedia achievement
    if (html !== '') {
        $('#firstContent').append('<p id="achievements">' + html + '</p>');
    }

    // Add image thumbnails
    html = imageThumbnails(metrics);
    anchor.after(html);

    // Activate tooltip
    $('[data-toggle="tooltip"]').tooltip();
};

var imageThumbnails = function (metrics) {
    var html = '',
        images = JSON.parse(metrics.images_sample),
        thumbnails = [];

    if (images !== null) {
        // Create list of thumbnails with non-empty links
        $.each (images, function (gbifID, url) {
            if (url !== '') {
                thumbnails.push('<a href="http://gbif.org/occurrence/' + gbifID + '" class="thumbnail"><img src="' + url + '" alt="Image for occurrence ' + gbifID + '"></a>');
            }
        });

        // If thumbnails available, add an images section
        if (thumbnails.length > 0) {
            html =  '<article id="imagesSample">' +
                            '<header></header>' +
                            '<div class="content">' +
                                '<div class="header"><div class="left"><h2>Sample of images</h2></div></div>' +
                                '<div class="fullwidth">' +
                                    '<div class="thumbnails clearfix">' +
                                        thumbnails.join('') +
{'fraction_non_alphanumeric': 0.15559484718363223, 'fraction_numerical': 0.0015155342258145997, 'mean_word_length': 2.0697674418604652, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7420213', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1081, 'n_words': 245}