// IsCheckRecipients will return the value of the check recipients flag or the
// default value (false)
162162
func IsCheckRecipients(ctx context.Context) bool {
	bv, ok := ctx.Value(ctxKeyCheckRecipients).(bool)
	if !ok {
		return false
	}
	return bv
}
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)
	}
}
115494
func (c *Config) CheckRecipientHash(alias string) bool {
	if alias == "" {
		return c.Root.CheckRecpHash
	}
	if sc, found := c.Mounts[alias]; found && sc != nil {
		return sc.CheckRecpHash
	}
	return false
}
495727
func (s *Store) SaveRecipients(ctx context.Context) error {
	rs, err := s.GetRecipients(ctx, "")
	if err != nil {
		return errors.Wrapf(err, "failed to get recipients")
	}
	return s.saveRecipients(ctx, rs, "Save Recipients", true)
}
1227183
func IsFsckCheck(ctx context.Context) bool {
	bv, ok := ctx.Value(ctxKeyFsckCheck).(bool)
	if !ok {
		return false
	}
	return bv
}
828376
func isDoc(val reflect.Value) bool {
	iterations := 0
	for val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr {
		val = val.Elem()
		// preventing cycles
		iterations++
		if iterations > 10 {
			return false
		}
	}
	return val.Kind() == reflect.Struct || val.Kind() == reflect.Map
}
354793
func (f *fragment) InvalidateChecksums() {
	f.mu.Lock()
	f.checksums = make(map[int][]byte)
	f.mu.Unlock()
}
1197728
func (e *Email) AddRecipient(Recipient string) {
	e.To = append(e.To, Recipient)
}
345972
func checkHeaders(headers map[string]string, caller string) map[string]string {
	if headers == nil {
		headers = map[string]string{}
	}
	// We don't just check to see if there's a value; it has to be non-empty.
	if headers["X-Uber-Source"] == "" {
		headers["X-Uber-Source"] = caller
	}
	return headers
}
1040795
func (_m *State) GetChecks() []types.CheckSpec {
	ret := _m.Called()

	var r0 []types.CheckSpec
	if rf, ok := ret.Get(0).(func() []types.CheckSpec); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]types.CheckSpec)
		}
	}

	return r0
}
1073226
func HasRecipientFunc(ctx context.Context) bool {
	imf, ok := ctx.Value(ctxKeyRecipientFunc).(store.RecipientCallback)
	return ok && imf != nil
}
553853
func (m *Message) AddRecipient(recipient string) error {
	return m.AddRecipientAndVariables(recipient, nil)
}
966792
func (c *Checker) Check(rel string, recurse bool, beforeRev, afterRev string) ([]Change, error) {
	// If revision is unset use VCS's default revision
	dBefore, dAfter := c.vcs.DefaultRevision()
	if beforeRev == "" {
		beforeRev = dBefore
	}
	if afterRev == "" {
		afterRev = dAfter
	}
	c.recurse = recurse

	var err error
	c.path, err = importPathTo(rel)
	if err != nil {
		return nil, err
	}

	c.logf("import path: %q before: %q after: %q recursive: %v\n", c.path, beforeRev, afterRev, c.recurse)

	// Parse revisions from VCS into go/ast
	start := time.Now()
	if c.b, err = c.parse(beforeRev); err != nil {
		return nil, err
	}
	if c.a, err = c.parse(afterRev); err != nil {
		return nil, err
	}
	parse := time.Since(start)

	start = time.Now()
	changes, err := c.compareDecls()
	if err != nil {
		var buf bytes.Buffer
		fmt.Fprintf(&buf, "error comparing declarations: %s\n", err)
		if derr, ok := err.(*diffError); ok {
			_ = ast.Fprint(&buf, c.b[derr.pkg].fset, derr.bdecl, ast.NotNilFilter)
			_ = ast.Fprint(&buf, c.a[derr.pkg].fset, derr.adecl, ast.NotNilFilter)
		}
		return nil, errors.New(buf.String())
	}
	diff := time.Since(start)

	start = time.Now()
	sort.Sort(byID(changes))
	sort := time.Since(start)

	c.logf("Timing: parse: %v, diff: %v, sort: %v, total: %v\n", parse, diff, sort, parse+diff+sort)
	c.logf("Changes detected: %v\n", len(changes))

	return changes, nil
}
428624
func (o *SMTPOptions) AddRecipients(addresses ...string) error {
	if len(addresses) == 0 {
		return errors.New("AddRecipients requires one or more strings that contain comma " +
			"separated email addresses")
	}

	o.mutex.Lock()
	defer o.mutex.Unlock()

	addrs, err := mail.ParseAddressList(strings.Join(addresses, ","))
	if err != nil {
		return err
	}

	o.toAddrs = append(o.toAddrs, addrs...)

	return nil
}
22320
func isRecipientAllowed(c context.Context, recipient string, build *buildbucketpb.Build) bool {
	// TODO(mknyszek): Do a real ACL check here.
	if strings.HasSuffix(recipient, "@google.com") || strings.HasSuffix(recipient, "@chromium.org") {
		return true
	}
	logging.Warningf(c, "Address %q is not allowed to be notified of build %d", recipient, build.Id)
	return false
}
1019811
func Check() []Result {
	results := make([]Result, 0, len(checkers))
	for _, checker := range checkers {
		startTime := time.Now()
		if raw, err := checker.check(); err != nil && err != ErrDisabledComponent {
			results = append(results, Result{
				Name:     checker.name,
				Raw:      raw,
				Status:   "fail - " + err.Error(),
				Duration: time.Now().Sub(startTime),
			})
		} else if err == nil {
			results = append(results, Result{
				Name:     checker.name,
				Raw:      raw,
				Status:   HealthCheckOK,
				Duration: time.Now().Sub(startTime),
			})
		}
	}
	return results
}
205685
func (s *Server) readRecipients(c *Connection) {
	text := c.read()
	s.addMessageLine(text)

	c.write("250 Recipient")
	text = c.read()
	for strings.Contains(text, "RCPT") {
		s.addMessageLine(text)
		c.write("250 Recipient")
		text = c.read()
	}
}