<commit_before>let express = require('express');
let Mustache = require('mustache');
let fs = require('fs');
let app = express();

class PresentationServer {

    constructor(presentations, config) {

        config = config ? config : {};
        presentations = presentations ? presentations : [];

        this.config = Object.assign({
            resources: __dirname + '/../node_modules',
            lib: __dirname + '/../node_modules/reveal.js/lib',
            themes: __dirname + '/../node_modules/reveal.js/css/theme',
            styles: __dirname + '/../node_modules/highlight.js/src/styles'
        }, config);

        this.presentationContainer = this.loadContainer(__dirname + '/templates/presentationContainer.mustache');
        this.configurationContainer = this.loadContainer(__dirname + '/templates/configurationContainer.mustache');

        presentations.unshift({
            id: '404',
            title: 'Presentation not found',
            path: __dirname + '/static/not-found.html'
        });

        presentations.unshift({
            id: 'demo',
            title: 'Demonstration',
            path: __dirname + '/static/demo.html'
        });

        this.presentations = presentations.map(presentation => {
            try {<commit_msg>now validating for duplicate presentation ids<commit_after>let express = require('express');
let Mustache = require('mustache');
let fs = require('fs');
let app = express();

class PresentationServer {

    constructor(presentations, config) {

        config = config ? config : {};
        presentations = presentations ? presentations : [];

        this.config = Object.assign({
            resources: __dirname + '/../node_modules',
            lib: __dirname + '/../node_modules/reveal.js/lib',
            themes: __dirname + '/../node_modules/reveal.js/css/theme',
            styles: __dirname + '/../node_modules/highlight.js/src/styles'
        }, config);

        this.presentationContainer = this.loadContainer(__dirname + '/templates/presentationContainer.mustache');
        this.configurationContainer = this.loadContainer(__dirname + '/templates/configurationContainer.mustache');

        presentations.unshift({
            id: '404',
            title: 'Presentation not found',
            path: __dirname + '/static/not-found.html'
        });

        presentations.unshift({
            id: 'demo',
            title: 'Demonstration',
            path: __dirname + '/static/demo.html'
        });

        presentations.forEach(function(presentation) {
            if (presentations.filter(p => p.id == presentation.id).length > 1) {
                throw "Duplicate presentation id detected, please rename '" + presentation.id + "'";
            }
        });

        this.presentations = presentations.map(presentation => {
            try {
{'fraction_non_alphanumeric': 0.1330049261083744, 'fraction_numerical': 0.0024630541871921183, 'mean_word_length': 2.3525943396226414, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7409027', 'n_tokens_mistral': 742, 'n_tokens_neox': 698, 'n_words': 147}