send a stop transfer request to the Aspera sdk, can  be done for:
            cancel - stop an in progress transfer
            free_resource - request to the Aspera sdk free resouces related to trasnfer_id
18780
def stop(self, free_resource=False):
        ''' 
        '''
        if not self.is_stopped():
            self._is_stopping = True
            try:
                if free_resource or self.is_running(False):
                    if not free_resource:
                        logger.info("StopTransfer called - %s" % self.get_transfer_id())
                    self._is_stopped = faspmanager2.stopTransfer(self.get_transfer_id())
                    if not free_resource:
                        logger.info("StopTransfer returned %s - %s" % (
                                    self._is_stopped, self.get_transfer_id()))
            except Exception as ex:
                self.notify_exception(ex)

            self._is_stopping = False

        return self.is_stopped(False)
823207
def make_cancel_request(repo_name, request_id, auth, dry_run=True):
    
    url = '{}/{}/request/{}'.format(SELF_SERVE, repo_name, request_id)

    if dry_run:
        LOG.info('We would make a DELETE request to %s.' % url)
        return None

    LOG.info("We're going to cancel the job at %s" % url)
    req = requests.delete(url, auth=auth, timeout=TCP_TIMEOUT)
    # TODO: add debug message with the canceled job_id URL. Find a way
    # to do that without doing an additional request.
    return req
698114
def stopServing(self, exception=None):
        
        if exception is None:
            exception = ServiceUnavailableError
        self.serve_exception = exception
        if self.pending:
            d = self.out_of_service_deferred = defer.Deferred()
            return d
        return defer.succeed(None)
1295053
synchronized void stop(Integer timeout) {
        final InternalState required = this.requiredState;
        if(required != InternalState.STOPPED) {
            this.requiredState = InternalState.STOPPED;
            ROOT_LOGGER.stoppingServer(serverName);
            // Only send the stop operation if the server is started
            if (internalState == InternalState.SERVER_STARTED) {
                internalSetState(new ServerStopTask(timeout), internalState, InternalState.PROCESS_STOPPING);
            } else {
                transition(false);
            }
        }
    }
1335549
def request_stop(self, message='', exit_code=0):
        
        # Log an error message if exit code is not 0
        # Force output to stderr
        if exit_code:
            if message:
                logger.error(message)
                try:
                    sys.stderr.write(message)
                except Exception:  # pylint: disable=broad-except
                    pass
            logger.error("Sorry, I bail out, exit code: %d", exit_code)
            try:
                sys.stderr.write("Sorry, I bail out, exit code: %d" % exit_code)
            except Exception:  # pylint: disable=broad-except
                pass
        else:
            if message:
                logger.info(message)

        self.unlink()
        self.do_stop()

        logger.info("Stopped %s.", self.name)
        sys.exit(exit_code)
473125
def request_halt(self, req, msg):
        
        f = Future()
        @gen.coroutine
        def _halt():
            req.reply("ok")
            yield gen.moment
            self.stop(timeout=None)
            raise AsyncReply

        self.ioloop.add_callback(lambda: chain_future(_halt(), f))
        return f
177373
def stop(self, subname='total'):
        '''
        '''
        assert self._stop is None, (
            'Unable to stop, the timer is already stopped')
        self._stop = time.time()
        return self.send(subname, self._stop - self._start)
367279
def _wait_for_transfer_threads(self, terminate):
        # type: (SyncCopy, bool) -> None
        
        if terminate:
            self._synccopy_terminate = terminate
        for thr in self._transfer_threads:
            blobxfer.util.join_thread(thr)
965190
def stop(name, call=None):
    '''
    
    '''
    datacenter_id = get_datacenter_id()
    conn = get_conn()
    node = get_node(conn, name)

    conn.stop_server(datacenter_id=datacenter_id, server_id=node['id'])

    return True
1327417
def remove_aspera_coordinator(self, transfer_coordinator):
        ''' 
        '''
        # usually called on processing completion - but can be called for a cancel
        if self._in_waiting_queue(transfer_coordinator):
            logger.info("Remove from waiting queue count=%d" % self.waiting_coordinator_count())
            with self._lockw:
                self._waiting_transfer_coordinators.remove(transfer_coordinator)
        else:
            logger.info("Remove from processing queue count=%d" % self.tracked_coordinator_count())
            try:
                self.remove_transfer_coordinator(transfer_coordinator)
                self.append_processed_queue(transfer_coordinator)
            except Exception:
                pass

            self._wakeup_processing_thread()
147496
async def stop(self):
        
        if self.__started:
            self.__transport._unregister_rtp_sender(self)
            self.__rtp_task.cancel()
            self.__rtcp_task.cancel()
            await asyncio.gather(
                self.__rtp_exited.wait(),
                self.__rtcp_exited.wait())
619027
public void abort() throws IOException {
        /*
         * The abort() method of DownloadImpl would attempt to notify its
         * TransferStateChangeListener BEFORE it releases its intrinsic lock.
         * And according to the implementation of
         * MultipleFileTransferStateChangeListener which is actually shared by
         * all sub-transfers, it will call the synchronized method isDone() on
         * ALL sub-transfer objects. This would result in serious
         * contention with the worker threads who try to acquire the same set of
         * locks to call setState().
         * In order to prevent this. we should first cancel all download jobs and
         * then notify the listener.
         */

        /* First abort all the download jobs without notifying the state change listener.*/
        for (Transfer fileDownload : subTransfers) {
            ((DownloadImpl)fileDownload).abortWithoutNotifyingStateChangeListener();
        }

        /*
         * All sub-transfers are already in CANCELED state. Now the main thread
         * is able to check isDone() on each sub-transfer object without
         * contention with worker threads.
         */
        for (Transfer fileDownload : subTransfers) {
            ((DownloadImpl)fileDownload).notifyStateChangeListeners(TransferState.Canceled);
        }
    }
1287269
def stop(instance_id, force=False, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The stop action must be called with -a or --action.'
        )

    log.info('Stopping instance %s', instance_id)

    params = {
        'action': 'StopInstances',
        'zone': _get_specified_zone(provider=get_configured_provider()),
        'instances.1': instance_id,
        'force': int(force),
    }
    result = query(params)

    return result
549514
def _worker_thread_transfer(self):
        # type: (Uploader) -> None
        
        while not self.termination_check:
            try:
                ud, ase, offsets, data = self._transfer_queue.get(
                    block=False, timeout=0.1)
            except queue.Empty:
                continue
            try:
                self._process_transfer(ud, ase, offsets, data)
            except Exception as e:
                with self._upload_lock:
                    self._exceptions.append(e)
959845
def stop(self) -> None:
        

        self._shutdown = True

        # Close connection if needed
        self._protocol.close()

        # Cancel any pending tasks
        self.cancel_pending_tasks()
575469
def cancel_invoice(self, invoice_id):
        
        return self._create_put_request(
            resource=INVOICES,
            billomat_id=invoice_id,
            command=CANCEL,
        )
340198
public void sendRequest() throws SipException {
        //hack to add this tx as cancelable, in case someone use x send, instead of dialog.send(ctx);
        validateWrappedTransaction();
        final String method = this.wrappedTransaction.getRequest().getMethod();
        final DialogWrapper dw = getDialogWrapper();
        if ((method.equals(Request.INVITE) || method.equals(Request.SUBSCRIBE)) && dw != null) {
            dw.lastCancelableTransactionId = this.activityHandle;
        }
        if (tracer.isInfoEnabled()) {
            tracer.info(toString() + " sending request:\n" + getRequest());
        }
        wrappedTransaction.sendRequest();
    }