// Lookup returns a list of handlers with the given
// given type, or nil if none exist
19993
func (r *registry) Lookup(handlerType HandlerType) interface{} {
	if handlerType == Auth {
		return r.filters
	} else if handlerType == Decoration {
		return r.decorators
	} else if handlerType == Endorsement {
		return r.endorsers
	} else if handlerType == Validation {
		return r.validators
	}

	return nil
}
1010081
func (o *OrganizationLookup) Lookup(ctx context.Context, name string) (platform.ID, bool) {
	org, err := o.OrganizationService.FindOrganization(
		ctx,
		platform.OrganizationFilter{Name: &name},
	)

	if err != nil {
		return platform.InvalidID(), false
	}
	return org.ID, true
}
51133
func (e *Etcd) Lookup(state request.Request, name string, typ uint16) (*dns.Msg, error) {
	return e.Proxy.Lookup(state, name, typ)
}
586266
func (gms *genericMsgStore) Lookup(seq uint64) (*pb.MsgProto, error) {
	return nil, nil
}
1326941
func (db *geoDB) lookup(ip net.IP) *geoDBInfo {
	result := new(geoDBInfo)
	db.geodb.Lookup(ip, result)
	return result
}
98435
func (m *MetadataMapping) Lookup(cc string) (Metadata, bool) {
	m.RLock()
	defer m.RUnlock()
	md, exists := m.mdByName[cc]
	return md, exists
}
617250
func (h *DefaultPluginHandler) Lookup(filename string) (string, bool) {
	for _, prefix := range h.ValidPrefixes {
		path, err := exec.LookPath(fmt.Sprintf("%s-%s", prefix, filename))
		if err != nil || len(path) == 0 {
			continue
		}
		return path, true
	}

	return "", false
}
562360
func lookup(server string, name string, dnsType uint16) (response *dns.Msg, err error) {
	name = dns.Fqdn(name)
	m := &dns.Msg{}
	m.SetQuestion(name, dnsType)
	m.Rcode = dns.OpcodeQuery
	m.RecursionDesired = true

	response, _, err = clientUDP.Exchange(m, server)
	if err == nil && m.Response == true && m.Truncated == false {
		return response, nil
	}

	// Try TCP on error, a truncated response, or some bogus non-response
	response, _, err = clientTCP.Exchange(m, server)
	return response, err
}
1186911
func Lookup(ident []byte) Token {
	// TODO Maps with []byte key are illegal because []byte does not
	//      support == . Should find a more efficient solution eventually.
	if tok, is_keyword := keywords[string(ident)]; is_keyword {
		return tok
	}
	return IDENT
}
1325954
func lookup(contextChain []interface{}, name string) reflect.Value {
    // dot notation
    if name != "." && strings.Contains(name, ".") {
        parts := strings.SplitN(name, ".", 2)
        
        v := lookup(contextChain, parts[0])
        return lookup([]interface{}{v}, parts[1])
    }

    defer func() {
        if r := recover(); r != nil {
            fmt.Printf("Panic while looking up %q: %s\n", name, r)
        }
    }()

Outer:
    for _, ctx := range contextChain { //i := len(contextChain) - 1; i >= 0; i-- {
        v := ctx.(reflect.Value)
        for v.IsValid() {
            typ := v.Type()
            if n := v.Type().NumMethod(); n > 0 {
                for i := 0; i < n; i++ {
                    m := typ.Method(i)
                    mtyp := m.Type
                    if m.Name == name && mtyp.NumIn() == 1 {
                        return v.Method(i).Call(nil)[0]
                    }
                }
            }
            if name == "." {
                return v
            }
            switch av := v; av.Kind() {
            case reflect.Ptr:
                v = av.Elem()
            case reflect.Interface:
                v = av.Elem()
            case reflect.Struct:
                ret := av.FieldByName(name)
                if ret.IsValid() {
                    return ret
                } else {
                    continue Outer
                }
            case reflect.Map:
                ret := av.MapIndex(reflect.ValueOf(name))
                if ret.IsValid() {
                    return ret
                } else {
                    continue Outer
                }
            default:
                continue Outer
            }
        }
    }
    return reflect.Value{}
}
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
}
751325
func Lookup(lookupValue interface{}, expr map[string]interface{}, src *Col, result *map[int]struct{}) (err error) {
	// Figure out lookup path - JSON array "in"
	path, hasPath := expr["in"]
	if !hasPath {
		return errors.New("Missing lookup path `in`")
	}
	vecPath := make([]string, 0)
	if vecPathInterface, ok := path.([]interface{}); ok {
		for _, v := range vecPathInterface {
			vecPath = append(vecPath, fmt.Sprint(v))
		}
	} else {
		return fmt.Errorf("Expecting vector lookup path `in`, but %v given", path)
	}
	// Figure out result number limit
	intLimit := int(0)
	if limit, hasLimit := expr["limit"]; hasLimit {
		if floatLimit, ok := limit.(float64); ok {
			intLimit = int(floatLimit)
		} else if _, ok := limit.(int); ok {
			intLimit = limit.(int)
		} else {
			return dberr.New(dberr.ErrorExpectingInt, "limit", limit)
		}
	}
	lookupStrValue := fmt.Sprint(lookupValue) // the value to look for
	lookupValueHash := StrHash(lookupStrValue)
	scanPath := strings.Join(vecPath, INDEX_PATH_SEP)
	if _, indexed := src.indexPaths[scanPath]; !indexed {
		return dberr.New(dberr.ErrorNeedIndex, scanPath, expr)
	}
	num := lookupValueHash % src.db.numParts
	ht := src.hts[num][scanPath]
	ht.Lock.RLock()
	vals := ht.Get(lookupValueHash, intLimit)
	ht.Lock.RUnlock()
	for _, match := range vals {
		// Filter result to avoid hash collision
		if doc, err := src.read(match, false); err == nil {
			for _, v := range GetIn(doc, vecPath) {
				if fmt.Sprint(v) == lookupStrValue {
					(*result)[match] = struct{}{}
				}
			}
		}
	}
	return
}
76915
func Lookup(epname string, remoteAddr, localAddr string, proto u8proto.U8proto, ingress bool) (*CtEntry, error) {
	key, err := createTupleKey(remoteAddr, localAddr, proto, ingress)
	if err != nil {
		return nil, err
	}

	_, ipv4 := key.(*CtKey4)

	mapname := getMapName(epname, ipv4, proto)

	m := bpf.GetMap(mapname)
	if m == nil {
		// Open the map and leave it open
		m, err = bpf.OpenMap(mapname)
		if err != nil {
			return nil, fmt.Errorf("Can not open CT map %s: %s", mapname, err)
		}
	}

	v, err := m.Lookup(key)
	if err != nil || v == nil {
		return nil, err
	}
	return v.(*CtEntry), err
}
741259
func (ms *Macros) Lookup(pt ast.ParamType) *Macro {
	if m := ms.Get(pt.Indent()); m != nil {
		return m
	}

	if alias, has := ast.HasAlias(pt); has {
		if m := ms.Get(alias); m != nil {
			return m
		}
	}

	return nil
}
1050456
func Lookup(rblList string, targetHost string) (r RBLResults) {
	r.List = rblList
	r.Host = targetHost

	if ip, err := net.LookupIP(targetHost); err == nil {
		for _, addr := range ip {
			if addr.To4() != nil {
				res := Result{}
				res.Address = addr.String()

				addr := Reverse(addr)

				query(rblList, addr, &res)

				r.Results = append(r.Results, res)

			}
		}
	}
	return
}
547321
func (f *Filter) Lookup(p []byte) bool {
	for _, subfil := range f.fs {
		if subfil.Lookup(p, f.hs[:subfil.K]) {
			return true
		}
	}
	return false
}
111938
func (ts *tagStore) Lookup(ctx context.Context, desc distribution.Descriptor) ([]string, error) {
	allTags, err := ts.All(ctx)
	switch err.(type) {
	case distribution.ErrRepositoryUnknown:
		// This tag store has been initialized but not yet populated
		break
	case nil:
		break
	default:
		return nil, err
	}

	var tags []string
	for _, tag := range allTags {
		tagLinkPathSpec := manifestTagCurrentPathSpec{
			name: ts.repository.Named().Name(),
			tag:  tag,
		}

		tagLinkPath, _ := pathFor(tagLinkPathSpec)
		tagDigest, err := ts.blobStore.readlink(ctx, tagLinkPath)
		if err != nil {
			switch err.(type) {
			case storagedriver.PathNotFoundError:
				continue
			}
			return nil, err
		}

		if tagDigest == desc.Digest {
			tags = append(tags, tag)
		}
	}

	return tags, nil
}