<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _nbtt(self):
 """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. """

        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