// Find returns the first position in subject where this Rule will
// match, or -1 if no match was found.
979148
func (r RegexpRule) Find(subject string) (int, Rule) {
	if indices := r.Regexp.FindStringIndex(subject); indices == nil {
		return -1, nil
	} else {
		return indices[0], r
	}
}
947533
func (bol Boolean) Find(path Ref) (Value, error) {
	if len(path) == 0 {
		return bol, nil
	}
	return nil, fmt.Errorf("find: not found")
}
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
}
1139353
func (engine *Engine) Find(beans interface{}, condiBeans ...interface{}) error {
	session := engine.NewSession()
	defer session.Close()
	return session.Find(beans, condiBeans...)
}
850449
func (r *Trie) Find(uri route.Uri) *route.Pool {
	key := strings.TrimPrefix(uri.String(), "/")
	node := r

	for {
		pathParts := parts(key)
		SegmentValue := pathParts[0]

		matchingChild, ok := node.ChildNodes[SegmentValue]
		if !ok {
			return nil
		}

		node = matchingChild

		if len(pathParts) <= 1 {
			break
		}

		key = pathParts[1]
	}

	if nil != node.Pool {
		return node.Pool
	}

	return nil
}
1146375
func (s *Action) Find(ctx context.Context, c *cli.Context) error {
	if c.IsSet("clip") {
		ctx = WithClip(ctx, c.Bool("clip"))
	}

	if !c.Args().Present() {
		return ExitError(ctx, ExitUsage, nil, "Usage: %s find <NEEDLE>", s.Name)
	}

	return s.find(ctx, c, c.Args().First(), s.show)
}
556145
func (tl TopicList) Find(name string) *Topic {
	for _, topic := range tl {
		if topic.Name == name {
			return topic
		}
	}
	return nil
}
1206171
func (v *VerbalExpression) Find(s string) *VerbalExpression {
	return v.add(`(?:` + quote(s) + `)`)
}
358163
func (list *AccountList) Find(id string) *Account {
	for _, item := range list.Data {
		if item.ID == id {
			return item
		}
	}

	return nil
}
863649
func (s *Store) Find(result interface{}, query *Query) error {
	return s.Bolt().View(func(tx *bolt.Tx) error {
		return s.TxFind(tx, result, query)
	})
}
349712
func (r *simpleRegistrar) Find(entity dosa.DomainObject) (*dosa.RegisteredEntity, error) {
	if r.entity == nil {
		return nil, errors.New("no entity found in registrar")
	}

	return r.entity, nil
}
1232902
func (r *EmailResource) Find(address string) (*Email, error) {
	emails, err := r.List()
	if err != nil {
		return nil, err
	}

	for _, email := range emails {
		if email.Email == address {
			return email, nil
		}
	}

	return nil, ErrNotFound
}
342298
func (s *set) Find(path Ref) (Value, error) {
	if len(path) == 0 {
		return s, nil
	}
	if !s.Contains(path[0]) {
		return nil, fmt.Errorf("find: not found")
	}
	return path[0].Value.Find(path[1:])
}
268032
func (bow *Browser) Find(expr string) *goquery.Selection {
	return bow.state.Dom.Find(expr)
}
1351305
func (p *srvFile) Find(name string) *srvFile {
	var f *srvFile

	p.Lock()
	for f = p.cfirst; f != nil; f = f.next {
		if name == f.Name {
			break
		}
	}
	p.Unlock()
	return f
}
1041591
func (t Tags) Find(name string) Tag {
	for _, popTag := range t {
		if popTag.Name == name {
			return popTag
		}
	}
	return Tag{}
}
672309
func (s strings) Find(in []string, what string) int {
	for i, entry := range in {
		if entry == what {
			return i
		}
	}

	return -1
}