code: def cancel(self, event):
          
          with self._lock:
              self._queue.remove(event)
              heapq.heapify(self._queue)
docs: Remove an event from the queue.
  
          This must be presented the ID as returned by enter().
          If the event is not in the queue, this raises ValueError.