def _validate_email(email):
 if (not isinstance(email, basestring)):
  raise AccountEmailInvalid(u'Email must be a string')
 if (len(email) < EMAIL_MIN_LENGTH):
  raise AccountEmailInvalid(u"Email '{email}' must be at least {min} characters long".format(email=email, min=EMAIL_MIN_LENGTH))
 if (len(email) > EMAIL_MAX_LENGTH):
  raise AccountEmailInvalid(u"Email '{email}' must be at most {max} characters long".format(email=email, max=EMAIL_MAX_LENGTH))
 try:
  validate_email(email)
 except ValidationError:
  raise AccountEmailInvalid(u"Email '{email}' format is not valid".format(email=email))

def _validate_email ( email ) : if ( not isinstance ( email , basestring ) ) : raise AccountEmailInvalid ( u'Email must be a string' ) if ( len ( email ) < EMAIL_MIN_LENGTH ) : raise AccountEmailInvalid ( u"Email '{email}' must be at least {min} characters long" . format ( email = email , min = EMAIL_MIN_LENGTH ) ) if ( len ( email ) > EMAIL_MAX_LENGTH ) : raise AccountEmailInvalid ( u"Email '{email}' must be at most {max} characters long" . format ( email = email , max = EMAIL_MAX_LENGTH ) ) try : validate_email ( email ) except ValidationError : raise AccountEmailInvalid ( u"Email '{email}' format is not valid" . format ( email = email ) )
validate the format of the email address .