Increment the tick and return branch, turn, tick

        Unless we're viewing the past, in which case raise HistoryError.

        Idea is you use this when you want to advance time, which you
        can only do once per branch, turn, tick.
19024
def _nbtt(self):
        
        from .cache import HistoryError
        branch, turn, tick = self._btt()
        tick += 1
        if (branch, turn) in self._turn_end_plan:
            if tick > self._turn_end_plan[branch, turn]:
                self._turn_end_plan[branch, turn] = tick
            else:
                tick = self._turn_end_plan[branch, turn] + 1
        self._turn_end_plan[branch, turn] = tick
        if self._turn_end[branch, turn] > tick:
            raise HistoryError(
                "You're not at the end of turn {}. Go to tick {} to change things".format(
                    turn, self._turn_end[branch, turn]
                )
            )
        parent, turn_start, tick_start, turn_end, tick_end = self._branches[branch]
        if turn < turn_end or (
            turn == turn_end and tick < tick_end
        ):
            raise HistoryError(
                "You're in the past. Go to turn {}, tick {} to change things".format(turn_end, tick_end)
            )
        if self._planning:
            if (turn, tick) in self._plan_ticks[self._last_plan]:
                raise HistoryError(
                    "Trying to make a plan at {}, but that time already happened".format((branch, turn, tick))
                )
            self._plan_ticks[self._last_plan][turn].append(tick)
            self._plan_ticks_uncommitted.append((self._last_plan, turn, tick))
            self._time_plan[branch, turn, tick] = self._last_plan
        self._otick = tick
        return branch, turn, tick
164133
def next(self, now=None, increments=_increments, delta=True, default_utc=WARN_CHANGE):
        '''
        
        '''
        if default_utc is WARN_CHANGE and (isinstance(now, _number_types) or (now and not now.tzinfo) or now is None):
            warnings.warn(WARNING_CHANGE_MESSAGE, FutureWarning, 2)
            default_utc = False

        now = now or (datetime.utcnow() if default_utc and default_utc is not WARN_CHANGE else datetime.now())
        if isinstance(now, _number_types):
            now = datetime.utcfromtimestamp(now) if default_utc else datetime.fromtimestamp(now)

        # handle timezones if the datetime object has a timezone and get a
        # reasonable future/past start time
        onow, now = now, now.replace(tzinfo=None)
        tz = onow.tzinfo
        future = now.replace(microsecond=0) + increments[0]()
        if future < now:
            # we are going backwards...
            _test = lambda: future.year < self.matchers.year
            if now.microsecond:
                future = now.replace(microsecond=0)
        else:
            # we are going forwards
            _test = lambda: self.matchers.year < future.year

        # Start from the year and work our way down. Any time we increment a
        # higher-magnitude value, we reset all lower-magnitude values. This
        # gets us performance without sacrificing correctness. Still more
        # complicated than a brute-force approach, but also orders of
        # magnitude faster in basically all cases.
        to_test = ENTRIES - 1
        while to_test >= 0:
            if not self._test_match(to_test, future):
                inc = increments[to_test](future, self.matchers)
                future += inc
                for i in xrange(0, to_test):
                    future = increments[ENTRIES+i](future, inc)
                try:
                    if _test():
                        return None
                except:
                    print(future, type(future), type(inc))
                    raise
                to_test = ENTRIES-1
                continue
            to_test -= 1

        # verify the match
        match = [self._test_match(i, future) for i in xrange(ENTRIES)]
        _assert(all(match),
            "\nYou have discovered a bug with crontab, please notify the\n" \
            "author with the following information:\n" \
            "crontab: %r\n" \
            "now: %r", ' '.join(m.input for m in self.matchers), now)

        if not delta:
            onow = now = datetime(1970, 1, 1)

        delay = future - now
        if tz:
            delay += _fix_none(onow.utcoffset())
            if hasattr(tz, 'localize'):
                delay -= _fix_none(tz.localize(future).utcoffset())
            else:
                delay -= _fix_none(future.replace(tzinfo=tz).utcoffset())

        return delay.days * 86400 + delay.seconds + delay.microseconds / 1000000.
1217199
def _run_once(runner_list, extra_tick, use_poll):
    
    if len(runner_list) > 0:
        asyncore.loop(0, use_poll, None, 1)
        for runner in runner_list:
            if not runner.tick():
                return runner
    if extra_tick is not None:
        code = extra_tick()
        if code is False:
            return False
    return True
703589
def forward(self):
        
        if self._index >= len(self._history) - 1:
            return None
        self._index += 1
        self._check_index()
        return self.current_item
703272
void increment() {
        long id = rand.nextInt(config.tuples);
        long toIncrement = rand.nextInt(5); // 0 - 4

        try {
            client.callProcedure(new CMCallback(), "Increment", toIncrement, id);
        }
        catch (IOException e) {
            // This is not ideal error handling for production, but should be
            // harmless in a benchmark like this
            try { Thread.sleep(50); } catch (Exception e2) {}
        }
    }
953106
def add_recurrence_time(time)
      return if time.nil?
      rule = SingleOccurrenceRule.new(time)
      add_recurrence_rule rule
      time
    end
406158
def increment(self, name, value):
        
        counter = self.get(name, CounterType.Increment)
        counter.count = counter.count + value if counter.count != None else value
        self._update()
1355179
def increment_error(self, error: Exception):
        ''''''
        _logger.debug('Increment error %s', error)

        for error_class in ERROR_PRIORITIES:
            if isinstance(error, error_class):
                self.errors[error_class] += 1
                return

        self.errors[type(error)] += 1
19447
def increment_for(obj)
      # decide the time of event asap
      ts = Time.now.ceil.to_i

      if obj.class.ancestors.include?Cequel::Record
        args = obj.key_attributes.collect { |k,v|  v.to_s }
        cache_key = generate_key(ts, obj.class.name, *args)

        val = Cequel::Record.redis.get(cache_key)
        if val.nil?
          val = 1
        else
          val = val.to_i + 1
        end

        ttl = (time_window + 1) * 60

        # Update a sharded counter
        Cequel::Record.redis.setex(cache_key, ttl, val)

        # Optionally, update the index
        index_key = generate_index_key(ts, obj.class.name, *args)
        index_present = Cequel::Record.redis.get(index_key).try(:to_i)
        if index_present != 1
          Cequel::Record.redis.setex(index_key, ttl, 1)
        end
      end

    end
700864
def advance(time)
      yes, no = @stack.partition { |rule| rule.include?(time) }

      if no.empty?
        yes.all? { |rule| rule.advance!(time) } or return false
        puts time if ENV["DEBUG"]
        yield time if block_given?
        true
      else
        no.any? { |rule| rule.continue?(time) }
      end
    end
308373
def read_history(self, num=10, segment=0):
        
        if num < 0:
            num = 0
        if segment < 0:
            raise TypeError("segment must be >= 0")
        return self._builder.read_history(num, segment)
1193029
function (time) {
            last = now;
            now = time;
            delta = (now - last);

            // fix for negative timestamp returned by wechat or chrome on startup
            if (delta < 0) {
                delta = 0;
            }

            // get the game tick
            api.tick = (delta > minstep && me.sys.interpolation) ? delta / step : 1;

            for (var i = 0, len = timers.length; i < len; i++) {
                var _timer = timers[i];
                if (!(_timer.pauseable && me.state.isPaused())) {
                    _timer.elapsed += delta;
                }
                if (_timer.elapsed >= _timer.delay) {
                    _timer.fn.apply(null, _timer.args);
                    if (_timer.repeat === true) {
                        _timer.elapsed -= _timer.delay;
                    } else {
                        me.timer.clearTimeout(_timer.timerId);
                    }
                }
            }
        }
922484
def shift_up(self, times=1):
        
        try:
            return Location(self._rank + times, self._file)
        except IndexError as e:
            raise IndexError(e)
805196
def increment(self, key, value=1):
        
        raw = self._get_payload(key)

        integer = int(raw['data']) + value

        self.put(key, integer, int(raw['time']))

        return integer
824182
public void incrementCurrentSection()
    {
        if (runner_controlled_sections) 
        {
            // assume the current run object is at least a JavaProcessRunner!
            rollback_section = current_section;
            current_section = getCurrentSection().incrementCurrentSection(current_section);
        }
        else
        {
            // as previously 
            rollback_section = current_section;
            current_section++;
        }
    }
360241
public LogicalTimestamp incrementAndUpdate(LogicalTimestamp timestamp) {
    long nextValue = currentTimestamp.value() + 1;
    if (timestamp.value() > nextValue) {
      return update(timestamp);
    }
    return increment();
  }
1285818
function(amount) {
      for (var i = 0; i < this.series_.length; ++i)
        this.series_[i].shiftTimestampsForward(amount);
    }