// HasEditRecipients returns true if a value for EditRecipients has been set in this context
517411
func HasEditRecipients(ctx context.Context) bool {
	_, ok := ctx.Value(ctxKeyEditRecipients).(bool)
	return ok
}
1226884
func HasAutoPrint(ctx context.Context) bool {
	_, ok := ctx.Value(ctxKeyAutoPrint).(bool)
	return ok
}
844184
func GetPrefixesFromCIDRSet(rules api.CIDRRuleSlice) []*net.IPNet {
	cidrs := api.ComputeResultantCIDRSet(rules)
	return getPrefixesFromCIDR(cidrs)
}
331854
func (s *BouncedRecipientInfo) SetRecipientDsnFields(v *RecipientDsnFields) *BouncedRecipientInfo {
	s.RecipientDsnFields = v
	return s
}
657690
func (s *Store) GetRecipients(ctx context.Context, name string) ([]string, error) {
	idf := s.idFile(ctx, name)
	buf, err := s.storage.Get(ctx, idf)
	if err != nil {
		return nil, errors.Wrapf(err, "failed to get recipients for %s", name)
	}

	rawRecps := unmarshalRecipients(buf)
	finalRecps := make([]string, 0, len(rawRecps))
	for _, r := range rawRecps {
		fp := s.crypto.Fingerprint(ctx, r)
		if fp == "" {
			fp = r
		}
		finalRecps = append(finalRecps, fp)
	}

	if s.sc.CheckRecipientHash(s.alias) {
		computedSum := sha3fp(buf)
		storedSum := s.sc.GetRecipientHash(s.alias, idf)
		if storedSum == "" {
			out.Yellow(ctx, "WARNING: No previous recipient checksum for '%s/%s'. Run 'gopass recipients update' to get rid of this warning", s.alias, idf)
		} else if storedSum == computedSum {
			out.Debug(ctx, "[%s/%s] Computed Recipient Checksum matches stored sum (%s)", s.alias, idf, computedSum)
		} else {
			return finalRecps, ErrRecipientChecksumChanged
		}
	}

	return finalRecps, nil
}
911419
func (ref Ref) HasPrefix(other Ref) bool {
	if len(other) > len(ref) {
		return false
	}
	for i := range other {
		if !ref[i].Equal(other[i]) {
			return false
		}
	}
	return true
}
1073226
func HasRecipientFunc(ctx context.Context) bool {
	imf, ok := ctx.Value(ctxKeyRecipientFunc).(store.RecipientCallback)
	return ok && imf != nil
}
884658
func (p *Repository) ContainsAllRLocked(needed labels.LabelArrayList) bool {
nextLabel:
	for _, neededLabel := range needed {
		for _, l := range p.rules {
			if len(l.Labels) > 0 && neededLabel.Contains(l.Labels) {
				continue nextLabel
			}
		}

		return false
	}

	return true
}
121770
func (r Network_Interconnect_Tenant) EditConnection(receivedObject *datatypes.Network_Interconnect_Tenant) (resp string, err error) {
	params := []interface{}{
		receivedObject,
	}
	err = r.Session.DoRequest("SoftLayer_Network_Interconnect_Tenant", "editConnection", params, &r.Options, &resp)
	return
}
1068630
func (s *Layer) SetCustomRecipes(v *Recipes) *Layer {
	s.CustomRecipes = v
	return s
}
525342
func (l4 L4PolicyMap) HasRedirect() bool {
	for _, f := range l4 {
		if f.IsRedirect() {
			return true
		}
	}

	return false
}
1218049
func (e *Email) AddRecipients(Recipients ...string) {
	e.To = append(e.To, Recipients...)
}
802439
func hasFreshness(reqDir *RequestCacheDirectives, respDir *ResponseCacheDirectives, respHeaders http.Header, respExpires time.Time, privateCache bool) bool {
	if !privateCache && respDir.SMaxAge != -1 {
		return true
	}

	if respDir.MaxAge != -1 {
		return true
	}

	if !respExpires.IsZero() || respHeaders.Get("Expires") != "" {
		return true
	}

	return false
}
910176
func supportsEditing() bool {
	term := os.Getenv("TERM")

	for _, t := range unsupported {
		if t == term {
			return false
		}
	}

	return true
}
1110103
func (s *Action) ConfirmRecipients(ctx context.Context, name string, recipients []string) ([]string, error) {
	return cui.ConfirmRecipients(ctx, s.Store.Crypto(ctx, name), name, recipients)
}
1311380
func marshalRecipients(r []string) []byte {
	if len(r) == 0 {
		return []byte("\n")
	}

	// deduplicate
	m := make(map[string]struct{}, len(r))
	for _, k := range r {
		m[k] = struct{}{}
	}
	// sort
	keys := make([]string, 0, len(m))
	for k := range m {
		keys = append(keys, k)
	}
	sort.Strings(keys)

	out := bytes.Buffer{}
	for _, k := range keys {
		_, _ = out.WriteString(k)
		_, _ = out.WriteString("\n")
	}

	return out.Bytes()
}
1216015
func hasReadWriteOnce(modes []api.PersistentVolumeAccessMode) bool {
	if modes == nil {
		return false
	}
	for _, mode := range modes {
		if mode == api.ReadWriteOnce {
			return true
		}
	}
	return false
}