// Lookup implements the fs.NodeRequestLookuper interface for *Trash
424173
func (t *Trash) Lookup(ctx context.Context,
	req *fuse.LookupRequest, resp *fuse.LookupResponse) (fs.Node, error) {
	if req.Name == strconv.Itoa(os.Getuid()) {
		return &Alias{
			realPath: fmt.Sprintf("../private/%s/.trash", t.kbusername),
		}, nil
	}
	return nil, fuse.ENOENT
}
98435
func (m *MetadataMapping) Lookup(cc string) (Metadata, bool) {
	m.RLock()
	defer m.RUnlock()
	md, exists := m.mdByName[cc]
	return md, exists
}
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
}
270226
func (d *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.LookupResponse) (node fs.Node, err error) {
	ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Lookup",
		fmt.Sprintf("%s %s", d.node.GetBasename(), req.Name))
	defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()

	d.folder.fs.vlog.CLogf(ctx, libkb.VLog1, "Dir Lookup %s", req.Name)
	defer func() { err = d.folder.processError(ctx, libkbfs.ReadMode, err) }()

	// This fits in situation 1 as described in libkbfs/delayed_cancellation.go
	err = libcontext.EnableDelayedCancellationWithGracePeriod(
		ctx, d.folder.fs.config.DelayedCancellationGracePeriod())
	if err != nil {
		return nil, err
	}

	specialNode := handleTLFSpecialFile(
		req.Name, d.folder, &resp.EntryValid)
	if specialNode != nil {
		return specialNode, nil
	}

	// Check if this is a per-file metainformation file, if so
	// return the corresponding SpecialReadFile.
	if strings.HasPrefix(req.Name, libfs.FileInfoPrefix) {
		name := req.Name[len(libfs.FileInfoPrefix):]
		return NewFileInfoFile(d.folder.fs, d.node, name, &resp.EntryValid), nil
	}

	newNode, de, err := d.folder.fs.config.KBFSOps().Lookup(ctx, d.node, req.Name)
	if err != nil {
		if _, ok := err.(idutil.NoSuchNameError); ok {
			return nil, fuse.ENOENT
		}
		return nil, err
	}

	// No libkbfs calls after this point!
	d.folder.nodesMu.Lock()
	defer d.folder.nodesMu.Unlock()

	// newNode can be nil even without errors when the KBFS direntry
	// is of a type that doesn't get its own node (is fully contained
	// in the directory); Symlink does this.
	if newNode != nil {
		if n, ok := d.folder.nodes[newNode.GetID()]; ok {
			return n, nil
		}

		newNode.FillCacheDuration(&resp.EntryValid)
	}

	switch de.Type {
	default:
		return nil, fmt.Errorf("unhandled entry type: %v", de.Type)

	case data.File, data.Exec:
		child := d.makeFile(newNode)
		d.folder.nodes[newNode.GetID()] = child
		return child, nil

	case data.Dir:
		child := newDir(d.folder, newNode)
		d.folder.nodes[newNode.GetID()] = child
		return child, nil

	case data.Sym:
		// Give each symlink instance a unique inode.  We don't get
		// enough information about remote renames of syminks to be
		// able to attach a constant inode to a given symlink.
		child := &Symlink{
			parent: d,
			name:   req.Name,
			inode:  d.folder.fs.assignInode(),
		}
		// A Symlink is never included in Folder.nodes, as it doesn't
		// have a libkbfs.Node to keep track of renames.
		return child, nil
	}
}
807521
func (s *StructStruct) Lookup(path ...string) *StructField {
	name := path[0]
	if len(path) == 1 {
		for _, item := range s.data {
			if item.Name() == name {
				return item
			}
		}
		return nil
	}
	for _, item := range s.data {
		if item.embedded != nil && item.Name() == name {
			return item.embedded.Lookup(path[1:]...)
		}
	}
	return nil
}
364593
func Lookup(args ...cty.Value) (cty.Value, error) {
	return LookupFunc.Call(args)
}
181430
func (w *walletAPIHandler) lookup(ctx context.Context, c Call, wr io.Writer) error {
	var opts nameOptions
	if err := unmarshalOptions(c, &opts); err != nil {
		return w.encodeErr(c, err, wr)
	}
	if err := w.registerIdentifyUI(); err != nil {
		return w.encodeErr(c, err, wr)
	}

	result, err := w.cli.LookupCLILocal(ctx, opts.Name)
	if err != nil {
		return w.encodeErr(c, err, wr)
	}
	return w.encodeResult(c, result, wr)
}
1143413
func (p Proxy) Lookup(state request.Request, name string, typ uint16) (*dns.Msg, error) {
	req := new(dns.Msg)
	req.SetQuestion(name, typ)
	state.SizeAndDo(req)

	state2 := request.Request{W: state.W, Req: req}

	return p.lookup(state2)
}
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)
}
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
}
1002113
func Lookup(dir string) (Info, error) {
	dir = filepath.Clean(dir)

	mounts, err := Self()
	if err != nil {
		return Info{}, err
	}

	// Sort descending order by Info.Mountpoint
	sort.SliceStable(mounts, func(i, j int) bool {
		return mounts[j].Mountpoint < mounts[i].Mountpoint
	})
	for _, m := range mounts {
		// Note that m.{Major, Minor} are generally unreliable for our purpose here
		// https://www.spinics.net/lists/linux-btrfs/msg58908.html
		// Note that device number is not checked here, because for overlayfs files
		// may have different device number with the mountpoint.
		if strings.HasPrefix(dir, m.Mountpoint) {
			return m, nil
		}
	}

	return Info{}, errors.Errorf("failed to find the mount info for %q", dir)
}
522255
func (e *Etcd) Lookup(ctx context.Context, state request.Request, name string, typ uint16) (*dns.Msg, error) {
	return e.Upstream.Lookup(ctx, state, name, typ)
}
10075
func (s Stmts) Lookup(id string) (Stmt, bool) {
	for _, stmt := range s {
		if stmt.ID() == id {
			return stmt, true
		}
	}
	return nil, false
}
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
}
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)
}
91392
func (r *Router) Lookup(method Method, path string) (Handler, Params, bool) {
	if root := r.trees[method]; root != nil {
		return root.getValue(path)
	}
	return nil, nil, false
}
835855
func (c *thresholdStateCache) Lookup(hash *chainhash.Hash) (ThresholdState, bool) {
	state, ok := c.entries[*hash]
	return state, ok
}