// Lookup finds and returns the parsed Language that has been saved in the
// registry.
345877
func Lookup(name string) (Contains, error) {
	languagesMu.RLock()
	lang, ok := languagesMu.cache[name]
	if ok {
		languagesMu.RUnlock()
		return lang, nil
	}
	langDef, ok := languagesMu.defs[name]
	languagesMu.RUnlock()
	if !ok {
		return Contains{}, errors.Wrap(ErrLanguageNotFound, name)
	}

	lang, err := parseLang(langDef.body)
	if err != nil {
		return Contains{}, errors.Wrapf(err, "failed to parse %s", name)
	}

	languagesMu.Lock()
	defer languagesMu.Unlock()

	languagesMu.cache[name] = lang
	return lang, nil
}
152755
func Find(langs ...string) (t Translator, err error) {
	for _, lang := range langs {
		t, err = mgr.Find(lang)
		if t != nil || err != nil {
			return
		}
	}
	return
}
908525
func (tx readTx) lookup(table, index, id string) api.StoreObject {
	defer metrics.StartTimer(lookupLatencyTimer)()
	j, err := tx.memDBTx.First(table, index, id)
	if err != nil {
		return nil
	}
	if j != nil {
		return j.(api.StoreObject)
	}
	return nil
}
1296123
func GetLanguage(lang string) *Language {
	l, ok := languages[lang]
	if ok {
		return &l
	}
	return nil
}
15448
func (b *BucketLookup) Lookup(ctx context.Context, orgID platform.ID, name string) (platform.ID, bool) {
	oid := platform.ID(orgID)
	filter := platform.BucketFilter{
		OrganizationID: &oid,
		Name:           &name,
	}
	bucket, err := b.BucketService.FindBucket(ctx, filter)
	if err != nil {
		return platform.InvalidID(), false
	}
	return bucket.ID, true
}
982640
func (dd *DirData) Lookup(ctx context.Context, name string) (DirEntry, error) {
	topBlock, err := dd.GetTopBlock(ctx, BlockRead)
	if err != nil {
		return DirEntry{}, err
	}

	off := StringOffset(name)
	_, _, block, _, _, _, err := dd.tree.getBlockAtOffset(
		ctx, topBlock, &off, BlockLookup)
	if err != nil {
		return DirEntry{}, err
	}

	de, ok := block.(*DirBlock).Children[name]
	if !ok {
		return DirEntry{}, idutil.NoSuchNameError{Name: name}
	}
	return de, nil
}
362126
func (s *Set) Lookup(name interface{}) Option {
	switch v := name.(type) {
	case rune:
		return s.shortOptions[v]
	case int:
		return s.shortOptions[rune(v)]
	case string:
		return s.longOptions[v]
	}
	return nil
}
359295
func (ms *SQLMsgStore) Lookup(seq uint64) (*pb.MsgProto, error) {
	ms.Lock()
	msg, err := ms.lookup(seq)
	ms.Unlock()
	return msg, err
}
1121106
func (l *ComposableEnvLookup) Lookup(key string, config *config.ServiceConfig) []string {
	result := []string{}
	for _, lookup := range l.Lookups {
		env := lookup.Lookup(key, config)
		if len(env) == 1 {
			result = env
		}
	}
	return result
}
184917
func (v *Vars) lookup(id ID) *varValue {
	for idx := len(v.scopes) - 1; idx >= 0; idx-- {
		if val, ok := v.scopes[idx].values[id]; ok {
			return &val
		}
	}
	return nil
}
623644
func (f *File) Lookup(name string) (*File, error) {
	var bino uint32
	bname := []byte(name)
	err := f.walkDir(func(name []byte, ino uint32) bool {
		if bytes.Equal(bname, name) {
			bino = ino
			return false
		}
		return true
	})
	if err != nil {
		return nil, err
	}
	if bino == 0 {
		return nil, fmt.Errorf("file not found")
	}
	return f.fs.File(bino)
}
17915
func (jt *jointab) Lookup(col *sqlparser.ColName) (order int, joinVar string) {
	c := col.Metadata.(*column)
	return c.Origin().Order(), jt.refs[c]
}
289755
func GetLanguage() string {
	globalConfig.RLock()
	lang := globalConfig.language
	globalConfig.RUnlock()

	return lang
}
143090
func Lookup(ns Symbol, path ...string) Symbol {
	cur := ns
	for _, p := range path {
		var next Symbol
		if strct, _ := cur.(*Struct); strct != nil {
			for _, sym := range strct.symbols {
				if sym.Name() == p {
					next = sym
					break
				}
			}
		}
		if next == nil {
			return newBrokenSymbol(p)
		}
		cur = next
	}
	return cur
}
704668
func (f *Registry) lookup(name string, version int) (record, error) {
	if versions, ok := f.facades[name]; ok {
		if record, ok := versions[version]; ok {
			return record, nil
		}
	}
	return record{}, errors.NotFoundf("%s(%d)", name, version)
}
724266
func Lookup(manager *plugins.Manager) *Plugin {
	if p := manager.Plugin(Name); p != nil {
		return p.(*Plugin)
	}
	return nil
}
1366322
func (c *MockConfig) Lookup(key string) (interface{}, bool) {
	if key == "invalid" {
		return nil, false
	}
	value, ok := c.Lookup(key)
	if !ok {
		return nil, false
	}
	return value, true
}