<commit_before>// Copyright (c) <NAME>, 2016. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.

import moment from 'moment';
import { Tools } from './Tools';
import { Tracking } from './Tracking';

export class App {
    constructor() {}

    async initialize() {
        const element = document.getElementById('build-date');

        if (element) {
            const timestamp = element.getAttribute('data-timestamp');
            const format = element.getAttribute('data-format');

            const value = moment(timestamp, format);

            if (value.isValid()) {
                let text: string = value.fromNow();
                element.textContent = `| Last updated ${text}`;
            }
        }

        const tracking = new Tracking();
        tracking.initialize();

        const tools = new Tools();
        tools.initialize();

        setTimeout(() => {
            const images = document.querySelectorAll('img.lazy');
            for (const image of images) {
                image.setAttribute('src', image.getAttribute('data-original'));
            }
        }, 500);

        if ('serviceWorker' in navigator) {
            (navigator as any).serviceWorker
                .register('/service-worker.js')
                .then(() => {})
                .catch((err: any) =>
                    console.warn('Failed to register Service Worker: ', err)
                );
        }
    }
}<commit_msg>Encode value<commit_after>// Copyright (c) <NAME>, 2016. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.

import moment from 'moment';
import { Tools } from './Tools';
import { Tracking } from './Tracking';

export class App {
    constructor() {}

    async initialize() {
        const element = document.getElementById('build-date');

        if (element) {
            const timestamp = element.getAttribute('data-timestamp');
            const format = element.getAttribute('data-format');

            const value = moment(timestamp, format);

            if (value.isValid()) {
                let text: string = value.fromNow();
                element.textContent = `| Last updated ${text}`;
            }
        }

        const tracking = new Tracking();
        tracking.initialize();

        const tools = new Tools();
        tools.initialize();

        setTimeout(() => {
            const images = document.querySelectorAll('img.lazy');
            for (const image of images) {
                let url = image.getAttribute('data-original');
                url = encodeURI(url);
                image.setAttribute('src', url);
            }
        }, 500);

        if ('serviceWorker' in navigator) {
            (navigator as any).serviceWorker
                .register('/service-worker.js')
                .then(() => {})
                .catch((err: any) =>
                    console.warn('Failed to register Service Worker: ', err)
                );
        }
    }
}
{'fraction_non_alphanumeric': 0.12580645161290321, 'fraction_numerical': 0.005806451612903226, 'mean_word_length': 1.8165304268846503, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '1198834', 'n_tokens_mistral': 770, 'n_tokens_neox': 736, 'n_words': 222}