// Resolve resolves as the first highest scored match returned by the Searcher
552614
func (r HighestScoreResolver) Resolve(value string) (*ComponentMatch, error) {
	matches, err := r.Searcher.Search(true, value)
	if len(matches) == 0 {
		return nil, ErrNoMatch{Value: value, Errs: err, Type: r.Searcher.Type()}
	}
	sort.Sort(ScoredComponentMatches(matches))
	return matches[0], errors.NewAggregate(err)
}
179746
func (k *KeybaseServiceBase) Resolve(
	ctx context.Context, assertion string,
	offline keybase1.OfflineAvailability) (
	kbname.NormalizedUsername, keybase1.UserOrTeamID, error) {
	res, err := k.identifyClient.Resolve3(
		ctx, keybase1.Resolve3Arg{
			Assertion: assertion,
			Oa:        offline,
		})
	if err != nil {
		return kbname.NormalizedUsername(""), keybase1.UserOrTeamID(""),
			ConvertIdentifyError(assertion, err)
	}
	return kbname.NewNormalizedUsername(res.Name), res.Id, nil
}
438067
func (c *Client) Resolved(unit string, retry bool) error {
	p := params.Resolved{
		UnitName: unit,
		Retry:    retry,
	}
	return c.facade.FacadeCall("Resolved", p, nil)
}
835669
func Resolve(appConfig *AppConfig) (*ResolvedComponents, error) {
	r := &appConfig.Resolvers
	c := &appConfig.ComponentInputs
	g := &appConfig.GenerationInputs
	s := &appConfig.SourceRepositories
	i := &appConfig.ImageStreams
	b := &app.ReferenceBuilder{}

	if err := AddComponentInputsToRefBuilder(b, r, c, g, s, i); err != nil {
		return nil, err
	}

	components, repositories, errs := b.Result()
	if len(errs) > 0 {
		return nil, kutilerrors.NewAggregate(errs)
	}

	// Add source components if source-image points to another location
	// TODO: image sources aren't really "source repositories" and we should probably find another way to
	// represent them
	imageComp, repositories, err := AddImageSourceRepository(repositories, r.ImageSourceResolver(), g)
	if err != nil {
		return nil, err
	}

	// TODO: the second half of this method is potentially splittable - each chunk below amends or qualifies
	// the inputs provided by the user (mostly via flags). c is cleared to prevent it from being used accidentally.
	c = nil

	// if the --context-dir flag was passed, set the context directory on all repositories
	if len(g.ContextDir) > 0 && len(repositories) > 0 {
		klog.V(5).Infof("Setting contextDir on all repositories to %v", g.ContextDir)
		for _, repo := range repositories {
			repo.SetContextDir(g.ContextDir)
		}
	}

	// if the --strategy flag was passed, set the build strategy on all repositories
	if g.Strategy != newapp.StrategyUnspecified && len(repositories) > 0 {
		klog.V(5).Infof("Setting build strategy on all repositories to %v", g.Strategy)
		for _, repo := range repositories {
			repo.SetStrategy(g.Strategy)
		}
	}

	if g.Strategy != newapp.StrategyUnspecified && len(repositories) == 0 && !g.BinaryBuild {
		return nil, errors.New("--strategy is specified and none of the arguments provided could be classified as a source code location")
	}

	if g.BinaryBuild && (len(repositories) > 0 || components.HasSource()) {
		return nil, errors.New("specifying binary builds and source repositories at the same time is not allowed")
	}

	componentsIncludingImageComps := components
	if imageComp != nil {
		componentsIncludingImageComps = append(components, imageComp)
	}

	if err := componentsIncludingImageComps.Resolve(); err != nil {
		return nil, err
	}

	// If any references are potentially ambiguous in the future, force the user to provide the
	// unambiguous input.
	if err := detectPartialMatches(componentsIncludingImageComps); err != nil {
		return nil, err
	}

	// Guess at the build types
	components, err = InferBuildTypes(components, g)
	if err != nil {
		return nil, err
	}

	// Couple source with resolved builder components if possible
	if err := EnsureHasSource(components.NeedsSource(), repositories.NotUsed(), g); err != nil {
		return nil, err
	}

	// For source repos that are not yet linked to a component, create components
	sourceComponents, err := AddMissingComponentsToRefBuilder(b, repositories.NotUsed(), r.DockerfileResolver(), r.SourceResolver(), r.PipelineResolver(), g)
	if err != nil {
		return nil, err
	}

	// Resolve any new source components added
	if err := sourceComponents.Resolve(); err != nil {
		return nil, err
	}
	components = append(components, sourceComponents...)

	klog.V(4).Infof("Code [%v]", repositories)
	klog.V(4).Infof("Components [%v]", components)

	return &ResolvedComponents{
		Components:   components,
		Repositories: repositories,
	}, nil
}
1072180
func (g *graph) ResolveAll() []reflect.Value {
	var values []reflect.Value
	for _, def := range g.definitions {
		values = append(values, def.Resolve(g))
	}
	return values
}
1151723
func (r UniqueExactOrInexactMatchResolver) Resolve(value string) (*ComponentMatch, error) {
	matches, err := r.Searcher.Search(true, value)
	sort.Sort(ScoredComponentMatches(matches))

	exact := matches.Exact()
	switch len(exact) {
	case 0:
		inexact := matches.Inexact()
		switch len(inexact) {
		case 0:
			return nil, ErrNoMatch{Value: value, Errs: err, Type: r.Searcher.Type()}
		case 1:
			return inexact[0], errors.NewAggregate(err)
		default:
			return nil, ErrMultipleMatches{Value: value, Matches: matches, Errs: err}
		}
	case 1:
		return exact[0], errors.NewAggregate(err)
	default:
		return nil, ErrMultipleMatches{Value: value, Matches: matches, Errs: err}
	}
}
188920
func (d DestinationKeyspaceID) Resolve(allShards []*topodatapb.ShardReference, addShard func(shard string) error) error {
	shard, err := GetShardForKeyspaceID(allShards, d)
	if err != nil {
		return err
	}
	return addShard(shard)
}
1311008
func (r *PeerResolver) Resolve(peers []fab.Peer) (fab.Peer, error) {
	return r.loadBalancePolicy.Choose(peers)
}
46522
func (a *API) Resolve(ctx context.Context, address string) (storage.Address, error) {
	// if DNS is not configured, return an error
	if a.dns == nil {
		if hashMatcher.MatchString(address) {
			return common.Hex2Bytes(address), nil
		}
		apiResolveFail.Inc(1)
		return nil, fmt.Errorf("no DNS to resolve name: %q", address)
	}
	// try and resolve the address
	resolved, err := a.dns.Resolve(address)
	if err != nil {
		if hashMatcher.MatchString(address) {
			return common.Hex2Bytes(address), nil
		}
		return nil, err
	}
	return resolved[:], nil
}
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
}
1261613
func (m *MockJobResolver) Resolve(arg0, arg1 string) (job.Job, error) {
	ret := m.ctrl.Call(m, "Resolve", arg0, arg1)
	ret0, _ := ret[0].(job.Job)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
74495
func (d DestinationKeyRanges) Resolve(allShards []*topodatapb.ShardReference, addShard func(shard string) error) error {
	for _, kr := range d {
		if err := processKeyRange(allShards, kr, addShard); err != nil {
			return err
		}
	}
	return nil
}
1041066
func (state *Runtime) Resolve(name string) reflect.Value {

	if name == "." {
		return state.context
	}

	sc := state.scope
	// try to resolve variables in the current scope
	vl, ok := sc.variables[name]
	// if not found walks parent scopes
	for !ok && sc.parent != nil {
		sc = sc.parent
		vl, ok = sc.variables[name]
	}

	// if not found check globals
	if !ok {
		state.set.gmx.RLock()
		vl, ok = state.set.globals[name]
		state.set.gmx.RUnlock()
		// not found check defaultVariables
		if !ok {
			vl, ok = defaultVariables[name]
		}
	}
	return vl
}
670917
func (h Handle) ResolvesTo(
	ctx context.Context, codec kbfscodec.Codec, resolver idutil.Resolver,
	idGetter IDGetter, osg idutil.OfflineStatusGetter, other Handle) (
	resolvesTo bool, partialResolvedH *Handle, err error) {
	// Check the conflict extension.
	var conflictAdded, finalizedAdded bool
	if !h.IsConflict() && other.IsConflict() {
		conflictAdded = true
		// Ignore the added extension for resolution comparison purposes.
		other.conflictInfo = nil
	}

	// Check the finalized extension.
	if h.IsFinal() {
		if conflictAdded {
			// Can't add conflict info to a finalized handle.
			return false, nil, HandleFinalizedError{}
		}
	} else if other.IsFinal() {
		finalizedAdded = true
		// Ignore the added extension for resolution comparison purposes.
		other.finalizedInfo = nil
	}

	if h.TypeForKeying() == tlf.TeamKeying {
		// Nothing to resolve for team-based TLFs, just use `other` by
		// itself.
		partialResolvedH = other.DeepCopy()
	} else {
		unresolvedAssertions := make(map[string]bool)
		for _, uw := range other.unresolvedWriters {
			unresolvedAssertions[uw.String()] = true
		}
		for _, ur := range other.unresolvedReaders {
			unresolvedAssertions[ur.String()] = true
		}

		// TODO: Once we keep track of the original assertions in
		// Handle, restrict the resolver to use other's assertions
		// only, so that we don't hit the network at all.
		partialResolvedH, err = h.ResolveAgain(
			ctx, partialResolver{resolver, unresolvedAssertions}, idGetter,
			osg)
		if err != nil {
			return false, nil, err
		}

		// If we're migrating, use the partially-resolved handle's
		// list of writers, readers, and conflict info, rather than
		// explicitly checking team membership.  This is assuming that
		// we've already validated the migrating folder's name against
		// the user list in the current MD head (done via
		// `MDOps.GetIDForHandle()`).
		if other.TypeForKeying() == tlf.TeamKeying {
			if h.IsFinal() {
				return false, nil,
					errors.New("Can't migrate a finalized folder")
			}

			other.resolvedWriters = partialResolvedH.resolvedWriters
			other.resolvedReaders = partialResolvedH.resolvedReaders
			other.unresolvedWriters = partialResolvedH.unresolvedWriters
			other.unresolvedReaders = partialResolvedH.unresolvedReaders
			other.conflictInfo = partialResolvedH.conflictInfo
		}
	}

	if conflictAdded || finalizedAdded {
		resolvesTo, err = partialResolvedH.EqualsIgnoreName(codec, other)
	} else {
		resolvesTo, err = partialResolvedH.Equals(codec, other)
	}
	if err != nil {
		return false, nil, err
	}

	return resolvesTo, partialResolvedH, nil
}
974229
func (r PerfectMatchWeightedResolver) Resolve(value string) (*ComponentMatch, error) {
	var errs []error
	types := []string{}
	candidates := ScoredComponentMatches{}
	var group MultiSimpleSearcher
	var groupWeight float32 = 0.0
	for i, resolver := range r {
		// lump all resolvers with the same weight into a single group
		if len(group) == 0 || resolver.Weight == groupWeight {
			group = append(group, resolver.Searcher)
			groupWeight = resolver.Weight
			if i != len(r)-1 && r[i+1].Weight == groupWeight {
				continue
			}
		}
		matches, err := group.Search(true, value)
		if err != nil {
			klog.V(5).Infof("Error from resolver: %v\n", err)
			errs = append(errs, err...)
		}
		types = append(types, group.Type())

		sort.Sort(ScoredComponentMatches(matches))
		if len(matches) > 0 && matches[0].Score == 0.0 && (len(matches) == 1 || matches[1].Score != 0.0) {
			return matches[0], errors.NewAggregate(errs)
		}
		for _, m := range matches {
			if groupWeight != 0.0 {
				m.Score = groupWeight * m.Score
			}
			candidates = append(candidates, m)
		}
		group = nil
	}

	switch len(candidates) {
	case 0:
		return nil, ErrNoMatch{Value: value, Errs: errs, Type: strings.Join(types, ", ")}
	case 1:
		if candidates[0].Score != 0.0 {
			if candidates[0].NoTagsFound {
				return nil, ErrNoTagsFound{Value: value, Match: candidates[0], Errs: errs}
			}
			return nil, ErrPartialMatch{Value: value, Match: candidates[0], Errs: errs}
		}
		return candidates[0], errors.NewAggregate(errs)
	default:
		sort.Sort(candidates)
		if candidates[0].Score < candidates[1].Score {
			if candidates[0].Score != 0.0 {
				return nil, ErrPartialMatch{Value: value, Match: candidates[0], Errs: errs}
			}
			return candidates[0], errors.NewAggregate(errs)
		}
		return nil, ErrMultipleMatches{Value: value, Matches: candidates, Errs: errs}
	}
}
1065615
func (prs *ResizeParser) Resolve(param string) string {
	if !strings.HasPrefix(param, resizeParam+".") {
		return ""
	}
	return strings.TrimPrefix(param, resizeParam+".")
}
992343
func (this *Promise) Resolve(v interface{}) (e error) {
	return this.setResult(&PromiseResult{v, RESULT_SUCCESS})
}