// QClass returns the class of the question in the request.
// If the request is malformed 0 returned.
514936
func (r *Request) QClass() uint16 {
	if r.Req == nil {
		return 0
	}
	if len(r.Req.Question) == 0 {
		return 0
	}

	return r.Req.Question[0].Qclass

}
46566
func Class(class ...string) Applyer {
	mustValidateClassNames(class)
	return markupFunc(func(h *HTML) {
		if h.classes == nil {
			h.classes = make(map[string]struct{})
		}
		for _, name := range class {
			h.classes[name] = struct{}{}
		}
	})
}
1000594
func (rule *classRule) Rewrite(ctx context.Context, state request.Request) Result {
	if rule.fromClass > 0 && rule.toClass > 0 {
		if state.Req.Question[0].Qclass == rule.fromClass {
			state.Req.Question[0].Qclass = rule.toClass
			return RewriteDone
		}
	}
	return RewriteIgnored
}
755182
func (p *Partition) Class(w string) (int, error) {
	n, ok := p.words[w]
	if !ok {
		return 0, &NotFoundError{w}
	}
	return n, nil
}
127297
func (r *HealthRecord) Class() string {
	switch {
	case r.Error != nil:
		return "unhealthy"
	case r.ReplicationDelay > *degradedThreshold:
		return "unhappy"
	default:
		return "healthy"
	}
}
907038
func (q *KnowledgeQAService) Get(req KnowledgeQARequest) (*KnowledgeQAResponse, error) {

	val := url.Values{}
	val.Set("q", req.QAText)

	var knowRes KnowledgeQAResponse
	res, err := q.client.get(q.ctx, KnowledgeQAURL, val, &knowRes)
	if err != nil {
		return nil, err
	}

	defer res.Body.Close()

	return &knowRes, nil
}
642323
func newCharClass(start rune, end rune) *tCharClass {
	charRange := newCharClassRange(start, end)
	return &tCharClass{
		Ranges:    []tCharClassRange{charRange},
		TotalSize: charRange.Size,
	}
}
1324349
func (s *serverConfig) GetStorageClass() (storageClass, storageClass) {
	if globalIsStorageClass {
		return globalStandardStorageClass, globalRRStorageClass
	}
	if s == nil {
		return storageClass{}, storageClass{}
	}
	return s.StorageClass.Standard, s.StorageClass.RRS
}
859449
func NewDebtClass(s string) (debtClass, error) {
	var e debtClass
	err := e.FromString(s)
	if err != nil {
		return 0, err
	}
	return e, nil
}
187235
func (p *Partition) EquivClass(w string) ([]string, error) {
	i, ok := p.words[w]
	if !ok {
		return nil, &NotFoundError{w}
	}
	return p.classes[i], nil
}
726071
func NewClass(id, fingerprint string, sample bool) *Class {
	class := &Class{
		Id:           id,
		Fingerprint:  fingerprint,
		Metrics:      NewMetrics(),
		TotalQueries: 0,
		Example:      &Example{},
		sample:       sample,
	}
	return class
}
31887
func (f *FieldSetType) RemoveClass(class string) *FieldSetType {
	delete(f.class, class)
	return f
}
1134524
func (r *Request) QType() uint16 {
	if r.Req == nil {
		return 0
	}
	if len(r.Req.Question) == 0 {
		return 0
	}

	return r.Req.Question[0].Qtype
}
945512
func (f *FieldSetType) AddClass(class string) *FieldSetType {
	f.class[class] = struct{}{}
	return f
}
1183893
func (c HTMLConfig) Class(kind Kind) string {
	switch kind {
	case String:
		return c.String
	case Keyword:
		return c.Keyword
	case Comment:
		return c.Comment
	case Type:
		return c.Type
	case Literal:
		return c.Literal
	case Punctuation:
		return c.Punctuation
	case Plaintext:
		return c.Plaintext
	case Tag:
		return c.Tag
	case HTMLTag:
		return c.HTMLTag
	case HTMLAttrName:
		return c.HTMLAttrName
	case HTMLAttrValue:
		return c.HTMLAttrValue
	case Decimal:
		return c.Decimal
	}
	return ""
}
112304
func (s Sample) IQR() float64 {
	if !s.Sorted {
		s = *s.Copy().Sort()
	}
	return s.Quantile(0.75) - s.Quantile(0.25)
}
769599
func (q *QueryFeedback) Equal(rq *QueryFeedback) bool {
	if len(q.Feedback) != len(rq.Feedback) {
		return false
	}
	for i, fb := range q.Feedback {
		rfb := rq.Feedback[i]
		if fb.Count != rfb.Count {
			return false
		}
		if fb.Lower.Kind() == types.KindInt64 {
			if fb.Lower.GetInt64() != rfb.Lower.GetInt64() {
				return false
			}
			if fb.Upper.GetInt64() != rfb.Upper.GetInt64() {
				return false
			}
		} else {
			if !bytes.Equal(fb.Lower.GetBytes(), rfb.Lower.GetBytes()) {
				return false
			}
			if !bytes.Equal(fb.Upper.GetBytes(), rfb.Upper.GetBytes()) {
				return false
			}
		}
	}
	return true
}