<commit_before>(function($){
    $.fn.seAccordion = function(options) {
        var defaults = {
            header: 'h1',
            content: 'div',
            speed: 'slow',
            easing: 'swing',
            singleOpen: true,
            allowAllClosed: false,
            triggerEvent: 'click'
        };
        var params = $.extend(defaults, options);

        return this.each(function() {
            var obj = $(this),
                triggerEvent = params.triggerEvent !== 'mouseover' ? 'touchstart click' : 'mouseover',
                slideOptions = {
                    duration: params.speed,
                    easing: params.easing
                };

            if(params.singleOpen === true && params.allowAllClosed === false)
                obj.children(params.content).first().addClass('opened');

            obj.children(params.header).css('cursor', 'pointer');
            obj.children(params.content + ':not(.opened)').css('display', 'none');

            obj.children(params.header).off().on(triggerEvent, function(e) {
                e.preventDefault();

                if(!$(this).next(params.content).hasClass('opened'))
                {<commit_msg>Prevent displaying more than one content if singleOpen is set to true and allow to hide all elements if allowAllClosed is set to true<commit_after>(function($){
    $.fn.seAccordion = function(options) {
        var defaults = {
            header: 'h1',
            content: 'div',
            speed: 'slow',
            easing: 'swing',
            singleOpen: true,
            allowAllClosed: false,
            triggerEvent: 'click'
        };
        var params = $.extend(defaults, options);

        return this.each(function() {
            var obj = $(this),
                triggerEvent = params.triggerEvent !== 'mouseover' ? 'touchstart click' : 'mouseover',
                slideOptions = {
                    duration: params.speed,
                    easing: params.easing
                };

            if(params.singleOpen === true)
            {
                var nbrOpenend = obj.children(params.content + '.opened').length;

                if(nbrOpenend > 1)
                    obj.children(params.content + '.opened:not(:first)').removeClass('opened');
                else if(nbrOpenend === 0 && params.allowAllClosed === false)
                    obj.children(params.content).first().addClass('opened');
            }

            obj.children(params.header).css('cursor', 'pointer');
            obj.children(params.content + ':not(.opened)').css('display', 'none');

            obj.children(params.header).off().on(triggerEvent, function(e) {
                e.preventDefault();

                if(!$(this).next(params.content).hasClass('opened'))
                {
{'fraction_non_alphanumeric': 0.1377952755905512, 'fraction_numerical': 0.0014316392269148174, 'mean_word_length': 1.7321603128054741, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '4408448', 'n_tokens_mistral': 742, 'n_tokens_neox': 688, 'n_words': 140}