def serialize_event(user, subscription=None, node=None, event_description=None):
    all_subs = constants.NODE_SUBSCRIPTIONS_AVAILABLE.copy()
    all_subs.update(constants.USER_SUBSCRIPTIONS_AVAILABLE)
    if not event_description:
        event_description = getattr(subscription, 'event_name')
    # Looks at only the types available. Deals with pre-pending file names.
        for sub_type in all_subs:
            if sub_type in event_description:
                event_type = sub_type
    else:
        event_type = event_description
    if node and node.node__parent:
        notification_type = 'adopt_parent'
    else:
        notification_type = 'none'
    if subscription:
        for n_type in constants.NOTIFICATION_TYPES:
            if user in getattr(subscription, n_type):
                notification_type = n_type
    return {
        'event': {
            'title': event_description,
            'description': all_subs[event_type],
            'notificationType': notification_type,
            'parent_notification_type': get_parent_notification_type(node, event_type, user)
        },
        'kind': 'event',
        'children': []
    }
Return a new environ dict targeting the given wsgi.version
dataset/ETHPy150Open CenterForOpenScience/osf.io/website/notifications/utils.py/serialize_event--crossover with--dataset/ETHPy150Open timonwong/OmniMarkupPreviewer/OmniMarkupLib/libs/cherrypy/wsgiserver/wsgiserver3.py/WSGIGateway.get_environ