// Resolve attempts to resolve the newest version of the specified name and
// returns its path.
776124
func (api *NameAPI) Resolve(ctx context.Context, name string, opts ...caopts.NameResolveOption) (coreiface.Path, error) {
	results, err := api.Search(ctx, name, opts...)
	if err != nil {
		return nil, err
	}

	err = coreiface.ErrResolveFailed
	var p coreiface.Path

	for res := range results {
		p, err = res.Path, res.Err
		if err != nil {
			break
		}
	}

	return p, err
}
209082
func (d DestinationShard) Resolve(allShards []*topodatapb.ShardReference, addShard func(shard string) error) error {
	return addShard(string(d))
}
333950
func (v Variable) Resolve(env Environ) (string, Variable) {
	name := ""
	for i := 0; i < maxNameRefDepth; i++ {
		if v.Kind != NameRef {
			return name, v
		}
		name = v.Str // keep name for the next iteration
		v = env.Get(name)
	}
	return name, Variable{}
}
1311008
func (r *PeerResolver) Resolve(peers []fab.Peer) (fab.Peer, error) {
	return r.loadBalancePolicy.Choose(peers)
}
618616
func (db *DB) Resolve(n *Node) *Node {
	if n.Seq() > db.NodeSeq(n.ID()) {
		return n
	}
	return db.Node(n.ID())
}
193504
func (r PipelineResolver) Resolve(value string) (*ComponentMatch, error) {
	return &ComponentMatch{
		Value:     value,
		LocalOnly: true,
	}, nil
}
1179397
func (it *Resolver) resolve(ctx context.Context) error {
	values, err := graph.RefsOf(ctx, it.qs, it.order)
	if err != nil {
		return err
	}
	for index, value := range values {
		node := it.order[index]
		it.values[node] = value
		it.nodes[value.Key()] = node
	}
	it.cached = true
	return nil
}
1261673
func (parser *Parser) Resolve(param string) string {
	if !strings.HasPrefix(param, globalParam+".") {
		return ""
	}
	return strings.TrimPrefix(param, globalParam+".")
}
268398
func (d DestinationShards) Resolve(allShards []*topodatapb.ShardReference, addShard func(shard string) error) error {
	for _, shard := range d {
		if err := addShard(shard); err != nil {
			return err
		}
	}
	return nil
}
982767
func (prs *Parser) Resolve(p string) (httpParam string) {
	if p == param || strings.HasPrefix(p, param+".") {
		return param
	}
	return ""
}
798457
func Resolve(h string) (out string, err error) {
	start := time.Now()
	defer func() {
		log.DebugLevel().Tag("dns").Printf("Resolve %v took: %v", h, time.Since(start))
	}()

	host, port, err := utilNet.SplitHostPort(h)
	if err != nil && !e.Equal(err, utilNet.ErrCantFindPort) {
		return "", e.Forward(err)
	}

	addrs, err := LookupHost(host)
	if err != nil {
		return "", e.Forward(err)
	}
	if len(addrs) == 0 {
		return "", e.New(ErrHostNotResolved)
	}

	if strings.Contains(addrs[0], ":") {
		out = "[" + addrs[0] + "]"
	} else {
		out = addrs[0]
	}
	if port != "" {
		out += ":" + port
	}
	return
}
494979
func (o *orphanDeploymentResolver) Resolve() ([]*corev1.ReplicationController, error) {
	deployments, err := o.dataSet.ListDeployments()
	if err != nil {
		return nil, err
	}

	results := []*corev1.ReplicationController{}
	for _, deployment := range deployments {
		deploymentStatus := appsutil.DeploymentStatusFor(deployment)
		if !o.deploymentStatusFilter.Has(string(deploymentStatus)) {
			continue
		}
		_, exists, _ := o.dataSet.GetDeploymentConfig(deployment)
		if !exists {
			results = append(results, deployment)
		}
	}
	return results, nil
}
53943
func (m *MockInterface) Resolve(arg0 *charm_v6.URL) (*charm_v6.URL, []string, error) {
	ret := m.ctrl.Call(m, "Resolve", arg0)
	ret0, _ := ret[0].(*charm_v6.URL)
	ret1, _ := ret[1].([]string)
	ret2, _ := ret[2].(error)
	return ret0, ret1, ret2
}
676717
func (m *Manager) resolve(req *chartutil.Requirements, repoNames map[string]string, hash string) (*chartutil.RequirementsLock, error) {
	res := resolver.New(m.ChartPath, m.HelmHome)
	return res.Resolve(req, repoNames, hash)
}
1144637
func (r *PeerResolver) Resolve(peers []fab.Peer) (fab.Peer, error) {
	filteredPeers := r.blockHeightResolver.Filter(peers)

	var orgPeers []fab.Peer
	for _, p := range filteredPeers {
		if p.MSPID() == r.mspID {
			orgPeers = append(orgPeers, p)
		}
	}

	if len(orgPeers) > 0 {
		// Our org is in the list. Use the default balancer to balance between them.
		logger.Debugf("Choosing a peer from [%s]", r.mspID)
		return r.loadBalancePolicy.Choose(orgPeers)
	}

	logger.Debugf("Choosing a peer from another org since there are no peers from [%s] in the list of peers", r.mspID)
	return r.loadBalancePolicy.Choose(filteredPeers)
}
915901
func (r *CacheResolver) Resolve(host string) ([]net.IP, error) {
	r.mu.RLock()
	if item, ok := r.cache[host]; ok {
		if item.ttl.IsZero() || timeNow().Before(item.ttl) {
			r.mu.RUnlock()
			ips := make([]net.IP, len(item.ips))
			copy(ips, item.ips)
			return ips, nil
		}
	}
	r.mu.RUnlock()

	resolver := r.Resolver
	if resolver == nil {
		resolver = DefaultResolver
	}
	ips, err := resolver.Resolve(host)
	if err != nil {
		return nil, err
	}

	var ttl time.Time
	if r.TTL > 0 {
		ttl = timeNow().Add(r.TTL)
	}
	item := &cacheItem{ips, ttl}
	r.mu.Lock()
	if r.cache == nil {
		r.cache = make(map[string]*cacheItem)
	}
	r.cache[host] = item
	r.mu.Unlock()

	ips = make([]net.IP, len(item.ips))
	copy(ips, item.ips)
	return ips, err
}
1178291
func Resolve(providerArg string) (string, error) {
	provider := providerArg

	if provider == "" {
		provider = os.Getenv("SUMMON_PROVIDER")
	}

	if provider == "" {
		providers, _ := ioutil.ReadDir(DefaultPath)
		if len(providers) == 1 {
			provider = providers[0].Name()
		} else if len(providers) > 1 {
			return "", fmt.Errorf("More than one provider found in %s, please specify one\n", DefaultPath)
		}
	}

	provider = expandPath(provider)

	if provider == "" {
		return "", fmt.Errorf("Could not resolve a provider!")
	}

	_, err := os.Stat(provider)
	if err != nil {
		return "", err
	}

	return provider, nil
}