Remove an event or a handler from it.

def off(self, event, handler=None):
        """Remove an event or a handler from it."""
        if handler:
            self.events[event].off(handler)
        else:
            del self.events[event]
            delattr(self, event)