human
Here's a good function header given the following:
I wrote the below code

    event_type = event.type
    allowed_keys = ['event_id', 'sender', 'room_id', 'hashes', 'signatures', 'content', 'type', 'state_key', 'depth', 'prev_events', 'prev_state', 'auth_events', 'origin', 'origin_server_ts', 'membership']
    event_dict = event.get_dict()
    new_content = {}
    def add_fields(*fields):
        for field in fields:
            if (field in event.content):
                new_content[field] = event_dict['content'][field]
    if (event_type == EventTypes.Member):
        add_fields('membership')
    elif (event_type == EventTypes.Create):
        add_fields('creator')
    elif (event_type == EventTypes.JoinRules):
        add_fields('join_rule')
    elif (event_type == EventTypes.PowerLevels):
        add_fields('users', 'users_default', 'events', 'events_default', 'state_default', 'ban', 'kick', 'redact')
    elif (event_type == EventTypes.Aliases):
        add_fields('aliases')
    elif (event_type == EventTypes.RoomHistoryVisibility):
        add_fields('history_visibility')
    allowed_fields = {k: v for (k, v) in event_dict.items() if (k in allowed_keys)}
    allowed_fields['content'] = new_content
    allowed_fields['unsigned'] = {}
    if ('age_ts' in event.unsigned):
        allowed_fields['unsigned']['age_ts'] = event.unsigned['age_ts']
    if ('replaces_state' in event.unsigned):
        allowed_fields['unsigned']['replaces_state'] = event.unsigned['replaces_state']
    return type(event)(allowed_fields, internal_metadata_dict=event.internal_metadata.get_dict())

What's a good function header?
assistant
#Here's a good function header.

def prune_event(event):