KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/lib64/python2.4/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.4/sets.pyc
mò
‚=5Dc@sÿdZdklZydklZlZWngej
o[d„Zd„ZyeefWn1e	j
o%ddjddjf\ZZnXnXdddgZ
defd	„ƒYZdefd
„ƒYZ
defd„ƒYZdefd
„ƒYZdS(såClasses to represent arbitrary sets (including sets of sets).

This module implements sets using dictionaries whose values are
ignored.  The usual operations (union, intersection, deletion, etc.)
are provided as both methods and operators.

Important: sets are not sequences!  While they support 'x in s',
'len(s)', and 'for x in s', none of those operations are unique for
sequences; for example, mappings support all three as well.  The
characteristic operation for sequences is subscripting with small
integers: s[i], for i in range(len(s)).  Sets don't support
subscripting at all.  Also, sequences allow multiple occurrences and
their elements have a definite order; sets on the other hand don't
record multiple occurrences and don't remember the order of element
insertion (which is why they don't support s[i]).

The following classes are provided:

BaseSet -- All the operations common to both mutable and immutable
    sets. This is an abstract class, not meant to be directly
    instantiated.

Set -- Mutable sets, subclass of BaseSet; not hashable.

ImmutableSet -- Immutable sets, subclass of BaseSet; hashable.
    An iterable argument is mandatory to create an ImmutableSet.

_TemporarilyImmutableSet -- A wrapper around a Set, hashable,
    giving the same hash value as the immutable set equivalent
    would have.  Do not use this class directly.

Only hashable objects can be added to a Set. In particular, you cannot
really add a Set as an element to another Set; if you try, what is
actually added is an ImmutableSet built from it (it compares equal to
the one you tried adding).

When you ask if `x in y' where x is a Set and y is a Set or
ImmutableSet, x is wrapped into a _TemporarilyImmutableSet z, and
what's tested is actually `z in y'.

(s
generators(sifiltersifilterfalseccsD|djo
d„}nx#|D]}||ƒo|Vq!q!WdS(NcCs|S(N(tx(R((t/usr/lib64/python2.4/sets.pyt	predicate@s(RtNonetiterableR(RRR((Rtifilter>s


ccsD|djo
d„}nx#|D]}||ƒp|Vq!q!WdS(NcCs|S(N(R(R((RRGs(RRRR(RRR((RtifilterfalseEs


itBaseSettSettImmutableSetcBstZdZdgZd„Zd„Zd„ZeZed„Z	d„Z
d„Zd„Zd	„Z
d
„ZeZd„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZeZeZd„Zd„Zd„Z d„Z!d„Z"RS(s1Common base class for mutable and immutable sets.t_datacCs!|itjo
td‚ndS(sThis is an abstract class.s7BaseSet is an abstract class.  Use Set or ImmutableSet.N(tselft	__class__Rt	TypeError(R((Rt__init__ZscCs
t|iƒS(s'Return the number of elements of a set.N(tlenRR
(R((Rt__len__cscCs
|iƒS(seReturn string representation of a set.

        This looks like 'Set([<list of elements>])'.
        N(Rt_repr(R((Rt__repr__gscCs8|iiƒ}|o|iƒnd|ii|fS(Ns%s(%r)(RR
tkeystelementstsortedtsortRt__name__(RRR((RRqscCs
|iiƒS(ssReturn an iterator over the elements or a set.

        This is the keys iterator for the underlying dict.
        N(RR
titerkeys(R((Rt__iter__wscCs
td‚dS(Nscan't compare sets using cmp()(R
(Rtother((Rt__cmp__ƒscCs,t|tƒo|i|ijSntSdS(N(t
isinstanceRRRR
tFalse(RR((Rt__eq__•scCs,t|tƒo|i|ijSntSdS(N(RRRRR
tTrue(RR((Rt__ne__›scCs#|iƒ}|ii|iƒ|S(sReturn a shallow copy of a set.N(RRtresultR
tupdate(RR!((Rtcopy£scCs`dkl}|iƒ}||t|ƒ<|i}t	}x!|D]}|||||ƒ<q?W|S(s1Return a deep copy of a set; used by copy module.(sdeepcopyN(R#tdeepcopyRRR!tmemotidR
tdataRtvaluetelt(RR%R(R!R$R'R)((Rt__deepcopy__«s
	cCs%t|tƒptSn|i|ƒS(shReturn the union of two sets as a new set.

        (I.e. all elements that are in either set.)
        N(RRRtNotImplementedRtunion(RR((Rt__or__ÄscCs |i|ƒ}|i|ƒ|S(shReturn the union of two sets as a new set.

        (I.e. all elements that are in either set.)
        N(RRR!t_updateR(RRR!((RR,Ís
cCs%t|tƒptSn|i|ƒS(snReturn the intersection of two sets as a new set.

        (I.e. all elements that are in both sets.)
        N(RRRR+Rtintersection(RR((Rt__and__ÖscCsyt|tƒpt|ƒ}nt|ƒt|ƒjo||}}n||}}t|i	i
|ƒ}|i|ƒS(snReturn the intersection of two sets as a new set.

        (I.e. all elements that are in both sets.)
        N(
RRRRRRtlittletbigRR
thas_keytcommonR(RRR1R2R4((RR/ßs
cCs%t|tƒptSn|i|ƒS(s„Return the symmetric difference of two sets as a new set.

        (I.e. all elements that are in exactly one of the sets.)
        N(RRRR+Rtsymmetric_difference(RR((Rt__xor__íscCs¨|iƒ}|i}t}|i}y
|i}Wn"t
j
ot|ƒi}nXx$t|i
|ƒD]}|||<qiWx$t|i
|ƒD]}|||<qW|S(s„Return the symmetric difference of two sets as a new set.

        (I.e. all elements that are in exactly one of the sets.)
        N(RRR!R
R'RR(tselfdataRt	otherdatatAttributeErrorRRR3R)(RRR'R(R8R!R7R)((RR5ös 		
cCs%t|tƒptSn|i|ƒS(s€Return the difference of two sets as a new Set.

        (I.e. all elements that are in this set and not in the other.)
        N(RRRR+Rt
difference(RR((Rt__sub__	scCsx|iƒ}|i}y
|i}Wn"tj
ot|ƒi}nXt	}x$t|i|ƒD]}|||<q`W|S(s€Return the difference of two sets as a new Set.

        (I.e. all elements that are in this set and not in the other.)
        N(RRR!R
R'RR8R9RRR(RR3R)(RRR'R(R8R!R)((RR:s	
cCsay||ijSWnItj
o=t|ddƒ}|djo‚n|ƒ|ijSnXdS(s{Report whether an element is a member of a set.

        (Called in response to the expression `element in self'.)
        t__as_temporarily_immutable__N(telementRR
R
tgetattrRt	transform(RR=R?((Rt__contains__$s
cCsV|i|ƒt|ƒt|ƒjotSnx!t|ii|ƒD]
}tSqDWt	S(s-Report whether another set contains this set.N(
Rt_binary_sanity_checkRRRRR
R3R)R(RRR)((Rtissubset3s
cCsV|i|ƒt|ƒt|ƒjotSnx!t|ii|ƒD]
}tSqDWt	S(s-Report whether this set contains another set.N(
RRARRRRR
R3R)R(RRR)((Rt
issuperset<s
cCs3|i|ƒt|ƒt|ƒjo
|i|ƒS(N(RRARRRB(RR((Rt__lt__Is
cCs3|i|ƒt|ƒt|ƒjo
|i|ƒS(N(RRARRRC(RR((Rt__gt__Ms
cCs!t|tƒp
td‚ndS(Ns,Binary operation only permitted between sets(RRRR
(RR((RRASscCs+d}x|D]}|t|ƒN}q
W|S(Ni(R!RR)thash(RR!R)((Rt
_compute_hashYs
cCsJ|i}t|tƒo|i|iƒdSnt}t	|ƒt
ttfjo‹t
|ƒ}xätopy#x|D]}|||<qsWdSWqbtj
o:t|ddƒ}|djo‚n|||ƒ<qbXqbWnixe|D]]}y|||<Wqåtj
o:t|ddƒ}|djo‚n|||ƒ<qåXqåWdS(Nt__as_immutable__(RR
R'RRRR"RR(ttypetlistttupletxrangetitertitR=R
R>RR?(RRR?RNR(R=R'((RR.ds8	

(#Rt
__module__t__doc__t	__slots__RRRt__str__RRRRRR R#t__copy__R*R-R,R0R/R6R5R;R:R@RBRCt__le__t__ge__RDRERARGR.(((RRSs@																												
				cBs>tZdZdgZed„Zd„Zd„Zd„ZRS(sImmutable set class.t	_hashcodecCs4d|_h|_|dj	o|i|ƒndS(s5Construct an immutable set from an optional iterable.N(RRRVR
RR.(RR((RRs
		
cCs*|idjo|iƒ|_n|iS(N(RRVRRG(R((Rt__hash__—scCs|i|ifS(N(RR
RV(R((Rt__getstate__œscCs|\|_|_dS(N(tstateRR
RV(RRY((Rt__setstate__Ÿs(	RRORPRQRRRWRXRZ(((RR	‰s			cBsËtZdZgZed„Zd„Zd„Zd„Zd„Z	d„Z
d„Zd„Zd	„Z
d
„Zd„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(s Mutable set class.cCs+h|_|dj	o|i|ƒndS(s*Construct a set from an optional iterable.N(RR
RRR.(RR((RR©s	
cCs
|ifS(N(RR
(R((RRX¯scCs|\|_dS(N(R'RR
(RR'((RRZ³scCs
td‚dS(sA Set cannot be hashed.s'Can't hash a Set, only an ImmutableSet.N(R
(R((RRW¶scCs$|i|ƒ|ii|iƒ|S(s2Update a set with the union of itself and another.N(RRARR
R"(RR((Rt__ior__Às
cCs|i|ƒdS(s2Update a set with the union of itself and another.N(RR.R(RR((Rtunion_updateÆscCs!|i|ƒ||@i|_|S(s9Update a set with the intersection of itself and another.N(RRARR
(RR((Rt__iand__Ês
cCs7t|tƒo||M}n|i|ƒi|_dS(s9Update a set with the intersection of itself and another.N(RRRRR/R
(RR((Rtintersection_updateÐscCs|i|ƒ|i|ƒ|S(sAUpdate a set with the symmetric difference of itself and another.N(RRARtsymmetric_difference_update(RR((Rt__ixor__×s

cCs|i}t}t|tƒpt|ƒ}n||jo|i	ƒnx0|D](}||jo||=qQ|||<qQWdS(sAUpdate a set with the symmetric difference of itself and another.N(RR
R'RR(RRRRtclearR)(RRR'R(R)((RR_Ýs	

cCs|i|ƒ|i|ƒ|S(s1Remove all elements of another set from this set.N(RRARtdifference_update(RR((Rt__isub__ës

cCsl|i}t|tƒpt|ƒ}n||jo|iƒnx!t|i	|ƒD]
}||=qWWdS(s1Remove all elements of another set from this set.N(RR
R'RRRRRaRR3R)(RRR'R)((RRbñs	
cCs|i|ƒdS(s9Add all values from an iterable (such as a list or file).N(RR.R(RR((RR"ýscCs|iiƒdS(s"Remove all elements from this set.N(RR
Ra(R((RRascCsayt|i|<WnItj
o=t|ddƒ}|djo‚nt|i|ƒ<nXdS(s`Add an element to a set.

        This has no effect if the element is already present.
        RHN(RRR
R=R
R>RR?(RR=R?((Rtadds
cCs[y|i|=WnFtj
o:t|ddƒ}|djo‚n|i|ƒ=nXdS(svRemove an element from a set; it must be a member.

        If the element is not a member, raise a KeyError.
        R<N(RR
R=R
R>RR?(RR=R?((Rtremoves
cCs+y|i|ƒWntj
onXdS(smRemove an element from a set if it is a member.

        If the element is not a member, do nothing.
        N(RReR=tKeyError(RR=((Rtdiscard!s
cCs|iiƒdS(s+Remove and return an arbitrary set element.iN(RR
tpopitem(R((Rtpop+scCs
t|ƒS(N(R	R(R((RRH/scCs
t|ƒS(N(t_TemporarilyImmutableSetR(R((RR<3s(RRORPRQRRRXRZRWR[R\R]R^R`R_RcRbR"RaRdReRgRiRHR<(((RR¢s,			
											
	
	
		RjcBstZd„Zd„ZRS(NcCs||_|i|_dS(N(tsetRt_setR
(RRk((RR<s	cCs
|iiƒS(N(RRlRG(R((RRW@s(RRORRW(((RRj8s	N(RPt
__future__t
generatorst	itertoolsRRtImportErrorRRt	NameErrort__all__tobjectRR	RRj(
RR	RRRRrRjRRnR((Rt?)s 
		(ÿ7–

Anon7 - 2021