// isValidNumber reports whether s is a valid JSON number literal.
556879
func isValidNumber(s string) bool {
	// This function implements the JSON numbers grammar.
	// See https://tools.ietf.org/html/rfc7159#section-6
	// and https://json.org/number.gif

	if s == "" {
		return false
	}

	// Optional -
	if s[0] == '-' {
		s = s[1:]
		if s == "" {
			return false
		}
	}

	// Digits
	switch {
	default:
		return false

	case s[0] == '0':
		s = s[1:]

	case '1' <= s[0] && s[0] <= '9':
		s = s[1:]
		for len(s) > 0 && '0' <= s[0] && s[0] <= '9' {
			s = s[1:]
		}
	}

	// . followed by 1 or more digits.
	if len(s) >= 2 && s[0] == '.' && '0' <= s[1] && s[1] <= '9' {
		s = s[2:]
		for len(s) > 0 && '0' <= s[0] && s[0] <= '9' {
			s = s[1:]
		}
	}

	// e or E followed by an optional - or + and
	// 1 or more digits.
	if len(s) >= 2 && (s[0] == 'e' || s[0] == 'E') {
		s = s[1:]
		if s[0] == '+' || s[0] == '-' {
			s = s[1:]
			if s == "" {
				return false
			}
		}
		for len(s) > 0 && '0' <= s[0] && s[0] <= '9' {
			s = s[1:]
		}
	}

	// Make sure we are at the end.
	return s == ""
}
798667
func (v *EmailIsPresent) IsValid(errors *validate.Errors) {
	if !rxEmail.Match([]byte(v.Field)) {
		if v.Message == "" {
			v.Message = fmt.Sprintf("%s does not match the email format.", v.Name)
		}
		errors.Add(GenerateKey(v.Name), v.Message)
	}
}
1021435
func (a ARP) IsValid() bool {
	if len(a) < ARPSize {
		return false
	}
	const htypeEthernet = 1
	const macSize = 6
	return a.hardwareAddressSpace() == htypeEthernet &&
		a.protocolAddressSpace() == uint16(IPv4ProtocolNumber) &&
		a.hardwareAddressSize() == macSize &&
		a.protocolAddressSize() == IPv4AddressSize
}
801099
func (c Cap) IsValid() bool {
	return c.center.Vector.IsUnit() && c.height <= fullHeight
}
360280
func (ll LatLng) IsValid() bool {
	return math.Abs(ll.Lat.Radians()) <= math.Pi/2 && math.Abs(ll.Lng.Radians()) <= math.Pi
}
1001692
func (m *GormIdentityRepository) IsValid(ctx context.Context, id uuid.UUID) bool {
	_, err := m.Load(ctx, id)
	if err != nil {
		return false
	}
	return true
}
1187347
func (l *lockRESTServer) IsValid(w http.ResponseWriter, r *http.Request) bool {
	if err := storageServerRequestValidate(r); err != nil {
		l.writeErrorResponse(w, err)
		return false
	}
	return true
}
1036349
func (jfo *JobFindOptions) IsValid() bool {
	s := structs.New(jfo)
	f := s.Fields()

	nonZeroValues := 0

	for _, field := range f {
		if !field.IsZero() {
			nonZeroValues += 1
		}
	}

	return nonZeroValues == 0 || nonZeroValues == 1
}
58488
func (c Cap) IsValid() bool {
	return c.center.Vector.IsUnit() && c.radius <= s1.StraightChordAngle
}
822360
func (h FrameHeader) IsValid() bool {
	if len(h) < 4 {
		return false
	}
	return h[0] == 0xff && h[1]&0xE0 == 0xE0 && h.Version() <= MPEG1 && h.Layer() <= Layer1
}
30941
func (v *Value) Number() (json.Number, error) {
	var valid bool

	// Check the type of this data
	switch v.data.(type) {
	case json.Number:
		valid = true
	}

	if valid {
		return v.data.(json.Number), nil
	}

	return "", ErrNotNumber
}
476974
func IsNumeric(str string) bool {
	if IsNull(str) {
		return true
	}
	return rxNumeric.MatchString(str)
}
139828
func (service *Service) PhonenumberValidation(w http.ResponseWriter, request *http.Request) {
	service.handlePhoneValidation(w, request, false)
}
1179482
func (o ObjectPath) IsValid() bool {
	s := string(o)
	if len(s) == 0 {
		return false
	}
	if s[0] != '/' {
		return false
	}
	if s[len(s)-1] == '/' && len(s) != 1 {
		return false
	}
	// probably not used, but technically possible
	if s == "/" {
		return true
	}
	split := strings.Split(s[1:], "/")
	for _, v := range split {
		if len(v) == 0 {
			return false
		}
		for _, c := range v {
			if !isMemberChar(c) {
				return false
			}
		}
	}
	return true
}
385693
func (h hashPrefix) IsValid() bool {
	return len(h) >= minHashPrefixLength && len(h) <= maxHashPrefixLength
}
1089642
func (service *IYOPhonenumberValidationService) ConfirmRegistrationValidation(r *http.Request, key, code string) (err error) {
	info, err := service.getPhonenumberValidationInformation(r, key)
	if err != nil {
		return
	}
	if info == nil {
		err = ErrInvalidOrExpiredKey
		return
	}
	if info.SMSCode != code {
		err = ErrInvalidCode
		return
	}
	return validation.NewManager(r).UpdatePhonenumberValidationInformation(key, true)
}
81205
func isNumber(t querypb.Type) bool {
	return IsIntegral(t) || IsFloat(t) || t == Decimal
}