<commit_before>//"use strict";

var Planetoid = Planetoid || {};

Planetoid.SoundPlayer = function(sounds, assetFactory) {

    var _sounds = sounds;
    var _assetFactory = assetFactory;
    var _audio = {};
    var _isSoundEnabled = false;
    var _counterForSound = {};

    init();

    function init() {
        sounds.forEach(function(sound){
            for (var i = 0; i < sound.numConcurrent; i++) {
                _audio[sound.name] = _audio[sound.name] || [];
                _audio[sound.name][i] = _assetFactory.loadAudio(sound.path);
            }
            _counterForSound[sound.name] = 0;
        });
    }

    return {
        playSound: function(soundName) {
            if (_isSoundEnabled && _audio[soundName]) {
                var counter = _counterForSound[soundName];
                _audio[soundName][counter].play();
                _counterForSound[soundName] = (counter + 1) % _sounds[soundName].numConcurrent;
            }
        },
        setSoundEnabled(isSoundEnabled) {
            _isSoundEnabled = isSoundEnabled;
        }
    };
};<commit_msg>Syntax on a JS file<commit_after>//"use strict";

var Planetoid = Planetoid || {};

Planetoid.SoundPlayer = function(sounds, assetFactory) {

    var _sounds = sounds;
    var _assetFactory = assetFactory;
    var _audio = {};
    var _isSoundEnabled = false;
    var _counterForSound = {};

    init();

    function init() {
        sounds.forEach(function(sound){
            for (var i = 0; i < sound.numConcurrent; i++) {
                _audio[sound.name] = _audio[sound.name] || [];
                _audio[sound.name][i] = _assetFactory.loadAudio(sound.path);
            }
            _counterForSound[sound.name] = 0;
        });
    }

    return {
        playSound: function(soundName) {
            if (_isSoundEnabled && _audio[soundName]) {
                var counter = _counterForSound[soundName];
                _audio[soundName][counter].play();
                _counterForSound[soundName] = (counter + 1) % _sounds[soundName].numConcurrent;
            }
        },
        setSoundEnabled: function(isSoundEnabled) {
            _isSoundEnabled = isSoundEnabled;
        }
    };
};
{'fraction_non_alphanumeric': 0.12454379562043795, 'fraction_numerical': 0.002737226277372263, 'mean_word_length': 2.0887323943661973, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1552848', 'n_tokens_mistral': 655, 'n_tokens_neox': 628, 'n_words': 115}