Wait until history is read but no more than 10 cycles
        in case a browser session is closed.
9420
def flush(self):
        
        i = 0
        while self._frame_data.is_dirty and i < 10:
            i += 1
            time.sleep(0.1)
757902
def wait_until_page_ready(page_object, timeout=WTF_TIMEOUT_MANAGER.NORMAL):
        
        try:
            do_until(lambda: page_object.webdriver.execute_script("return document.readyState").lower()
                     == 'complete', timeout)
        except wait_utils.OperationTimeoutError:
            raise PageUtilOperationTimeoutError(
                "Timeout occurred while waiting for page to be ready.")
833728
def wait_until_not(self, condition):
        
        return WebDriverWait(self.driver, self.timeout).until_not(condition)
1051240
def pause(self) -> None:
        """"""
        with self.__state_lock:
            if self.__state == DataChannelBuffer.State.started:
                self.__state = DataChannelBuffer.State.paused
948324
def wait_until_internet(time_between_attempts=3, max_attempts=10):
    
    counter = 0
    while not is_internet_on():
        time.sleep(time_between_attempts)  # wait until internet is on
        counter += 1

        if counter > max_attempts:
            return False

    return True
471765
def _wait_until_connectable(self, timeout=30):
        """"""
        count = 0
        while not utils.is_connectable(self.profile.port):
            if self.process.poll() is not None:
                # Browser has exited
                raise WebDriverException(
                    "The browser appears to have exited "
                    "before we could connect. If you specified a log_file in "
                    "the FirefoxBinary constructor, check it for details.")
            if count >= timeout:
                self.kill()
                raise WebDriverException(
                    "Can't load the profile. Possible firefox version mismatch. "
                    "You must use GeckoDriver instead for Firefox 48+. Profile "
                    "Dir: %s If you specified a log_file in the "
                    "FirefoxBinary constructor, check it for details."
                    % (self.profile.path))
            count += 1
            time.sleep(1)
        return True
690189
def pause(id, reason = '')
      params = { :id => id }
      requires params
      params[:reason] = reason
      DataSift.request(:PUT, 'historics/pause', @config, params)
    end
651061
def pause(self, remaining_pause_cycles):
        """"""
        url = urljoin(self._url, '/pause')
        elem = ElementTreeBuilder.Element(self.nodename)
        elem.append(Resource.element_for_value('remaining_pause_cycles',
                                               remaining_pause_cycles))
        body = ElementTree.tostring(elem, encoding='UTF-8')

        response = self.http_request(url, 'PUT', body, { 'Content-Type':
            'application/xml; charset=utf-8' })

        if response.status not in (200, 201, 204):
            self.raise_http_error(response)

        self.update_from_element(ElementTree.fromstring(response.read()))
1229029
def before_event(self, event):
        
        if event not in ["prev_page", "next_page"]:
            while self.history.position < self.history.size:
                self.next_page()
855035
def wait_until_available(resource):
  """'"""
  while True:
    resource.load()
    if resource.state == 'available':
      break
    time.sleep(RETRY_INTERVAL_SEC)
728894
def delayed_close(self):
        """"""
        self.state = CLOSING
        self.server.io_loop.add_callback(self.close)
1295822
def _wait(jid):
    '''
    
    '''
    if jid is None:
        jid = salt.utils.jid.gen_jid(__opts__)
    states = _prior_running_states(jid)
    while states:
        time.sleep(1)
        states = _prior_running_states(jid)
819359
function waitForLogout(self, cb) {
    if (!self.loggingout) return cb();
    setTimeout(function() {
      waitForLogout(self, cb);
    }, 1);
  }
65715
private function waitForNextAvailableSession()
    {
        $elapsedCycles = 0;

        while (true) {
            $session = $this->config['lock']->synchronize(function () use ($elapsedCycles) {
                $item = $this->cacheItemPool->getItem($this->cacheKey);
                $data = $item->get();
                $session = $this->getSession($data);

                if ($session) {
                    $this->cacheItemPool->save($item->set($data));
                    return $session;
                }

                if ($this->config['maxCyclesToWaitForSession'] <= $elapsedCycles) {
                    $this->cacheItemPool->save($item->set($data));

                    throw new \RuntimeException(
                        'A session did not become available in the allotted number of attempts.'
                    );
                }
            });

            if ($session && $this->handleSession($session)) {
                return $session;
            }

            $elapsedCycles++;
            usleep($this->config['sleepIntervalSeconds'] * 1000000);
        }
    }
1299921
function later (info) {
	process.stdin.resume();
	const action = start.bind(null, info);
	process.on('SIGINT', action);
	process.on('SIGTERM', action);

	(function wait () {
		if (beenthere) {
			return;
		}

		setTimeout(wait, EVENT_LOOP);
	}());
}
922718
def wait(self, timeout=None):
        
        try:
            if timeout:
                gevent.sleep(timeout)
            else:
                while True:
                    gevent.sleep(1000)
        except (KeyboardInterrupt, SystemExit, Exception):
            pass
66131
protected void checkPauseAndWait() {
		pauseLock.lock();
		try {
			while (paused && ! stopped) {
				pausedCondition.await();
			}
		} catch (InterruptedException e) {
		} finally {
			pauseLock.unlock();
		}
	}