Requests device to stop running, waiting at most the given timout in seconds (fractional). Has no effect if
        `run()` was not called with background=True set. Returns True if successfully stopped (or already not running).
545921
def stop(self, timeout=None):
        
        stopped = True
        self.__shutdown.set()
        if self.__bgthread:
            logger.debug('Stopping bgthread')
            self.__bgthread.join(timeout)
            if self.__bgthread.is_alive():
                logger.warning('bgthread did not finish within timeout')
                stopped = False
            self.__bgthread = None
        return stopped
677484
def wait_for_exists(self, timeout=0, *args, **selectors):
        
        return self.device(**selectors).wait.exists(timeout=timeout)
538525
def is_running(self, is_stopped):
        '''  '''
        if is_stopped and self.is_stopped():
            return False

        return faspmanager2.isRunning(self.get_transfer_id())
1330628
def stop(self):
        
        self._running.clear()
        with self._lock:
            if self._timer:
                self._timer.cancel()
            self._timer = None
1313131
def resume():
    
    t = timer()
    if f.t.stopped:
        raise StoppedError("Cannot resume stopped timer.")
    if not f.t.paused:
        raise PausedError("Cannot resume timer that is not paused.")
    f.t.paused = False
    f.t.start_t = t
    f.t.last_t = t
    return t
426492
def stop(self, sig=None, timeout=10):
        
        if self.process is None:
            return self

        if sig is None:
            sig = self._sig_stop

        try:
            os.killpg(self.process.pid, sig)
        except OSError as err:
            if err.errno in IGNORED_ERROR_CODES:
                pass
            else:
                raise

        def process_stopped():
            """Return True only only when self.process is not running."""
            return self.running() is False

        self._set_timeout(timeout)
        try:
            self.wait_for(process_stopped)
        except TimeoutExpired:
            log.warning('Timeout expired, killing process', process=self)
            pass

        self._kill_all_kids(sig)
        self._clear_process()
        return self
922718
def wait(self, timeout=None):
        
        try:
            if timeout:
                gevent.sleep(timeout)
            else:
                while True:
                    gevent.sleep(1000)
        except (KeyboardInterrupt, SystemExit, Exception):
            pass
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)
1212520
def wait(self, timeout=None):
    

    tbegin = _get_timeout_begin(timeout)
    with self._lock:
      while self._queue or self._running:
        remainder = _get_timeout_remainder(tbegin, timeout)
        if remainder is not None and remainder <= 0.0:
          return False  # timeout
        self._lock.wait(remainder)
      if self._shutdown:
        for worker in self._workers:
          worker.join()
    return True
1140405
def timeout(self, seconds=None):
        
        if seconds is None:
            self.socketIO.wait()
        else:
            self.socketIO.wait(seconds=seconds)
1242044
def pause(self):
		
		if self.status == RUNNING:
			self.status = PAUSED
			self.previous_intervals.append(time.time() - self.interval_start)
			self.current_interval_duration = 0.0
		elif self.status == PAUSED:
			self.interval_start = time.time()
			self.status = RUNNING
1295300
def stop(self) -> None:
        
        if not self.running:
            return
        try:
            self.wait(timeout_s=0)
            # If we get here: stopped already
        except subprocess.TimeoutExpired:  # still running
            for kill_level in self.ALL_KILL_LEVELS:
                tried_to_kill = self._terminate(level=kill_level)  # please stop
                if tried_to_kill:
                    try:
                        self.wait(timeout_s=self.kill_timeout_sec)
                        break
                    except subprocess.TimeoutExpired:  # failed to close
                        self.warning("Subprocess didn't stop when asked")
                        pass  # carry on escalating
        self.close_logs()
        self.running = False
518095
def wait(self, seconds, poll_interval):
        
        # jid is None when all hosts were skipped
        if self.jid is None:
            return self.results

        clock = seconds - poll_interval
        while (clock >= 0 and not self.completed):
            time.sleep(poll_interval)

            poll_results = self.poll()

            for (host, res) in poll_results['polled'].iteritems():
                if res.get('started'):
                    self.runner.callbacks.on_async_poll(host, res, self.jid, clock)

            clock = clock - poll_interval

        return self.results
806476
def stop(self):
        """"""
        if not self.running.wait(0.2):
            return
        self._logger.debug('runner disabled: %s', self)
        with self._lock:
            self.running.clear()
        self._stopped.wait()
371710
def stop(self, timeout = 10.0):
		
		if (self._send_greenlet is not None) and \
				(self._send_queue.qsize() > 0):
			self.wait_send(timeout = timeout)

		if self._send_greenlet is not None:
			gevent.kill(self._send_greenlet)
			self._send_greenlet = None
		if self._error_greenlet is not None:
			gevent.kill(self._error_greenlet)
			self._error_greenlet = None
		if self._feedback_greenlet is not None:
			gevent.kill(self._feedback_greenlet)
			self._feedback_greenlet = None

		return self._send_queue.qsize() < 1
427667
def stop(self):
        
        # check that everything is running
        if not self._running:
            logging.warning('Realsense not running. Aborting stop.')
            return False

        self._pipe.stop()
        self._running = False
        return True
941480
def wait(self, seconds=None, **kw):
        ''
        # Use ping/pong to unblock recv for polling transport
        self._heartbeat_thread.hurry()
        # Use timeout to unblock recv for websocket transport
        self._transport.set_timeout(seconds=1)
        # Listen
        warning_screen = self._yield_warning_screen(seconds)
        for elapsed_time in warning_screen:
            if self._should_stop_waiting(**kw):
                break
            try:
                try:
                    self._process_packets()
                except TimeoutError:
                    pass
                except KeyboardInterrupt:
                    self._close()
                    raise
            except ConnectionError as e:
                self._opened = False
                try:
                    warning = Exception('[connection error] %s' % e)
                    warning_screen.throw(warning)
                except StopIteration:
                    self._warn(warning)
                try:
                    namespace = self.get_namespace()
                    namespace._find_packet_callback('disconnect')()
                except PacketError:
                    pass
        self._heartbeat_thread.relax()
        self._transport.set_timeout()