<commit_before>/* !
 * "position: sticky" jQuery plugin / polyfill
 * https://github.com/regru/i-sticky
 * License: MIT
 */
( function( $ ) {
    var prefixTestList       = [ '', '-webkit-', '-ms-', '-moz-', '-o-' ],
        stickyTestElement    = document.createElement('div'),

        hasNativeSupport     = false,
        areWindowEventsAttached = false,
        isAnimationRequested = false,
        lastKnownScrollTop   = 0,
        lastKnownScrollLeft  = 0,

        // requestAnimationFrame may be prefixed
        requestAnimationFrame = window.requestAnimationFrame
            || window.webkitRequestAnimationFrame
            || window.mozRequestAnimationFrame,
        id        = 0,
        stickies  = [],
        methods   = { unstick : function() {
            var currentId = $( this ).data('sticky-id'),
                removeIndex,
                el;

            for ( var i = stickies.length - 1; i >= 0; i-- ) {
                if ( stickies[i].id == currentId ) {
                    removeIndex = i;
                    break;
                }
            }

            if ( typeof removeIndex !== 'undefined' ) {
                el = stickies.splice( removeIndex, 1 );
            }

            if ( typeof el !== 'undefined' ) {
                $( this )
                        .removeAttr('style')
                        .next( '.' + el[0].options.holderClass )
                            .remove();
            }

            return this;
        } };

    for ( var i = 0, l = prefixTestList.length; i < l; i++ ) {
        stickyTestElement.setAttribute( 'style', 'position:' + prefixTestList[i] + 'sticky' );

        if ( stickyTestElement.style.position !== '' ) {
            hasNativeSupport = true;
            break;
        }
    }

    $.fn.iSticky = function( methodOrOptions ) {
        if ( hasNativeSupport ) {
            if ( typeof methodOrOptions === 'object' && methodOrOptions.force ) {
                attachWindowEvents();
            }
            else {
                return this;
            }
        }

        if ( typeof methodOrOptions === 'string' && methods[methodOrOptions] ) {
            return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ) );
        }

        var options = $.extend( {
                holderClass      : 'i-sticky__holder',
                holderAutoHeight : true,
                debug            : false,
            }, methodOrOptions ),
            selector = this.selector;

        return this.each( function() {
            var $this = $( this ),
                id    = 'sticky-' + ++id,
                topCSSstring,
                bottomCSSstring,
                item;
<commit_msg>fix for multiple stickies on the same page<commit_after>/* !
 * "position: sticky" jQuery plugin / polyfill
 * https://github.com/regru/i-sticky
 * License: MIT
 */
( function( $ ) {
    var prefixTestList       = [ '', '-webkit-', '-ms-', '-moz-', '-o-' ],
        stickyTestElement    = document.createElement('div'),

        hasNativeSupport     = false,
        areWindowEventsAttached = false,
        isAnimationRequested = false,
        lastKnownScrollTop   = 0,
        lastKnownScrollLeft  = 0,

        // requestAnimationFrame may be prefixed
        requestAnimationFrame = window.requestAnimationFrame
            || window.webkitRequestAnimationFrame
            || window.mozRequestAnimationFrame,
        idCounter = 0,
        stickies  = [],
        methods   = { unstick : function() {
            var currentId = $( this ).data('sticky-id'),
                removeIndex,
                el;

            for ( var i = stickies.length - 1; i >= 0; i-- ) {
                if ( stickies[i].id == currentId ) {
                    removeIndex = i;
                    break;
                }
            }

            if ( typeof removeIndex !== 'undefined' ) {
                el = stickies.splice( removeIndex, 1 );
            }

            if ( typeof el !== 'undefined' ) {
                $( this )
                        .removeAttr('style')
                        .next( '.' + el[0].options.holderClass )
                            .remove();
            }

            return this;
        } };

    for ( var i = 0, l = prefixTestList.length; i < l; i++ ) {
        stickyTestElement.setAttribute( 'style', 'position:' + prefixTestList[i] + 'sticky' );

        if ( stickyTestElement.style.position !== '' ) {
            hasNativeSupport = true;
            break;
        }
    }

    $.fn.iSticky = function( methodOrOptions ) {
        if ( hasNativeSupport ) {
            if ( typeof methodOrOptions === 'object' && methodOrOptions.force ) {
                attachWindowEvents();
            }
            else {
                return this;
            }
        }

        if ( typeof methodOrOptions === 'string' && methods[methodOrOptions] ) {
            return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ) );
        }

        var options = $.extend( {
                holderClass      : 'i-sticky__holder',
                holderAutoHeight : true,
                debug            : false,
            }, methodOrOptions ),
            selector = this.selector;

        return this.each( function() {
            var $this = $( this ),
                id    = 'sticky-' + ++idCounter,
                topCSSstring,
                bottomCSSstring,
                item;

{'fraction_non_alphanumeric': 0.11820503465888361, 'fraction_numerical': 0.003283473184968989, 'mean_word_length': 1.3542292829540576, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '1939619', 'n_tokens_mistral': 1470, 'n_tokens_neox': 1377, 'n_words': 309}