def METHOD_NAME(self, event, function):
    """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.
    """
    if not callable(function):
        raise TypeError('Need a callable, got %r' % function)
    callback_proto = available_events.get(event)
    if function not in self.callbacks[event]:
        self.callbacks[event].append(callback_proto.adapt(function))