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/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.4/test/test_heapq.pyc
mò
‚=5Dc@s¥dZdklZlZlZlZlZlZdkZdk	Z	dk
lZdkZd„Z
de	ifd„ƒYZdfd„ƒYZd	fd
„ƒYZdfd„ƒYZd
„Zdfd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZdfd„ƒYZdklZlZd„Zde	ifd„ƒYZdd „Z!e"d!joe!d"e#ƒndS(#sUnittests for heapq.(sheappushsheappopsheapifysheapreplacesnlargests	nsmallestN(stest_supportccs0yxt|ƒVqWWntj
onXdS(Ni(theappoptheapt
IndexError(R((t'/usr/lib64/python2.4/test/test_heapq.pytheapiter
stTestHeapcBsPtZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	RS(	NcCs&g}g}|i|ƒxGtdƒD]9}tiƒ}|i|ƒt	||ƒ|i|ƒq&Wg}x2|o*t|ƒ}|i|ƒ|i|ƒqlW|}|i
ƒ|i||ƒ|i|ƒ|itt	gƒy-|itt	ddƒ|ittdƒWntj
onXdS(Ni(Rtdatatselftcheck_invarianttrangetitrandomtitemtappendtheappushtresultsRtdata_sortedtsorttassertEqualtassertRaisest	TypeErrortNonetAttributeError(RRR
RRRR((Rt
test_push_pops2






cCsQxJt|ƒD]<\}}|o)|dd?}|i|||jƒq
q
WdS(Ni(t	enumerateRtposRt	parentposRtassert_(RRRRR((RR0s

cCsrxXtdƒD]J}g}t|ƒD]}|tiƒq$~}t|ƒ|i|ƒq
W|i	t
tdƒdS(Ni(R	tsizet_[1]tdummyRRtheapifyRRRRR(RRRRR((Rttest_heapify7s
-
cCsg}tdƒD]}|tidƒq~}g}x<|D]4}t||ƒt	|ƒdjot
|ƒq=q=W|iƒ|i
|t|ƒdƒdS(NièiÐi
iöÿÿÿ(RR	R
Rt	randrangeRRRRtlenRRRRtsorted(RR
RRRR((Rttest_naive_nbest?s0

cCsäg}tdƒD]}|tidƒq~}|d }t|ƒx4|dD](}||djot	||ƒqOqOW|itt
|ƒƒt|ƒdƒ|itt	dƒ|itt	ddƒ|itt	gdƒdS(NièiÐi
iiöÿÿÿ(RR	R
RR!RRRRtheapreplaceRRtlistRR#RRRR(RR
RRRR((Rt
test_nbestIs0

&c	CsáxÚtdƒD]Ì}tidƒ}g}t|ƒD]}|tidƒq3~}|d@o|}t
|ƒn%g}x|D]}t||ƒqWg}t|ƒD]}|t
|ƒq§~}|i|t|ƒƒq
WdS(Nidi2ii(txrangettrialRR!RRR	R
RRRRRRtheap_sortedRRR#(	RR*RR
RR)RRR((Rt
test_heapsort[s
0-c	Cshg}tdƒD]}|tidƒq~}x1dD])}|it	||ƒt
|ƒ| ƒq7WdS(NièiÐiiii
idiiçiL(	iiii
idiiçièiL(RR	R
RR!RtnRRt	nsmallestR#(RR
R,RR((Rttest_nsmallestjs0c	Csng}tdƒD]}|tidƒq~}x7dD]/}|it	||ƒt
|dtƒ| ƒq7WdS(
NièiÐiiii
idiiçiLtreverse(	iiii
idiiçièiL(RR	R
RR!RR,RRtnlargestR#tTrue(RR
R,RR((Rttest_largestos0(
t__name__t
__module__RRR R$R'R+R.R2(((RRs				
			tLenOnlycBstZdZd„ZRS(s:Dummy sequence class defining __len__ but not __getitem__.cCsdS(Ni
((R((Rt__len__ys(R3R4t__doc__R6(((RR5wstGetOnlycBstZdZd„ZRS(s:Dummy sequence class defining __getitem__ but not __len__.cCsdS(Ni
((Rtndx((Rt__getitem__~s(R3R4R7R:(((RR8|stCmpErrcBstZdZd„ZRS(s;Dummy element that always raises an error during comparisoncCs
t‚dS(N(tZeroDivisionError(Rtother((Rt__cmp__ƒs(R3R4R7R>(((RR;sccsx|D]
}|VqWdS(sRegular generatorN(tseqnR
(R?R
((RtR†stGcBs tZdZd„Zd„ZRS(sSequence using __getitem__cCs
||_dS(N(R?R(RR?((Rt__init__scCs|i|S(N(RR?R
(RR
((RR:s(R3R4R7RBR:(((RRA‹s	tIcBs)tZdZd„Zd„Zd„ZRS(s Sequence using iterator protocolcCs||_d|_dS(Ni(R?RR
(RR?((RRB”s	cCs|S(N(R(R((Rt__iter__—scCsF|it|iƒjo
t‚n|i|i}|id7_|S(Ni(RR
R"R?t
StopIterationtv(RRF((Rtnext™s

(R3R4R7RBRDRG(((RRC’s		tIgcBs tZdZd„Zd„ZRS(s9Sequence using iterator protocol defined with a generatorcCs||_d|_dS(Ni(R?RR
(RR?((RRB¡s	ccsx|iD]
}|Vq
WdS(N(RR?tval(RRI((RRD¤s
(R3R4R7RBRD(((RRHŸs	tXcBs tZdZd„Zd„ZRS(s Missing __getitem__ and __iter__cCs||_d|_dS(Ni(R?RR
(RR?((RRBªs	cCsF|it|iƒjo
t‚n|i|i}|id7_|S(Ni(RR
R"R?RERF(RRF((RRG­s

(R3R4R7RBRG(((RRJ¨s	tNcBs tZdZd„Zd„ZRS(sIterator missing next()cCs||_d|_dS(Ni(R?RR
(RR?((RRBµs	cCs|S(N(R(R((RRD¸s(R3R4R7RBRD(((RRK³s	tEcBs)tZdZd„Zd„Zd„ZRS(sTest propagation of exceptionscCs||_d|_dS(Ni(R?RR
(RR?((RRB½s	cCs|S(N(R(R((RRDÀscCsdddS(Nii((R((RRGÂs(R3R4R7RBRDRG(((RRL»s		tScBs)tZdZd„Zd„Zd„ZRS(sTest immediate stopcCsdS(N((RR?((RRBÇscCs|S(N(R(R((RRDÉscCs
t‚dS(N(RE(R((RRGËs(R3R4R7RBRDRG(((RRMÅs		(schainsimapcCs(ttd„ttt|ƒƒƒƒƒS(s Test multiple tiers of iteratorscCs|S(N(tx(RN((Rt<lambda>ÑsN(tchaintimapR@RHRAR?(R?((RtLÏstTestErrorHandlingcBs>tZd„Zd„Zd„Zd„Zd„Zd„ZRS(NcCsax'ttfD]}|it|dƒq
Wx0tttt	fD]}|it|ddƒq=WdS(Ni
(
RRtfRRRRR%R0R-(RRT((Rttest_non_sequenceÕs
cCs‘x*ttfD]}|it|tƒƒq
Wx-ttfD]}|it|tƒdƒq:Wx-t	t
fD]}|it|dtƒƒqjWdS(Ni
i(RRRTRRRR5RR%R0R-(RRT((Rt
test_len_onlyÛs


cCs‘x*ttfD]}|it|tƒƒq
Wx-ttfD]}|it|tƒdƒq:Wx-t	t
fD]}|it|dtƒƒqjWdS(Ni
i(RRRTRRRR8RR%R0R-(RRT((Rt
test_get_onlyãs


cCs tƒtƒtƒg}x'ttfD]}|it||ƒq%Wx*tt	fD]}|it||dƒqOWx*t
tfD]}|it|d|ƒq|WdS(Ni
i(R;tseqRRRTRRR<RR%R0R-(RRXRT((RRWës


cCs:x3ttttttfD]}|it	|dƒqWdS(Ni
(
RRRR%R0R-RTRRR(RRT((Rttest_arg_parsingôsc	CsxttfD]ó}xêddtdƒd
tdddƒfD]Á}xEtttt	t
fD].}|i
|d	||ƒƒ|d	|ƒƒqWW|i
|d	t|ƒƒgƒ|it|d	t|ƒƒ|it|d	t|ƒƒ|it|d	t|ƒƒq;Wq
WdS(Nt123tiètdof1.2iÐi˜ii(R\f1.2(R0R-RTR	R(tsRARCRHRRR@tgRRRMRRRJRKR<RL(RR^RTR]((Rttest_iterable_argsøs
(,(R3R4RURVRWRYR_(((RRSÓs						cCsÂdkl}tg}tt|ƒo|itƒnti	|Œ|osttdƒocdk
}dgd}xAtt|ƒƒD]-}ti	|Œ|iƒtiƒ||<q„W|GHndS(N(sBuiltinFunctionTypetgettotalrefcounti(ttypestBuiltinFunctionTypeRttest_classest
isinstanceRR
RSttest_supporttrun_unittesttverbosethasattrtsystgcRtcountsR(R"R
tcollectR`(RgR
RbRjRkRc((Rt	test_mains
	
	


t__main__Rg($R7theapqRRRR%R0R-RtunittestttestReRiRtTestCaseRR5R8R;R@RARCRHRJRKRLRMt	itertoolsRPRQRRRSRRmR3R1(ReRPRpRRR-RmRRLRARCRRRRiRMR@R5R8RJRKRQRRR0R;RSR%RH((Rt?s0+		
		e	
	
		2


Anon7 - 2021