<commit_before>//
// Triple Play - utilities for use in PlayN-based games
// Copyright (c) 2011-2014, Three Rings Design, Inc. - All rights reserved.
// http://github.com/threerings/tripleplay/blob/master/LICENSE

package tripleplay.flump;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import playn.core.Asserts;
import playn.core.Image;

import tripleplay.util.TexturePacker;

public class Library
{
    /** The original frame rate of movies in this library. */
    public final float frameRate;

    /** The symbols defined in this library. */
    public final Map<String,Symbol> symbols;

    public Library (
        float frameRate, Iterable<Movie.Symbol> movies, Iterable<Texture.Symbol> textures) {
        this.frameRate = frameRate;

        // map all of our movies and textures by symbol name
        final Map<String,Symbol> symbols = new HashMap<String,Symbol>();
        this.symbols = Collections.unmodifiableMap(symbols);
        for (Movie.Symbol movie : movies) {
            symbols.put(movie.name(), movie);
        }
        for (Texture.Symbol texture : textures) {
            symbols.put(texture.name(), texture);
        }

        // go through and resolve references
        for (Movie.Symbol movie : movies) {
            for (LayerData layer : movie.layers) {
                for (KeyframeData kf : layer.keyframes) {
                    if (kf._symbolName != null) {
                        Symbol symbol = symbols.get(kf._symbolName);
                        Asserts.checkNotNull(symbol);

                        if (layer._lastSymbol == null) layer._lastSymbol = symbol;
                        else if (layer._lastSymbol != symbol) layer._multipleSymbols = true;
                        kf._symbol = symbol;
                    }
                }
            }
        }
    }

    /** Pack multiple libraries into a single group of atlases. The libraries will be modified so
     * that their symbols point at the new atlases. */
    public static void pack (Collection<Library> libs) {<commit_msg>Comment out an Flump Library Asserts call which is taking a measurable amount of time.<commit_after>//
// Triple Play - utilities for use in PlayN-based games
// Copyright (c) 2011-2014, Three Rings Design, Inc. - All rights reserved.
// http://github.com/threerings/tripleplay/blob/master/LICENSE

package tripleplay.flump;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import playn.core.Image;

import tripleplay.util.TexturePacker;

public class Library
{
    /** The original frame rate of movies in this library. */
    public final float frameRate;

    /** The symbols defined in this library. */
    public final Map<String,Symbol> symbols;

    public Library (
        float frameRate, Iterable<Movie.Symbol> movies, Iterable<Texture.Symbol> textures) {
        this.frameRate = frameRate;

        // map all of our movies and textures by symbol name
        final Map<String,Symbol> symbols = new HashMap<String,Symbol>();
        this.symbols = Collections.unmodifiableMap(symbols);
        for (Movie.Symbol movie : movies) {
            symbols.put(movie.name(), movie);
        }
        for (Texture.Symbol texture : textures) {
            symbols.put(texture.name(), texture);
        }

        // go through and resolve references
        for (Movie.Symbol movie : movies) {
            for (LayerData layer : movie.layers) {
                for (KeyframeData kf : layer.keyframes) {
                    if (kf._symbolName != null) {
                        Symbol symbol = symbols.get(kf._symbolName);
                        // We would ideally check not null here, but neck deep in a triple-loop
                        // is not a good place for an assert which is not actually culled for
                        // production release.
                        //Asserts.checkNotNull(symbol);

                        if (layer._lastSymbol == null) layer._lastSymbol = symbol;
                        else if (layer._lastSymbol != symbol) layer._multipleSymbols = true;
                        kf._symbol = symbol;
                    }
                }
            }
        }
    }

    /** Pack multiple libraries into a single group of atlases. The libraries will be modified so
     * that their symbols point at the new atlases. */
    public static void pack (Collection<Library> libs) {
{'fraction_non_alphanumeric': 0.09233791748526522, 'fraction_numerical': 0.0034926871862038856, 'mean_word_length': 2.0917678812415654, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1684211', 'n_tokens_mistral': 1221, 'n_tokens_neox': 1156, 'n_words': 383}