<commit_before>import time
from collections import OrderedDict, defaultdict
from threading import Lock

from eventsourcing.application.notificationlog import NotificationLogReader
from eventsourcing.application.simple import SimpleApplication
from eventsourcing.application.snapshotting import SnapshottingApplication
from eventsourcing.domain.model.events import publish, subscribe, unsubscribe
from eventsourcing.exceptions import CausalDependencyFailed, PromptFailed
from eventsourcing.infrastructure.base import ACIDRecordManager
from eventsourcing.infrastructure.eventsourcedrepository import EventSourcedRepository
from eventsourcing.utils.transcoding import json_dumps, json_loads


class ProcessEvent(object):
    def __init__(
        self, new_events, tracking_kwargs=None, causal_dependencies=None, orm_objs=None
    ):
        self.new_events = new_events
        self.tracking_kwargs = tracking_kwargs
        self.causal_dependencies = causal_dependencies
        self.orm_objs = orm_objs


class ProcessApplication(SimpleApplication):
    set_notification_ids = False
    use_causal_dependencies = False
    notification_log_reader_class = NotificationLogReader

    def __init__(
        self,
        name=None,
        policy=None,
        setup_table=False,
        use_direct_query_if_available=False,
        notification_log_reader_class=None,
        **kwargs,
    ):
        self.policy_func = policy
        self.readers = OrderedDict()
        self.is_reader_position_ok = defaultdict(bool)
        self._notification_generators = {}
        self._policy_lock = Lock()
        self.clock_event = None
        self.tick_interval = None
        self.use_direct_query_if_available = use_direct_query_if_available
        self.notification_log_reader_class = (
            notification_log_reader_class or type(self).notification_log_reader_class
        )
<commit_msg>Fixed comma (spurious comma caused SyntaxError with pypy3.5).<commit_after>import time
from collections import OrderedDict, defaultdict
from threading import Lock

from eventsourcing.application.notificationlog import NotificationLogReader
from eventsourcing.application.simple import SimpleApplication
from eventsourcing.application.snapshotting import SnapshottingApplication
from eventsourcing.domain.model.events import publish, subscribe, unsubscribe
from eventsourcing.exceptions import CausalDependencyFailed, PromptFailed
from eventsourcing.infrastructure.base import ACIDRecordManager
from eventsourcing.infrastructure.eventsourcedrepository import EventSourcedRepository
from eventsourcing.utils.transcoding import json_dumps, json_loads


class ProcessEvent(object):
    def __init__(
        self, new_events, tracking_kwargs=None, causal_dependencies=None, orm_objs=None
    ):
        self.new_events = new_events
        self.tracking_kwargs = tracking_kwargs
        self.causal_dependencies = causal_dependencies
        self.orm_objs = orm_objs


class ProcessApplication(SimpleApplication):
    set_notification_ids = False
    use_causal_dependencies = False
    notification_log_reader_class = NotificationLogReader

    def __init__(
        self,
        name=None,
        policy=None,
        setup_table=False,
        use_direct_query_if_available=False,
        notification_log_reader_class=None,
        **kwargs
    ):
        self.policy_func = policy
        self.readers = OrderedDict()
        self.is_reader_position_ok = defaultdict(bool)
        self._notification_generators = {}
        self._policy_lock = Lock()
        self.clock_event = None
        self.tick_interval = None
        self.use_direct_query_if_available = use_direct_query_if_available
        self.notification_log_reader_class = (
            notification_log_reader_class or type(self).notification_log_reader_class
        )

{'fraction_non_alphanumeric': 0.05249412379211282, 'fraction_numerical': 0.0005223295899712719, 'mean_word_length': 4.0661375661375665, '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': '2539149', 'n_tokens_mistral': 1031, 'n_tokens_neox': 978, 'n_words': 207}