Return next tick function for current environment.
552359
function nextTickFn() {
  // setImmediate allows to run task after already queued I/O callbacks
  if (typeof setImmediate === 'function') {
    return setImmediate;
  } else if (typeof process !== 'undefined' && process.nextTick) {
    return function(fn) {
      process.nextTick(fn);
    }
  } else {
    return function(fn) {
      setTimeout(fn, 0);
    }
  }
}
551294
def get_next_line(self):
        """"""

        line = self.freq_file.readline().strip().split()
        if len(line) < 1:
            self.load_genotypes()
            line = self.freq_file.readline().strip().split()
        info_line = self.info_file.readline().strip().split()
        info = float(info_line[4])
        exp_freq = float(info_line[3])
        return line, info, exp_freq
373322
def _tick(self):
        """"""
        if (self.verbose >= 3 and not IS_REDIRECTED) or self.options.get("progress"):
            stats = self.get_stats()
            prefix = DRY_RUN_PREFIX if self.dry_run else ""
            sys.stdout.write(
                "{}Touched {}/{} entries in {} directories...\r".format(
                    prefix,
                    stats["entries_touched"],
                    stats["entries_seen"],
                    stats["local_dirs"],
                )
            )
        sys.stdout.flush()
        return
918697
def step_next(self):
        """"""
        window_start = around(self.parent.value('window_start') +
                              self.parent.value('window_length') /
                              self.parent.value('window_step'), 2)

        self.parent.overview.update_position(window_start)
1337113
def get_next_version(self, increment=None):
		
		increment = increment or self.increment
		return self.infer_next_version(self.get_latest_version(), increment)
1062888
def _read_next_timestep(self, ts=None):
    """"""

    if self.ts.frame >= self.n_frames-1:
        raise IOError(errno.EIO, 'trying to go over trajectory limit')
    if ts is None:
        ts = self.ts
    ts.frame += 1

    self.zdock_inst._set_pose_num(ts.frame+1)
    ts._pos = self.zdock_inst.static_mobile_copy_uni.trajectory.ts._pos

    return ts
726104
def step_prev(self):
        """"""
        window_start = around(self.parent.value('window_start') -
                              self.parent.value('window_length') /
                              self.parent.value('window_step'), 2)
        if window_start < 0:
            return
        self.parent.overview.update_position(window_start)
1029027
def tick(self):
        

        now = time.time()

        elapsed = now - self.latest_tick

        if elapsed > self.tick_interval:
            ticks = int(elapsed / self.tick_interval)

            self.tick_all(ticks)

            self.latest_tick = now
920384
def next(self):
        """"""
        try:
            self._current = self.services.pop(0)
        except IndexError:
            raise StopIteration
        else:
            return self._current
470868
def next(self):
        
        x, y = next(self.scan)
        xs = int(round(x))
        ys = int(round(y))
        return xs, ys
1279119
def next(self):
        
        while True:
            x, y = next(self.scan)
            self.index += 1
            if (self.index < self.start): continue
            if (self.index > self.stop): raise StopIteration("skip stopping")
            if ((self.index-self.start) % self.step != 0): continue
            return x, y
1266531
def next(self):
    "  "

    char = self.char
    if char == '\n':
      self.lineno += 1
      self.colno = 0
    else:
      self.colno += 1
    self.index += 1
    return self.char
722418
def next(self):
        
        next_index = (self.index + 1) % len(self._browser.driver.window_handles)
        next_handle = self._browser.driver.window_handles[next_index]
        return Window(self._browser, next_handle)
1196529
def next(self):
        """"""
        batch_size = self.batch_size
        c, h, w = self.data_shape
        # if last batch data is rolled over
        if self._cache_data is not None:
            # check both the data and label have values
            assert self._cache_label is not None, "_cache_label didn't have values"
            assert self._cache_idx is not None, "_cache_idx didn't have values"
            batch_data = self._cache_data
            batch_label = self._cache_label
            i = self._cache_idx
        else:
            batch_data = nd.zeros((batch_size, c, h, w))
            batch_label = nd.empty(self.provide_label[0][1])
            batch_label[:] = -1
            i = self._batchify(batch_data, batch_label)
        # calculate the padding
        pad = batch_size - i
        # handle padding for the last batch
        if pad != 0:
            if self.last_batch_handle == 'discard':
                raise StopIteration
            # if the option is 'roll_over', throw StopIteration and cache the data
            elif self.last_batch_handle == 'roll_over' and \
                self._cache_data is None:
                self._cache_data = batch_data
                self._cache_label = batch_label
                self._cache_idx = i
                raise StopIteration
            else:
                _ = self._batchify(batch_data, batch_label, i)
                if self.last_batch_handle == 'pad':
                    self._allow_read = False
                else:
                    self._cache_data = None
                    self._cache_label = None
                    self._cache_idx = None

        return io.DataBatch([batch_data], [batch_label], pad=pad)
993213
private void tickIfNecessary() {
        final long oldTick = lastTick.get();
        final long newTick = clock.tick();
        final long age = newTick - oldTick;
        if (age > TICK_INTERVAL) {
            final long newIntervalStartTick = newTick - age % TICK_INTERVAL;
            if (lastTick.compareAndSet(oldTick, newIntervalStartTick)) {
                final long requiredTicks = age / TICK_INTERVAL;
                for (long i = 0; i < requiredTicks; i++) {
                    m15Rate.tick();
                    m120Rate.tick();
                }
            }
        }
    }
1007502
def handle_tick(self):
        """"""

        self.uptime += 1

        for name, interval in self.ticks.items():
            if interval == 0:
                continue

            self.tick_counters[name] += 1
            if self.tick_counters[name] == interval:
                self.graph_input(self.TICK_STREAMS[name], self.uptime)
                self.tick_counters[name] = 0
226816
def next_pos(self):
        
        result = None
        if self._index <= len(self._steps):
            result = self._steps[self._index]
            self._index += 1
        return result