code: def unregister_handler(self, handler_or_func):
          
          index = -1
          for i, handler in enumerate(self._direct_handlers):
              if handler is handler_or_func or handler._original_func is handler_or_func:
                  index = i
                  break
          if index >= 0:
              self._direct_handlers.pop(index)
              self._cached_handlers = None
  
          elif self.parent_class_hook is not None and self.parent_class_hook.has_handler(handler_or_func):
              self.parent_class_hook.unregister_handler(handler_or_func)
              self._cached_handlers = None
  
          elif self.instance_class_hook is not None and self.instance_class_hook.has_handler(handler_or_func):
              self.instance_class_hook.unregister_handler(handler_or_func)
              self._cached_handlers = None
  
          else:
              raise ValueError('{} is not a registered handler of {}'.format(handler_or_func, self))
docs: Remove the handler from this hook's list of handlers.
          This does not give up until the handler is found in the class hierarchy.