<commit_before>from __future__ import absolute_import
from __future__ import unicode_literals

from task_processing.events.event import EventFailed
from task_processing.events.event import EventFinished
from task_processing.events.event import EventKilled
from task_processing.events.event import EventLost
from task_processing.events.event import EventRunning
from task_processing.events.event import EventStaging
from task_processing.events.event import EventStarting

MESOS_STATUS_TO_EVENT = {
    0: EventStarting,
    1: EventRunning,
    2: EventFinished,
    3: EventFailed,
    4: EventKilled,
    5: EventLost,
    6: EventStaging,
}


def mesos_status_to_event(mesos_status):
    return MESOS_STATUS_TO_EVENT[mesos_status.state](mesos_status)<commit_msg>add catchall for unknown mesos status updates<commit_after>from __future__ import absolute_import
from __future__ import unicode_literals

from task_processing.events.event import EventBase
from task_processing.events.event import EventFailed
from task_processing.events.event import EventFinished
from task_processing.events.event import EventKilled
from task_processing.events.event import EventLost
from task_processing.events.event import EventRunning
from task_processing.events.event import EventStaging
from task_processing.events.event import EventStarting

MESOS_STATUS_TO_EVENT = {
    0: EventStarting,
    1: EventRunning,
    2: EventFinished,
    3: EventFailed,
    4: EventKilled,
    5: EventLost,
    6: EventStaging,
}


def mesos_status_to_event(mesos_status):
    return MESOS_STATUS_TO_EVENT.get(mesos_status.state, EventBase)(mesos_status)
{'fraction_non_alphanumeric': 0.05412054120541206, 'fraction_numerical': 0.008610086100861008, 'mean_word_length': 6.043290043290043, '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': '1204845', 'n_tokens_mistral': 484, 'n_tokens_neox': 470, 'n_words': 120}