docs: def _parse_timestamp(tokens):
      """Parses each token in the given `_TimestampTokens` and marshals the numeric components into a `Timestamp`."""
      def parse():
          precision = TimestampPrecision.YEAR
          off_hour = tokens[_TimestampState.OFF_HOUR]
          off_minutes = tokens[_TimestampState.OFF_MINUTE]
          microsecond = None
          fraction_digits = None
          if off_hour is not None:
              assert off_minutes is not None
              off_sign = -1 if _MINUS in off_hour else 1
              off_hour = int(off_hour)
              off_minutes = int(off_minutes) * off_sign
              if off_sign == -1 and off_hour == 0 and off_minutes == 0:
                  # -00:00 (unknown UTC offset) is a naive datetime.
                  off_hour = None
                  off_minutes = None
          else:
              assert off_minutes is None
  
          year = tokens[_TimestampState.YEAR]
          assert year is not None
          year = int(year)
  
          month = tokens[_TimestampState.MONTH]
          if month is None:
              month = 1
          else:
              month = int(month)
              precision = TimestampPrecision.MONTH
  
          day = tokens[_TimestampState.DAY]
          if day is None:
              day = 1
          else:
              day = int(day)
              precision = TimestampPrecision.DAY
  
          hour = tokens[_TimestampState.HOUR]
          minute = tokens[_TimestampState.MINUTE]
          if hour is None:
              assert minute is None
              hour = 0
              minute = 0
          else:
              assert minute is not None
              hour = int(hour)
              minute = int(minute)
              precision = TimestampPrecision.MINUTE
  
          second = tokens[_TimestampState.SECOND]
          if second is None:
              second = 0
          else:
              second = int(second)
              precision = TimestampPrecision.SECOND
  
              fraction = tokens[_TimestampState.FRACTIONAL]
              if fraction is not None:
                  fraction_digits = len(fraction)
                  if fraction_digits > MICROSECOND_PRECISION:
                      for digit in fraction[MICROSECOND_PRECISION:]:
                          if digit != _ZERO:
                              raise ValueError('Only six significant digits supported in timestamp fractional. Found %s.'
                                               % (fraction,))
                      fraction_digits = MICROSECOND_PRECISION
                      fraction = fraction[0:MICROSECOND_PRECISION]
                  else:
                      fraction.extend(_ZEROS[MICROSECOND_PRECISION - fraction_digits])
                  microsecond = int(fraction)
          return timestamp(
              year, month, day,
              hour, minute, second, microsecond,
              off_hour, off_minutes,
              precision=precision, fractional_precision=fraction_digits
          )
      return parse