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