// Lookup returns the requested Users as a slice.
// https://dev.twitter.com/rest/reference/get/users/lookup
188147
func (s *UserService) Lookup(params *UserLookupParams) ([]User, *http.Response, error) {
	users := new([]User)
	apiError := new(APIError)
	resp, err := s.sling.New().Get("lookup.json").QueryStruct(params).Receive(users, apiError)
	return *users, resp, relevantError(err, *apiError)
}
97970
func lookupUserid(id int) string {
	u, err := user.LookupId(strconv.Itoa(id))
	if err == nil {
		return u.Username
	}
	if _, ok := err.(user.UnknownUserIdError); ok {
		return ""
	}
	if parsedPasswd {
		return ""
	}
	parsedPasswd = true
	populateMap(uidName, nil, "/etc/passwd")
	return uidName[id]
}
57718
func (t *UDPv4) lookup(targetKey encPubkey) []*node {
	var (
		target         = enode.ID(crypto.Keccak256Hash(targetKey[:]))
		asked          = make(map[enode.ID]bool)
		seen           = make(map[enode.ID]bool)
		reply          = make(chan []*node, alpha)
		pendingQueries = 0
		result         *nodesByDistance
	)
	// Don't query further if we hit ourself.
	// Unlikely to happen often in practice.
	asked[t.Self().ID()] = true

	// Generate the initial result set.
	t.tab.mutex.Lock()
	result = t.tab.closest(target, bucketSize, false)
	t.tab.mutex.Unlock()

	for {
		// ask the alpha closest nodes that we haven't asked yet
		for i := 0; i < len(result.entries) && pendingQueries < alpha; i++ {
			n := result.entries[i]
			if !asked[n.ID()] {
				asked[n.ID()] = true
				pendingQueries++
				go t.lookupWorker(n, targetKey, reply)
			}
		}
		if pendingQueries == 0 {
			// we have asked all closest nodes, stop the search
			break
		}
		select {
		case nodes := <-reply:
			for _, n := range nodes {
				if n != nil && !seen[n.ID()] {
					seen[n.ID()] = true
					result.push(n, bucketSize)
				}
			}
		case <-t.tab.closeReq:
			return nil // shutdown, no need to continue.
		}
		pendingQueries--
	}
	return result.entries
}
482721
func (r *Resolver) Lookup(instance, service, domain string, entries chan<- *ServiceEntry) error {
	params := defaultParams(service)
	params.Instance = instance
	if domain != "" {
		params.Domain = domain
	}
	params.Entries = entries

	go r.c.mainloop(params)

	err := r.c.query(params)
	if err != nil {
		r.Exit <- true
		return err
	}

	return nil
}
389095
func (l *localIdentityCache) lookup(lbls labels.Labels) *identity.Identity {
	l.mutex.RLock()
	defer l.mutex.RUnlock()

	stringRepresentation := string(lbls.SortedList())
	if id, ok := l.identitiesByLabels[stringRepresentation]; ok {
		return id
	}

	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
}
1059840
func (u Util) userLookup(name string) (*user.User, error) {
	res := &C.lookup_res_t{}

	if ret, err := C.user_lookup(C.CString(u.DestDir),
		C.CString(name), res); ret < 0 {
		return nil, fmt.Errorf("lookup failed: %v", err)
	}

	if res.name == nil {
		return nil, fmt.Errorf("user %q not found", name)
	}

	homedir, err := u.JoinPath(C.GoString(res.home))
	if err != nil {
		return nil, err
	}

	usr := &user.User{
		Name:    C.GoString(res.name),
		Uid:     fmt.Sprintf("%d", int(res.uid)),
		Gid:     fmt.Sprintf("%d", int(res.gid)),
		HomeDir: homedir,
	}

	C.user_lookup_res_free(res)

	return usr, nil
}
394738
func (pl ProfileList) Lookup(_ context.Context, req *fuse.LookupRequest, resp *fuse.LookupResponse) (node fs.Node, err error) {
	// Handle timed profiles first.
	if strings.HasPrefix(req.Name, cpuProfilePrefix) {
		durationStr := strings.TrimPrefix(req.Name, cpuProfilePrefix)
		duration, err := time.ParseDuration(durationStr)
		if err != nil {
			return nil, err
		}

		return timedProfileFile{duration, cpuProfile{}}, nil
	} else if strings.HasPrefix(req.Name, traceProfilePrefix) {
		durationStr := strings.TrimPrefix(req.Name, traceProfilePrefix)
		duration, err := time.ParseDuration(durationStr)
		if err != nil {
			return nil, err
		}
		return timedProfileFile{duration, traceProfile{}}, nil
	}

	f := libfs.ProfileGet(req.Name)
	if f == nil {
		return nil, fuse.ENOENT
	}
	resp.EntryValid = 0
	return &SpecialReadFile{read: f}, nil
}
5428
func (cf *Filter) Lookup(data []byte) bool {
	i1, i2, fp := getIndicesAndFingerprint(data, uint(len(cf.buckets)))
	b1, b2 := cf.buckets[i1], cf.buckets[i2]
	return b1.getFingerprintIndex(fp) > -1 || b2.getFingerprintIndex(fp) > -1
}
1338300
func (s *UsersService) LookupIyoID(identifier string, headers, queryParams map[string]interface{}) (IyoID, *http.Response, error) {
	var err error
	var respBody200 IyoID

	resp, err := s.client.doReqNoBody("GET", s.client.BaseURI+"/users/identifiers/"+identifier, headers, queryParams)
	if err != nil {
		return respBody200, nil, err
	}
	defer resp.Body.Close()

	switch resp.StatusCode {
	case 200:
		err = json.NewDecoder(resp.Body).Decode(&respBody200)
	default:
		err = goraml.NewAPIError(resp, nil)
	}

	return respBody200, resp, err
}
1306098
func (r *HashRing) Lookup(key string) (string, bool) {
	strs := r.LookupN(key, 1)
	if len(strs) == 0 {
		return "", false
	}
	return strs[0], true
}
180892
func (cs *clientStore) lookup(ID string) *client {
	cs.RLock()
	c := cs.clients[ID]
	cs.RUnlock()
	return c
}
1234014
func (r *Reader) Lookup(ipAddress net.IP, result interface{}) error {
	if r.buffer == nil {
		return errors.New("cannot call Lookup on a closed database")
	}
	pointer, err := r.lookupPointer(ipAddress)
	if pointer == 0 || err != nil {
		return err
	}
	return r.retrieveData(pointer, result)
}
697771
func (d *Dir) Lookup(ctx context.Context, name string) (fs.Node, error) {
	node, ok := d.nodes[name]
	if !ok {
		return nil, fuse.ENOENT
	}
	return node, 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
}
392651
func (c *Ctrie) Lookup(key []byte) (interface{}, bool) {
	return c.lookup(&Entry{Key: key, hash: c.hash(key)})
}
567782
func (s scope) lookup(k string) data.Value {
	for i := range s {
		var elem = s[len(s)-i-1].vars
		if val, ok := elem[k]; ok {
			return val
		}
	}
	return data.Undefined{}
}