Cancel the future.

        Returns True if any of the elements of the iterables is cancelled.
        False otherwise.
967629
def cancel(self):
        
        super(ProcessMapFuture, self).cancel()

        return any(tuple(f.cancel() for f in self._futures))
35466
def cancelEdit( self ):
        
        
        if ( self._partsWidget.isVisible() ):
            return False
            
        self._completerTree.hide()
        self.completer().popup().hide()
        
        self.setText(self._originalText)
        return True
857231
public function cancel()
    {
        if ($this->isRealized) {
            return false;
        }

        $success = $this->isRealized = true;
        foreach ($this->waitQueue as $response) {
            if (!$response->cancel()) {
                $success = false;
            }
        }

        return $success;
    }
1144801
static boolean isSorted(Iterable<? extends TimeSeriesCollection> tscIterable) {
        final Iterator<? extends TimeSeriesCollection> iter = tscIterable.iterator();
        if (!iter.hasNext()) return true; // Empty collection is ordered.

        DateTime timestamp = iter.next().getTimestamp();
        while (iter.hasNext()) {
            final DateTime nextTimestamp = iter.next().getTimestamp();
            if (!nextTimestamp.isAfter(timestamp)) return false;
            timestamp = nextTimestamp;
        }
        return true;
    }
577105
public CompletableFuture<Void> close() {
    CompletableFuture[] futures = new CompletableFuture[connections.size()];

    for (CompletableFuture<Connection> future : this.connectionFutures.values()) {
      future.cancel(false);
    }

    int i = 0;
    for (Connection connection : connections.values()) {
      futures[i++] = connection.close();
    }

    return CompletableFuture.allOf(futures);
  }
18553
@Override
    public void close()
    {
        isOpen.set(false);
        Iterator<Future<?>> iterator = futures.iterator();
        while ( iterator.hasNext() )
        {
            Future<?> future = iterator.next();
            iterator.remove();
            if ( !future.isDone() && !future.isCancelled() && !future.cancel(true) )
            {
                log.warn("Could not cancel " + future);
            }
        }
        if (shutdownOnClose) {
            executorService.shutdownNow();
        }
    }
201225
def close(self, cancelled=False):
        
        self._on_close(cancelled)
        self._scene.remove_effect(self)
329154
def clear(self):
        

        for _, waiter in self.waiters():
            if isinstance(waiter, asyncio.Future) and not waiter.done():
                waiter.set_exception(asyncio.CancelledError())

        self._waiters = {}
475636
function is_cancelled(){
        $mform =& $this->_form;
        if ($mform->isSubmitted()){
            foreach ($mform->_cancelButtons as $cancelbutton){
                if (optional_param($cancelbutton, 0, PARAM_RAW)){
                    return true;
                }
            }
        }
        return false;
    }
704229
def _maybe_clear_confirmation_futures(self):
        
        for name in self._connections.keys():
            self._connections[name].clear_confirmation_futures()
1276814
public boolean isCancelled() {
    Object r;
    return ((r = result) instanceof AltResult)
        && (((AltResult) r).ex instanceof CancellationException);
  }
427512
public void cancel() {
        final OnCancelListener listener;
        synchronized (this) {
            if (mIsCanceled) {
                return;
            }
            mIsCanceled = true;
            mCancelInProgress = true;
            listener = mOnCancelListener;
        }

        try {
            if (listener != null) {
                listener.onCancel();
            }
        } finally {
            synchronized (this) {
                mCancelInProgress = false;
                notifyAll();
            }
        }
    }
89287
@Override
    public boolean cancel(boolean mayInterruptIfRunning) {

        if (m_isDone == true) {
            return false;
        }
        m_isDone = true;

        try {
            m_cancelResult = m_schedFuture.cancel(mayInterruptIfRunning);

            m_pendingException = new CancellationException();
        } finally {
            // Let get() finish
            this.m_coordinationLatch.countDown();
        }

        return m_cancelResult;
    }
154932
@Override
    public boolean cancel(boolean mayInterruptIfRunning) {
        if (m_isDone == true) {
            return false;
        }
        m_isDone = true;

        if (m_pendingException != null) {
            return false;
        }

        m_cancelResult = m_schedFuture.cancel(false);

        if ((m_cancelResult != true) || (m_defaultFuture != null)) {
            // Push the cancel call to the Default Executor Future if it has progressed that far.
            try {
                this.m_coordinationLatch.await();
            } catch (InterruptedException ie) {
                // Try to proceed.
            }

            if (m_defaultFuture != null) {
                m_cancelResult = m_defaultFuture.cancel(mayInterruptIfRunning);
            }
        }

        if (m_cancelResult == true) {
            m_pendingException = new CancellationException();
            m_scheduledExecutorQueue.remove(this);
        }

        // Let get() finish
        this.m_coordinationLatch.countDown();

        return m_cancelResult;
    }
589099
@Trivial
    private final void purgeFutures() {
        for (Iterator<ScheduledFuture<?>> it = futures.iterator(); it.hasNext();)
            if (it.next().isDone())
                it.remove();
    }
148754
@Override
    public boolean resetSupported() {
        boolean sup = true;

        for (val i: iterators)
            if (!i.resetSupported()) {
                sup = false;
                break;
            }

        return sup;
    }
932679
def remove(self, future):
        
        if self._loop.get_debug():
            logger.debug("Removing %s from the linked list.", future)
        if future.prev is None:
            assert future is self.head
            self.head = future.next
            if self.head is None:
                self.tail = None
                if not self.cancelled():
                    self.set_result(None)
            else:
                self.head.prev = None
        elif future.next is None:
            assert future is self.tail
            self.tail = future.prev
            if self.tail is None:
                self.head = None
                if not self.cancelled():
                    self.set_result(None)
            else:
                self.tail.prev = None