// SplitFeedbackByQueryType splits the feedbacks into equality feedbacks and range feedbacks.
185353
func SplitFeedbackByQueryType(feedbacks []Feedback) ([]Feedback, []Feedback) {
	var eqFB, ranFB []Feedback
	for _, fb := range feedbacks {
		// Use `>=` here because sometimes the lower is equal to upper.
		if bytes.Compare(kv.Key(fb.Lower.GetBytes()).PrefixNext(), fb.Upper.GetBytes()) >= 0 {
			eqFB = append(eqFB, fb)
		} else {
			ranFB = append(ranFB, fb)
		}
	}
	return eqFB, ranFB
}
612040
func (s *UpdateFindingsFeedbackInput) SetFeedback(v string) *UpdateFindingsFeedbackInput {
	s.Feedback = &v
	return s
}
1075502
func LinearBackoff(i int) time.Duration {
	return time.Duration(i) * time.Second
}
1218849
func (q *SimpleQueryStringQuery) AutoGenerateSynonymsPhraseQuery(enable bool) *SimpleQueryStringQuery {
	q.autoGenerateSynonymsPhraseQuery = &enable
	return q
}
729847
func (s *Stack) SetFeedbackURL(v string) *Stack {
	s.FeedbackURL = &v
	return s
}
319508
func Reverse(in interface{}) interface{} {
	value := reflect.ValueOf(in)
	valueType := value.Type()

	kind := value.Kind()

	if kind == reflect.String {
		return ReverseString(in.(string))
	}

	if kind == reflect.Array || kind == reflect.Slice {
		length := value.Len()

		resultSlice := makeSlice(value, length)

		j := 0
		for i := length - 1; i >= 0; i-- {
			resultSlice.Index(j).Set(value.Index(i))
			j++
		}

		return resultSlice.Interface()
	}

	panic(fmt.Sprintf("Type %s is not supported by Reverse", valueType.String()))
}
511453
func CheckValidTypesForResultMerger(fields []*querypb.Field, pkFieldCount int) error {
	for i := 0; i < pkFieldCount; i++ {
		typ := fields[i].Type
		if !sqltypes.IsIntegral(typ) && !sqltypes.IsFloat(typ) && !sqltypes.IsBinary(typ) {
			return vterrors.Errorf(vtrpc.Code_FAILED_PRECONDITION, "unsupported type: %v cannot compare fields with this type", typ)
		}
	}
	return nil
}
5681
func compareSegmentType(a, b segment) int {
	segs := []segment{a, b}
	ranks := make([]int, 2)
	for i, seg := range segs {
		switch seg.(type) {
		case literal:
			ranks[i] = 3
		case glob:
			ranks[i] = 2
		case alternation:
			ranks[i] = 1
		case fullglob:
			ranks[i] = 0
		default:
			panic("Bad type for segment!")
		}
	}

	switch {
	case ranks[0] < ranks[1]:
		return -1
	case ranks[0] > ranks[1]:
		return 1
	default:
		return 0
	}
}
1359879
func (r Network_Monitor_Version1_Query_Host) GetQueryType() (resp datatypes.Network_Monitor_Version1_Query_Type, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_Monitor_Version1_Query_Host", "getQueryType", nil, &r.Options, &resp)
	return
}
169377
func (d *Document) SubmitFeedback(ctx context.Context, feedback map[string]map[string]interface{}) APIResponse {
	feedbackMap := map[string]map[string]map[string]interface{}{
		"feedback": feedback,
	}

	feedbackBody, err := json.Marshal(feedbackMap)
	if err != nil {
		return apiResponse("encoding failed", d.ID, nil, err)
	}

	resp, err := d.client.makeAPIRequest(ctx, "PUT", d.Links.Extractions, bytes.NewReader(feedbackBody), nil, d.Owner)

	if err != nil {
		return apiResponse(ErrHTTPPutFailed, d.ID, resp, err)
	}

	defer resp.Body.Close()

	if resp.StatusCode != http.StatusNoContent {
		return apiResponse(ErrDocumentFeedback, d.ID, resp, errors.New(ErrDocumentFeedback))
	}

	return apiResponse("feedback completed", d.ID, resp, err)
}
1188532
func (s *BackupSummary) SetBackupType(v string) *BackupSummary {
	s.BackupType = &v
	return s
}
436760
func (api *LoadBalancerAPI) FilterBy(key string, value interface{}) *LoadBalancerAPI {
	api.filterBy(key, value, false)
	return api
}
986195
func splitResourceTypeName(s string) (resourceTuple, bool, error) {
	if !strings.Contains(s, "/") {
		return resourceTuple{}, false, nil
	}
	seg := strings.Split(s, "/")
	if len(seg) != 2 {
		return resourceTuple{}, false, fmt.Errorf("arguments in resource/name form may not have more than one slash")
	}
	resource, name := seg[0], seg[1]
	if len(resource) == 0 || len(name) == 0 || len(SplitResourceArgument(resource)) != 1 {
		return resourceTuple{}, false, fmt.Errorf("arguments in resource/name form must have a single resource and name")
	}
	return resourceTuple{Resource: resource, Name: name}, true, nil
}
1062246
func (s *Selection) AddBackMatcher(m Matcher) *Selection {
	return s.AddSelection(s.prevSel.FilterMatcher(m))
}
320701
func EncodeFeedback(q *QueryFeedback) ([]byte, error) {
	var pb *queryFeedback
	var err error
	switch q.Tp {
	case PkType:
		pb, err = encodePKFeedback(q)
	case IndexType:
		pb = encodeIndexFeedback(q)
	case ColType:
		pb, err = encodeColumnFeedback(q)
	}
	if err != nil {
		return nil, errors.Trace(err)
	}
	var buf bytes.Buffer
	enc := gob.NewEncoder(&buf)
	err = enc.Encode(pb)
	if err != nil {
		return nil, errors.Trace(err)
	}
	return buf.Bytes(), nil
}
39529
func backendsListEqual(a, b []*compute.Backend) bool {
	if len(a) != len(b) {
		return false
	}
	if len(a) == 0 {
		return true
	}

	aSet := sets.NewString()
	for _, v := range a {
		aSet.Insert(v.Group)
	}
	bSet := sets.NewString()
	for _, v := range b {
		bSet.Insert(v.Group)
	}

	return aSet.Equal(bSet)
}
571791
func (vec *T) DividedByW() T {
	oow := 1 / vec[3]
	return T{vec[0] * oow, vec[1] * oow, vec[2] * oow, 1}
}