https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/netaddr/ip/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/netaddr/ip/__init__.pyc
�
o�\c@s+dZddlZddlmZmZmZmZmZm	Z	m
Z
mZmZm
Z
ddlmZmZddlmZmZmZmZmZdefd��YZdefd	��YZd
efd��YZedd
�Zdeefd��YZdeefd��YZ d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&dd�Z'd�Z(d�Z)d�Z*d�Z+ed�Z,ed�ed �ed!�ed"�ed#�ed$�e d%d&�fZ-ed'�Z.ed(�Z/ed)�Z0ed*�ed+�ed,�ed-�ed.�ed/�e d0d1�e d2d3�fe,e0fZ1ed4�Z2ed5�ed6�fZ3ed7�Z4ed8�Z5ed9�ed:�ed;�ed<�ed=�ed>�ed?�ed@�edA�edB�edC�edD�edE�edF�edG�edH�fZ6dS(Is9Routines for IPv4 and IPv6 addresses, subnets and ranges.i����N(
tAddrFormatErrortAddrConversionErrortnum_bitst
DictDotLookuptNOHOSTtNt	INET_PTONtPtZEROFILLtZ(tipv4tipv6(t_sys_maxintt_iter_ranget_is_strt	_int_typet	_str_typetBaseIPcBs�eZdZdZd�Zd�Zed�edd�Zd�Zd	�Z	d
�Z
d�Zd�Zd
�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zed��Zed��ZRS(si
    An abstract base class for common operations shared between various IP
    related subclasses.

    t_valuet_modulecCsd|_d|_dS(sConstructor.N(tNoneRR(tself((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__init__s	cCspt|t�s(tdt|���nd|koE|jjknsctd|jj��n||_dS(Nsint argument expected, not %sis&value out of bounds for an %s address!(	t
isinstanceRt	TypeErrorttypeRtmax_intRtfamily_nameR(Rtvalue((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt
_set_value s"cCs|jS(N(R(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt<lambda>(stdocs?a positive integer representing the value of IP address/subnet.cCstS(sP
        :return: a key tuple that uniquely identifies this IP address.
        (tNotImplemented(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytkey+scCstS(sg
        :return: A key tuple used to compare and sort this `IPAddress`
            correctly.
        (R (R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytsort_key1scCst|j��S(sM
        :return: A hash value uniquely indentifying this IP object.
        (thashR!(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__hash__8scCs9y|j�|j�kSWnttfk
r4tSXdS(s�
        :param other: an `IPAddress` or `IPNetwork` object.

        :return: ``True`` if this `IPAddress` or `IPNetwork` object is
            equivalent to ``other``, ``False`` otherwise.
        N(R!tAttributeErrorRR (Rtother((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__eq__>scCs9y|j�|j�kSWnttfk
r4tSXdS(s�
        :param other: an `IPAddress` or `IPNetwork` object.

        :return: ``True`` if this `IPAddress` or `IPNetwork` object is
            not equivalent to ``other``, ``False`` otherwise.
        N(R!R%RR (RR&((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__ne__JscCs9y|j�|j�kSWnttfk
r4tSXdS(s�
        :param other: an `IPAddress` or `IPNetwork` object.

        :return: ``True`` if this `IPAddress` or `IPNetwork` object is
            less than ``other``, ``False`` otherwise.
        N(R"R%RR (RR&((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__lt__VscCs9y|j�|j�kSWnttfk
r4tSXdS(s�
        :param other: an `IPAddress` or `IPNetwork` object.

        :return: ``True`` if this `IPAddress` or `IPNetwork` object is
            less than or equal to ``other``, ``False`` otherwise.
        N(R"R%RR (RR&((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__le__bscCs9y|j�|j�kSWnttfk
r4tSXdS(s�
        :param other: an `IPAddress` or `IPNetwork` object.

        :return: ``True`` if this `IPAddress` or `IPNetwork` object is
            greater than ``other``, ``False`` otherwise.
        N(R"R%RR (RR&((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__gt__nscCs9y|j�|j�kSWnttfk
r4tSXdS(s�
        :param other: an `IPAddress` or `IPNetwork` object.

        :return: ``True`` if this `IPAddress` or `IPNetwork` object is
            greater than or equal to ``other``, ``False`` otherwise.
        N(R"R%RR (RR&((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__ge__zscCs|j�S(s<:return: ``True`` if this IP is unicast, ``False`` otherwise(tis_multicast(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt
is_unicast�scCs6|jtkr|tkS|jtkr2|tkSdS(s>:return: ``True`` if this IP is multicast, ``False`` otherwiseN(Rt_ipv4tIPV4_MULTICASTt_ipv6tIPV6_MULTICAST(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR-�s
cCs<|jjdkr|tkS|jjdkr8|tkSdS(s�
        :return: ``True`` if this IP is loopback address (not for network
            transmission), ``False`` otherwise.
            References: RFC 3330 and 4291.
        iiN(Rtversiont
IPV4_LOOPBACKt
IPV6_LOOPBACK(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytis_loopback�s
cCs�|jjdkr6xWtD]}||krtSqWn6|jjdkrlx!tD]}||krOtSqOWn|j�r|tStS(s�
        :return: ``True`` if this IP is for internal/private use only
            (i.e. non-public), ``False`` otherwise. Reference: RFCs 1918,
            3330, 4193, 3879 and 2365.
        ii(RR3tIPV4_PRIVATEtTruetIPV6_PRIVATEt
is_link_localtFalse(Rtcidr((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt
is_private�s

cCs<|jjdkr|tkS|jjdkr8|tkSdS(s�
        :return: ``True`` if this IP is link-local address ``False`` otherwise.
            Reference: RFCs 3927 and 4291.
        iiN(RR3tIPV4_LINK_LOCALtIPV6_LINK_LOCAL(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR:�s
cCsp|jjdkr6xWtD]}||krtSqWn6|jjdkrlx!tD]}||krOtSqOWntS(s�
        :return: ``True`` if this IP is in IANA reserved range, ``False``
            otherwise. Reference: RFCs 3330 and 3171.
        ii(RR3t
IPV4_RESERVEDR8t
IPV6_RESERVEDR;(RR<((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytis_reserved�s

cCs#|jjdko"|jd?dkS(sp
        :return: ``True`` if this IP is IPv4-compatible IPv6 address, ``False``
            otherwise.
        ii i��(RR3R(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytis_ipv4_mapped�scCs#|jjdko"|jd?dkS(sl
        :return: ``True`` if this IP is IPv4-mapped IPv6 address, ``False``
            otherwise.
        ii i(RR3R(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytis_ipv4_compat�scCs ddlm}t||��S(s~
        A record dict containing IANA registration details for this IP address
        if available, None otherwise.
        i����(tquery(tnetaddr.ip.ianaRER(RRE((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytinfo�scCs
|jjS(s6the IP protocol version represented by this IP object.(RR3(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR3�s(s_values_module(t__name__t
__module__t__doc__t	__slots__RRtpropertyRR!R"R$R'R(R)R*R+R,R.R-R6R=R:RBRCRDRGR3(((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyRs2																	
			
t	IPAddresscBsyeZdZd$Zd%dd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
e
Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd%d�Zed��Zed��Zed��Zed��Zd�Zed�Z d%d�Z!d�Z"d�Z#d�Z$d�Z%d �Z&d!�Z'e'Z(d"�Z)d#�Z*RS(&s�
    An individual IPv4 or IPv6 address without a net mask or subnet prefix.

    To support these and other network based operations, see `IPNetwork`.

    icCs�tt|�j�t|t�rj|dk	rO||jjkrOtd��n|j	|_	|j|_nM|dk	r�|dkr�t
|_q�|dkr�t|_q�td|��nt|�r�d|kr�td|j
j��n|jdkrt|t�r�y�dt|�ko+t
jknrKt|�|_	t
|_nCt
jt|�kontjknr�t|�|_	t|_nWq�tk
r�q�XnGxDt
tfD]6}y|j||�|_	Wn
q�q�X||_Pq�W|jdkr�td|��q�n�t|�rmy|jj||�|_	Wq�tk
ritd	||jjf��q�XnJdt|�ko�|jjknr�t|�|_	ntd
|��dS(s�
        Constructor.

        :param addr: an IPv4 or IPv6 address which may be represented in an
            accepted string format, as an unsigned integer or as another
            IPAddress object (copy construction).

        :param version: (optional) optimizes version detection if specified
            and distinguishes between IPv4 and IPv6 for addresses with an
            equivalent integer value.

        :param flags: (optional) decides which rules are applied to the
            interpretation of the addr value. Supported constants are
            INET_PTON and ZEROFILL. See the netaddr.core docs for further
            details.

        s1cannot switch IP versions using copy constructor!iis%r is an invalid IP version!t/sQ%s() does not support netmasks or subnet prefixes! See documentation for details.is+failed to detect a valid IP address from %rsbase address %r is not IPv%dsbad address format: %rN(tsuperRMRRRRRR3t
ValueErrorRR/R1Rt	__class__RHRtintRt
str_to_intR(RtaddrR3tflagstmodule((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR�sZ%(
	
(cCs|j|jjfS(s1:returns: Pickled state of an `IPAddress` object.(RRR3(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__getstate__AscCs_|\}}||_|dkr-t|_n.|dkrEt|_ntdt|���dS(sT
        :param state: data used to unpickle a pickled `IPAddress` object.

        iis&unpickling failed for object state: %sN(RR/RR1RPtstr(RtstateRR3((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__setstate__Es	cCs�|j�s|jjS|jdkr)dS|j}d}x8|dkrr|d@dkr[Pn|d7}|dL}q;W|jj|}d|ko�|jjkns�td|��n|S(s�
        @return: If this IP is a valid netmask, the number of non-zero
            bits are returned, otherwise it returns the width in bits for
            the IP address version.
        iis+Unexpected mask length %d for address type!(t
is_netmaskRtwidthRRP(Rti_valtnumbitstmask_length((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytnetmask_bitsVs 
	
"
cCs|jd}||d@dkS(sV
        :return: ``True`` if this IP address host mask, ``False`` otherwise.
        ii(R(Rtint_val((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytis_hostmaskus
cCs)|j|jjAd}||d@dkS(sY
        :return: ``True`` if this IP address network mask, ``False`` otherwise.
        ii(RRR(RRa((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR[|scCsRt|j|�}d|ko0|jjknrB||_|Std��dS(s�
        Increases the numerical value of this IPAddress by num.

        An IndexError is raised if result exceeds maximum IP address value or
        is less than zero.

        :param num: size of IP address increment.
        is)result outside valid IP address boundary!N(RRRRRt
IndexError(Rtnumt	new_value((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__iadd__�s
	"	cCsRt|j|�}d|ko0|jjknrB||_|Std��dS(s�
        Decreases the numerical value of this IPAddress by num.

        An IndexError is raised if result is less than zero or exceeds maximum
        IP address value.

        :param num: size of IP address decrement.
        is)result outside valid IP address boundary!N(RRRRRRc(RRdRe((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__isub__�s
	"	cCs[t|j|�}d|ko0|jjknrK|j||jj�Std��dS(s
        Add the numerical value of this IP address to num and provide the
        result as a new IPAddress object.

        :param num: size of IP address increase.

        :return: a new IPAddress object with its numerical value increased by num.
        is)result outside valid IP address boundary!N(RRRRRRQR3Rc(RRdRe((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__add__�s	"cCs[t|j|�}d|ko0|jjknrK|j||jj�Std��dS(s
        Subtract the numerical value of this IP address from num providing
        the result as a new IPAddress object.

        :param num: size of IP address decrease.

        :return: a new IPAddress object with its numerical value decreased by num.
        is)result outside valid IP address boundary!N(RRRRRRQR3Rc(RRdRe((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__sub__�s	"cCs[t||j�}d|ko0|jjknrK|j||jj�Std��dS(s
        Subtract num (lvalue) from the numerical value of this IP address
        (rvalue) providing the result as a new IPAddress object.

        :param num: size of IP address decrease.

        :return: a new IPAddress object with its numerical value decreased by num.
        is)result outside valid IP address boundary!N(RRRRRRQR3Rc(RRdRe((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__rsub__�s	"cCs|jj|jfS(sP
        :return: a key tuple that uniquely identifies this IP address.
        (RR3R(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR!�scCs|jj|j|jjfS(sI:return: A key tuple used to compare and sort this `IPAddress` correctly.(RR3RR\(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR"�scCs|jS(s<:return: the value of this IP address as an unsigned integer(R(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__int__�scCs|jS(s<:return: the value of this IP address as an unsigned integer(R(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__long__�scCs|jdkrdSd|jS(s;:return: an octal string representation of this IP address.it0s0%o(R(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__oct__�scCsd|jS(s@:return: a hexadecimal string representation of this IP address.s0x%x(R(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__hex__�scCs|jS(sx
        :return: return the integer value of this IP address when called by             hex(), oct() or bin().
        (R(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt	__index__�scCs|jj|j|�S(s�
        :param word_sep: (optional) the separator to insert between words.
            Default: None - use default separator for address type.

        :return: the value of this IP address as a binary digit string.(Rtint_to_bitsR(Rtword_sep((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytbits�scCs|jj|j�S(s7The value of this IP address as a packed binary string.(Rt
int_to_packedR(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytpacked�scCs|jj|j�S(sx
        A list of unsigned integer words (octets for IPv4, hextets for IPv6)
        found in this IP address.
        (Rtint_to_wordsR(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytwordsscCs|jj|j�S(s�
        The value of this IP adddress in standard Python binary
        representational form (0bxxx). A back port of the format provided by
        the builtin bin() function found in Python 2.6.x and higher.
        (Rt
int_to_binR(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytbinscCs|jj|j�S(s1The reverse DNS lookup record for this IP address(Rtint_to_arpaR(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytreverse_dnsscCs�d}|j}|jjdkr6||jd�}n�|jjdkr�d|jkoetjknr||jd�}q�tj|jko�dknr�||jdd�}q�td|��n|S(s�
        Raises an `AddrConversionError` if IPv6 address cannot be converted
        to IPv4.

        :return: A numerically equivalent version 4 `IPAddress` object.
        iiiI������I��s2IPv6 address %s unsuitable for conversion to IPv4!N(RRQRR3RR/RR(Rtiptklass((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR
s	""
cCs�d}|j}|jjdkrt|r_d|jkoAdknr_||jdd�}q�||jd�}nF|jjdkr�||jd�}|s�|d|jd�}q�n|S(s�
        .. note:: The IPv4-mapped IPv6 address format is now considered             deprecated. See RFC 4291 or later for details.

        :param ipv4_compatible: If ``True`` returns an IPv4-mapped address
            (::ffff:x.x.x.x), an IPv4-compatible (::x.x.x.x) address
            otherwise. Default: False (IPv4-mapped).

        :return: A numerically equivalent version 6 `IPAddress` object.
        iI��I������iN(RRQRR3R(Rtipv4_compatibleR|R}((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR/s	cCsF|dk	r-t|d�s-td��q-n|jj|jd|�S(s�
        Only relevant for IPv6 addresses. Has no effect for IPv4.

        :param dialect: An ipv6_* dialect class.

        :return: an alternate string representation for this IP address.
        tword_fmts-custom dialects should subclass ipv6_verbose!tdialectN(RthasattrRRt
int_to_strR(RR�((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytformatLs
cCs#|j|jt|�B|jj�S(s�
        :param other: An `IPAddress` object (or other int-like object).

        :return: bitwise OR (x | y) between the integer value of this IP
            address and ``other``.
        (RQRRRRR3(RR&((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__or__ZscCs#|j|jt|�@|jj�S(s�
        :param other: An `IPAddress` object (or other int-like object).

        :return: bitwise AND (x & y) between the integer value of this IP
            address and ``other``.
        (RQRRRRR3(RR&((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__and__cscCs#|j|jt|�A|jj�S(s�
        :param other: An `IPAddress` object (or other int-like object).

        :return: bitwise exclusive OR (x ^ y) between the integer value of
            this IP address and ``other``.
        (RQRRRRR3(RR&((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__xor__lscCs|j|j|>|jj�S(s�
        :param numbits: size of bitwise shift.

        :return: an `IPAddress` object based on this one with its integer
            value left shifted by ``numbits``.
        (RQRRR3(RR^((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt
__lshift__uscCs|j|j|?|jj�S(s�
        :param numbits: size of bitwise shift.

        :return: an `IPAddress` object based on this one with its integer
            value right shifted by ``numbits``.
        (RQRRR3(RR^((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt
__rshift__~scCs
t|j�S(si:return: ``True`` if the numerical value of this IP address is not             zero, ``False`` otherwise.(tboolR(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__nonzero__�scCs|jj|j�S(s,:return: IP address in presentational format(RR�R(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__str__�scCsd|jj|fS(s8:return: Python statement to create an equivalent objects%s('%s')(RQRH(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__repr__�s(N(+RHRIRJRKRRRWRZR`RbR[RfRgRht__radd__RiRjR!R"RkRlRnRoRpRsRLRuRwRyR{R
R;RR�R�R�R�R�R�R�t__bool__R�R�(((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyRM�sLQ																																tIPListMixincBsVeZdZdZd�Zed��Zd�Zd�Zd�Z	d�Z
e
ZRS(su
    A mixin class providing shared list-like functionality to classes
    representing groups of IP addresses.

    cCs=t|j|jj�}t|j|jj�}t||�S(s�
        :return: An iterator providing access to all `IPAddress` objects
            within range represented by this ranged IP object.
        (RMtfirstRR3tlasttiter_iprange(Rtstart_iptend_ip((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__iter__�scCst|j|jd�S(sP
        The total number of IP addresses within this ranged IP object.
        i(RRR�R�(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytsize�scCs,|j}|tkr(tdt��n|S(s�
        :return: the number of IP addresses in this ranged IP object. Raises
            an `IndexError` if size > system max int (a Python 2.x
            limitation). Use the .size property for subnets of any size.
        sVrange contains more than %d (sys.maxint) IP addresses! Use the .size property instead.(R�RRc(RR�((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__len__�s
	
cCs�d}t|d�r�|jjdkr6td��n|j|j�\}}}||dksm||kr�tt|j	|jj�g�}q�t|j	||jj�}t|j	|||jj�}t
|||�}n�y�t|�}|j|kodknr4t|j|d|jj�}nNd|koR|jdknrvt|j	||jj�}nt
d��Wn!tk
r�td|��nX|S(	s�
        :return: The IP address(es) in this `IPNetwork` object referenced by
            index or slice. As slicing can produce large sequences of objects
            an iterator is returned instead of the more usual `list`.
        tindicesisIPv6 slices are not supported!iis'index out range for address range size!sunsupported index type %r!N(RR�RR3RR�R�titerRMR�R�RRR�RcRP(RtindextitemtstarttstoptstepR�R�((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__getitem__�s($  ##
cCs�t|t�r~|jj|jjkr+tSt|t�r\|j|jko[|j|jkS|j|jko}|j|jkSt|�|kS(s�
        :param other: an `IPAddress` or ranged IP object.

        :return: ``True`` if other falls within the boundary of this one,
            ``False`` otherwise.
        (	RRRR3R;RMRR�R�(RR&((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt__contains__�s""cCstS(s�
        Ranged IP objects always represent a sequence of at least one IP
        address and are therefore always True in the boolean context.
        (R8(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR��s((RHRIRJRKR�RLR�R�R�R�R�R�(((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR��s				%		icCs�t|t�r�t|�dkr7td|j��n|\}}d|ko]|jknsxtd|j��nd|ko�|jkns�td|j��q�n�t|t�rs|r�t|�}nd|kr�|j	dd�\}}n|}d}yt||jdt
�}WnZtk
r|jd	krltj|�}	t|	|jdt
�}q�td
|��nX|j}yt|�}Wn�tk
r�|dkr;|j}q;nwtk
r:t||jdt
�}
|
j�r|j|
j}q;|
j�r'|j|
j}q;td|��nXd|koU|jkns�td|j��q�ntd
t|���|t@r�|j|}||@}n||fS(Nisinvalid %s tuple!is#invalid address value for %s tuple!sinvalid prefix for %s tuple!RNiRUisinvalid IPNetwork address %s!s!addr %r is not a valid IPNetwork!sinvalid prefix for %s address!sunexpected type %s for addr arg(RttupletlenRRRR\Rtcidr_abbrev_to_verbosetsplitRRMR3RR/texpand_partial_addressRRRRRPR[tnetmask_to_prefixRbthostmask_to_prefixRRtprefix_to_netmask(RVRTtimplicit_prefixRURt	prefixlentval1tval2R|t
expanded_addrtmasktnetmask((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytparse_ip_network�s\
	




t	IPNetworkcBseZdZd#Zed$dd�Zd�Zd�Zd�Z	e
d�e	dd	�Ze
d
��Ze
d��Z
e
d��Ze
d
��Ze
d��Ze
d��Ze
d��Ze
d��Ze
d��Ze
d��Zd�Zd�Zd�Zd�Zd�Zd�Zed�Zdd�Zdd�Zdd�Zd$d$d�Z d �Z!d!�Z"d"�Z#RS(%sf
    An IPv4 or IPv6 network or subnet.

    A combination of an IP address and a network mask.

    Accepts CIDR and several related variants :

    a) Standard CIDR::

        x.x.x.x/y -> 192.0.2.0/24
        x::/y -> fe80::/10

    b) Hybrid CIDR format (netmask address instead of prefix), where 'y'        address represent a valid netmask::

        x.x.x.x/y.y.y.y -> 192.0.2.0/255.255.255.0
        x::/y:: -> fe80::/ffc0::

    c) ACL hybrid CIDR format (hostmask address instead of prefix like        Cisco's ACL bitmasks), where 'y' address represent a valid netmask::

        x.x.x.x/y.y.y.y -> 192.0.2.0/0.0.0.255
        x::/y:: -> fe80::/3f:ffff:ffff:ffff:ffff:ffff:ffff:ffff

    d) Abbreviated CIDR format (as of netaddr 0.7.x this requires the        optional constructor argument ``implicit_prefix=True``)::

        x       -> 192
        x/y     -> 10/8
        x.x/y   -> 192.168/16
        x.x.x/y -> 192.168.0/24

        which are equivalent to::

        x.0.0.0/y   -> 192.0.0.0/24
        x.0.0.0/y   -> 10.0.0.0/8
        x.x.0.0/y   -> 192.168.0.0/16
        x.x.x.0/y   -> 192.168.0.0/24

    t
_prefixlenicCs�tt|�j�d
\}}}t|d�rO|j}|j}|j}nIt|d�r||j}|j}|j}n|dkr�t	t
|d|d|�\}}t
}n�|dkr�t	t|d|d|�\}}t}n�|d	k	rtd|��ny%t
}t	||||�\}}Wnit
k
r�y%t}t	||||�\}}Wnt
k
rtnX|d	kr�t
d|��q�nX||_||_||_d	S(s�
        Constructor.

        :param addr: an IPv4 or IPv6 address with optional CIDR prefix,
            netmask or hostmask. May be an IP address in presentation
            (string) format, an tuple containing and integer address and a
            network prefix, or another IPAddress/IPNetwork object (copy
            construction).

        :param implicit_prefix: (optional) if True, the constructor uses
            classful IPv4 rules to select a default prefix when one is not
            provided. If False it uses the length of the IP address version.
            (default: False)

        :param version: (optional) optimizes version detection if specified
            and distinguishes between IPv4 and IPv6 for addresses with an
            equivalent integer value.

        :param flags: (optional) decides which rules are applied to the
            interpretation of the addr value. Currently only supports the
            NOHOST option. See the netaddr.core docs for further details.

        R�RiR�RUis%r is an invalid IP version!sinvalid IPNetwork %sN(NNN(ROR�RRR�RRR�R\R�R/R1RPR(RRTR�R3RURR�RV((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyRlsH							
	
		cCs|j|j|jjfS(s0:return: Pickled state of an `IPNetwork` object.(RR�RR3(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyRW�scCs�|\}}}||_|dkr0t|_n.|dkrHt|_ntdt|���d|ko{|jjknr�||_ntdt|���dS(sT
        :param state: data used to unpickle a pickled `IPNetwork` object.

        iis%unpickling failed for object state %siN(RR/RR1RPRXR\R�(RRYRR�R3((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyRZ�s	"cCspt|t�s(tdt|���nd|koE|jjknsctd|jj��n||_dS(Nsint argument expected, not %sis!invalid prefix for an %s address!(	RRRRRR\RRR�(RR((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt_set_prefixlen�s"cCs|jS(N(R�(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR�sRsCsize of the bitmask used to separate the network from the host bitscCst|j|jj�S(s�
        The IP address of this `IPNetwork` object. This is may or may not be
        the same as the network IP address which varies according to the value
        of the CIDR subnet prefix.
        (RMRRR3(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR|�scCst|j|j@|jj�S(s/The network address of this `IPNetwork` object.(RMRt_netmask_intRR3(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytnetwork�scCsP|jjdkr/|jj|jdkr/dSt|j|jB|jj�SdS(s0The broadcast address of this `IPNetwork` objectiiN(RR3R\R�RRMRt
_hostmask_int(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt	broadcast�s+cCs|j|jj|jA@S(se
        The integer value of first IP address found within this `IPNetwork`
        object.
        (RRRR�(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR��scCs&d|jj|j>d}|j|BS(sd
        The integer value of last IP address found within this `IPNetwork`
        object.
        i(RR\R�R(Rthostmask((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR��scCs&|jj|jA}t||jj�S(s+The subnet mask of this `IPNetwork` object.(RRR�RMR3(RR�((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR��scCs|jj|jAS(s+Same as self.netmask, but in integer format(RRR�(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR�scCs.d|jj|j>d}t||jj�S(s)The host mask of this `IPNetwork` object.i(RR\R�RMR3(RR�((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR�scCsd|jj|j>dS(s,Same as self.hostmask, but in integer formati(RR\R�(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR�scCs)t|j|j@|jfd|jj�S(s�
        The true CIDR address for this `IPNetwork` object which omits any
        host bits to the right of the CIDR subnet prefix.
        R3(R�RR�R�RR3(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR<scCsnt|j�|j|}||jd|jjkrFtd��n|dkratd��n||_|S(sP
        Increases the value of this `IPNetwork` object by the current size
        multiplied by ``num``.

        An `IndexError` is raised if result exceeds maximum IP address value
        or is less than zero.

        :param num: (optional) number of `IPNetwork` blocks to increment             this IPNetwork's value by.
        is#increment exceeds address boundary!isincrement is less than zero!(RRR�R�RRRcR(RRdRe((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyRfs	cCsnt|j�|j|}|dkr5td��n||jd|jjkratd��n||_|S(sP
        Decreases the value of this `IPNetwork` object by the current size
        multiplied by ``num``.

        An `IndexError` is raised if result is less than zero or exceeds
        maximum IP address value.

        :param num: (optional) number of `IPNetwork` blocks to decrement             this IPNetwork's value by.
        isdecrement is less than zero!is#decrement exceeds address boundary!(RRR�R�RcRRR(RRdRe((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyRg2s	cCs�t|t�r�|jj|jjkr+tS|jj|j}|j|?}t|t�r�||>|j	jko�|d|>|j
jkS|j|?}t|t�r�||kSt|t�r�||ko�|j|jkSnt|�|kS(s�
        :param other: an `IPAddress` or ranged IP object.

        :return: ``True`` if other falls within the boundary of this one,
            ``False`` otherwise.
        i(
RRRR3R;R\R�RtIPRanget_startt_endRMR�(RR&t
shiftwidthtself_nett	other_net((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR�Gs


cCs|jj|j|jfS(sR
        :return: A key tuple used to uniquely identify this `IPNetwork`.
        (RR3R�R�(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR!escCsJ|jd}|j|jj|jA@}|j|}|jj|||fS(s[
        :return: A key tuple used to compare and sort this `IPNetwork` correctly.
        i(R�RRRR�R3(Rt
net_size_bitsR�t	host_bits((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR"ks

cCsd	}|j}|jjdkr@|d|j|jf�}n�|jjdkrd|jkootjknr�tj	|j�}|d||jdf�}qtj|jko�dknr�tj	|jd�}|d||jdf�}qt
d|��n|S(
s�
        :return: A numerically equivalent version 4 `IPNetwork` object.             Raises an `AddrConversionError` if IPv6 address cannot be             converted to IPv4.
        is%s/%diii`I������I��s2IPv6 address %s unsuitable for conversion to IPv4!N(RRQRR3R|R�RR/RR�R(RR|R}RT((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR
ts	" " 
cCs�d}|j}|jjdkr�|rkd|jkoAdknrk||jd|jfdd�}q�||j|jfdd�}nf|jjdkr�|r�||j|jdfdd�}q�|d|j|jdfdd�}n|S(s�
        .. note:: the IPv4-mapped IPv6 address format is now considered         deprecated. See RFC 4291 or later for details.

        :param ipv4_compatible: If ``True`` returns an IPv4-mapped address
            (::ffff:x.x.x.x), an IPv4-compatible (::x.x.x.x) address
            otherwise. Default: False (IPv4-mapped).

        :return: A numerically equivalent version 6 `IPNetwork` object.
        iI��I������R3ii`N(RRQRR3RR�(RR~R|R}((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR�s	!%
icCs6|jd|j|jf|jj�}||8}|S(s�
        :param step: the number of IP subnets between this `IPNetwork` object
            and the expected subnet. Default: 1 (the previous IP subnet).

        :return: The adjacent subnet preceding this `IPNetwork` object.
        s%s/%d(RQR�R�RR3(RR�tip_copy((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytprevious�s
cCs6|jd|j|jf|jj�}||7}|S(s�
        :param step: the number of IP subnets between this `IPNetwork` object
            and the expected subnet. Default: 1 (the next IP subnet).

        :return: The adjacent subnet succeeding this `IPNetwork` object.
        s%s/%d(RQR�R�RR3(RR�R�((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytnext�s
cCs�d|ko|jjknsAtd||jjf��ng}|j}||_x5|j|jkr�|j|j�|jd7_q\W|S(sb
        Provides a list of supernets for this `IPNetwork` object between the
        size of the current prefix and (if specified) an endpoint prefix.

        :param prefixlen: (optional) a CIDR prefix for the maximum supernet.
            Default: 0 - returns all possible supernets.

        :return: a tuple of supernet `IPNetwork` objects.
        is"CIDR prefix /%d invalid for IPv%d!i(RR\RPR3R<R�tappend(RR�t	supernetstsupernet((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR��s
"		c	csGd|jko |jjknsDtd||jjf��n|j|ks\t�n|jj}d||jd||}|dkr�|}nd|ko�|kns�td��n|jj|j�}d}x`||krB|j	d||f|jj�}|j
|j|7_
||_|d7}|Vq�WdS(s�
        A generator that divides up this IPNetwork's subnet into smaller
        subnets based on a specified CIDR prefix.

        :param prefixlen: a CIDR prefix indicating size of subnets to be
            returned.

        :param count: (optional) number of consecutive IP subnets to be
            returned.

        :return: an iterator containing IPNetwork subnet objects.
        is"CIDR prefix /%d invalid for IPv%d!iis,count outside of current IP subnet boundary!s%s/%dN(R�RR\RPR3t
StopIterationRR�R�RQRR�(	RR�tcounttfmtR\tmax_subnetstbase_subnettitsubnet((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR��s(
%			
cCs�tg�}|jjdkr�|jdkrktt|jd|jj�t|jd|jj��}q�tt|j|jj�t|j|jj��}nI|jdkr�tt|jd|jj�t|j|jj��}n|S(s

        A generator that provides all the IP addresses that can be assigned
        to hosts within the range of this IP object's subnet.

        - for IPv4, the network and broadcast addresses are always excluded.           for subnets that contains less than 4 IP addresses /31 and /32           report in a manner per RFC 3021

        - for IPv6, only the unspecified address '::' or Subnet-Router anycast           address (first address in the network) is excluded.

        :return: an IPAddress iterator
        iii(R�RR3R�R�RMR�R�(Rtit_hosts((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt
iter_hostss"cCs&|jj|j�}d||jfS(s&:return: this IPNetwork in CIDR formats%s/%s(RR�RR�(RRT((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR�(scCsd|jj|fS(s8:return: Python statement to create an equivalent objects%s('%s')(RQRH(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR�-s(s
_prefixlenN($RHRIRJRKR;RRRWRZR�RLR�R|R�R�R�R�R�R�R�R�R<RfRgR�R!R"R
RR�R�R�R�R�R�R�(((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR�As@(D						
							 )	%	R�cBs�eZdZdZdd�Zd�Zd�Zd�Zed��Z	ed	��Z
d
�Zd�Zd�Z
d
�Zd�ZRS(s�
    An arbitrary IPv4 or IPv6 address range.

    Formed from a lower and upper bound IP address. The upper bound IP cannot
    be numerically smaller than the lower bound and the IP version of both
    must match.

    R�R�icCsst|d|�|_|jj|_t||jjd|�|_t|j�t|j�krotd��ndS(s�
        Constructor.

        :param start: an IPv4 or IPv6 address that forms the lower
            boundary of this IP range.

        :param end: an IPv4 or IPv6 address that forms the upper
            boundary of this IP range.

        :param flags: (optional) decides which rules are applied to the
            interpretation of the start and end values. Supported constants
            are INET_PTON and ZEROFILL. See the netaddr.core docs for further
            details.

        RUs(lower bound IP greater than upper bound!N(RMR�RR3R�RRR(RR�tendRU((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR=s
cCs|jj|jj|jjfS(s.:return: Pickled state of an `IPRange` object.(R�RR�RR3(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyRWSscCsF|\}}}t||�|_|jj|_t||�|_dS(sQ
        :param state: data used to unpickle a pickled `IPRange` object.
        N(RMR�RR�(RRYR�R�R3((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyRZWscCst|t�r|jj|jjkr+tSt|t�rb|jj|jkoa|jj|jkSt|t	�r�|jj|jjko�|jj|jjkSt|t
�r|jj|j}|j|?|>}|d|>}|jj|ko|jj|kSnt|�|kS(Ni(
RRRR3R;RMR�RR�R�R�R\R�(RR&R�tother_starttother_next_start((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR�as cCs
t|j�S(s?The integer value of first IP address in this `IPRange` object.(RRR�(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR�wscCs
t|j�S(s>The integer value of last IP address in this `IPRange` object.(RRR�(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR�|scCs|jj|j|jfS(sP
        :return: A key tuple used to uniquely identify this `IPRange`.
        (RR3R�R�(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR!�scCs2|jjt|j�}|jj|jj|fS(sY
        :return: A key tuple used to compare and sort this `IPRange` correctly.
        (RR\RR�R3R�R(Rtskey((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR"�scCst|j|j�S(sx
        The list of CIDR addresses found within the lower and upper bound
        addresses of this `IPRange`.
        (tiprange_to_cidrsR�R�(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytcidrs�scCsd|j|jfS(s<:return: this `IPRange` in a common representational format.s%s-%s(R�R�(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR��scCsd|jj|j|jfS(s8:return: Python statement to create an equivalent objects%s('%s', '%s')(RQRHR�R�(R((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR��s(s_starts_end(RHRIRJRKRRWRZR�RLR�R�R!R"R�R�R�(((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR�2s		
					cgs1x*t|�D]}x|D]}|VqWq
WdS(s�
    :param args: A list of IP addresses and subnets passed in as arguments.

    :return: A generator that flattens out IP subnets, yielding unique
        individual IP addresses (no duplicates).
    N(t
cidr_merge(targsR<R|((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytiter_unique_ips�s
cCs�d�}t|�r4d|ks-|dkr4|Sny$t|�}d|||�fSWnHtk
r�d|kr�|jdd�\}}y9dt|�ko�dkns�td	|��nWq�tk
r�|SXn|}d}|jd
�}t|�dkr|Sx+tdt|��D]}|jd�q%W|dkrty||d�}Wqttk
rp|SXnd
d
j|�|fSt	t
fk
r�|SXdS(s�
    A function that converts abbreviated IPv4 CIDRs to their more verbose
    equivalent.

    :param abbrev_cidr: an abbreviated CIDR.

    Uses the old-style classful IP address rules to decide on a default
    subnet prefix if one is not explicitly provided.

    Only supports IPv4 addresses.

    Examples ::

        10                  - 10.0.0.0/8
        10/16               - 10.0.0.0/16
        128                 - 128.0.0.0/16
        128/8               - 128.0.0.0/8
        192.168             - 192.168.0.0/16

    :return: A verbose CIDR from an abbreviated CIDR or old-style classful         network address. The original value if it was not recognised as a         supported abbreviation.
    cSs�t|�}d|ko#dkns;td|��nd|koRdknr[dSd|kordknr{dSd	|ko�d
knr�dSd|ko�d
knr�dSdS(Nii�sInvalid octet: %r!iii�i�ii�i�ii�i�ii (RRRc(toctet((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytclassful_prefix�st:ts%s.0.0.0/%sRNiii s.prefixlen in address %r out of range for IPv4!t.iRms%s/%sN(RRRRPR�RR�trangeR�tjoinRRc(tabbrev_cidrR�R�t	part_addrtprefixttokens((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR��s>	
"

c
Cs�t|d�std��ng}x<|D]4}t|�}|j|j|j|j|f�q+W|j�t|�d}x�|dkr+||d||ddkr||dd||ddkr||d||dt	||dd||d�f||d<||=n|d8}q�Wg}x�|D]x}t|�dkre|j|d�q9|d}t
|dd|�}t
|dd|�}	|jt||	��q9W|S(	s
    A function that accepts an iterable sequence of IP addresses and subnets
    merging them into the smallest possible list of CIDRs. It merges adjacent
    subnets where possible, those contained within others and also removes
    any duplicates.

    :param ip_addrs: an iterable sequence of IP addresses and subnets.

    :return: a summarized list of `IPNetwork` objects.
    R�s#A sequence or iterator is expected!iiiiiR3(
R�RPR�R�R3R�R�tsortR�tminRMtextendR�(
tip_addrstrangesR|R<R�tmergedtrange_tupleR3trange_startt
range_stop((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR��s,
&
DD


cCs t||�\}}}||S(s
    Removes an exclude IP address or subnet from target IP subnet.

    :param target: the target IP address or subnet to be divided up.

    :param exclude: the IP address or subnet to be removed from target.

    :return: list of `IPNetwork` objects remaining after exclusion.
    (tcidr_partition(ttargettexcludetleftt_tright((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytcidr_exclude+s
cCs�t|�}t|�}|j|jkr=gg|jgfS|j|jkrb|jgggfS|j|jkr�g|ggfSg}g}|jd}|jj}|j}|j}|}|d||}	x�|j|krv|j|	kr|jt||fd|��|	}
n%|jt|	|fd|��|}
|d7}||kr[Pn|
}|
d||}	q�W||g|ddd�fS(sc
    Partitions a target IP subnet on an exclude IP address.

    :param target: the target IP address or subnet to be divided up.

    :param exclude: the IP address or subnet to partition on

    :return: list of `IPNetwork` objects before, the partition and after, sorted.

    Adding the three lists returns the equivalent of the original subnet.
    iiR3Ni����(	R�R�R�R<R�RR\R3R�(R�R�R�R�t
new_prefixlenttarget_module_widthttarget_firstR3ti_lowerti_uppertmatched((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR�9s8

			
c	Cs�tg|D]}t|�^q
�}t|�dksFtd��n|d}|d}|j|jkr{td��n|j}|j}|j}|j	j
}x9|dkr�||kr�|d8}|d||>M}q�Wt||fd|j�S(sO
    Function that accepts a sequence of IP addresses and subnets returning
    a single `IPNetwork` subnet that is large enough to span the lower and
    upper bound IP addresses with a possible overlap on either end.

    :param ip_addrs: sequence of IP addresses and subnets.

    :return: a single spanning `IPNetwork` subnet.
    is-IP sequence must contain at least 2 elements!ii����s.IP sequence cannot contain both IPv4 and IPv6!R3(tsortedR�R�RPR3RR�R�R�RR\(	R�R|t
sorted_ipst	lowest_ipt
highest_iptipnumR�tlowest_ipnumR\((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt
spanning_cidrus 
"

			
iccs�t|�}t|�}|j|jkr9td��n|j}t|�}|dkritd��nt|�}t|�}t}|dkr�t}n||}xKtr�||7}|r�||ks�Pq�n||ks�Pnt||�Vq�WdS(s�
    A generator that produces IPAddress objects between an arbitrary start
    and stop IP address with intervals of step between them. Sequences
    produce are inclusive of boundary IPs.

    :param start: start IP address.

    :param end: end IP address.

    :param step: (optional) size of step between IP addresses. Default: 1

    :return: an iterator of one or more `IPAddress` objects.
    s(start and stop IP versions do not match!isstep argument cannot be zeroN(RMR3RRRRPR;R8(R�R�R�R3R�t
negative_stepR�((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR��s,		
	
cCsg}t|�}t|�}|j|jg}t||g�}|jj}|j|dkr�t|dd|fd|j�}t||�d}|j�}n|j|dkr�t|dd|fd|j�}|t||�d7}n
|j	|�|S(s`
    A function that accepts an arbitrary start and end IP address or subnet
    and returns a list of CIDR subnets that fit exactly between the boundaries
    of the two with no overlap.

    :param start: the start IP address or subnet.

    :param end: the end IP address or subnet.

    :return: a list of one or more IP addresses and subnets.
    iiR3i(
R�R�R�RRR\R3R�tpopR�(R�R�t	cidr_listtipranget	cidr_spanR\R�((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyR��s##
cCs�d}t|d�s(td|��nt|�}xatg|D]}t|�^qA�D]:}||kru|}qZ|dk	rZ|j|krZPqZqZW|S(sb
    Matches an IP address or subnet against a given sequence of IP addresses
    and subnets.

    :param ip: a single IP address or subnet.

    :param cidrs: a sequence of IP addresses and/or subnets.

    :return: the smallest (most specific) matching IPAddress or IPNetwork
        object from the provided sequence, None if there was no match.
    R�s,IP address/subnet sequence expected, not %r!N(RR�RRMR�R�R�(R|R�tmatchR<((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytsmallest_matching_cidr�s
,	cCs~d}t|d�s(td|��nt|�}xCtg|D]}t|�^qA�D]}||krZ|}PqZqZW|S(sb
    Matches an IP address or subnet against a given sequence of IP addresses
    and subnets.

    :param ip: a single IP address or subnet.

    :param cidrs: a sequence of IP addresses and/or subnets.

    :return: the largest (least specific) matching IPAddress or IPNetwork
        object from the provided sequence, None if there was no match.
    R�s,IP address/subnet sequence expected, not %r!N(RR�RRMR�R�(R|R�RR<((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytlargest_matching_cidrs
,cCs�g}t|d�s(td|��nt|�}xftg|D]}t|�^qA�D]?}||kr||j|�qZ|rZ|j|dkrZPqZqZW|S(sM
    Matches an IP address or subnet against a given sequence of IP addresses
    and subnets.

    :param ip: a single IP address.

    :param cidrs: a sequence of IP addresses and/or subnets.

    :return: all matching IPAddress and/or IPNetwork objects from the provided
        sequence, an empty list if there was no match.
    R�s,IP address/subnet sequence expected, not %r!i����(R�RRMR�R�R�R�(R|R�tmatchesR<((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pytall_matching_cidrs"s
,s127.0.0.0/8s
10.0.0.0/8s
100.64.0.0/10s
172.16.0.0/12s192.0.0.0/24s192.168.0.0/16s
198.18.0.0/15s	239.0.0.0s239.255.255.255s169.254.0.0/16s224.0.0.0/4s192.88.99.0/24s	0.0.0.0/8s192.0.2.0/24s240.0.0.0/4s198.51.100.0/24s203.0.113.0/24s233.252.0.0/24s	234.0.0.0s238.255.255.255s	225.0.0.0s231.255.255.255s::1sfc00::/7s	fec0::/10s	fe80::/10sff00::/8s	ff00::/12s::/8s0100::/8s0200::/7s0400::/6s0800::/5s1000::/4s4000::/3s6000::/3s8000::/3sA000::/3sC000::/3sE000::/4sF000::/5sF800::/6sFE00::/9(7RJtsyst_systnetaddr.coreRRRRRRRRRR	tnetaddr.strategyR
R/RR1tnetaddr.compatRR
RRRtobjectRRMR�R;R�R�R�R�R�R�R�R�RR�R�RRR
R4R7R>R0t	IPV4_6TO4R@R5R9R?R2RA(((s6/tmp/pip-install-zM1pc4/netaddr/netaddr/ip/__init__.pyt<module>spF(���eD��m		T	,		<	"/	$															
	

https://t.me/AnonymousX5 - 2025