def register(self, event, fn):
<EOL>self._handler_dict.setdefault(event, [])<EOL>if fn not in self._handler_dict[event]:<EOL><INDENT>self._handler_dict[event].append(fn)<EOL><DEDENT>
Registers the given function as a handler to be applied
in response to the the given event.