// EmailFromKey extracts the email from a key id
495955
func (g *GPG) EmailFromKey(ctx context.Context, id string) string {
	return g.findKey(ctx, id).Identity().Email
}
903154
func AttemptIDFromKey(k *ds.Key) *dm.Attempt_ID {
	if k.Kind() != "Attempt" || k.Parent() != nil {
		panic(fmt.Errorf("invalid Attempt key: %s", k))
	}
	ret := &dm.Attempt_ID{}
	if err := ret.SetDMEncoded(k.StringID()); err != nil {
		panic(fmt.Errorf("invalid Attempt key: %s: %s", k, err))
	}
	return ret
}
1099240
func (k *PublicKey) OmitEmail() string {
	return strings.Join(strings.Split(k.Content, " ")[:2], " ")
}
766018
func (repo *repo) FindByEmail(email string) (user service.Entity, err error) {
	if err = dbconn.DB.Where("email = ?", email).First(&user).Error; err != nil {
		return service.Entity{}, err
	}
	return user, nil
}
1064395
func ExecutionIDFromKey(k *ds.Key) *dm.Execution_ID {
	if k.Kind() != "Execution" || k.Parent() == nil {
		panic(fmt.Errorf("invalid Execution key: %s", k))
	}
	id := k.IntID()
	if id <= 0 || id > math.MaxUint32 {
		panic(fmt.Errorf("invalid Execution key: %s", k))
	}
	atmpt := AttemptIDFromKey(k.Parent())
	return &dm.Execution_ID{Quest: atmpt.Quest, Attempt: atmpt.Id, Id: uint32(id)}
}
816752
func (s *DeliverabilityTestReport) SetFromEmailAddress(v string) *DeliverabilityTestReport {
	s.FromEmailAddress = &v
	return s
}
172838
func (g *GPG) EmailFromKey(ctx context.Context, id string) string {
	ent := g.findEntity(id)
	if ent == nil || ent.Identities == nil {
		return ""
	}
	for name, id := range ent.Identities {
		if id.UserId == nil {
			return name
		}
		return id.UserId.Email
	}
	return ""
}
1177562
func keyFromForm(param string) keyExtractor {
	return func(c echo.Context) (string, error) {
		key := c.FormValue(param)
		if key == "" {
			return "", errors.New("missing key in the form")
		}
		return key, nil
	}
}
1300778
func EmailValid(value string, basekey string, mm messages.MessageMap) error {
	if !IsEmail(value) {
		mm.Add(basekey, InvalidEmail)
		return nil
	}
	return nil
}
358740
func (c *ClassifierDeserializer) GetAttributeForKey(key string) (Attribute, error) {
	b, err := c.GetBytesForKey(key)
	if err != nil {
		return nil, WrapError(err)
	}
	attr, err := DeserializeAttribute(b)
	if err != nil {
		return nil, WrapError(err)
	}
	return attr, nil
}
819083
func (g *GPGEmail) GetEmail() string {
	if g == nil || g.Email == nil {
		return ""
	}
	return *g.Email
}
336874
func (b *AESGCMBarrier) aeadFromKey(key []byte) (cipher.AEAD, error) {
	// Create the AES cipher
	aesCipher, err := aes.NewCipher(key)
	if err != nil {
		return nil, errwrap.Wrapf("failed to create cipher: {{err}}", err)
	}

	// Create the GCM mode AEAD
	gcm, err := cipher.NewGCM(aesCipher)
	if err != nil {
		return nil, fmt.Errorf("failed to initialize GCM mode")
	}
	return gcm, nil
}
984964
func Email() string {
	return strings.ToLower(FirstName(RandomGender)+LastName()) + StringNumberExt(1, "", 3) + "@" + randomFrom(jsonData.Domains)
}
1233576
func (internet Internet) Email(v reflect.Value) (interface{}, error) {
	return internet.email(), nil
}
854443
func (s Session) AddEmail(email string) Session {
	return s.appendString(TypeEmail, email)
}
1064836
func (be *T) Key() engine.BackendKey {
	return engine.BackendKey{Id: be.id}
}
226604
func typeOfKey(k string) string {
	c := strings.Index(k, ":")
	p := strings.Index(k, "|")
	if c < 0 && p < 0 {
		return ""
	}
	if c < 0 {
		return k[:p]
	}
	if p < 0 {
		return k[:c]
	}
	min := c
	if p < min {
		min = p
	}
	return k[:min]
}