<commit_before>
var Impetus = {};

(function(){ // namespace

// class ImpetusSound
function ImpetusSound(url)
{
    this.url = url; // :String
}
// function getInfo():Object
ImpetusSound.prototype.getInfo = function()
{
    return flash.getSoundInfo(this.url);
};
// function play():void
ImpetusSound.prototype.play = function(pos)
{
    flash.playSound(this.url, pos);
};
// function stop():void
ImpetusSound.prototype.stop = function()
{
    flash.stopSound(this.url);
};
// function getState():Object
ImpetusSound.prototype.getState = function()
{
    return flash.getSoundState(this.url);
};
// function getPeak():Object
ImpetusSound.prototype.getPeak = function()
{
    return flash.getSoundPeak(this.url);
};
// function setVolume(int volume):void
ImpetusSound.prototype.setVolume = function(volume)
{
    flash.setSoundVolume(this.url, volume);
};
// function setBalance(int balance):void
ImpetusSound.prototype.setBalance = function(balance)
{
    flash.setSoundBalance(this.url, balance);
};

// var sounds:Array<ImpetusSound>
var sounds = [];

// var flash:HTMLObjectElement
var flash = null;

// var loadCallback:function
var loadCallback = null;

// static var isLoaded:boolean
Impetus.isLoaded = false;

// static function Impetus.getSound(String url):ImpetusSound
Impetus.getSound = function(url)
{
    for(var i = 0; i < sounds.length; ++i)
    {
        if(sounds[i].url === url)
        {
            return sounds[i];
        }
    }

    var s = new ImpetusSound(url);

    sounds.push(s);

    return s;
};

// static function Impetus.setDefaultVolume(int volume, boolean all = false):void
Impetus.setDefaultVolume = function(volume, all)
{
    flash.setDefaultVolume(volume / 100, all);
};

// static function Impetus.setDefaultBalance(int balance, boolean all = false):void
Impetus.setDefaultBalance = function(balance, all)
{
    flash.setDefaultBalance(balance / 100, all);
};

// static function Impetus.load(String swfUrl, function callback = null):Builder
Impetus.load = function(swfUrl, callback)
{<commit_msg>Check if flash isn't null before execute a command<commit_after>
var Impetus = {};

(function(){ // namespace

// class ImpetusSound
function ImpetusSound(url)
{
    this.url = url; // :String
}
// function getInfo():Object
ImpetusSound.prototype.getInfo = function()
{
    return (flash !== null)? flash.getSoundInfo(this.url) : {};
};
// function play():void
ImpetusSound.prototype.play = function(pos)
{
    if(flash !== null)
    {
        flash.playSound(this.url, pos);
    }
};
// function stop():void
ImpetusSound.prototype.stop = function()
{
    if(flash !== null)
    {
        flash.stopSound(this.url);
    }
};
// function getState():Object
ImpetusSound.prototype.getState = function()
{
    return (flash !== null)? flash.getSoundState(this.url) : {};
};
// function getPeak():Object
ImpetusSound.prototype.getPeak = function()
{
    return (flash !== null)? flash.getSoundPeak(this.url) : {};
};
// function setVolume(int volume):void
ImpetusSound.prototype.setVolume = function(volume)
{
    if(flash !== null)
    {
        flash.setSoundVolume(this.url, volume);
    }
};
// function setBalance(int balance):void
ImpetusSound.prototype.setBalance = function(balance)
{
    if(flash !== null)
    {
        flash.setSoundBalance(this.url, balance);
    }
};

// var sounds:Array<ImpetusSound>
var sounds = [];

// var flash:HTMLObjectElement
var flash = null;

// var loadCallback:function
var loadCallback = null;

// static var isLoaded:boolean
Impetus.isLoaded = false;

// static function Impetus.getSound(String url):ImpetusSound
Impetus.getSound = function(url)
{
    for(var i = 0; i < sounds.length; ++i)
    {
        if(sounds[i].url === url)
        {
            return sounds[i];
        }
    }

    var s = new ImpetusSound(url);

    sounds.push(s);

    return s;
};

// static function Impetus.setDefaultVolume(int volume, boolean all = false):void
Impetus.setDefaultVolume = function(volume, all)
{
    if(flash !== null)
    {
        flash.setDefaultVolume(volume / 100, all);
    }
};

// static function Impetus.setDefaultBalance(int balance, boolean all = false):void
Impetus.setDefaultBalance = function(balance, all)
{
    if(flash !== null)
    {
        flash.setDefaultBalance(balance / 100, all);
    }
};

// static function Impetus.load(String swfUrl, function callback = null):Builder
Impetus.load = function(swfUrl, callback)
{
{'fraction_non_alphanumeric': 0.14395654142145767, 'fraction_numerical': 0.003168854685377999, 'mean_word_length': 3.661392405063291, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '280576', 'n_tokens_mistral': 1438, 'n_tokens_neox': 1386, 'n_words': 292}