// oneOf reports whether a provided string is a member of a variadic list of
// valid options
163858
func oneOf(prop string, validOpts ...string) bool {
	for _, valid := range validOpts {
		if prop == valid {
			return true
		}
	}
	return false
}
42539
func (t *tree) expectOneOf(expected1, expected2 lex.TokenType, context string) lex.Token {
	token := t.Cur()
	if token.T != expected1 && token.T != expected2 {
		t.unexpected(token, context)
	}
	return token
}
618567
func Of(v ...string) StringOrSlice {
	if v == nil {
		v = []string{}
	}
	return StringOrSlice{values: v}
}
350466
func TypeOf(goType reflect.Type) *Type {
	if goType == nil {
		return nil
	}
	typeMutex.RLock()
	t := typesByGoType[goType]
	typeMutex.RUnlock()
	if t != nil {
		return t
	}
	typeMutex.Lock()
	defer typeMutex.Unlock()
	t = typesByGoType[goType]
	if t != nil {
		return t
	}
	t = typeOf(goType)
	typesByGoType[goType] = t
	return t
}
842312
func (result ErrorResults) OneError() error {
	if n := len(result.Results); n != 1 {
		return fmt.Errorf("expected 1 result, got %d", n)
	}
	if err := result.Results[0].Error; err != nil {
		return err
	}
	return nil
}
1284704
func (c *GitTreesService) One() (tree *GitTree, result *Result) {
	result = c.client.get(c.URL, &tree)
	return
}
739648
func IndexOfString(a []string, x string) int {
	return indexOf(len(a), func(i int) bool { return a[i] == x })
}
325232
func OneGenOf(gens ...gopter.Gen) gopter.Gen {
	if len(gens) == 0 {
		return Fail(reflect.TypeOf(nil))
	}
	return func(genParams *gopter.GenParameters) *gopter.GenResult {
		idx := genParams.Rng.Intn(len(gens))
		return gens[idx](genParams)
	}
}
454252
func (p *PullRequestsService) One() (pull *PullRequest, result *Result) {
	result = p.client.get(p.URL, &pull)
	return
}
909349
func isMemberOf(set *apps.StatefulSet, pod *v1.Pod) bool {
	return getParentName(pod) == set.Name
}
142371
func ObjTypeOf(objType reflect.Type) *ObjType {
	if objType == nil {
		return nil
	}
	objTypeMutex.RLock()
	methods := objTypesByGoType[objType]
	objTypeMutex.RUnlock()
	if methods != nil {
		return methods
	}
	objTypeMutex.Lock()
	defer objTypeMutex.Unlock()
	methods = objTypesByGoType[objType]
	if methods != nil {
		return methods
	}
	methods = objTypeOf(objType)
	objTypesByGoType[objType] = methods
	return methods
}
774394
func OneConstOf(consts ...interface{}) gopter.Gen {
	if len(consts) == 0 {
		return Fail(reflect.TypeOf(nil))
	}
	return func(genParams *gopter.GenParameters) *gopter.GenResult {
		idx := genParams.Rng.Intn(len(consts))
		return gopter.NewGenResult(consts[idx], gopter.NoShrinker)
	}
}
199225
func (*Attempt_Data) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*Attempt_Data_Scheduling_)(nil),
		(*Attempt_Data_Executing_)(nil),
		(*Attempt_Data_Waiting_)(nil),
		(*Attempt_Data_Finished_)(nil),
		(*Attempt_Data_AbnormalFinish)(nil),
	}
}
568140
func (h *Hostlist) IndexOf(host *Hostname) int {
	for index, found := range *h {
		if found.Equal(host) {
			return index
		}
	}
	return -1
}
305007
func (c *Cmd) one(line string) error {
	cmd, args := c.parseLine(line)

	var msg string
	var cmderr error

	if cmd == "" {
		msg, cmderr = c.EmptyLine()
	} else {
		c.LastLine = line[:]
		if fn := c.Commands[cmd]; fn == nil {
			msg, cmderr = c.Default(line)
		} else {
			msg, cmderr = fn(args)
		}
	}

	if msg != "" {
		if _, err := c.Out.Write([]byte(msg)); err != nil {
			return err
		}
	}
	return cmderr
}
500615
func (g *Generator) OneStringOf(values ...string) string {
	i := g.Int(0, len(values)-1)
	return values[i]
}
305471
func (ei *ExtendedIdentify) OnError(ctx context.Context) {
	if ei.userBreaks == nil {
		return
	}

	// The identify got an error, so just send a nil breaks list so
	// that the goroutine waiting on the breaks can finish and the
	// error can be returned.
	select {
	case ei.userBreaks <- keybase1.TLFIdentifyFailure{
		Breaks: nil,
		User:   keybase1.User{},
	}:
	case <-ctx.Done():
	}
}