<commit_before># <NAME> <<EMAIL>>
from EventLoop import EventLoop

##__________________________________________________________________||
class AllEvents(object):
    def __call__(self, event): return True

##__________________________________________________________________||
class EventReaderBundle(object):
    """A bundle of event readers

    """
    def __init__(self, eventBuilder, eventLoopRunner, readerCollectorAssociator, eventSelection = None):
        self.eventBuilder = eventBuilder
        self.eventLoopRunner = eventLoopRunner
        self.readerCollectorAssociator = readerCollectorAssociator
        self.eventSelection = eventSelection if eventSelection is not None else AllEvents()

        self.EventLoop = EventLoop

    def begin(self):
        self.eventLoopRunner.begin()

    def read(self, component):
        reader = self.readerCollectorAssociator.make(component.name)
        eventLoop = self.EventLoop(self.eventBuilder, self.eventSelection, component, reader)
        self.eventLoopRunner.run(eventLoop)

    def end(self):
        self.eventLoopRunner.end()
        return self.readerCollectorAssociator.collector.collect()

##__________________________________________________________________||<commit_msg>change an argument name and update docstring in EventReaderBundle<commit_after># <NAME> <<EMAIL>>
from EventLoop import EventLoop

##__________________________________________________________________||
class AllEvents(object):
    def __call__(self, event): return True

##__________________________________________________________________||
class EventReaderBundle(object):
    """A bundle of copies of an event reader.


    Each copy reads events in a different data set.

    """
    def __init__(self, eventBuilder, eventLoopRunner, readerCollectorAssociator, eventSelection = None):
        self.eventBuilder = eventBuilder
        self.eventLoopRunner = eventLoopRunner
        self.readerCollectorAssociator = readerCollectorAssociator
        self.eventSelection = eventSelection if eventSelection is not None else AllEvents()

        self.EventLoop = EventLoop

    def begin(self):
        self.eventLoopRunner.begin()

    def read(self, dataset):
        reader = self.readerCollectorAssociator.make(dataset.name)
        eventLoop = self.EventLoop(self.eventBuilder, self.eventSelection, dataset, reader)
        self.eventLoopRunner.run(eventLoop)

    def end(self):
        self.eventLoopRunner.end()
        return self.readerCollectorAssociator.collector.collect()

##__________________________________________________________________||
{'fraction_non_alphanumeric': 0.07772220084647942, 'fraction_numerical': 0.0, 'mean_word_length': 4.56745182012848, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6877375', 'n_tokens_mistral': 598, 'n_tokens_neox': 585, 'n_words': 148}