<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def on(cls, hook):
 """Hook decorator."""

        def decorator(function_):
            cls._hooks[hook].append(function_)
            return function_
        return decorator