// headerVal for key as an int. Return false if header is not present or valid.
498560
func headerVal(key string, resp *http.Response) (int, bool) {
	if h := resp.Header.Get(key); len(h) > 0 {
		if i, err := strconv.Atoi(h); err == nil {
			return i, true
		}
	}
	return 0, false
}
133715
func (a Annotation) getVal(key string) (string, bool) {
	v, ok := a[key]
	return v, ok
}
577645
func readValueHeaderTOC(fpr io.Reader) ([]byte, uint32, error) {
	return _readValueHeader(fpr, true)
}
1179124
func (ns *Namespace) KeyVals(key interface{}, vals ...interface{}) (types.KeyValues, error) {
	return types.KeyValues{Key: key, Values: vals}, nil
}
469698
func (h Header) Set(key, value string) {
	h[textproto.CanonicalMIMEHeaderKey(key)] = []string{value}
}
785799
func (p *Personalization) SetHeader(key string, value string) {
	p.Headers[key] = value
}
450375
func validateHeader(header uint32) (valid bool, size int) {
	var (
		sync  = (header >> 20) & 0xfff
		id    = (header >> 19) & 1
		layer = 4 - (header>>17)&3
		br    = (header >> 12) & 15
		sf    = (header >> 10) & 3
		pad   = (header >> 9) & 1
	)

	if sync != 0xfff || id == 0 || layer == 4 || br == 15 || sf == 3 {
		return false, 0
	}

	if br == 0 { // free format
		return true, 0
	}

	size = 12 * bitrateBps[layer][br]
	if layer != 1 {
		size *= 12
	}
	size /= samplingFreqHz[sf]
	size += int(pad)
	if layer == 1 {
		size *= 4
	}

	return true, size
}
1034925
func headerKey(number uint64, hash common.Hash) []byte {
	return append(append(headerPrefix, encodeBlockNumber(number)...), hash.Bytes()...)
}
541621
func (req *MCRequest) HeaderBytes() []byte {
	data := make([]byte, HDR_LEN+len(req.Extras)+len(req.Key))

	req.fillHeaderBytes(data)

	return data
}
868921
func (F *Frisby) ExpectHeader(key, value string) *Frisby {
	Global.NumAsserts++
	chk_val := F.Resp.Header.Get(key)
	if chk_val == "" {
		err_str := fmt.Sprintf("Expected Header %q, but it was missing", key)
		F.AddError(err_str)
	} else if chk_val != value {
		err_str := fmt.Sprintf("Expected Header %q to be %q, but got %q", key, value, chk_val)
		F.AddError(err_str)
	}
	return F
}
1263917
func (kv KeyVal) Value() string {
	if !strings.Contains(string(kv), "=") {
		return ""
	}
	return strings.SplitN(strings.TrimSpace(string(kv)), "=", 2)[1]
}
750671
func codeVal(status int) string {
	code := (status - (status % 100)) / 100
	return strconv.Itoa(code) + "xx"
}
1073258
func (f *FST) IsMatchWithVal(addr int) (bool, uint64) {
	s, err := f.decoder.stateAt(addr, nil)
	if err != nil {
		return false, 0
	}
	return s.Final(), s.FinalOutput()
}
679484
func (m *HeaderValueOption) Validate() error {
	if m == nil {
		return nil
	}

	if m.GetHeader() == nil {
		return HeaderValueOptionValidationError{
			field:  "Header",
			reason: "value is required",
		}
	}

	{
		tmp := m.GetHeader()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HeaderValueOptionValidationError{
					field:  "Header",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	{
		tmp := m.GetAppend()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HeaderValueOptionValidationError{
					field:  "Append",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	return nil
}
728710
func (ctx *Context) AddHeader(key, value string) {
	ctx.Response.Header().Add(key, value)
}
118801
func (h *headerRule) Valid(ctx context.Context) bool {
	return h.valid(ctx.ResponseWriter().Header().Get)
}
1163109
func (h *headerRule) Claim(ctx context.Context) bool {
	return h.claim(ctx.Request().Header.Get)
}