<commit_before>from .. project import aliases, project
from . import animation
import copy, traceback
from .. util import log


class Collection(animation.BaseAnimation):
    def __init__(self, layout, animations=None, no_fail=False, **kwds):
        super().__init__(layout, **kwds)
        self.animations = [self._make_animation(i, no_fail) for i in animations or []]
        self.index = 0
        self.internal_delay = 0  # never wait

    # Override to handle all the animations
    def cleanup(self, clean_layout=True):
        for a in self.animations:
            if a:
                a.cleanup()
        super().cleanup(clean_layout)

    def add_animation(self, anim, **kwds):
        # DEPRECATED.
        anim.set_runner(kwds)
        self.animations.append(anim)

    def pre_run(self):<commit_msg>Collection/Sequence could start next before dying<commit_after>from .. project import aliases, project
from . import animation
import copy, traceback
from .. util import log


class Collection(animation.BaseAnimation):
    def __init__(self, layout, animations=None, no_fail=False, **kwds):
        super().__init__(layout, **kwds)
        self.animations = [self._make_animation(i, no_fail) for i in animations or []]
        self.index = 0
        self.internal_delay = 0  # never wait

    # Override to handle all the animations
    def cleanup(self, clean_layout=True):
        self.state = animation.STATE.canceled
        for a in self.animations:
            if a:
                a.cleanup()
        super().cleanup(clean_layout)

    def add_animation(self, anim, **kwds):
        # DEPRECATED.
        anim.set_runner(kwds)
        self.animations.append(anim)

    def pre_run(self):
{'fraction_non_alphanumeric': 0.101288056206089, 'fraction_numerical': 0.00234192037470726, 'mean_word_length': 2.7396061269146608, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7372723', 'n_tokens_mistral': 510, 'n_tokens_neox': 490, 'n_words': 136}