// HasCheckRecipients returns true if check recipients has been set in this
// context
518791
func HasCheckRecipients(ctx context.Context) bool {
	_, ok := ctx.Value(ctxKeyCheckRecipients).(bool)
	return ok
}
398871
func CheckIfTaintsAlreadyExists(oldTaints []v1.Taint, taints []v1.Taint) string {
	var existingTaintList = make([]string, 0)
	for _, taint := range taints {
		for _, oldTaint := range oldTaints {
			if taint.Key == oldTaint.Key && taint.Effect == oldTaint.Effect {
				existingTaintList = append(existingTaintList, taint.Key)
			}
		}
	}
	return strings.Join(existingTaintList, ",")
}
798666
func (c *batchOptions) Check() error {
	for i, p := range c.Payments {
		if strings.TrimSpace(p.Recipient) == "" {
			return fmt.Errorf("payment %d: %s", i, ErrRecipientMissing)
		}
		if strings.TrimSpace(p.Amount) == "" {
			return fmt.Errorf("payment %d: %s", i, ErrAmountMissing)
		}
		namt, err := stellarnet.ParseStellarAmount(p.Amount)
		if err != nil {
			return fmt.Errorf("payment %d: %s", i, ErrInvalidAmount)
		}
		if namt < 0 {
			return fmt.Errorf("payment %d: %s", i, ErrInvalidAmount)
		}
		if len(p.Message) > libkb.MaxStellarPaymentNoteLength {
			return fmt.Errorf("payment %d: %s", i, ErrMessageTooLong)
		}
	}

	if c.Timeout <= 0 {
		c.Timeout = 15 * len(c.Payments)
	}

	return nil
}
1225244
func (ctx *BatchedContext) checkResults() bool {
	for _, v := range ctx.results {
		if v != C.CUDA_SUCCESS {
			return true
		}
	}
	return false
}
514431
func WithRecipientFunc(ctx context.Context, imf store.RecipientCallback) context.Context {
	return context.WithValue(ctx, ctxKeyRecipientFunc, imf)
}
248317
func (iter *CommonIterator) HasNext() bool {
	if iter.currentLoc < len(iter.response.Results) || iter.response.HasMore {
		return true
	}
	return false
}
139402
func WithEditRecipients(ctx context.Context, bv bool) context.Context {
	return context.WithValue(ctx, ctxKeyEditRecipients, bv)
}
1265064
func (h *handshake) checkAck(s *segment) bool {
	if s.flagIsSet(header.TCPFlagAck) && s.ackNumber != h.iss+1 {
		// RFC 793, page 36, states that a reset must be generated when
		// the connection is in any non-synchronized state and an
		// incoming segment acknowledges something not yet sent. The
		// connection remains in the same state.
		ack := s.sequenceNumber.Add(s.logicalLen())
		h.ep.sendRaw(buffer.VectorisedView{}, header.TCPFlagRst|header.TCPFlagAck, s.ackNumber, ack, 0)
		return false
	}

	return true
}
1218049
func (e *Email) AddRecipients(Recipients ...string) {
	e.To = append(e.To, Recipients...)
}
1073226
func HasRecipientFunc(ctx context.Context) bool {
	imf, ok := ctx.Value(ctxKeyRecipientFunc).(store.RecipientCallback)
	return ok && imf != nil
}
1075616
func (f *Form) IsChecked(name string) (bool, error) {
	if _, ok := f.checkboxs[name]; ok {
		_, found := f.fields[name]
		return found, nil
	}
	return false, errors.NewElementNotFound("No checkbox found with name '%s'.", name)
}
1247213
func (r *Application) HasHealthChecks() bool {
	return r.HealthChecks != nil && len(*r.HealthChecks) > 0
}
1004675
func CheckPackages(c context.Context, names []string, includeHidden bool) ([]string, error) {
	if len(names) == 0 {
		return nil, nil
	}

	pkgs := make([]*Package, len(names))
	for i, n := range names {
		pkgs[i] = &Package{Name: n}
	}

	if err := datastore.Get(c, pkgs); err != nil {
		merr, ok := err.(errors.MultiError)
		if !ok {
			return nil, transient.Tag.Apply(err)
		}
		existing := pkgs[:0]
		for i, pkg := range pkgs {
			switch err := merr[i]; {
			case err == nil:
				existing = append(existing, pkg)
			case err != datastore.ErrNoSuchEntity:
				return nil, errors.Annotate(err, "failed to fetch %q", pkg.Name).Tag(transient.Tag).Err()
			}
		}
		pkgs = existing
	}

	out := make([]string, 0, len(pkgs))
	for _, p := range pkgs {
		if !p.Hidden || includeHidden {
			out = append(out, p.Name)
		}
	}
	return out, nil
}
600704
func (p *Pushover) GetRecipientDetails(recipient *Recipient) (*RecipientDetails, error) {
	endpoint := fmt.Sprintf("%s/users/validate.json", APIEndpoint)

	// Validate pushover
	if err := p.validate(); err != nil {
		return nil, err
	}

	// Validate recipient
	if err := recipient.validate(); err != nil {
		return nil, err
	}

	req, err := newURLEncodedRequest("POST", endpoint,
		map[string]string{"token": p.token, "user": recipient.token})
	if err != nil {
		return nil, err
	}

	var response RecipientDetails
	if err := do(req, &response, false); err != nil {
		return nil, err
	}

	return &response, nil
}
613645
func lookupRecipientAssertion(m libkb.MetaContext, assertion string, isCLI bool) (maybeUsername string, err error) {
	defer m.TraceTimed(fmt.Sprintf("Stellar.lookupRecipientAssertion(isCLI:%v, %v)", isCLI, assertion), func() error { return err })()
	reason := fmt.Sprintf("Find transaction recipient for %s", assertion)

	// GUI is a verified lookup modeled after func ResolveAndCheck.
	arg := keybase1.Identify2Arg{
		UserAssertion:         assertion,
		CanSuppressUI:         true,
		ActLoggedOut:          true,
		NoErrorOnTrackFailure: true,
		Reason:                keybase1.IdentifyReason{Reason: reason},
		IdentifyBehavior:      keybase1.TLFIdentifyBehavior_RESOLVE_AND_CHECK,
	}
	if isCLI {
		// CLI is a real identify
		arg = keybase1.Identify2Arg{
			UserAssertion:    assertion,
			UseDelegateUI:    true,
			Reason:           keybase1.IdentifyReason{Reason: reason},
			IdentifyBehavior: keybase1.TLFIdentifyBehavior_CLI,
		}
	}

	eng := engine.NewResolveThenIdentify2(m.G(), &arg)
	err = engine.RunEngine2(m, eng)
	if err != nil {
		// These errors mean no resolution was found.
		if _, ok := err.(libkb.NotFoundError); ok {
			m.Debug("identifyRecipient: not found %s: %s", assertion, err)
			return "", nil
		}
		if libkb.IsResolutionNotFoundError(err) {
			m.Debug("identifyRecipient: resolution not found error %s: %s", assertion, err)
			return "", nil
		}
		return "", err
	}

	idRes, err := eng.Result(m)
	if err != nil {
		return "", err
	}
	if idRes == nil {
		return "", fmt.Errorf("missing identify result")
	}
	m.Debug("lookupRecipientAssertion: uv: %v", idRes.Upk.Current.ToUserVersion())
	username := idRes.Upk.GetName()
	if username == "" {
		return "", fmt.Errorf("empty identify result username")
	}
	if isCLI && idRes.TrackBreaks != nil {
		m.Debug("lookupRecipientAssertion: TrackBreaks = %+v", idRes.TrackBreaks)
		return "", libkb.TrackingBrokeError{}
	}
	return username, nil
}
802210
func (s *SeesawSync) Healthchecks(arg int, reply *int) error {
	return errors.New("unimplemented")
}
160212
func (r *Store) ListRecipients(ctx context.Context, store string) []string {
	ctx, sub, _ := r.getStore(ctx, store)
	return sub.Recipients(ctx)
}