<commit_before>var scroll_to_bottom_feed = function() {
    var position_y = -1;
    var scroll_action_id = setInterval(
        function(){ 
            if (position_y !== scrollY){
                position_y = scrollY;
                scrollBy(0,99999);
            } else {
                clearInterval(scroll_action_id);
            }
        }, 
        1000
    );
}

var do_action_every_second = function(action) {
    var action_id = setInterval(
        action, 
        1000
    );
    return action_id;
}

var create_put_reaction_action = function(reaction_id) {
    var all_like_btns = document.querySelectorAll('a.UFILikeLink._48-k');
    var cnt = 0;
    return function() {
        var feed = closest_parent_with_class(all_like_btns[cnt], '_4-u2');
        feed.scrollIntoView();
        var reaction_panel = feed.querySelector('._1oxj.uiLayer');
        var reactions = reaction_panel.querySelectorAll('._iu- ._iuw');
        setTimeout(
            function(){
                reactions[reaction_id].click();
            },
            300
        );
        cnt += 1;
    };
}

var put_reaction_on_all_post = function(reaction) {
    if (reaction === 'like') {
        reaction_id = 0;
    } else if (reaction === 'love') {
        reaction_id = 1;
    } else if (reaction === 'haha') {
        reaction_id = 2;
    } else if (reaction === 'wow') {
        reaction_id = 3;
    } else if (reaction === 'sad') {
        reaction_id = 4;
    } else if (reaction === 'angry') {
        reaction_id = 5;
    }
    var put_reaction_action = create_put_reaction_action(reaction_id);
    var action_id = do_action_every_second(put_reaction_action);
    // stop the action
    var all_like_btns = document.querySelectorAll('a.UFILikeLink._48-k');
    setTimeout(
        function() {
            clearInterval(action_id);
        },
        1000 * all_like_btns.length + 100
    );
}

var cancel_all_emotion_on_post = function(){
    var cancel_btns = $('a.UFILikeLink.UFILinkBright');
    var cnt = 0;
    var action_id = do_action_every_second(function() {
        cancel_btns[cnt].click();
        cnt += 1;<commit_msg>Better UX when cancel reaction<commit_after>var scroll_to_bottom_feed = function() {
    var position_y = -1;
    var scroll_action_id = setInterval(
        function(){ 
            if (position_y !== scrollY){
                position_y = scrollY;
                scrollBy(0,99999);
            } else {
                clearInterval(scroll_action_id);
            }
        }, 
        1000
    );
}

var do_action_every_second = function(action) {
    var action_id = setInterval(
        action, 
        1000
    );
    return action_id;
}

var create_put_reaction_action = function(reaction_id) {
    var all_like_btns = document.querySelectorAll('a.UFILikeLink._48-k');
    var cnt = 0;
    return function() {
        var feed = closest_parent_with_class(all_like_btns[cnt], '_4-u2');
        feed.scrollIntoView();
        var reaction_panel = feed.querySelector('._1oxj.uiLayer');
        var reactions = reaction_panel.querySelectorAll('._iu- ._iuw');
        setTimeout(
            function(){
                reactions[reaction_id].click();
            },
            300
        );
        cnt += 1;
    };
}

var put_reaction_on_all_post = function(reaction) {
    if (reaction === 'like') {
        reaction_id = 0;
    } else if (reaction === 'love') {
        reaction_id = 1;
    } else if (reaction === 'haha') {
        reaction_id = 2;
    } else if (reaction === 'wow') {
        reaction_id = 3;
    } else if (reaction === 'sad') {
        reaction_id = 4;
    } else if (reaction === 'angry') {
        reaction_id = 5;
    }
    var put_reaction_action = create_put_reaction_action(reaction_id);
    var action_id = do_action_every_second(put_reaction_action);
    // stop the action
    var all_like_btns = document.querySelectorAll('a.UFILikeLink._48-k');
    setTimeout(
        function() {
            clearInterval(action_id);
        },
        1000 * all_like_btns.length + 100
    );
}

var cancel_all_emotion_on_post = function(){
    var cancel_btns = $('a.UFILikeLink.UFILinkBright');
    var cnt = 0;
    var action_id = do_action_every_second(function() {
        cancel_btns[cnt].scrollIntoView();
        setTimeout(
            cancel_btns[cnt].click,
            300
        );
        cnt += 1;
{'fraction_non_alphanumeric': 0.11817142857142857, 'fraction_numerical': 0.019885714285714284, 'mean_word_length': 2.1572871572871573, 'pattern_counts': {'":': 0, '<': 3, '<?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': '575412', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1362, 'n_words': 264}