def build_event_set(event):
    """
    Turn an EventStream event into a set of event types that ORES
    uses internally.
    """
    event_set = set()
    if event['meta']['stream'] == 'mediawiki.revision-create':
        event_set.add('edit')
        if event.get('page_namespace') == 0:
            event_set.add('main_edit')
        user_groups = event.get('performer', {}).get('user_groups', [])
        if 'bot' in user_groups:
            event_set.add('bot_edit')
        else:
            event_set.add('nonbot_edit')
        if not event.get('rev_parent_id'):
            event_set.add('page_creation')
            if event.get('page_namespace') == 0:
                event_set.add('main_creation')
            if 'bot' in user_groups:
                event_set.add('bot_page_creation')
            else:
                event_set.add('nonbot_page_creation')
    return event_set
