// Find returns the data for a given session token from the MemStore instance.
// If the session token is not found or is expired, the returned exists flag will
// be set to false.
502650
func (m *MemStore) Find(token string) ([]byte, bool, error) {
	m.mu.RLock()
	defer m.mu.RUnlock()

	item, found := m.items[token]
	if !found {
		return nil, false, nil
	}
	if time.Now().UnixNano() > item.expiration {
		return nil, false, nil
	}

	b, ok := item.object.([]byte)
	if !ok {
		return nil, true, errTypeAssertionFailed
	}

	return b, true, nil
}
436390
func (r *sessionRepository) FindByToken(ctx context.Context, token string) (*sessions.Session, error) {
	conn := r.pool.Get()
	defer conn.Close()

	return getSession(conn, sessionKey(token))
}
577674
func (m *tokenManager) Locate(ctx context.Context) (uuid.UUID, error) {
	token := goajwt.ContextJWT(ctx)
	if token == nil {
		return uuid.UUID{}, errors.New("Missing token") // TODO, make specific tokenErrors
	}
	id := token.Claims.(jwt.MapClaims)["sub"]
	if id == nil {
		return uuid.UUID{}, errors.New("Missing sub")
	}
	idTyped, err := uuid.FromString(id.(string))
	if err != nil {
		return uuid.UUID{}, errors.New("uuid not of type string")
	}
	return idTyped, nil
}
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
}
71176
func (self *BaseDispatcher) Find(d *restObj, num int64, bundle PBundle) bool {
	allow, ok := d.find.(Allower)
	if !ok {
		return true
	}
	return allow.Allow(num, "GET", bundle)
}
203354
func (s *IPDirectionalPoolsService) Find(k IPDirectionalPoolKey) (AccountLevelIPDirectionalGroupDTO, *http.Response, error) {
	var t AccountLevelIPDirectionalGroupDTO
	res, err := s.client.get(k.URI(), &t)
	return t, res, err
}
131136
func (s *DB) Find(out interface{}, where ...interface{}) *DB {
	return s.NewScope(out).inlineCondition(where...).callCallbacks(s.parent.callbacks.queries).db
}
947835
func (r *UserResource) Find(username string) (*Account, error) {
	user := Account{}
	path := fmt.Sprintf("/users/%s", username)

	if err := r.client.do("GET", path, nil, nil, &user); err != nil {
		return nil, err
	}

	return &user, nil
}
90658
func (this Collection) Find(s interface{}) *Context {
    re := getRegexp(s)

    for _, c := range this {
        cc := c.Find(re)
        if !cc.Empty() {
            return cc
        }
    }

    return NewDoc(nil)
}
224728
func (p *DataFrame) find(parts []string) interface{} {
	data := p.data

	for i, part := range parts {
		val := data[part]
		if val == nil {
			return nil
		}

		if i == len(parts)-1 {
			// found
			return val
		}

		valValue := reflect.ValueOf(val)
		if valValue.Kind() != reflect.Map {
			// not found
			return nil
		}

		// continue
		data = mapStringInterface(valValue)
	}

	// not found
	return nil
}
488222
func (e *VirtualMachine) Find(c *fi.Context) (*VirtualMachine, error) {
	glog.V(4).Info("VirtualMachine.Find invoked!")
	return nil, nil
}
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
}
392973
func (r *RedisStore) Find(token string) (b []byte, exists bool, err error) {
	conn := r.pool.Get()
	defer conn.Close()

	b, err = redis.Bytes(conn.Do("GET", r.prefix+token))
	if err == redis.ErrNil {
		return nil, false, nil
	} else if err != nil {
		return nil, false, err
	}
	return b, true, nil
}
317838
func (m *MemoryStorer) Get(key string) (value string, err error) {
	m.mut.RLock()
	session, ok := m.sessions[key]
	m.mut.RUnlock()
	if !ok {
		return "", errNoSession{}
	}

	return session.value, nil
}
945804
func (all *assetLruList) Find(v *assetLruListEntry) (alle *assetLruListElement) {
	if all.len == 0 {
		return nil
	}
	for alle = all.Front(); alle != nil && alle.Value != v; alle = alle.Next() {
	}
	return
}
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
}
632884
func (g *group) Find(rs []rune) []Entity {
	g.RLock()
	ents := find(rs, []*group{g})
	g.RUnlock()
	return ents[g.name]
}