<commit_before>//
// Flump - Copyright 2013 Flump Authors

package flump.display {

import flash.utils.ByteArray;

import flump.executor.Executor;
import flump.executor.Future;
import flump.mold.LibraryMold;

import react.Signal;

/**
 * Loads zip files created by the flump exporter and parses them into Library instances.
 */
public class LibraryLoader
{
    /**
     * Loads a Library from the zip in the given bytes.
     *
     * @deprecated Use a new LibraryLoader with the builder pattern instead.
     *
     * @param bytes The bytes containing the zip
     *
     * @param executor The executor on which the loading should run. If not specified, it'll run on
     * a new single-use executor.
     *
     * @param scaleFactor the desired scale factor of the textures to load. If the Library contains
     * textures with multiple scale factors, loader will load the textures with the scale factor
     * closest to this value. If scaleFactor <= 0 (the default), Starling.contentScaleFactor will be
     * used.
     *
     * @return a Future to use to track the success or failure of loading the resources out of the
     * bytes. If the loading succeeds, the Future's onSuccess will fire with an instance of
     * Library. If it fails, the Future's onFail will fire with the Error that caused the
     * loading failure.
     */
    public static function loadBytes (bytes :ByteArray, executor :Executor=null,
        scaleFactor :Number=-1) :Future {
        return new LibraryLoader().setExecutor(executor).setScaleFactor(scaleFactor)
            .loadBytes(bytes);
    }

    /**
     * Loads a Library from the zip at the given url.
     *
     * @deprecated Use a new LibraryLoader with the builder pattern instead.
     *
     * @param url The url where the zip can be found
     *
     * @param executor The executor on which the loading should run. If not specified, it'll run on
     * a new single-use executor.
     *
     * @param scaleFactor the desired scale factor of the textures to load. If the Library contains
     * textures with multiple scale factors, loader will load the textures with the scale factor
     * closest to this value. If scaleFactor <= 0 (the default), Starling.contentScaleFactor will be
     * used.
     *
     * @return a Future to use to track the success or failure of loading the resources from the
     * url. If the loading succeeds, the Future's onSuccess will fire with an instance of
     * Library. If it fails, the Future's onFail will fire with the Error that caused the
     * loading failure.
     */
    public static function loadURL (url :String, executor :Executor=null,
        scaleFactor :Number=-1) :Future {
        return new LibraryLoader().setExecutor(executor).setScaleFactor(scaleFactor)
            .loadURL(url);
    }

    /**
     * Dispatched when a ProgressEvent is received on a URL load of a Zip archive.
     *
     * Signal parameters:
     *  * event :flash.events.ProgressEvent
     */
    public const urlLoadProgressed :Signal = new Signal();

    /**
     * Dispatched when a file is found in the Zip archive that is not recognized by Flump.
     *
     * Dispatched Object has the following named properties:
     *  * name :String - the filename in the archive
     *  * bytes :ByteArray - the content of the file
     */
    public const fileLoaded :Signal = new Signal(Object);

    /**
     * Dispatched when the library mold has been read from the archive.
     */
    public const libraryMoldLoaded :Signal = new Signal(LibraryMold);

    /**
     * Dispatched when the bytes for an ATF atlas have been read from the archive.
     *
     * Dispatched Object has the following named properties:
     *  * name :String - the filename of the atlas
     *  * bytes :ByteArray - the content of the atlas
     */
    public const atfAtlasLoaded :Signal = new Signal(Object);

    /**
     * Dispatched when a PNG atlas has been loaded and decoded from the archive. Changes made to<commit_msg>Signals require a type parameter<commit_after>//
// Flump - Copyright 2013 Flump Authors

package flump.display {

import flash.events.ProgressEvent;
import flash.utils.ByteArray;

import flump.executor.Executor;
import flump.executor.Future;
import flump.mold.LibraryMold;

import react.Signal;

/**
 * Loads zip files created by the flump exporter and parses them into Library instances.
 */
public class LibraryLoader
{
    /**
     * Loads a Library from the zip in the given bytes.
     *
     * @deprecated Use a new LibraryLoader with the builder pattern instead.
     *
     * @param bytes The bytes containing the zip
     *
     * @param executor The executor on which the loading should run. If not specified, it'll run on
     * a new single-use executor.
     *
     * @param scaleFactor the desired scale factor of the textures to load. If the Library contains
     * textures with multiple scale factors, loader will load the textures with the scale factor
     * closest to this value. If scaleFactor <= 0 (the default), Starling.contentScaleFactor will be
     * used.
     *
     * @return a Future to use to track the success or failure of loading the resources out of the
     * bytes. If the loading succeeds, the Future's onSuccess will fire with an instance of
     * Library. If it fails, the Future's onFail will fire with the Error that caused the
     * loading failure.
     */
    public static function loadBytes (bytes :ByteArray, executor :Executor=null,
        scaleFactor :Number=-1) :Future {
        return new LibraryLoader().setExecutor(executor).setScaleFactor(scaleFactor)
            .loadBytes(bytes);
    }

    /**
     * Loads a Library from the zip at the given url.
     *
     * @deprecated Use a new LibraryLoader with the builder pattern instead.
     *
     * @param url The url where the zip can be found
     *
     * @param executor The executor on which the loading should run. If not specified, it'll run on
     * a new single-use executor.
     *
     * @param scaleFactor the desired scale factor of the textures to load. If the Library contains
     * textures with multiple scale factors, loader will load the textures with the scale factor
     * closest to this value. If scaleFactor <= 0 (the default), Starling.contentScaleFactor will be
     * used.
     *
     * @return a Future to use to track the success or failure of loading the resources from the
     * url. If the loading succeeds, the Future's onSuccess will fire with an instance of
     * Library. If it fails, the Future's onFail will fire with the Error that caused the
     * loading failure.
     */
    public static function loadURL (url :String, executor :Executor=null,
        scaleFactor :Number=-1) :Future {
        return new LibraryLoader().setExecutor(executor).setScaleFactor(scaleFactor)
            .loadURL(url);
    }

    /**
     * Dispatched when a ProgressEvent is received on a URL load of a Zip archive.
     *
     * Signal parameters:
     *  * event :flash.events.ProgressEvent
     */
    public const urlLoadProgressed :Signal = new Signal(ProgressEvent);

    /**
     * Dispatched when a file is found in the Zip archive that is not recognized by Flump.
     *
     * Dispatched Object has the following named properties:
     *  * name :String - the filename in the archive
     *  * bytes :ByteArray - the content of the file
     */
    public const fileLoaded :Signal = new Signal(Object);

    /**
     * Dispatched when the library mold has been read from the archive.
     */
    public const libraryMoldLoaded :Signal = new Signal(LibraryMold);

    /**
     * Dispatched when the bytes for an ATF atlas have been read from the archive.
     *
     * Dispatched Object has the following named properties:
     *  * name :String - the filename of the atlas
     *  * bytes :ByteArray - the content of the atlas
     */
    public const atfAtlasLoaded :Signal = new Signal(Object);

    /**
     * Dispatched when a PNG atlas has been loaded and decoded from the archive. Changes made to
{'fraction_non_alphanumeric': 0.06726345890836752, 'fraction_numerical': 0.0019893074723361928, 'mean_word_length': 2.7361820715281002, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1080076', 'n_tokens_mistral': 2138, 'n_tokens_neox': 2073, 'n_words': 973}