<commit_before>function onKeyPress(key) {

    var skipButtonSelector = '#player_skip_button';
    var playButtonSelector = '#player_play_button';
    var pauseButtonSelector = '#player_pause_button';
    var nextMixButtonSelector = '#next_mix_button';

    if (key === NEXT) {
        pressOneButtonOrAnother(skipButtonSelector, nextMixButtonSelector)
    } else if (key === PLAY) {
        pressOneButtonOrAnother(playButtonSelector, pauseButtonSelector)
    }
}

function pressOneButtonOrAnother(oneButtonSelector,anotherButtonSelector) {
    var oneButton = document.querySelector(oneButtonSelector);
    if(window.getComputedStyle(oneButton).display == "none"){
        var anotherButton = document.querySelector(anotherButtonSelector);
        simulateClick(anotherButton);
    }
    else{
        simulateClick(oneButton);
    }
}

console.log('keysocket: Loading 8tracks\' extension keysocket');<commit_msg>8tracks.com support refactoring<commit_after>var playButtonSelector = '#player_play_button';
var pauseButtonSelector = '#player_pause_button';
var skipButtonSelector = '#player_skip_button';
var nextMixButtonSelector = '#next_mix_button';
    
function onKeyPress(key) {
    if (key === NEXT) {
        pressOneButtonOrAnother(skipButtonSelector, nextMixButtonSelector)
    } else if (key === PLAY) {
        pressOneButtonOrAnother(playButtonSelector, pauseButtonSelector)
    }
}

function pressOneButtonOrAnother(oneButtonSelector, anotherButtonSelector) {
    var oneButton = document.querySelector(oneButtonSelector);
    if(window.getComputedStyle(oneButton).display != "none"){
        simulateClick(oneButton);
    }
    else{
        var anotherButton = document.querySelector(anotherButtonSelector);
        simulateClick(anotherButton);
    }
}

console.log('keysocket: Loading 8tracks\' extension keysocket');
{'fraction_non_alphanumeric': 0.09967320261437909, 'fraction_numerical': 0.0016339869281045752, 'mean_word_length': 4.925806451612903, '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': '5305318', 'n_tokens_mistral': 518, 'n_tokens_neox': 497, 'n_words': 88}