
    h	                     Z    S r SSKrSSKrS\S\4S jrS\\-  S\4S jrS\\-  S\4S jrg)	zIPv4 helper functions.    Naddressreturnc                     [        U 5      S:w  a  [        R                  R                  eU S    SU S    SU S    SU S    3$ )zConvert an IPv4 address in binary form to text form.

*address*, a ``bytes``, the IPv4 address in binary form.

Returns a ``str``.
   r   .         )lendns	exceptionSyntaxError)r   s    ]C:\Users\ROHAN GUPTA\OneDrive\Desktop\mathbuddy-assessment\venv\Lib\site-packages\dns/ipv4.py	inet_ntoar      sM     7|qmm'''aj\71:,a
|1WQZLAA    textc                 p   [        U [        5      (       d  U R                  5       nOU nUR                  S5      n[	        U5      S:w  a  [
        R                  R                  eU Ho  nUR                  5       (       d  [
        R                  R                  e[	        U5      S:  d  MC  US   [        S5      :X  d  MW  [
        R                  R                  e    U Vs/ s H  n[        U5      PM     nn[        R                  " S/UQ76 $ s  snf ! [         a    [
        R                  R                  ef = f)zConvert an IPv4 address in text form to binary form.

*text*, a ``str`` or ``bytes``, the IPv4 address in textual form.

Returns a ``bytes``.
   .r   r   r   0BBBB)
isinstancebytesencodesplitr   r   r   r   isdigitordintstructpack	Exception)r   btextpartspartbs        r   	inet_atonr%   &   s     dE""KKE
5zQmm'''||~~--+++t9q=T!WC0--+++ (#()54SY5){{6&A&& * (mm'''(s   D D2D D %D5c                 *    [        [        U 5      5      $ )zVerify that *address* is a valid text form IPv4 address and return its
canonical text form.

*text*, a ``str`` or ``bytes``, the IPv4 address in textual form.

Raises ``dns.exception.SyntaxError`` if the text is not valid.
)r   r%   )r   s    r   canonicalizer'   B   s     Yt_%%r   )	__doc__r   dns.exceptionr   r   strr   r%   r'    r   r   <module>r,      sT   $   
Bu 
B 
B(C%K (E (8
&sU{ 
&s 
&r   