human
Complete this python program:
def event(name, priority=128):
assistant
#Here is the Python code you requested.

    """Register event to function with a decorator
    """
    def decorator(func):
        add_event_handler(name, func, priority)
        return func
    return decorator