Min of delay on planned departure.
354188
def get_delay(self, planned, estimated):
        """"""
        delay = 0                   # default is no delay
        if estimated >= planned:    # there is a delay
            delay = round((estimated - planned).seconds / 60)
        else:                       # leaving earlier
            delay = round((planned - estimated).seconds / 60) * -1
        return delay
593323
def go_to(self, time):
        """"""
        half_dur = self.half_duration
        self.set_interval((time - half_dur, time + half_dur))
1558
def n_waiting(self):
        """"""
        return self._counters[JobStatus.no_job] +\
            self._counters[JobStatus.unknown] +\
            self._counters[JobStatus.not_ready] +\
            self._counters[JobStatus.ready]
1068868
def delay(self):
        """"""
        if self.next_request_timestamp is None:
            return
        sleep_seconds = self.next_request_timestamp - time.time()
        if sleep_seconds <= 0:
            return
        message = "Sleeping: {:0.2f} seconds prior to" " call".format(
            sleep_seconds
        )
        log.debug(message)
        time.sleep(sleep_seconds)
1318010
function waitUntil(check, onComplete, delay, timeout) {
        if (check()) {
            onComplete();
            return;
        }

        if (!delay) delay = 100;
        var timeoutPointer = void 0;
        var intervalPointer = setInterval(function () {
            if (!check()) return;
            clearInterval(intervalPointer);
            if (timeoutPointer) clearTimeout(timeoutPointer);
            onComplete();
        }, delay);
        if (timeout) timeoutPointer = setTimeout(function () {
            clearInterval(intervalPointer);
        }, timeout);
    }
369730
private long reserveNextTicket(double requiredPermits, long nowMicros) {
    resync(nowMicros);
    long microsToNextFreeTicket = Math.max(0, nextFreeTicketMicros - nowMicros);
    double storedPermitsToSpend = Math.min(requiredPermits, this.storedPermits);
    double freshPermits = requiredPermits - storedPermitsToSpend;

    long waitMicros = storedPermitsToWaitTime(this.storedPermits, storedPermitsToSpend)
        + (long) (freshPermits * stableIntervalMicros);

    this.nextFreeTicketMicros = nextFreeTicketMicros + waitMicros;
    this.storedPermits -= storedPermitsToSpend;
    return microsToNextFreeTicket;
  }
1161238
def wait_until(time_label):
    '''
     
    '''
    if time_label == 'next_minute':
        gevent.sleep(60 - int(time.time()) % 60)
    elif time_label == 'next_hour':
        gevent.sleep(3600 - int(time.time()) % 3600)
    elif time_label == 'tomorrow':
        gevent.sleep(86400 - int(time.time()) % 86400)
419850
public synchronized void onTransportIdle() {
    if (keepAliveDuringTransportIdle) {
      return;
    }
    if (state == State.PING_SCHEDULED || state == State.PING_DELAYED) {
      state = State.IDLE;
    }
    if (state == State.PING_SENT) {
      state = State.IDLE_AND_PING_SENT;
    }
  }
172338
def departure(stop, destination):
    """"""
    from pyruter.api import Departures

    async def get_departures():
        """"""
        async with aiohttp.ClientSession() as session:
            data = Departures(LOOP, stop, destination, session)
            await data.get_departures()
            print(json.dumps(data.departures, indent=4, sort_keys=True))
    LOOP.run_until_complete(get_departures())
548731
def _delay(self, ms):
        
        if ms:
            self.Delay(ms)
        else:
            if self.default_delay:
                self.Delay(self.default_delay)
1204035
def _delay(self):
        
        if self.next_request_timestamp is None:
            return

        sleep_seconds = self.next_request_timestamp - time.time()
        if sleep_seconds <= 0:
            return
        time.sleep(sleep_seconds)
18355
def down(self, n=1, interval=0, pre_dl=None, post_dl=None):
        
        self.delay(pre_dl)
        self.k.tap_key(self.k.down_key, n, interval)
        self.delay(post_dl)
1321348
boolean isReady() {
        final C[] ds = destinations.get();
        if (ds == null)
            return false;
        for (final C d : ds)
            if (d == null)
                return false;
        final boolean ret = ds.length != 0; // this method is only called in tests and this needs to be true there.

        if (ret && LOGGER.isDebugEnabled())
            LOGGER.debug("at {} to {} is Ready " + shorthand(ds), thisNodeId, groupName);

        return ret;
    }
482225
def Wait(self):
    """"""
    time.sleep(self.sleep_time - int(self.sleep_time))

    # Split a long sleep interval into 1 second intervals so we can heartbeat.
    for _ in range(int(self.sleep_time)):
      time.sleep(1)

    # Back off slowly at first and fast if no answer.
    self.sleep_time = min(self.poll_max,
                          max(self.poll_min, self.sleep_time) * self.poll_slew)
867678
async function delayIfNeeded() {
  if (gT.engineConsts.extJsClickDelay) {
    await gT.s.driver.sleep(gT.engineConsts.extJsClickDelay, false);
  }
}
274756
private int calcFuByWait(MentsuComp comp, Tile last) {
        if (comp.isKanchan(last) || comp.isPenchan(last) || comp.isTanki(last)) {
            return 2;
        }

        return 0;
    }
268790
def delay(self, params, now=None):
        """"""

        if now is None:
            now = time.time()

        # Initialize last...
        if not self.last:
            self.last = now
        elif now < self.last:
            now = self.last

        # How much has leaked out?
        leaked = now - self.last

        # Update the last message time
        self.last = now

        # Update the water level
        self.level = max(self.level - leaked, 0)

        # Are we too full?
        difference = self.level + self.limit.cost - self.limit.unit_value
        if difference >= self.eps:
            self.next = now + difference
            return difference

        # OK, raise the water level and set next to an appropriate
        # value
        self.level += self.limit.cost
        self.next = now

        return None