<commit_before>VALID_STATUSES = [
        'unknown',
        'new',
        'running*',#for shortcutting
        'scheduled',
        'running',
        'crashed',
        'done',
]

RUNNING_STATUSES = [
        'running',
        'scheduled',
        ]

DONE_STATUSES = [
        'done',
        ]

class Status(object):
    def __init__(self, text=VALID_STATUSES[0]):
        self.text = text
        self.validate()

    def validate(self):
        if self.text not in VALID_STATUSES:
            raise ValueError("Status must be one of %s not %s." %
                    (VALID_STATUSES, self.text))

    def should_overwrite(self, other):
        return other < self

    @property
    def index(self):
        return VALID_STATUSES.index(self.text)

    def __cmp__(self, other):
        return cmp(self.index, other.index)

    @property
    def is_running(self):
        return self.text in RUNNING_STATUSES

    @property
    def is_done(self):
        return self.text in DONE_STATUSES

    def __str__(self):
        return str(self.text)
<commit_msg>pretty print workflow historian statuses<commit_after>VALID_STATUSES = [
        'unknown',
        'new',
        'running*',#for shortcutting
        'scheduled',
        'running',
        'crashed',
        'done',
]

RUNNING_STATUSES = [
        'running',
        'scheduled',
        ]

DONE_STATUSES = [
        'done',
        ]

class Status(object):
    def __init__(self, text=VALID_STATUSES[0]):
        self.text = text
        self.validate()

    def validate(self):
        if self.text not in VALID_STATUSES:
            raise ValueError("Status must be one of %s not %s." %
                    (VALID_STATUSES, self.text))

    def should_overwrite(self, other):
        return other < self

    @property
    def index(self):
        return VALID_STATUSES.index(self.text)

    def __cmp__(self, other):
        return cmp(self.index, other.index)

    @property
    def is_running(self):
        return self.text in RUNNING_STATUSES

    @property
    def is_done(self):
        return self.text in DONE_STATUSES

    def __str__(self):
        return str(self.text)

    def __repr__(self):
        return "Status(text='%s')" % self.text

{'fraction_non_alphanumeric': 0.10850968032417829, 'fraction_numerical': 0.0009004952723998199, 'mean_word_length': 2.039671682626539, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2470312', 'n_tokens_mistral': 716, 'n_tokens_neox': 680, 'n_words': 159}