HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/validators/__pycache__/email.cpython-310.pyc
o

we�
�@s\dZddlZddlmZddlmZedddddd�ded	ed
ededed
efdd��ZdS)zeMail.�N�)�hostname)�	validatorF)�ipv6_address�ipv4_address�simple_host�rfc_1034�rfc_2782�valuerrrrr	c
Cs�|r	|�d�dkrdS|�dd�\}}t|�dkst|�dkr!dS|s%|r:|�d�r8|�d�r8|�d��d�}ndSt�d|tj	�rQt
t|||d|||d	��SdS)
aValidate an email address.

    This was inspired from [Django's email validator][1].
    Also ref: [RFC 1034][2], [RFC 5321][3] and [RFC 5322][4].

    [1]: https://github.com/django/django/blob/main/django/core/validators.py#L174
    [2]: https://www.rfc-editor.org/rfc/rfc1034
    [3]: https://www.rfc-editor.org/rfc/rfc5321
    [4]: https://www.rfc-editor.org/rfc/rfc5322

    Examples:
        >>> email('someone@example.com')
        # Output: True
        >>> email('bogus@@')
        # Output: ValidationError(email=email, args={'value': 'bogus@@'})

    Args:
        value:
            eMail string to validate.
        ipv6_address:
            When the domain part is an IPv6 address.
        ipv4_address:
            When the domain part is an IPv4 address.
        simple_host:
            When the domain part is a simple hostname.
        rfc_1034:
            Allow trailing dot in domain name.
            Ref: [RFC 1034](https://www.rfc-editor.org/rfc/rfc1034).
        rfc_2782:
            Domain name is of type service record.
            Ref: [RFC 2782](https://www.rfc-editor.org/rfc/rfc2782).

    Returns:
        (Literal[True]):
            If `value` is a valid eMail.
        (ValidationError):
            If `value` is an invalid eMail.

    > *New in version 0.1.0*.
    �@rF�@��[�]z�(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*$|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"$))�skip_ipv6_addr�skip_ipv4_addr�
may_have_port�maybe_simplerr	)�count�rsplit�len�
startswith�endswith�lstrip�rstrip�re�match�
IGNORECASE�boolr)r
rrrrr	�
username_part�domain_part�r!�I/home/arjun/projects/env/lib/python3.10/site-packages/validators/email.py�emails83������r#)�__doc__rr�utilsr�strrr#r!r!r!r"�<module>s.�������