// returns -1 if not found
551483
func (t *ticket) findIdx(topic Topic) int {
	for i, tt := range t.topics {
		if tt == topic {
			return i
		}
	}
	return -1
}
551892
func (c *ConfigLookup) GetLowerString(key string) string {
	value, ok := c.Lookup(key)
	if !ok {
		return ""
	}
	return strings.ToLower(cast.ToString(value))
}
11368
func ErrorIsNotFound(err error) bool {
	_, ok := errors.Cause(err).(*ErrNotFound)
	return ok
}
1287547
func (iter *Iterator) findStringEnd() (int, bool) {
	escaped := false
	for i := iter.head; i < iter.tail; i++ {
		c := iter.buf[i]
		if c == '"' {
			if !escaped {
				return i + 1, false
			}
			j := i - 1
			for {
				if j < iter.head || iter.buf[j] != '\\' {
					// even number of backslashes
					// either end of buffer, or " found
					return i + 1, true
				}
				j--
				if j < iter.head || iter.buf[j] != '\\' {
					// odd number of backslashes
					// it is \" or \\\"
					break
				}
				j--
			}
		} else if c == '\\' {
			escaped = true
		}
	}
	j := iter.tail - 1
	for {
		if j < iter.head || iter.buf[j] != '\\' {
			// even number of backslashes
			// either end of buffer, or " found
			return -1, false // do not end with \
		}
		j--
		if j < iter.head || iter.buf[j] != '\\' {
			// odd number of backslashes
			// it is \" or \\\"
			break
		}
		j--

	}
	return -1, true // end with \
}
127319
func (keyboard *InlineKeyboard) Find(buttonData string) (i, j int, but *InlineButton) {
	for i, buttonsRow := range keyboard.Buttons {
		for j, button := range buttonsRow {
			if button.Data == buttonData {
				return i, j, &button
			}
		}
	}
	return -1, -1, nil
}
516299
func isNotFound(err error) bool {
	if err == nil {
		return false
	}
	if aerr, ok := err.(awserr.Error); ok {
		return aerr.Code() == s3.ErrCodeNoSuchKey ||
			// Check 'NotFound' as well because it's returned for some requests, even
			// though the API model doesn't include it (hence why there isn't an
			// 's3.ErrCodeNotFound' for comparison)
			aerr.Code() == "NotFound"
	}
	return false
}
739474
func IsNotFound(e error) bool {
	if e == NotFound {
		return true
	}
	if e, ok := e.(*URLError); ok && e.Err == NotFound {
		return true
	}
	return false
}
525612
func (cp *ComparablePrincipal) IsFound(set ...*ComparablePrincipal) bool {
	for _, cp2 := range set {
		if cp.IsA(cp2) {
			return true
		}
	}
	return false
}
1351236
func (ac *ArrayComprehension) Find(path Ref) (Value, error) {
	if len(path) == 0 {
		return ac, nil
	}
	return nil, fmt.Errorf("find: not found")
}
156795
func (re *Regexp) FindRunesMatch(r []rune) (*Match, error) {
	return re.run(false, -1, r)
}
464319
func minNotNeg1(a int, bs ...int) int {
	m := a
	for _, b := range bs {
		if a == -1 || (b != -1 && b < m) {
			m = b
		}
	}
	return m
}
92581
func (d DoubleArray) Find(input string) (id int, ok bool) {
	_, q, _, ok := d.search(input)
	if !ok {
		return
	}
	p := q
	q = int(d[p].Base) + int(terminator)
	if q >= len(d) || int(d[q].Check) != p || d[q].Base > 0 {
		return
	}
	return int(-d[q].Base), true
}
189729
func find(data []byte, start int, target rune) (index int) {
	index = bytes.IndexRune(data[start:], target)
	if index != -1 {
		return index + start
	}
	return index
}
147882
func (g *Virtual) find(v int, a int) (w int, n int) {
	prev := -1
	g.visit(v, a, func(w0 int, c0 int64) (skip bool) {
		switch prev {
		case -1:
			w, n = w0, 1
			prev = w0
			return
		case w0 - 1:
			n += 1
			prev = w0
			return
		}
		return true
	})
	return
}
913976
func (d *Document) FindStartOfPreviousWordUntilSeparator(sep string) int {
	if sep == "" {
		return d.FindStartOfPreviousWord()
	}

	x := d.TextBeforeCursor()
	i := strings.LastIndexAny(x, sep)
	if i != -1 {
		return i + 1
	}
	return 0
}
1168533
func (it *Iterator) Find(key []byte) []byte {
	it.Seek(key)
	if it.Valid() {
		k := it.RawKey()
		if k == nil {
			return nil
		} else if bytes.Equal(k, key) {
			return it.Value()
		}
	}

	return nil
}
845828
func (d *Document) FindStartOfPreviousWord() int {
	x := d.TextBeforeCursor()
	i := strings.LastIndexByte(x, ' ')
	if i != -1 {
		return i + 1
	}
	return 0
}