// getFluxSuggestion returns the function parameters for the requested function
480114
func (h *FluxHandler) getFluxSuggestion(w http.ResponseWriter, r *http.Request) {
	ctx := r.Context()
	name := httprouter.ParamsFromContext(ctx).ByName("name")
	completer := complete.DefaultCompleter()

	suggestion, err := completer.FunctionSuggestion(name)
	if err != nil {
		EncodeError(ctx, err, w)
		return
	}

	res := suggestionResponse{Name: name, Params: suggestion.Params}
	if err := encodeResponse(ctx, w, http.StatusOK, res); err != nil {
		logEncodingError(h.Logger, r, err)
		return
	}
}
139325
func GetFilter(identifier string) *FilterInterface {
	filter, ok := filters[identifier]
	if ok {
		return filter
	}

	return nil
}
1361942
func (repo *Repository) GetTagsAfter(after string, limit int) (*TagsResult, error) {
	allTags, err := repo.GetTags()
	if err != nil {
		return nil, fmt.Errorf("GetTags: %v", err)
	}

	if limit < 0 {
		limit = 0
	}

	numAllTags := len(allTags)
	if len(after) == 0 && limit == 0 {
		return &TagsResult{
			HasLatest: true,
			ReachEnd:  true,
			Tags:      allTags,
		}, nil
	} else if len(after) == 0 && limit > 0 {
		endIdx := limit
		if limit >= numAllTags {
			endIdx = numAllTags
		}
		return &TagsResult{
			HasLatest: true,
			ReachEnd:  limit >= numAllTags,
			Tags:      allTags[:endIdx],
		}, nil
	}

	previousAfter := ""
	hasMatch := false
	tags := make([]string, 0, len(allTags))
	for i := range allTags {
		if hasMatch {
			tags = allTags[i:]
			break
		}
		if allTags[i] == after {
			hasMatch = true
			if limit > 0 && i-limit >= 0 {
				previousAfter = allTags[i-limit]
			}
			continue
		}
	}

	if !hasMatch {
		tags = allTags
	}

	// If all tags after match is equal to the limit, it reaches the oldest tag as well.
	if limit == 0 || len(tags) <= limit {
		return &TagsResult{
			HasLatest:     !hasMatch,
			PreviousAfter: previousAfter,
			ReachEnd:      true,
			Tags:          tags,
		}, nil
	}
	return &TagsResult{
		HasLatest:     !hasMatch,
		PreviousAfter: previousAfter,
		Tags:          tags[:limit],
	}, nil
}
917366
func getImageRef(client libdocker.Interface, image string) (string, error) {
	img, err := client.InspectImageByRef(image)
	if err != nil {
		return "", err
	}
	if img == nil {
		return "", fmt.Errorf("unable to inspect image %s", image)
	}

	// Returns the digest if it exist.
	if len(img.RepoDigests) > 0 {
		return img.RepoDigests[0], nil
	}

	return img.ID, nil
}
119708
func (m *MockEnforcer) GetFilterQueue() *fqconfig.FilterQueue {
	ret := m.ctrl.Call(m, "GetFilterQueue")
	ret0, _ := ret[0].(*fqconfig.FilterQueue)
	return ret0
}
518220
func (r *RepositoryEvent) GetAction() string {
	if r == nil || r.Action == nil {
		return ""
	}
	return *r.Action
}
990085
func FilterFuzzy(completions []Suggest, sub string, ignoreCase bool) []Suggest {
	return filterSuggestions(completions, sub, ignoreCase, fuzzyMatch)
}
475244
func (m *MockLambdaAPI) GetFunctionRequest(arg0 *lambda.GetFunctionInput) (*request.Request, *lambda.GetFunctionOutput) {
	ret := m.ctrl.Call(m, "GetFunctionRequest", arg0)
	ret0, _ := ret[0].(*request.Request)
	ret1, _ := ret[1].(*lambda.GetFunctionOutput)
	return ret0, ret1
}
335605
func (stub *ChaincodeStub) GetFunctionAndParameters() (function string, params []string) {
	allargs := stub.GetStringArgs()
	function = ""
	params = []string{}
	if len(allargs) >= 1 {
		function = allargs[0]
		params = allargs[1:]
	}
	return
}
317902
func (v *Service) GetFunctions() (o []*Function) {
	if v != nil {
		o = v.Functions
	}
	return
}
110326
func (mc MongoClient) GetSubscriptionBySlug(slug string) (contract.Subscription, error) {
	return mc.getSubscription(bson.M{"slug": slug})
}
760820
func (p *PullRequestComment) GetPullRequestURL() string {
	if p == nil || p.PullRequestURL == nil {
		return ""
	}
	return *p.PullRequestURL
}
1248154
func GetSpongeFunc(spongeFunc []SpongeFunction, defaultSpongeFuncCreator ...SpongeFunctionCreator) SpongeFunction {
	if len(spongeFunc) > 0 {
		return spongeFunc[0]
	}
	if len(defaultSpongeFuncCreator) > 0 {
		return defaultSpongeFuncCreator[0]()
	}
	panic("No sponge function given")
}
883987
func GetAppliedContentGetFunction(applyTo string) GetAppliedContent {
	if applyTo != "" {
		return func(msg *Message) []byte {
			metadata := msg.TryGetMetadata()
			if metadata == nil {
				return []byte{}
			}
			return metadata.GetValue(applyTo)
		}
	}

	return func(msg *Message) []byte {
		return msg.GetPayload()
	}
}
513719
func (fs *FilterService) GetFavouriteList() ([]*Filter, *Response, error) {
	apiEndpoint := "rest/api/2/filter/favourite"
	req, err := fs.client.NewRequest("GET", apiEndpoint, nil)
	if err != nil {
		return nil, nil, err
	}
	filters := []*Filter{}
	resp, err := fs.client.Do(req, &filters)
	if err != nil {
		jerr := NewJiraError(resp, err)
		return nil, resp, jerr
	}
	return filters, resp, err
}
1253198
func (m *MockLambdaAPI) GetFunction(arg0 *lambda.GetFunctionInput) (*lambda.GetFunctionOutput, error) {
	ret := m.ctrl.Call(m, "GetFunction", arg0)
	ret0, _ := ret[0].(*lambda.GetFunctionOutput)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
459978
func (r *Registry) GetServerFunc(stream string) (func(*Peer, string, bool) (Server, error), error) {
	r.serverMu.RLock()
	defer r.serverMu.RUnlock()

	f := r.serverFuncs[stream]
	if f == nil {
		return nil, fmt.Errorf("stream %v not registered", stream)
	}
	return f, nil
}