def validate_email_address(emailaddress):
    """
    Checks if an email address is syntactically correct.

    Args:
        emailaddress (str): Email address to validate.

    Returns:
        is_valid (bool): If this is a valid email or not.

    Notes.
        (This snippet was adapted from
        http://commandline.org.uk/python/email-syntax-check.)

    """

    emailaddress = r"%s" % emailaddress

    domains = ("aero", "asia", "biz", "cat", "com", "coop",
               "edu", "gov", "info", "int", "jobs", "mil", "mobi", "museum",
               "name", "net", "org", "pro", "tel", "travel")

    # Email address must be more than 7 characters in total.
    if len(emailaddress) < 7:
        return False  # Address too short.

    # Split up email address into parts.
    try:
        localpart, domainname = emailaddress.rsplit('@', 1)
        host, toplevel = domainname.rsplit('.', 1)
    except __HOLE__:
        return False  # Address does not have enough parts.

    # Check for Country code or Generic Domain.
    if len(toplevel) != 2 and toplevel not in domains:
        return False  # Not a domain name.

    for i in '-_.%+.':
        localpart = localpart.replace(i, "")
    for i in '-_.':
        host = host.replace(i, "")

    if localpart.isalnum() and host.isalnum():
        return True  # Email address is fine.
    else:
        return False  # Email address has funny characters.
dataset/ETHPy150Open evennia/evennia/evennia/utils/utils.py/validate_email_address