// Find returns the element where the comparison function matches
// the node's value and the given key value.
198015
func (t *Tree) Find(key interface{}) interface{} {
	if key != nil && t.root != nil {
		d := &findData{key, t.compare}
		node := d.finder(t.root)
		if node != nil {
			return node.value
		}
	}

	return nil
}
514706
func (association *Association) Find(value interface{}) *Association {
	association.scope.related(value, association.column)
	return association.setErr(association.scope.db.Error)
}
447617
func (p *DB) findGE(key []byte, prev bool) (int, bool) {
	node := 0
	h := p.maxHeight - 1
	for {
		next := p.nodeData[node+nNext+h]
		cmp := 1
		if next != 0 {
			o := p.nodeData[next]
			cmp = p.cmp.Compare(p.kvData[o:o+p.nodeData[next+nKey]], key)
		}
		if cmp < 0 {
			// Keep searching in this list
			node = next
		} else {
			if prev {
				p.prevNode[h] = node
			} else if cmp == 0 {
				return next, true
			}
			if h == 0 {
				return next, cmp == 0
			}
			h--
		}
	}
}
349277
func (list *TokenList) Find(id string) *Token {
	for _, item := range list.Data {
		if item.ID == id {
			return item
		}
	}

	return nil
}
1041591
func (t Tags) Find(name string) Tag {
	for _, popTag := range t {
		if popTag.Name == name {
			return popTag
		}
	}
	return Tag{}
}
73544
func Find(nodes []ast.Node, filter Filter) []ast.Node {
	var found []ast.Node
	for _, node := range nodes {
		found = append(found, find(node, filter)...)
	}
	return found
}
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
}
923270
func (c *Configuration) Find(val string) string {
	output, _ := c.gitConfig(val)
	return output
}
1005116
func (n *Node) Find(key string) (leaf *Leaf, expansions []string) {
	if len(key) == 0 || key[0] != '/' {
		return nil, nil
	}

	return n.find(splitPath(key), nil)
}
93636
func (n *Node) search(qname string) (*Node, bool) {
	for n != nil {
		switch c := Less(n.Elem, qname); {
		case c == 0:
			return n, true
		case c < 0:
			n = n.Left
		default:
			n = n.Right
		}
	}

	return n, false
}
776832
func (f *Finder) Find(
	ctx context.Context, ipath ...string) ([]FindResult, error) {

	if len(ipath) == 0 {
		ipath = []string{""}
	}
	var result []FindResult
	for _, p := range ipath {
		results, err := f.find(ctx, p)
		if err != nil {
			return nil, err
		}
		result = append(result, results...)
	}
	return result, nil
}
600540
func (w *Writer) Find(key []byte, o *db.ReadOptions) db.Iterator {
	return &tableIter{
		err: errors.New("leveldb/table: cannot Find from a write-only table"),
	}
}
581117
func (arr Array) Find(path Ref) (Value, error) {
	if len(path) == 0 {
		return arr, nil
	}
	num, ok := path[0].Value.(Number)
	if !ok {
		return nil, fmt.Errorf("find: not found")
	}
	i, ok := num.Int()
	if !ok {
		return nil, fmt.Errorf("find: not found")
	}
	if i < 0 || i >= len(arr) {
		return nil, fmt.Errorf("find: not found")
	}
	return arr[i].Value.Find(path[1:])
}
791181
func (t *keyValueTree) FindAll(f func(k string, v interface{}) (bool, error)) []KeyValueChanger {
	ns, err := t.container.root.findAll(func(fn *node) (bool, error) {
		return f(fn.content.key().(string), fn.content.value())
	})
	if err != nil {
		return []KeyValueChanger{&keyValueChanger{nil, err}}
	}
	var cs []KeyValueChanger
	for _, n := range ns {
		cs = append(cs, &keyValueChanger{n, nil})
	}
	return cs
}
828457
func (node *Node) Match(keys []string) bool {
	sort.Strings(keys)
	return node.match(keys)
}
889436
func (g *Group) Find(shortDescription string) *Group {
	lshortDescription := strings.ToLower(shortDescription)

	var ret *Group

	g.eachGroup(func(gg *Group) {
		if gg != g && strings.ToLower(gg.ShortDescription) == lshortDescription {
			ret = gg
		}
	})

	return ret
}
187790
func (eng *engine) Find(keys KeyList, container TableListContainer, opts ...GetOption) error {
	s := eng.newSession()
	defer s.Close()
	action, err := s.find(keys, container, s.applyGetOption(opts), nil)
	if err != nil {
		return s.catch("Find: "+action, err)
	}
	return nil
}