Halts current process exection for an user defined time.

    :param wait_time: Current sleep time in seconds.
    :type wait_time: float
    :return: Definition success.
    :rtype: bool
184196
def wait(wait_time):
    

    LOGGER.debug("> Waiting '{0}' seconds!".format(wait_time))

    time.sleep(wait_time)
    return True
911037
def wait_for(func):
    

    def wrapped(*args, **kwargs):
        timeout = kwargs.pop('timeout', 15)

        start = time()
        result = None

        while time() - start < timeout:
            result = func(*args, **kwargs)
            if result:
                break
            sleep(0.2)

        return result

    return wrapped
1196320
def _delay(self):
        """"""
        if not self.next_scheduled:
            self.next_scheduled = self.clock_func() + self.interval
            return
        while True:
            current = self.clock_func()
            if current >= self.next_scheduled:
                extratime = current - self.next_scheduled
                self.next_scheduled = current + self.interval - extratime
                return
            delay_amt = self.next_scheduled - current
            #Call for 0, because that might be meaningful to sleep_func.
            if self.allow_negative_sleep or delay_amt >= 0: 
                self.sleep_func(self.next_scheduled - current)
859601
async def _delay(self):
        
        if self._response is None:
            await asyncio.sleep(0)
        if self._response.headers.get('retry-after'):
            await asyncio.sleep(int(self._response.headers['retry-after']))
        else:
            await asyncio.sleep(self._timeout)
1352474
def wait(self, timeout=None, raise_error=True):
        
        return self.get(timeout=timeout, raise_error=raise_error)
245080
def delay(self, seconds=0, minutes=0):
        

        minutes += int(seconds / 60)
        seconds = seconds % 60
        seconds += float(minutes * 60)

        self.robot.pause()
        if not self.robot.is_simulating():
            _sleep(seconds)
        self.robot.resume()

        return self
1086518
def wait(self, timeout=None):
        

        if timeout is not None:
            if not self._thread:
                self._thread = threading.Thread(target=self._wait4process)
                self._thread.daemon = 1
                self._thread.start()

        if self._thread:
            self._thread.join(timeout=timeout)
            self.timeout_happened = self.timeout_happened or self._thread.isAlive()
        else:
            # no timeout and no existing thread
            self._wait4process()

        return self
1163296
def sleep(self, time):
        
        try:
            task = asyncio.ensure_future(self.core.sleep(time))
            self.loop.run_until_complete(task)

        except asyncio.CancelledError:
            pass
        except RuntimeError:
            pass
776953
def waiting_config_state(self, timeout=300):
        
        t_start = time.time()
        while not self.check_config_state():
            if time.time() - t_start > timeout:
                return False
            time.sleep(0.1)
        return True
676136
def _function(self):
        

        start_time = datetime.datetime.now()

        # calculate stop time
        if self.settings['wait_mode'] == 'absolute':
            stop_time = start_time + datetime.timedelta(seconds= self.settings['wait_time'])
        elif self.settings['wait_mode'] == 'loop_interval':
            if self.last_execution is None:
                stop_time = start_time
            else:
                loop_time = start_time - self.last_execution
                wait_time = datetime.timedelta(seconds= self.settings['wait_time'])
                if wait_time.total_seconds() <0:
                    stop_time = start_time
                else:
                    stop_time = start_time + wait_time
        else:
            TypeError('unknown wait_mode')

        current_time = start_time
        while current_time<stop_time:
            if self._abort:
                break
            current_time = datetime.datetime.now()

            time.sleep(1)

            self.progress = 100.*(current_time- start_time).total_seconds() / (stop_time - start_time).total_seconds()
            self.updateProgress.emit(int(self.progress))

        if self.settings['wait_mode'] == 'absolute':
            self.last_execution = None
        else:
            self.last_execution = start_time
1157286
def wait_on_event(event, timeout=None):
    
    if timeout is not None:
        event.wait(timeout)
        return

    if six.PY2:
        # Thanks to a bug in python 2's threading lib, we can't simply call
        # .wait() with no timeout since it would wind up ignoring signals.
        while not event.is_set():
            event.wait(sys.maxint)
    else:
        event.wait()
1200191
def _wait(self, generator, method, timeout=None, *args, **kwargs):
        """"""
        if self.debug:
            print("waiting for %s to pause" % generator)

        original_timeout = timeout
        while timeout is None or timeout > 0:
            last_time = time.time()
            if self._lock.acquire(False):  # timeout param was added in 3.2
                try:
                    if self.can_resume():
                        return method(generator, *args, **kwargs)
                    elif self.has_terminated():
                        raise RuntimeError("%s has already terminated" % generator)
                finally:
                    self._lock.release()

            if timeout is not None:
                timeout -= time.time() - last_time

        msg = "%s did not pause after %ss" % (generator, original_timeout)
        if self.debug:
            print(msg)
        raise WaitTimeoutError(msg)
668380
def wait(self, timeout=3):
        

        start = time.time()
        while not self.exists():
            self.poco.sleep_for_polling_interval()
            if time.time() - start > timeout:
                break
        return self
1101155
def responsive_sleep(self, seconds, wait_reason=''):
        """"""
        for x in xrange(int(seconds)):
            if (self.config.wait_log_interval and
                    not x % self.config.wait_log_interval):
                self.config.logger.debug(
                    '%s: %dsec of %dsec' % (wait_reason, x, seconds)
                )
            self.quit_check()
            time.sleep(1.0)
106298
def wait(self, timeout=None):
    
    if self._future:
      try:
        # Future.exception() will return rather than raise any exception so we use it.
        self._future.exception(timeout)
      except concurrent.futures.TimeoutError:
        self._timeout()
      self._refresh_state()
    else:
      # fall back to polling
      while not self.is_complete:
        if timeout is not None:
          if timeout <= 0:
            self._timeout()
          timeout -= Job._POLL_INTERVAL_SECONDS
        time.sleep(Job._POLL_INTERVAL_SECONDS)
    return self
54054
def WaitUntilNoFlowsToProcess(self, timeout=None):
    
    t = self.flow_handler_thread
    if not t:
      return

    start_time = time.time()
    while True:
      with self.lock:
        # If the thread is dead, or there are no requests
        # to be processed/being processed, we stop waiting
        # and return from the function.
        if (not t.isAlive() or
            (not self._GetFlowRequestsReadyForProcessing() and
             not self.flow_handler_num_being_processed)):
          return

      time.sleep(0.2)

      if timeout and time.time() - start_time > timeout:
        raise TimeOutWhileWaitingForFlowsToBeProcessedError(
            "Flow processing didn't finish in time.")
565893
def incrementing_sleep(self, previous_attempt_number, delay_since_first_attempt_ms):
        
        result = self._wait_incrementing_start + (self._wait_incrementing_increment * (previous_attempt_number - 1))
        if result < 0:
            result = 0
        return result