PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  w{Zc@sdZdZdZdZdZddlZejddkrFeZ ne Z dd l m Z m Z d efd YZeeZeeZd efd YZdS(sImmutable integer set type. Integer set class. Copyright (C) 2010, David Moss. Ported to Python 3.x. Copyright (C) 2006, Heiko Wundram. Released under the MIT license: Copyright (c) 2006, Heiko Wundram. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. s Heiko Wundram s0.2t7s 2006-01-23iNii(t _func_namet _func_doct _InfinitycBs_eZdZdgZdZdZdZdZdZdZ dZ d Z RS( s0Internal type used to represent infinity values.t_negcCs ||_dS(N(R(tselftneg((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyt__init__BscCs<t|tttfstS|jo;t|to:|j S(N(t isinstancetintt_longRtNotImplementedR(Rtvalue((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyt__lt__Es cCs#t|tttfstS|jS(N(RR R RR R(RR ((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyt__le__KscCs=t|tttfstS|jp;t|to;|j S(N(RR R RR R(RR ((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyt__gt__Ps cCs$t|tttfstS|j S(N(RR R RR R(RR ((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyt__ge__VscCs;t|tttfstSt|to:|j|jkS(N(RR R RR R(RR ((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyt__eq__[scCs<t|tttfstSt|t p;|j|jkS(N(RR R RR R(RR ((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyt__ne__`scCsdS(NtNone((R((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyt__repr__es( t__name__t __module__t__doc__t __slots__RR RRRRRR(((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyR=s        tIntSetcBseZdZddddgZdZeedZdZdZ dJd Z e d d d d Z e dd d dZ e dd d dZe dd ddZe dd ddZe dd ddZe dd ddZe dd ddZe dd ddZe d d d!d"Ze d#d d!d$Ze d%d d!d&Ze d'd(d)d*Ze d+d(d,d-Ze d.d(d/d0d1Ze d2d(d)d3Ze d4d(d5d6d7Ze d8d(d9d:d;Ze d<d(d=d>Ze d?d(d@dAdBZ[ dCZ e Z!dDZ"dEZ#dFZ$dGZ%e%Z&dHZ'dIZ(RS(KsvInteger set class with efficient storage in a RLE format of ranges. Supports minus and plus infinity in the range.t_rangest_mint_maxt_hashcOst|dkr~t|dtr~|r:tdn|dj|_|dj|_|dj|_|dj|_dSg|_|jdt |_|jdt |_|jdkrt |_n|jdkrt |_n|rtdnt|jt t fp |jt ks2tdnt|jt t fpV|jt kshtd n|jt k r|jt k r|j|jkrtd nt|jt t fr|jd7_nx|D]}t|t t fr||d}}n't|tr"t|d kr7td n|\}}|dkr[|j}n|dkrs|j}nt|t t fp|t kstd nt|t t fp|t kstdn|t k r|t k r||krqnt|t t fr.|d7}q.n td||jkrCqn||jkr^|j}n||jkrsqn||jkr|j}n|jj||fqW|jdS(sInitialize an integer set. The constructor accepts an unlimited number of arguments that may either be tuples in the form of (start, stop) where either start or stop may be a number or None to represent maximum/minimum in that direction. The range specified by (start, stop) is always inclusive (differing from the builtin range operator). Keyword arguments that can be passed to an integer set are min and max, which specify the minimum and maximum number in the set, respectively. You can also pass None here to represent minus or plus infinity, which is also the default. iis*No keyword arguments for copy constructor.NtmintmaxsInvalid keyword argument.sInvalid type of min argument.sInvalid type of max argument.s$Minimum is not smaller than maximum.is$Invalid tuple, must be (start,stop).sInvalid type of tuple start.sInvalid type of tuple stop.sInvalid argument.(tlenRRt ValueErrorRRRRtpopt_MININFt_MAXINFRR R t TypeErrorttupletappendt _normalize(Rtargstkwargstargtstarttstop((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRssr%   ''      !!    ccs|}itd6td6}dt|dt|}}d\} } x| |ksb| |kr^| |kr| |kr|| d?| d@|| d?| d@ks| |kr|| d?| d@d| d@ } } } | d7} n3|| d?| d@d| d@ } } } | d7} || krQ| |kr7Pn||| ffV| }n| || t|try||j|fSWqtk rtSXntS(N( RRR R R&t __class__R%R tlist(Rtother((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyt __coerce__s   csi|dkrfd}n-|dkr?fd}n tdt||t|||S(sKMakes a function to match two ranges. Accepts two types: either 'set', which defines a function which returns a set with all ranges matching pall (pany is ignored), or 'bool', which returns True if pall matches for all ranges and pany matches for any one range. doc is the dostring to give this function. pany may be none to ignore the any match. The predicates get a dict with two keys, 'r1', 'r2', which denote whether the current range is present in range1 (self) and/or range2 (other) or none of the two, respectively.tsetcs@|j|}|tkrtS|d}|jj|j}t|j|j|_t|j|j|_g|_x|j |j|j|j|jD]x\}\}}|r|jr|jdd|kr|jdd|f|jdR(RRAtcoercedtnewsettstatesR,R-(tpall(s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pytfs$   "  !tboolc s|j|}|tkrtS|d}t|j|j}t|j|j} }xT|j|j|j||D]4\}\}}|stS|p|}qyW|S(Ni( RBR RRRRR<RR0( RRARERRtfoundRGR,R-(RHtpany(s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRI.s   s#Invalid type of function to create.(R!RR(tnamettypetdocRHRLRI((RHRLs5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyt_make_function s     t__and__RCs&Intersection of two sets as a new set.cCs|do|dS(NR.R/((ts((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pytFst__rand__cCs|do|dS(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSIst intersectioncCs|do|dS(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSLst__or__sUnion of two sets as a new set.cCs|dp|dS(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSQst__ror__cCs|dp|dS(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSTstunioncCs|dp|dS(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSWst__sub__s$Difference of two sets as a new set.cCs|do|d S(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRS\st__rsub__cCs|do|d S(NR/R.((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRS_st differencecCs|do|d S(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSbst__xor__s.Symmetric difference of two sets as a new set.cCs|d|dAS(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSgst__rxor__cCs|d|dAS(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSjstsymmetric_differencecCs|d|dAS(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSmst __contains__RJs*Returns true if self is superset of other.cCs|dp|d S(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSrstissubsets(Returns true if self is subset of other.cCs|dp|d S(NR/R.((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSust istruesubsets-Returns true if self is true subset of other.cCs|dp|d S(NR/R.((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSxscCs|do|d S(NR/R.((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSyst issupersetcCs|dp|d S(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRS|stistruesupersets/Returns true if self is true superset of other.cCs|dp|d S(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSscCs|do|d S(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSstoverlapss)Returns true if self overlaps with other.cCstS(N(tTrue(RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSscCs|do|dS(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSsRs'Returns true if self is equal to other.cCs|d|dA S(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSsRs+Returns true if self is different to other.cCstS(N(Re(RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSscCs|d|dAS(NR.R/((RR((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyRSscCs|jj|j}|j|_|j|_g|_|j}xH|jD]=}||dkrI|jj||df|d}qIqIW||jkr|jj||jfn|S(sInverse of set as a new set.ii(R?RDRRRR'(RRFtlaststoptr((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pytinverses    cCs|jS(sReturns a hash value representing this integer set. As the set is always stored normalized, the hash value is guaranteed to match for matching ranges.(R(R((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyt__hash__scCs|js dS|jddtks;|jddtkrJtdnd}x'|jD]}||d|d7}qZW|dkrtdn|S( sGet length of this integer set. In case the length is larger than 2**31 (including infinitely sized integer sets), it raises an OverflowError. This is due to len() restricting the size to 0 <= len < 2**31.iiisInfinitely sized integer set.iisInteger set bigger than 2**31.l(RR#R$t OverflowError(RtrlenRg((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyt__len__s . cCss|js dS|jddtks;|jddtkr?dSd}x'|jD]}||d|d7}qOW|S(s<Returns the length of this integer set as an integer. In case the length is infinite, returns -1. This function exists because of a limitation of the builtin len() function which expects values in the range 0 <= len < 2**31. Use this function in case your integer set might be larger.iii(RR#R$(RRkRg((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyR s .cCs t|jS(s<Returns true if this integer set contains at least one item.(RJR(R((s5/usr/lib/python2.7/site-packages/netaddr/ip/intset.pyt __nonzero__sccsg}x|jD]}|dtkrv|dtkrX|jddgddgfq|j|dddgq|dtkr|j|ddgq|d}x#||dkr|V|d7}qWqW|rx;trx+|D]#}|dV|dc|d7s  ,