A reimplemented destructor that cancels 
        the notification before destroying.
514749
def destroy(self):
        
        builder = self.builder
        NotificationManager.cancel_notification(builder)
        del self.builder
        super(AndroidNotification, self).destroy()
749710
public synchronized void removeObserver(final String notification, final ApptentiveNotificationObserver observer) {
		final ApptentiveNotificationObserverList list = findObserverList(notification);
		if (list != null) {
			list.removeObserver(observer);
		}
	}
898776
protected void destroyAndRemoveConnectionListener(ConnectionListener cl, Collection<ConnectionListener> listeners)
   {
      try
      {
         pool.destroyConnectionListener(cl);
      }
      catch (ResourceException e)
      {
         // TODO:
         cl.setState(ZOMBIE);
      }
      finally
      {
         listeners.remove(cl);
      }
   }
29186
private final void cancelCancellable() {
        if (timeoutMessageCancellable != null
                && !timeoutMessageCancellable.isCancelled()) {
            timeoutMessageCancellable.cancel();
        }
        if (pollMessageCancellable != null
                && !pollMessageCancellable.isCancelled()) {
            pollMessageCancellable.cancel();
        }
    }
159575
def cancel(self):
    

    with synchronized(self):
      cancelled = self.__cancelled
      if not cancelled:
        self.__cancelled = True
        notify_all(self)

    if not cancelled:
      self._trigger_event(Job.CANCELLED)
1084790
@Override
    public void removeNotificationHandler(String serviceName, NotificationHandler handler) throws ServiceException {

        ServiceInstanceUtils.validateManagerIsStarted(isStarted.get());
        ServiceInstanceUtils.validateServiceName(serviceName);
        if (handler == null) {
            throw new ServiceException(ErrorCode.SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR,
                    ErrorCode.SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR.getMessageTemplate(),
                    "NotificationHandler");
        }
        
        getLookupService().removeNotificationHandler(serviceName, handler);
    }
116874
def _remove(self, xer, primary):
        
        if xer in primary:
            notifier = primary.pop(xer)
            notifier.shutdown()
229609
function destroy(released) {
    function flush() {
      if (messages.messages.length && !released) {
        return messages.flush();
      }
      return Promise.resolve();
    }

    function finalize() {
      messages.ignoreSignal();
      channel.destroy();
      channel = undefined;
    }

    return flush().then(function(){
      return unsubscribe(channel, options);
    }).then(finalize, finalize);
  }
560950
@Override
    public void removeNotificationHandler(String serviceName, NotificationHandler handler) throws ServiceException {

        if(! isStarted){
            ServiceDirectoryError error = new ServiceDirectoryError(ErrorCode.SERVICE_DIRECTORY_MANAGER_FACTORY_CLOSED);
            throw new ServiceException(error);
        }

        if(handler == null || serviceName == null || serviceName.isEmpty()){
            throw new IllegalArgumentException();
        }

        getLookupService().removeNotificationHandler(serviceName, handler);
    }
477738
def cancel(self, caller):
        
        for o in {i for i in self.children if isinstance(i, AbstractCallable)}:
            o.cancel(caller)
939592
@Weight(value = Weight.Unit.VARIABLE, comment = "Depends on the current call stack depth")
  public static void cancel() {
    final int stackDepth = ThreadUtils.stackDepth();

    final List<TimeData> list = REGISTRY.get();
    final Iterator<TimeData> iterator = list.iterator();

    while (iterator.hasNext()) {
      final TimeData timeWatchItem = iterator.next();
      if (timeWatchItem.getDetectedStackDepth() >= stackDepth) {
        iterator.remove();
      }
    }
    if (list.isEmpty()) {
      REGISTRY.remove();
    }
  }
510021
public void destroyCleanupTerminatedInstanceTimer() {
        cleanupTerminatedInstancesScheduledFuture.cancel(true);
        cleanupTerminatedInstancesScheduledFuture = null;
        cleanupTerminatedInstancesTimer.shutdown();
        cleanupTerminatedInstancesTimer = null;
    }
221512
void unregisterEntry(ListIterator<PathElement> iterator, String value, ConcreteNotificationHandlerRegistration.NotificationHandlerEntry entry) {
        NotificationHandlerNodeRegistry registry = childRegistries.get(value);
        if (registry == null) {
            return;
        }
        registry.unregisterEntry(iterator, entry);
    }
631992
public void removeListener(EventListener l) {
        if (l == null) {
            throw new NullPointerException();
        }
        synchronized (notifyLock) {
            if (listeners != null) {
                // identity equality check
                Iterator<EventListener> iter = listeners.iterator();
                while (iter.hasNext()) {
                    if (iter.next() == l) {
                        iter.remove();
                        if (listeners.size() == 0) {
                            listeners = null;
                        }
                        return;
                    }
                }
            }
        }
    }
1151442
private void updateRemove()
    {
        if (willDelete)
        {
            for (final Integer id : toDelete)
            {
                final Featurable featurable = featurables.get(id);
                for (final HandlerListener listener : listeners)
                {
                    listener.notifyHandlableRemoved(featurable);
                }
                featurable.getFeature(Identifiable.class).notifyDestroyed();
                featurables.remove(featurable, id);
            }
            toDelete.clear();
            willDelete = false;
        }
    }
1026000
@Weight(value = Weight.Unit.VARIABLE, comment = "Depends on the current call stack depth")
  public static void cancel() {
    final int stackDepth = ThreadUtils.stackDepth();

    final List<TimeData> list = REGISTRY.get();

    list.removeIf(timeWatchItem -> timeWatchItem.getDetectedStackDepth() >= stackDepth);
    if (list.isEmpty()) {
      REGISTRY.remove();
    }
  }
1024846
def _retry(self):
        """"""
        notifications_to_delete = []
        for notification_id in self.notifications:
            if datetime.datetime.utcnow() > self.notifications[notification_id]['ts'] + self._wait_period:
                self._notify_receiver(
                    self.notifications[notification_id]['receiver'],
                    self.notifications[notification_id]['params'],
                    self.notifications[notification_id]['doc'])
                if self.notifications[notification_id]['attempts'] >= self._max_attempts - 1:
                    notifications_to_delete.append(notification_id)
                else:
                    self.notifications[notification_id]['ts'] = datetime.datetime.utcnow()
                    self.notifications[notification_id]['attempts'] += 1
        for notification_id in notifications_to_delete:
            del self.notifications[notification_id]