method to wait until block passed returns true or timeout (default is 10 seconds) is reached
 raises TiemoutError on timeout
487376
def wait_until(timeout=10)
      time_to_stop = Time.now + timeout
      while true
        rval = yield
        return rval if rval
        raise TimeoutError, "timeout of #{timeout}s exceeded" if Time.now > time_to_stop
        Thread.pass
      end
    end
1085498
def wait_until time_to_wait=30, &block
      time_limit = Time.now + time_to_wait
      until block.call 
        if Time.now > time_limit
          raise "wait_until timeout after #{time_to_wait} seconds"
        end
        sleep 0.1
      end
      true
    end
963556
def wait_for(
        predicate,
        timeout_seconds=120,
        sleep_seconds=1,
        ignore_exceptions=True,
        inverse_predicate=False,
        noisy=False,
        required_consecutive_success_count=1):
    
    count = 0
    start_time = time_module.time()
    timeout = Deadline.create_deadline(timeout_seconds)
    while True:
        try:
            result = predicate()
        except Exception as e:
            if ignore_exceptions:
                if noisy:
                    logger.exception("Ignoring error during wait.")
            else:
                count = 0
                raise  # preserve original stack
        else:
            if (not inverse_predicate and result) or (inverse_predicate and not result):
                count = count + 1
            if count >= required_consecutive_success_count:
                return result

        if timeout.is_expired():
            funname = __stringify_predicate(predicate)
            raise TimeoutExpired(timeout_seconds, funname)
        if noisy:
            header = '{}[{}/{}]'.format(
                shakedown.cli.helpers.fchr('>>'),
                pretty_duration(time_module.time() - start_time),
                pretty_duration(timeout_seconds)
            )
            if required_consecutive_success_count > 1:
                header = '{} [{} of {} times]'.format(
                    header,
                    count,
                    required_consecutive_success_count)
            print('{} spinning...'.format(header))
        time_module.sleep(sleep_seconds)
1232106
def wait_gone(self, timeout=None, raise_error=True):
        
        start_time = time.time()
        if timeout is None or timeout <= 0:
            timeout = self.timeout
        while start_time + timeout > time.time():
            if not self.exists:
                return True
        if not raise_error:
            return False
        raise WDAElementNotDisappearError("element not gone")
1213811
def wait_while(timeout = 30, &block)
      returned = nil

      Timeout.timeout(timeout) do
        while returned = yield(self)
          refresh_page_from_window
          sleep 0.1
        end
      end

      returned
    end
121896
def wait_until(timeout = 30, &block)
      returned = nil

      Timeout.timeout(timeout) do
        until returned = yield(self)
          refresh_page_from_window
          sleep 0.1
        end
      end

      returned
    end
181272
def wait(self, timeout=None):
    

    if not self.__running:
      raise RuntimeError("ThreadPool ain't running")
    self.__queue.wait(timeout)
1352003
def wait_for(self,
               condition,
               interval = DEFAULT_WAIT_INTERVAL,
               timeout  = DEFAULT_WAIT_TIMEOUT):
    

    start = time.time()

    # at least execute the check once!
    while True:
      res = condition()
      if res:
        return res

      # timeout?
      if time.time() - start > timeout:
        break

      # wait a bit
      time.sleep(interval)

    # timeout occured!
    raise WaitTimeoutError("wait_for timed out")
443363
def wait_until_jquery_requests_are_closed(self, timeout=None):
        
        timeout = timeout if timeout is not None else self.timeout

        def wait():
            '''
            Wait function passed to executor
            '''
            WebDriverWait(self.driver, timeout).until(
                lambda d: self.js_executor.execute_template('isJqueryAjaxComplete', {}))
            return True

        return self.execute_and_handle_webdriver_exceptions(
            wait, timeout, None, 'Timeout waiting for all jQuery AJAX requests to close')
925962
def wait(self, state, timeout=-1):
        

        if isinstance(state, str):
            state = state.upper()

        return _lxc.Container.wait(self, state, timeout)
971164
def wait(self, pattern, timeout=10.0, safe=False, **match_kwargs):
        """"""
        t = time.time() + timeout
        while time.time() < t:
            ret = self.exists(pattern, **match_kwargs)
            if ret:
                return ret
            time.sleep(0.2)
        if not safe:
            raise errors.ImageNotFoundError('Not found image %s' %(pattern,))
838957
def wait_for(options={}, &block)
      Wait.new(Cloudpassage::wait_options.merge(options)).until do
        instance_eval &block
      end
    end
1054581
def _blocking_poll(self, timeout=None):
        
        if self._result_set:
            return

        retry_ = self._retry.with_deadline(timeout)

        try:
            retry_(self._done_or_raise)()
        except exceptions.RetryError:
            raise concurrent.futures.TimeoutError(
                "Operation did not complete within the designated " "timeout."
            )
37399
def wait(mutex, timeout = nil)
      start_time = Garcon.monotonic_time
      @condition.wait(mutex, timeout)

      if timeout.nil?
        Result.new(nil)
      else
        Result.new(start_time + timeout - Garcon.monotonic_time)
      end
    end
1043730
private static void wait(Object lock, int timeout)
  {
    try {
      lock.wait(timeout);
    }
    catch(InterruptedException unused) {
      Thread.currentThread().interrupt();
    }
  }
589242
def WaitUntilComplete(self,poll_freq=2,timeout=None):
		
		start_time = time.time()
		while not self.time_completed:
			status = self.Status()
			if status == 'executing':
				if not self.time_executed:  self.time_executed = time.time()
				if clc.v2.time_utils.TimeoutExpired(start_time, timeout):
					raise clc.RequestTimeoutException('Timeout waiting for Request: {0}'.format(self.id), status)

			elif status == 'succeeded':
				self.time_completed = time.time()
			elif status in ("failed", "resumed" or "unknown"):
				# TODO - need to ID best reaction for resumed status (e.g. manual intervention)
				self.time_completed = time.time()
				raise(clc.CLCException("%s %s execution %s" % (self.context_key,self.context_val,status)))

			time.sleep(poll_freq)
148681
public void waitForCompletion() throws InterruptedException {
        try {
            waitForCompletion(0L);
        } catch (AsyncTimeoutException ate) {
            // cannot happen since arg of 0L means wait forever
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Unexpected timeout on blocking wait call, exception: " + ate.getMessage());
            }
            FFDCFilter.processException(ate,
                                        getClass().getName() + ".waitForCompletion", "268", this);
            InterruptedException ie = new InterruptedException("Unexpected timeout");
            ie.initCause(ate);
            throw ie;
        }
    }