// IsValid - To authenticate and verify the time difference.
777367
func (s *peerRESTServer) IsValid(w http.ResponseWriter, r *http.Request) bool {
	if err := storageServerRequestValidate(r); err != nil {
		s.writeErrorResponse(w, err)
		return false
	}
	return true
}
113280
func (c Color) IsValid() bool {
	return 0.0 <= c.R && c.R <= 1.0 &&
		0.0 <= c.G && c.G <= 1.0 &&
		0.0 <= c.B && c.B <= 1.0
}
921241
func (i Interval) IsValid() bool {
	return (math.Abs(i.Lo) <= math.Pi && math.Abs(i.Hi) <= math.Pi &&
		!(i.Lo == -math.Pi && i.Hi != math.Pi) &&
		!(i.Hi == -math.Pi && i.Lo != math.Pi))
}
977294
func (ls *LocalStore) isValid(chunk Chunk) bool {
	// by default chunks are valid. if we have 0 validators, then all chunks are valid.
	valid := true

	// ls.Validators contains a list of one validator per chunk type.
	// if one validator succeeds, then the chunk is valid
	for _, v := range ls.Validators {
		if valid = v.Validate(chunk); valid {
			break
		}
	}
	return valid
}
493570
func (r *Result) IsValid() bool {
	if r == nil {
		return true
	}
	return len(r.Errors) == 0
}
74493
func (policy Policy) isValid() error {
	if policy.Version != DefaultVersion && policy.Version != "" {
		return fmt.Errorf("invalid version '%v'", policy.Version)
	}

	for _, statement := range policy.Statements {
		if err := statement.isValid(); err != nil {
			return err
		}
	}

	for i := range policy.Statements {
		for _, statement := range policy.Statements[i+1:] {
			principals := policy.Statements[i].Principal.Intersection(statement.Principal)
			if principals.IsEmpty() {
				continue
			}

			actions := policy.Statements[i].Actions.Intersection(statement.Actions)
			if len(actions) == 0 {
				continue
			}

			resources := policy.Statements[i].Resources.Intersection(statement.Resources)
			if len(resources) == 0 {
				continue
			}

			if policy.Statements[i].Conditions.String() != statement.Conditions.String() {
				continue
			}

			return fmt.Errorf("duplicate principal %v, actions %v, resouces %v found in statements %v, %v",
				principals, actions, resources, policy.Statements[i], statement)
		}
	}

	return nil
}
1187585
func (r inclusiveRules) IsValid(value string) bool {
	for _, rule := range r {
		if !rule.IsValid(value) {
			return false
		}
	}
	return true
}
241899
func (c *Column) IsInvalid(sc *stmtctx.StatementContext, collPseudo bool) bool {
	if collPseudo && c.NotAccurate() {
		return true
	}
	if c.NDV > 0 && c.Len() == 0 && sc != nil {
		sc.SetHistogramsNotLoad()
		HistogramNeededColumns.insert(tableColumnID{TableID: c.PhysicalID, ColumnID: c.Info.ID})
	}
	return c.TotalRowCount() == 0 || (c.NDV > 0 && c.Len() == 0)
}
561664
func (v *StringLengthInRange) IsValid(errors *validate.Errors) {
	strLength := utf8.RuneCountInString(v.Field)
	if v.Max == 0 {
		v.Max = strLength
	}
	if v.Message == "" {
		v.Message = fmt.Sprintf("%s not in range(%d, %d)", v.Name, v.Min, v.Max)
	}
	if !(strLength >= v.Min && strLength <= v.Max) {
		errors.Add(GenerateKey(v.Name), v.Message)
	}
}
697150
func (r Registration) IsValid() error {
	if r.ClusterID == "" || r.Product == "" {
		return errors.New("You must supply both a ClusterID and a Product!")
	}
	return nil
}
1283941
func IsValid(uuid string) bool {
	_, err := Parse(uuid)
	return err == nil
}
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
}
981069
func (cfg *ScopeCfg) IsValid() bool {
	if cfg == nil ||
		strings.TrimSpace(cfg.Client.Provider) == "" ||
		strings.TrimSpace(cfg.Client.Address) == "" {
		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
}
1083496
func (v *URLIsPresent) IsValid(errors *validate.Errors) {
	if v.Field == "http://" || v.Field == "https://" {
		if v.Message == "" {
			v.Message = fmt.Sprintf("%s url is empty", v.Name)
		}
		errors.Add(GenerateKey(v.Name), v.Message)
	}
	parsedUrl, err := url.ParseRequestURI(v.Field)
	if err != nil {
		if v.Message == "" {
			v.Message = fmt.Sprintf("%s does not match url format. Err: %s", v.Name,
				err)
		}
		errors.Add(GenerateKey(v.Name), v.Message)
	} else {
		if parsedUrl.Scheme != "" && parsedUrl.Scheme != "http" && parsedUrl.Scheme != "https" {
			if v.Message == "" {
				v.Message = fmt.Sprintf("%s invalid url scheme", v.Name)
			}
			errors.Add(GenerateKey(v.Name), v.Message)
		}
	}
}
1266769
func (f *ScmpFilter) IsValid() bool {
	f.lock.Lock()
	defer f.lock.Unlock()

	return f.valid
}
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)
	}
}