<commit_before>from .. import Check
from .common import common_checks, resolve


def check(db):
    for event in db.events.find():
        for check in common_checks(event, 'event', 'events'):
            yield check

        for agenda in event['agenda']:
            for entity in agenda['related_entities']:
                if entity['id']:
                    wid = resolve(entity['type'], entity['id'])
                    if wid is None:
                        yield Check(collection='events',
                                    id=event['_id'],<commit_msg>temporal check<commit_after>from .. import Check
from .common import common_checks, resolve


def check(db):
    for event in db.events.find():
        for check in common_checks(event, 'event', 'events'):
            yield check

        if event.get('end'):
            if event.get('when') > event.get('end'):
                yield Check(collection='events',
                            id=event['_id'],
                            tagname='ends-before-it-starts',
                            severity='important')


        for agenda in event['agenda']:
            for entity in agenda['related_entities']:
                if entity['id']:
                    wid = resolve(entity['type'], entity['id'])
                    if wid is None:
                        yield Check(collection='events',
                                    id=event['_id'],
{'fraction_non_alphanumeric': 0.11690140845070422, 'fraction_numerical': 0.0, 'mean_word_length': 1.5239786856127886, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6793731', 'n_tokens_mistral': 356, 'n_tokens_neox': 335, 'n_words': 94}