Wait for the port file to contain values that look valid.
Return true, if a-ok, false if the valid values did not materialize within 5 seconds.
184605
public synchronized boolean waitForValidValues() throws IOException, FileNotFoundException {
        for (int tries = 0; tries < 50; tries++) {
            lock();
            getValues();
            unlock();
            if (containsPortInfo) {
                Log.debug("Found valid values in port file after waiting "+(tries*100)+"ms");
                return true;
            }
            try {
                Thread.sleep(100);
            } catch (InterruptedException e)
            {}
        }
        Log.debug("Gave up waiting for valid values in port file");
        return false;
    }
648244
def _wait_for_output(self):
        
        # Here we should get an empty list or list with a tuple [(fd, event)]
        # When we get list with a tuple we can use readline method on
        # the file descriptor.
        poll_result = self.poll_obj.poll(0)

        if poll_result:
            line = self.output().readline()
            if self._banner.match(line):
                return True

        return False
1195965
def wait_till_stopped(self, conf, container_id, timeout=10, message=None, waiting=True):
        """"""
        stopped = False
        inspection = None
        for _ in until(timeout=timeout, action=message):
            try:
                inspection = conf.harpoon.docker_api.inspect_container(container_id)
                if not isinstance(inspection, dict):
                    log.error("Weird response from inspecting the container\tresponse=%s", inspection)
                else:
                    if not inspection["State"]["Running"]:
                        stopped = True
                        conf.container_id = None
                        break
                    else:
                        break
            except (socket.timeout, ValueError):
                log.warning("Failed to inspect the container\tcontainer_id=%s", container_id)
            except DockerAPIError as error:
                if error.response.status_code != 404:
                    raise
                else:
                    break

        if not inspection:
            log.warning("Failed to inspect the container!")
            stopped = True
            exit_code = 1
        else:
            exit_code = inspection["State"]["ExitCode"]
        return stopped, exit_code
305693
def wait_for_connection(self, timeout=10):
        
        start_time = datetime.datetime.now()
        while True:
            if self.connected:
                return True
            now = datetime.datetime.now()
            if (now - start_time).total_seconds() > timeout:
                return False
            time.sleep(0.5)
1374082
def wait_for_ssh(ip):
  """"""
  for _ in range(12):
    with safe_socket() as s:
      try:
        s.connect((ip, 22))
        return True
      except socket.timeout:
        pass
    time.sleep(10)
  return False
1110528
def _wait_for_result(self):
        """"""
        basetime = 0.018 if self._low_res else 0.128
        sleep(basetime * (self._mtreg / 69.0) + self._delay)
677484
def wait_for_exists(self, timeout=0, *args, **selectors):
        
        return self.device(**selectors).wait.exists(timeout=timeout)
1278411
def wait(self, log_file):
        ""
        lines = map(self.log_line, self.filter_lines(self.get_lines(log_file)))
        return any(
            std.re.search(self.pattern, line)
            for line in lines
        )
1230304
def wait(self):
        
        try:
            SpawningProxy(self.containers, abort_on_error=True).wait()
        except Exception:
            # If a single container failed, stop its peers and re-raise the
            # exception
            self.stop()
            raise
307512
def is_ready(self):
        
        try:
            ready, _, _ = self.select.select([self.fileno], [], [],
                                             POLL_TIMEOUT)
            return bool(ready)
        except self.select.error as why:
            if why.args[0] != EINTR:
                self._exceptions.append(AMQPConnectionError(why))
        return False
1266242
def wait(self):
        
        ret = os.read(self.event_fd, 64 / 8)
        return struct.unpack('Q', ret)
540892
def _wait_for_file(cls, filename, timeout=FAIL_WAIT_SEC, want_content=True):
    """"""
    def file_waiter():
      return os.path.exists(filename) and (not want_content or os.path.getsize(filename))

    action_msg = 'file {} to appear'.format(filename)
    return cls._deadline_until(file_waiter, action_msg, timeout=timeout)
897014
def wait_for_server(host, port, cancel_event=None):
    
    while not is_server_running(host, port):
        # Stop waiting if shutting down
        if cancel_event and cancel_event.is_set():
            return False
        time.sleep(0.1)
    return True
973490
def valid_port(port)
      port_number = port.to_s.to_i(10) if /\A[0-9]+\z/ =~ port.to_s
      port_number if (1...2**16).cover? port_number
    end
491437
public synchronized boolean stillMyValues() throws IOException, FileNotFoundException {
        for (;;) {
            try {
                lock();
                getValues();
                unlock();
                if (containsPortInfo) {
                    if (serverPort == myServerPort &&
                        serverCookie == myServerCookie) {
                        // Everything is ok.
                        return true;
                    }
                    // Someone has overwritten the port file.
                    // Probably another javac server, lets quit.
                    return false;
                }
                // Something else is wrong with the portfile. Lets quit.
                return false;
            } catch (FileLockInterruptionException e) {
                continue;
            }
            catch (ClosedChannelException e) {
                // The channel has been closed since sjavac is exiting.
                return false;
            }
        }
    }
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
125899
def wait_transmit(self, *ports):
        

        port_list = self.set_ports_list(*ports)
        self.api.call_rc('ixCheckTransmitDone {}'.format(port_list))