<commit_before>/**
 * Zap! - HTML5 Sound Manager
 * Copyright (c) 2011 <NAME>
 * MIT Licensed
 */

var Zap=(function(){var k={},sounds={},loaded=0,timeout=6*1000,self=this,options={container:'sounds',console:true,complete:function(){},error:function(){},update:function(){}};k.init=function(a){options=$.extend(options,a);$('<div/>',{'id':options.container}).appendTo('body');return this}k.addSound=function(a,b,d,e){var d=d||1;var f=a;sounds[a]={asset:'#'+a,loaded:false,failed:false,duration:0,channels:d,channel:0}var g=setTimeout(function(){o('Zap: sound failed to load: '+a);sounds[a].failed=true;n();options.error(a)},e||timeout);$('<div/>',{'id':a}).appendTo('#'+options.container);var c;while(d--){c='sound-'+f+'-'+d;$('<audio/>',{'id':c,'preload':'auto','autobuffer':true}).appendTo('#'+a);$('#'+c).bind('canplaythrough',function(){clearTimeout(g);sounds[a].loaded=true;sounds[a].duration=$(this).get(0).duration*1000;n()});for(var s in b){$('<source/>',{'src':b[s]}).appendTo('#'+c)}}o('Zap: sound added '+a);return this}k.play=function(a,b,d,c){if(!sounds[a].loaded){o('Zap: sound with reference "'+a+'" is not loaded');return false}var e=c||function(){};var f=b||1;var g=sounds[a];var h=$('#sounds #'+a+' audio').get(g.channel);o('Zap: playing "'+a+'" on channel '+(g.channel+1));if(g.channel++>=g.channels-1){g.channel=0}h.volume=f;h.play();if(d){var i=0;var j=setInterval(function(){if(++i<d){Zap.play(a,b);return true}clearInterval(j);e()},g.duration)}else{setTimeout(e,g.duration)}return this}k.stop=function(a){var b=$('#sounds #'+a+' audio').each(function(){$(this).get(0).pause()});return this}k.stopAllSounds=function(){$('#sounds audio').each(function(){$(this).get(0).pause()});return this}var l=function(){var c=0;for(var i in sounds){c+=sounds[i].channels}return c}var m=function(){return(l()/loaded)*100}var n=function(){loaded++;options.update(m());if(loaded==l())options.complete()}var o=function(){if(window.console&&options.console){window.console.log(Array.prototype.slice.call(arguments))}}return k})();
<commit_msg>updated minified version<commit_after>/**
 * Zap! - HTML5 Sound Manager
 * Copyright (c) 2011 <NAME>
 * MIT Licensed
 */

var Zap=(function(){var k={},sounds={},loaded=0,timeout=6*1000,self=this,options={container:'sounds',console:true,complete:function(){},error:function(){},update:function(){}};k.formats={};k.init=function(a){options=$.extend(options,a);$('<div/>',{'id':options.container}).appendTo('body');return this}k.addSound=function(a,b,d,e){var d=d||1;var f=a;sounds[a]={asset:'#'+a,loaded:false,failed:false,duration:0,channels:d,channel:0}var g=setTimeout(function(){o('Zap: sound failed to load: '+a);sounds[a].failed=true;n();options.error(a)},e||timeout);$('<div/>',{'id':a}).appendTo('#'+options.container);var c;while(d--){c='sound-'+f+'-'+d;$('<audio/>',{'id':c,'preload':'auto','autobuffer':true}).appendTo('#'+a);$('#'+c).bind('canplaythrough',function(){clearTimeout(g);sounds[a].loaded=true;sounds[a].duration=$(this).get(0).duration*1000;n()});for(var s in b){$('<source/>',{'src':b[s]}).appendTo('#'+c)}}o('Zap: sound added '+a);return this}k.play=function(a,b,d,c){if(!sounds[a].loaded){o('Zap: sound with reference "'+a+'" is not loaded');return false}var e=c||function(){};var f=b||1;var g=sounds[a];var h=$('#sounds #'+a+' audio').get(g.channel);o('Zap: playing "'+a+'" on channel '+(g.channel+1));if(g.channel++>=g.channels-1){g.channel=0}h.volume=f;h.play();if(d){var i=0;var j=setInterval(function(){if(++i<d){Zap.play(a,b);return true}clearInterval(j);e()},g.duration)}else{setTimeout(e,g.duration)}return this}k.stop=function(a){var b=$('#sounds #'+a+' audio').each(function(){$(this).get(0).pause()});return this}k.stopAllSounds=function(){$('#sounds audio').each(function(){$(this).get(0).pause()});return this}k.supported=function(){this.formats={};var a;a=document.createElement('audio');this.formats.mp3=!!(a.canPlayType&&a.canPlayType('audio/mpeg;').replace(/no/,''));a=document.createElement('audio');this.formats.vorbis=!!(a.canPlayType&&a.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/,''));a=document.createElement('audio');this.formats.wav=!!(a.canPlayType&&a.canPlayType('audio/wav; codecs="1"').replace(/no/,''));a=document.createElement('audio');this.formats.aac=!!(a.canPlayType&&a.canPlayType('audio/mp4; codecs="mp4a.40.2"').replace(/no/,''));return this.formats}var l=function(){var c=0;for(var i in sounds){c+=sounds[i].channels}return c}var m=function(){return(l()/loaded)*100}var n=function(){loaded++;options.update(m());if(loaded==l())options.complete()}var o=function(){if(window.console&&options.console){window.console.log(Array.prototype.slice.call(arguments))}}return k})();
{'fraction_non_alphanumeric': 0.28537936913895995, 'fraction_numerical': 0.014279624893435636, 'mean_word_length': 13.264437689969604, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6142713', 'n_tokens_mistral': 1742, 'n_tokens_neox': 1720, 'n_words': 147}