// stateE0 is the state after reading the mantissa, e, optional sign,
// and at least one digit of the exponent in a number,
// such as after reading `314e-2` or `0.314e+1` or `3.14e0`.
484167
func stateE0(s *scanner, c byte) int {
	if '0' <= c && c <= '9' {
		return scanContinue
	}
	return stateEndValue(s, c)
}
711106
func (d *Execution_Data) State() Execution_State {
	if d != nil {
		switch d.ExecutionType.(type) {
		case *Execution_Data_Scheduling_:
			return Execution_SCHEDULING
		case *Execution_Data_Running_:
			return Execution_RUNNING
		case *Execution_Data_Stopping_:
			return Execution_STOPPING
		case *Execution_Data_Finished_:
			return Execution_FINISHED
		case *Execution_Data_AbnormalFinish:
			return Execution_ABNORMAL_FINISHED
		}
	}
	return Execution_SCHEDULING
}
1365843
func (a *Automaton) step(state, label int) int {
	assert(state >= 0)
	assert(label >= 0)
	if 2*state >= len(a.states) {
		return -1 // invalid state
	}
	trans := a.states[2*state]
	limit := trans + 3*a.states[2*state+1]
	// TODO binary search
	for trans < limit {
		dest, min, max := a.transitions[trans], a.transitions[trans+1], a.transitions[trans+2]
		if min <= label && label <= max {
			return dest
		}
		trans += 3
	}
	return -1
}
436926
func stateE0(s *Scanner, c int) int {
	if '0' <= c && c <= '9' {
		s.Step = stateE0
		return ScanContinue
	}
	return stateEndValue(s, c)
}
1286394
func (s entryState) String() string {
	switch s {
	case incomplete:
		return "incomplete"
	case ready:
		return "ready"
	case failed:
		return "failed"
	case expired:
		return "expired"
	default:
		return fmt.Sprintf("unknown(%d)", s)
	}
}
762043
func ToETLState(s string) (ETLState, error) {
	st := ETLState(s)
	switch st {
	case EtlOn:
		return EtlOn, nil
	case EtlOff:
		return EtlOff, nil
	default:
		return EtlOff, fmt.Errorf("%s: %s", errUnrecognizedETLState, s)
	}
}
332511
func (a *MobileAppState) State() keybase1.MobileAppState {
	a.Lock()
	defer a.Unlock()
	return a.state
}
994892
func stateNeg(s *scanner, c int) int {
	if c == '0' {
		s.step = state0
		return scanContinue
	}
	if '1' <= c && c <= '9' {
		s.step = state1
		return scanContinue
	}
	return s.error(c, "in numeric literal")
}
1301712
func xorInGeneric(d *state, buf []byte) {
	n := len(buf) / 8

	for i := 0; i < n; i++ {
		a := binary.LittleEndian.Uint64(buf)
		d.a[i] ^= a
		buf = buf[8:]
	}
}
461932
func lexEmoji(l *pageLexer) stateFunc {
	pos := l.pos + 1
	valid := false

	for i := pos; i < len(l.input); i++ {
		if i > pos && l.input[i] == emojiDelim {
			pos = i + 1
			valid = true
			break
		}
		r, _ := utf8.DecodeRune(l.input[i:])
		if !(isAlphaNumericOrHyphen(r) || r == '+') {
			break
		}
	}

	if valid {
		l.pos = pos
		l.emit(TypeEmoji)
	} else {
		l.pos++
		l.emit(tText)
	}

	return lexMainSection
}
1226154
func (p *ProgressBar) State() State {
	p.lock.Lock()
	defer p.lock.Unlock()
	s := State{}
	s.CurrentPercent = float64(p.state.currentNum) / float64(p.config.max)
	s.CurrentBytes = p.state.currentBytes
	s.MaxBytes = p.config.maxBytes
	s.SecondsSince = time.Since(p.state.startTime).Seconds()
	if p.state.currentNum > 0 {
		s.SecondsLeft = s.SecondsSince / float64(p.state.currentNum) * (float64(p.config.max) - float64(p.state.currentNum))
	}
	s.KBsPerSecond = float64(p.state.currentBytes) / 1000.0 / s.SecondsSince
	return s
}
842725
func stateTag(l *lexer) stateFn {
	if strings.HasPrefix(l.input[l.pos:], "}"+l.rightDelim) {
		l.seek(1)
		l.emit(tokenRawEnd)
		return stateRightDelim
	}
	if strings.HasPrefix(l.input[l.pos:], l.rightDelim) {
		return stateRightDelim
	}
	switch r := l.next(); {
	case r == eof || r == '\n':
		return l.errorf("unclosed action")
	case whitespace(r):
		l.ignore()
	case r == '!':
		l.emit(tokenComment)
		return stateComment
	case r == '#':
		l.emit(tokenSectionStart)
	case r == '^':
		l.emit(tokenSectionInverse)
	case r == '/':
		l.emit(tokenSectionEnd)
	case r == '&':
		l.emit(tokenRawAlt)
	case r == '>':
		l.emit(tokenPartial)
	case r == '{':
		l.emit(tokenRawStart)
	case alphanum(r):
		l.backup()
		return stateIdent
	default:
		return l.errorf("unrecognized character in action: %#U", r)
	}
	return stateTag
}
554011
func copyOutGeneric(d *state, b []byte) {
	for i := 0; len(b) >= 8; i++ {
		binary.LittleEndian.PutUint64(b, d.a[i])
		b = b[8:]
	}
}
1022955
func LexLogical(l *Lexer) StateFn {

	//u.Debugf("in lexLogical: peek: %q  end? %v", l.PeekX(5), l.IsEnd())
	l.SkipWhiteSpaces()

	r := l.Peek()
	switch r {
	case ')':
		return nil
	default:
	}

	if l.IsEnd() {
		return nil
	}

	l.Push("LexLogical", LexLogical)
	return LexExpression(l)
}
297338
func isHexadecimal(ch rune) bool {
	return '0' <= ch && ch <= '9' || 'a' <= ch && ch <= 'f' || 'A' <= ch && ch <= 'F'
}
976781
func SaveState(fd uintptr) (*State, error) {
	var oldState State
	if err := tcget(fd, &oldState.termios); err != 0 {
		return nil, err
	}

	return &oldState, nil
}
317042
func (api *ServerAPI) State(id int64) (string, error) {
	server, err := api.Read(id)
	if err != nil {
		return "", err
	}
	return string(server.Availability), nil
}