'Register a new event callback
Parameters
event : str
The event for which to register this callback.
function : callable
A function to be called on the given event. It should take the same
parameters as the appropriate callback prototype.
Raises
TypeError
If ``function`` is not callable.
KeyError
If ``event`` is not one of the known events.'

def register(self, event, function):

    if (not callable(function)):
        raise TypeError(('Need    a    callable,    got    %r' % function))
    self.callbacks[event].append(function)
