Wait `timeout` seconds for a given relation to come up.
15708
def wait_for_relation(service_name, relation_name, timeout=120):
    """"""
    start_time = time.time()
    while True:
        relation = unit_info(service_name, 'relations').get(relation_name)
        if relation is not None and relation['state'] == 'up':
            break
        if time.time() - start_time >= timeout:
            raise RuntimeError('timeout waiting for relation to be up')
        time.sleep(SLEEP_AMOUNT)
40483
def wait_for_disappearance(self, timeout=120):
        

        start = time.time()
        while self.exists():
            self.poco.sleep_for_polling_interval()
            if time.time() - start > timeout:
                raise PocoTargetTimeout('disappearance', self)
137930
def _wait_until_no_error_exp(self, timeout, wait_func, *args):
		""""""
	
		timeout = robot.utils.timestr_to_secs(timeout) if timeout is not None else self._timeout_in_secs
		maxtime = time.time() + timeout
		
		while True:
		
			try:
				timeout_error = wait_func(*args)
				if not timeout_error: return
				if time.time() > maxtime: raise AssertionError(timeout_error)
				time.sleep(0.2)
				
			except AssertionError:
			
				raise
				
			except:
			
				if time.time() > maxtime: raise
				continue
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()
14213
def wait(self):
        
        self.wait_event = threading.Event()
        timeout = int(self.timeout) if self.timeout else None
        self.timed_out = not self.wait_event.wait(timeout)
226311
def wait(self, **kwargs):
        """"""
        if self.request:
            self.request.wait(**kwargs)
            self.request = None
        return self.inflate()
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
1365528
def wait(*args, **kwargs):
    
    kwargs.setdefault('sleep_seconds', (1, None))
    kwargs.setdefault('expected_exceptions', WebDriverException)
    kwargs.setdefault('timeout_seconds', webium.settings.wait_timeout)

    return wait_lib(*args, **kwargs)
409782
function delay(timeout, value) {
        if (timeout < 0) {
            return value;
        }

        var future = new Future();
        setTimeout(function () {
            future.resolve(value);
        }, timeout);
        return future;
    }
217988
def wait(self, timeout=None):
        
        if self._thread is None:
            return
        self._thread.join(timeout=timeout)
1211615
async def wait_until_ready(
        self, timeout: Optional[float] = None, no_raise: bool = False
    ) -> bool:
        
        if self.node.ready.is_set():
            return True

        try:
            return await self.node.wait_until_ready(timeout=timeout)
        except asyncio.TimeoutError:
            if no_raise:
                return False
            else:
                raise
433425
function waitFor(check, cb, params) {
    params = params || {};
    if (typeof cb === 'object') {
      params = cb;
      cb = params.done;
    }

    var milliseconds = params.interval || 30,
        j = 0;

    var i = setInterval(function() {
      if (check()) {
        clearInterval(i);
        cb(null);
      }

      if (params.timeout && params.timeout - (j * milliseconds) <= 0) {
        clearInterval(i);
        cb(new Error('timeout'));
      }

      j++;
    }, milliseconds);
  }
496266
def _wait(self, timeout=None):
        
        r, w, x = select.select([self._stick_file], [], [], timeout)
        return bool(r)
1352280
def _wait_for(self, callback, timeout=None):
        '''
        
        '''
        start = time.time()
        while True:
            if callback():
                return
            elapsed = time.time() - start
            if timeout and elapsed > timeout:
                raise BrowsingTimeout(
                        'timed out after %.1fs waiting for: %s' % (
                            elapsed, callback))
            brozzler.sleep(self._wait_interval)
181272
def wait(self, timeout=None):
    

    if not self.__running:
      raise RuntimeError("ThreadPool ain't running")
    self.__queue.wait(timeout)
992384
def wait(self, timeout=None):
        
        timeout = ["--interval=%s" % timeout] if timeout else []
        cmdline = ["podman", "wait"] + timeout + [self._id or self.get_id()]
        return run_cmd(cmdline, return_output=True)
352336
def wait_send(self, timeout = None):
		""""""
		self._send_queue_cleared.clear()
		self._send_queue_cleared.wait(timeout = timeout)