<commit_before>(function() {
    "use strict";

    function AE( config ) {
        this.className  = config && config.className  || 'animated-ellipsis';
        this.style      = config && config.style      || undefined;
        this.spacing    = config && config.spacing    || '0.1rem';
        this.fontSize   = config && config.fontSize   || '2rem';
        this.marginLeft = config && config.marginLeft || '0.1rem';
        this.steps      = 3; 
        this.duration   = 2;
        this.perDelay   = 0.2;

        this.insertStyleNode();
    }

    AE.prototype.insertStyleNode = function() {
        const style = document.createElement( 'style' );
        style.type = 'text/css';
        style.innerHTML = ' \
            @-webkit-keyframes animated-ellipsis { \
                0%   { opacity: 0; } \
                50%  { opacity: 0; } \
                100% { opacity: 1; } \
            } \
            @keyframes animated-ellipsis { \
                0%   { opacity: 0; } \
                50%  { opacity: 0; } \
                100% { opacity: 1; } \
            }';
        this.style = document.getElementsByTagName( 'head' )[ 0 ].appendChild( style );
    }

    function animate( elem ) {
        var wrapper = elem;
        const steps = AnimatedEllipsis.steps;
        const perDelay = AnimatedEllipsis.perDelay;
        const marginLeft = wrapper.dataset.marginLeft || AnimatedEllipsis.marginLeft;
        const spacing = wrapper.dataset.spacing || AnimatedEllipsis.spacing;

        wrapper.style.marginLeft = marginLeft;
        wrapper.style.fontSize = AnimatedEllipsis.fontSize;

        for ( var iStep = 0; iStep < steps; ++iStep ) {
            var elemSpan = document.createElement( 'span' );
            const delay = iStep * perDelay;

            elemSpan.className = '.$step' + iStep;
            elemSpan.innerHTML = '.';
            var cssText = '\
                opacity: 0; \
                -webkit-animation: animated-ellipsis ' + AnimatedEllipsis.duration + 's infinite; \
                animation: animated-ellipsis ' + AnimatedEllipsis.duration + 's infinite; \
                -webkit-animation-delay: ' + delay+ 's; \
                animation-delay: ' + delay + 's; \
            ';

            if ( iStep !== 0 ) {
                cssText += ( 'margin-left: ' + spacing + ';' );
            }

            elemSpan.style.cssText = cssText;
            elemSpan = wrapper.appendChild( elemSpan );
        }
    }

    window.HTMLElement.prototype.animateEllipsis = function() {
        animate( this );
    };

    window.NodeList.prototype.animateEllipsis = function() {
        for ( elem of this ) {
            animate( elem );
        }
    }

    window.HTMLElement.prototype.stopAnimatingEllipsis = function() {
        var wrapper = this;
        while ( wrapper.hasChildNodes() ) {
            wrapper.removeChild( wrapper.lastChild );
        }

        delete wrapper.style.marginLeft;
    };

    AnimatedEllipsis = new AE();

    module.exports = AnimatedEllipsis;

}());
<commit_msg>Fall back to the basic for-loop.<commit_after>(function() {
    "use strict";

    function AE( config ) {
        this.className  = config && config.className  || 'animated-ellipsis';
        this.style      = config && config.style      || undefined;
        this.spacing    = config && config.spacing    || '0.1rem';
        this.fontSize   = config && config.fontSize   || '2rem';
        this.marginLeft = config && config.marginLeft || '0.1rem';
        this.steps      = 3; 
        this.duration   = 2;
        this.perDelay   = 0.2;

        this.insertStyleNode();
    }

    AE.prototype.insertStyleNode = function() {
        const style = document.createElement( 'style' );
        style.type = 'text/css';
        style.innerHTML = ' \
            @-webkit-keyframes animated-ellipsis { \
                0%   { opacity: 0; } \
                50%  { opacity: 0; } \
                100% { opacity: 1; } \
            } \
            @keyframes animated-ellipsis { \
                0%   { opacity: 0; } \
                50%  { opacity: 0; } \
                100% { opacity: 1; } \
            }';
        this.style = document.getElementsByTagName( 'head' )[ 0 ].appendChild( style );
    }

    function animate( elem ) {
        var wrapper = elem;
        const steps = AnimatedEllipsis.steps;
        const perDelay = AnimatedEllipsis.perDelay;
        const marginLeft = wrapper.dataset.marginLeft || AnimatedEllipsis.marginLeft;
        const spacing = wrapper.dataset.spacing || AnimatedEllipsis.spacing;

        wrapper.style.marginLeft = marginLeft;
        wrapper.style.fontSize = AnimatedEllipsis.fontSize;

        for ( var iStep = 0; iStep < steps; ++iStep ) {
            var elemSpan = document.createElement( 'span' );
            const delay = iStep * perDelay;

            elemSpan.className = '.$step' + iStep;
            elemSpan.innerHTML = '.';
            var cssText = '\
                opacity: 0; \
                -webkit-animation: animated-ellipsis ' + AnimatedEllipsis.duration + 's infinite; \
                animation: animated-ellipsis ' + AnimatedEllipsis.duration + 's infinite; \
                -webkit-animation-delay: ' + delay+ 's; \
                animation-delay: ' + delay + 's; \
            ';

            if ( iStep !== 0 ) {
                cssText += ( 'margin-left: ' + spacing + ';' );
            }

            elemSpan.style.cssText = cssText;
            elemSpan = wrapper.appendChild( elemSpan );
        }
    }

    window.HTMLElement.prototype.animateEllipsis = function() {
        animate( this );
    };

    window.NodeList.prototype.animateEllipsis = function() {
        for ( var iNode = 0; iNode < this.length; ++iNode ) {
            var elem = this[ iNode ];
            animate( elem );
        }
    };

    window.HTMLElement.prototype.stopAnimatingEllipsis = function() {
        var wrapper = this;
        while ( wrapper.hasChildNodes() ) {
            wrapper.removeChild( wrapper.lastChild );
        }

        delete wrapper.style.marginLeft;
    };

    AnimatedEllipsis = new AE();

    module.exports = AnimatedEllipsis;

}());

{'fraction_non_alphanumeric': 0.12417138237671786, 'fraction_numerical': 0.010185933710590138, 'mean_word_length': 1.6779220779220778, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, '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': '5059489', 'n_tokens_mistral': 1870, 'n_tokens_neox': 1732, 'n_words': 356}