config root man

Current Path : /usr/local/lib/python2.5/test/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/local/lib/python2.5/test/test_deque.pyo

³ò
h”Rc
@s ddklZddkZddklZlZddklZddkZddk	Z
ddklZddk
Z
ddkZdZd„Zdfd	„ƒYZd
fd„ƒYZdeifd
„ƒYZdeifd„ƒYZdefd„ƒYZdefd„ƒYZdeifd„ƒYZdefd„ƒYZdeifd„ƒYZdZhed<Zed„Zedjoede ƒndS(iÿÿÿÿ(tdequeN(ttest_supportt	seq_tests(tproxy(tStringIOi †ccst‚dVdS(Ni(tSyntaxError(((s+/usr/local/lib/python2.5/test/test_deque.pytfail
stBadCmpcBseZd„ZRS(cCs
t‚dS(N(tRuntimeError(tselftother((s+/usr/local/lib/python2.5/test/test_deque.pyt__eq__s(t__name__t
__module__R(((s+/usr/local/lib/python2.5/test/test_deque.pyRst	MutateCmpcBseZd„Zd„ZRS(cCs||_||_dS(N(Rtresult(R	RR((s+/usr/local/lib/python2.5/test/test_deque.pyt__init__s	cCs|iiƒ|iS(N(RtclearR(R	R
((s+/usr/local/lib/python2.5/test/test_deque.pyRs
(RR
RR(((s+/usr/local/lib/python2.5/test/test_deque.pyRs	t	TestBasiccBs
eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(c
Cs‰ttdƒƒ}|itddƒƒx$tddƒD]}|i|ƒq8Wx*ttddƒƒD]}|i|ƒqeW|it|ƒtddƒƒ|it	|ƒdƒg}tdƒD]}||i
ƒqÂ~}|i|tddƒƒ|it|ƒtddƒƒg}tdƒD]}||iƒq'~}|iƒ|i|td	dƒƒ|it|ƒtdd	ƒƒdS(
NidiÈii8ÿÿÿiiXiúi2i–(
RtxrangeRtappendtreversedt
appendlefttassertEqualtlisttrangetlentpoplefttpoptreverse(R	tdtit_[1]tleftt_[2]tright((s+/usr/local/lib/python2.5/test/test_deque.pyttest_basicss"--
c
Cs`tdƒ}|iƒxµ|tdƒtdƒtƒt|ƒgD]‰}|i||jt|ƒt|ƒjot|ƒt|ƒjƒ|i||jt|ƒt|ƒjot|ƒt|ƒjƒqAWttd
ƒ}x||D]t}xk|D]c}|i||jt|ƒt|ƒj||fƒ|i||jt|ƒt|ƒj||fƒ|i||jt|ƒt|ƒj||fƒ|i||jt|ƒt|ƒj||fƒ|i||jt|ƒt|ƒj||fƒ|i||jt|ƒt|ƒj||fƒ|it||ƒtt|ƒt|ƒƒ||fƒqñWqäWdS(Ntxabctabctabttatbtbatxbatcba(	R(R)R*R'R+R&R,R%R-(RRRRttypetmaptcmp(R	Rtetargstxty((s+/usr/local/lib/python2.5/test/test_deque.pyttest_comparisons2s$
+AF111111cCsOtdƒ}|it|idƒ|idƒ|it|ƒtdƒƒdS(NR)itbcdtabcd(RtassertRaisest	TypeErrortextendRR(R	R((s+/usr/local/lib/python2.5/test/test_deque.pyttest_extendCs
cCs²tdƒ}|it|idƒ|idƒ|it|ƒttdƒƒƒtƒ}|itdƒƒ|it|ƒtttdƒƒƒƒ|it|it	ƒƒdS(NR)iR6R7iè(
RR8R9t
extendleftRRRRRR(R	R((s+/usr/local/lib/python2.5/test/test_deque.pyttest_extendleftIs
"	(cCsd}tt|ƒƒ}t|ƒ}x†t|ƒD]x}|iƒ|idƒtiƒdjo|i|ƒ|i|ƒnx'tdt|ƒt|ƒƒD]}qŸWq1Wtdƒ}|i|ddƒ|i|ddƒtƒ}|i	t
|idƒ|i	t
|idƒdS(	NiÈigà?itsupermantsiÿÿÿÿtn(RRRRRtrandomRRRR8t
IndexErrort__getitem__(R	R@RtlRtj((s+/usr/local/lib/python2.5/test/test_deque.pyttest_getitemSs&



 	c	CsÛd}tt|ƒƒ}x"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N(RR8RBRR(R	R((s+/usr/local/lib/python2.5/test/test_deque.pyttest_underflowÆs	cCs‚ttdƒƒ}|it|ƒdƒ|iƒ|it|ƒdƒ|it|ƒgƒ|iƒ|it|ƒgƒdS(Nidi(RRRRRR(R	R((s+/usr/local/lib/python2.5/test/test_deque.pyt
test_clearËs

cCs]tdƒ}|idƒ|i|tdƒƒ|idƒ|i|tdƒƒ|it|idƒ|i|tdƒƒtddtƒdgƒ}t|ƒ}|it|idƒx0t||ƒD]\}}|i||jƒqËWxht	t
fD]Z}tdgƒ}|it||ƒdgƒ|it
|idƒ|i|tƒƒqûWdS(NtabcdefghcijRVt
abdefghcijt	abdefghijR)R*R'(RtremoveRR8t
ValueErrorRRtzipRJtTruetFalseR:RRB(R	RR1R3R4tmatch((s+/usr/local/lib/python2.5/test/test_deque.pyttest_removeÔs&


cCsjttdƒƒ}tt|ƒƒ}|it|ƒt|ƒƒ|i|ƒ|idt|ƒjƒdS(NiÈs...(RRtevaltreprRRRRJ(R	RR1((s+/usr/local/lib/python2.5/test/test_deque.pyt	test_reprìs

cCs™ttdƒƒ}|i|ƒzXttidƒ}||I|iƒttidƒ}|i|iƒt	|ƒƒWd|iƒt
itiƒXdS(NiÈtwbtrb(RRRtopenRtTESTFNtcloseRtreadRetosR](R	Rtfo((s+/usr/local/lib/python2.5/test/test_deque.pyt
test_printós


 
cCs-|ittddƒ|ittdƒdS(NR&ii(R8R9R(R	((s+/usr/local/lib/python2.5/test/test_deque.pyt	test_initscCs|itttdƒƒdS(NR&(R8R9thashR(R	((s+/usr/local/lib/python2.5/test/test_deque.pyt	test_hashscCs³x¬dD]¤}tt|ƒƒ}|i|i}}xSt|tƒD]B}||ƒ|ƒ}|||jo|i|||ƒqBqBW|it|ƒtt|tƒƒqWdS(Niiiidiè(iiiidiè(RRRRRSRRR(R	tsizeRRRRR3((s+/usr/local/lib/python2.5/test/test_deque.pyt#test_long_steadystate_queue_poplefts
	cCsÅx¾dD]¶}ttt|ƒƒƒ}|i|i}}xSt|tƒD]B}||ƒ|ƒ}|||jo|i|||ƒqHqHW|ittt|ƒƒƒtt|tƒƒqWdS(Niiiidiè(iiiidiè(	RRRRRRSRRR(R	RsRRRRR3((s+/usr/local/lib/python2.5/test/test_deque.pyt$test_long_steadystate_queue_poprights
	cCs‚tƒ}|i|i}}xttƒD]}||ƒq)Wx>ttƒD]0}|ƒ}||jo|i||ƒqJqJWdS(N(RRRRRSR(R	RRRRR3((s+/usr/local/lib/python2.5/test/test_deque.pyttest_big_queue_poplefts	

	
cCs‚tƒ}|i|i}}xttƒD]}||ƒq)Wx>ttƒD]0}|ƒ}||jo|i||ƒqJqJWdS(N(RRRRRSR(R	RRRRR3((s+/usr/local/lib/python2.5/test/test_deque.pyttest_big_queue_popright(s	

	
cCsžtƒ}|i|i}}xttƒD]}||ƒq)WxDtttƒƒD]0}|ƒ}||jo|i||ƒqPqPW|it|ƒdƒdS(Ni(RRRRRSRRR(R	RRRRR3((s+/usr/local/lib/python2.5/test/test_deque.pyttest_big_stack_right2s	
	
cCsžtƒ}|i|i}}xttƒD]}||ƒq)WxDtttƒƒD]0}|ƒ}||jo|i||ƒqPqPW|it|ƒdƒdS(Ni(RRRRRSRRR(R	RRRRR3((s+/usr/local/lib/python2.5/test/test_deque.pyttest_big_stack_left=s	
	
cCsZttdƒƒ}t|ƒ}|it|ƒt|ƒƒ|it|ƒt|ƒƒdS(NiÈ(RRtassertNotEqualtidRR(R	RR1((s+/usr/local/lib/python2.5/test/test_deque.pyttest_roundtrip_iter_initHscCs€ttdƒƒ}xgdD]_}ti||ƒ}ti|ƒ}|it|ƒt|ƒƒ|it|ƒt|ƒƒqWdS(NiÈiii(iii(	RRtpickletdumpstloadsRzR{RR(R	RRR?R1((s+/usr/local/lib/python2.5/test/test_deque.pyttest_pickleNscCs…tdƒ}|i|ƒxedD]]}titi||ƒƒ}|it|ƒt|ƒƒ|it|ƒt|dƒƒq WdS(NR&iiiiÿÿÿÿ(iii(RRR}RR~RzR{R(R	RRR1((s+/usr/local/lib/python2.5/test/test_deque.pyttest_pickle_recursiveVs
cCs‰dg}t|gƒ}ti|ƒ}|it|ƒt|ƒƒd|d<|it|ƒt|ƒƒ|it|ƒt|ƒƒdS(Ni
ii(RtcopytdeepcopyRRRzR{(R	tmutRR1((s+/usr/local/lib/python2.5/test/test_deque.pyt
test_deepcopy^s	
cCs‰dg}t|gƒ}ti|ƒ}|it|ƒt|ƒƒd|d<|it|ƒt|ƒƒ|it|ƒt|ƒƒdS(Ni
ii(RR‚RRRzR{(R	R„RR1((s+/usr/local/lib/python2.5/test/test_deque.pyt	test_copygs	
cCsOxHdtdƒfD]4}|ittt|ƒƒƒtt|ƒƒƒqWdS(NR7iÐ(RRRRR(R	R?((s+/usr/local/lib/python2.5/test/test_deque.pyt
test_reversedpscCsGddk}tƒ}x+tdƒD]}|idƒ|iƒq"WdS(Niÿÿÿÿidi(tgcRRRtcollect(R	RˆRR((s+/usr/local/lib/python2.5/test/test_deque.pyttest_gc_doesnt_blowupts	

(RR
R$R5R;R=RFRGRLRURWRXRYRcRfRoRpRrRtRuRvRwRxRyR|R€RR…R†R‡RŠ(((s+/usr/local/lib/python2.5/test/test_deque.pyRs:				
				5							
						
										tTestVariousIteratorArgscBs#eZd„Zd„Zd„ZRS(cCsíxæddtdƒd	tdddƒfD]½}x`titititititifD]4}|i	t
t||ƒƒƒt
||ƒƒƒqYW|it
tti|ƒƒ|it
tti|ƒƒ|ittti|ƒƒq(WdS(
Nt123R(iètdog333333ó?iÐi˜i(Rg333333ó?(RRRtSequencetIterFunctIterGentIterFuncStopt	itermultititerfuncRRRR8R9tIterNextOnlyt
IterNoNexttZeroDivisionErrort
IterGenExc(R	R?tg((s+/usr/local/lib/python2.5/test/test_deque.pyttest_constructors(2cCs9tdƒ}t|ƒ}|iƒ|it|iƒdS(Ntabcdefg(RtiterRR8Rtnext(R	Rtit((s+/usr/local/lib/python2.5/test/test_deque.pyttest_iter_with_altered_data‰s
cCs9tƒ}t|ƒ}|idƒ|it|iƒdS(Ni
(RR›RR8RRœ(R	RR((s+/usr/local/lib/python2.5/test/test_deque.pyt!test_runtime_error_on_empty_deques	
(RR
R™RžRŸ(((s+/usr/local/lib/python2.5/test/test_deque.pyR‹}s	
	tDequecBseZRS((RR
(((s+/usr/local/lib/python2.5/test/test_deque.pyR •stDequeWithBadItercBseZd„ZRS(cCs
t‚dS(N(R9(R	((s+/usr/local/lib/python2.5/test/test_deque.pyt__iter__™s(RR
R¢(((s+/usr/local/lib/python2.5/test/test_deque.pyR¡˜stTestSubclasscBs5eZd„Zd„Zd„Zd„Zd„ZRS(c
Cs©ttdƒƒ}|itddƒƒx$tddƒD]}|i|ƒq8Wx*ttddƒƒD]}|i|ƒqeW|it|ƒtddƒƒ|it	|ƒdƒg}tdƒD]}||i
ƒqÂ~}|i|tddƒƒ|it|ƒtddƒƒg}tdƒD]}||iƒq'~}|iƒ|i|td	dƒƒ|it|ƒtdd	ƒƒ|i
ƒ|it	|ƒdƒdS(
NidiÈii8ÿÿÿiiXiúi2i–(R RRRRRRRRRRRRR(R	RRR R!R"R#((s+/usr/local/lib/python2.5/test/test_deque.pyR$žs&--

cCs
tdƒ}|iƒ}|it|ƒt|ƒƒ|it|ƒt|ƒƒt|ƒ}|it|ƒt|ƒƒ|it|ƒt|ƒƒti|ƒ}ti|ƒ}|it	|ƒt	|ƒƒ|it|ƒt|ƒƒ|it|ƒt|ƒƒdS(NR&(
R t__copy__RR.RR}R~RRzR{(R	RR1R?((s+/usr/local/lib/python2.5/test/test_deque.pyttest_copy_pickle´scCstdƒ}|i|ƒtiti|ƒƒ}|it|ƒt|ƒƒ|it|ƒt|ƒƒ|i	ƒ}|i	ƒ}|it|ƒt|ƒƒ|i||ƒ||_
titi|ƒƒ}|it|ƒt|i
ƒƒtdƒ}|it
ti|ƒdS(NR&(R RR}RR~RzR{RR.RR3R¡R8R9(R	RR1tddtee((s+/usr/local/lib/python2.5/test/test_deque.pyR€Æs
	cCsQtdƒ}t|ƒ}|it|ƒt|ƒƒd}|itt|ƒdS(Ntgallahad(RRRtstrtNoneR8tReferenceError(R	Rtp((s+/usr/local/lib/python2.5/test/test_deque.pyttest_weakrefÙs
cCsNdtfd„ƒY}|dddgƒ}|dddgƒ}||jdS(	NtXcBseZd„ZRS(cSs
tgƒS(N(R›(R	((s+/usr/local/lib/python2.5/test/test_deque.pyR¢âs(RR
R¢(((s+/usr/local/lib/python2.5/test/test_deque.pyR®ásiiiiii(R(R	R®td1td2((s+/usr/local/lib/python2.5/test/test_deque.pyttest_strange_subclassàs(RR
R$R¥R€R­R±(((s+/usr/local/lib/python2.5/test/test_deque.pyR£œs
				tSubclassWithKwargscBseZdd„ZRS(icCsti|ƒdS(N(RR(R	tnewarg((s+/usr/local/lib/python2.5/test/test_deque.pyRës(RR
R(((s+/usr/local/lib/python2.5/test/test_deque.pyR²êstTestSubclassWithKwargscBseZd„ZRS(cCstddƒdS(NR³i(R²(R	((s+/usr/local/lib/python2.5/test/test_deque.pyttest_subclass_with_kwargsïs(RR
Rµ(((s+/usr/local/lib/python2.5/test/test_deque.pyR´îss‘

Example from the Library Reference:  Doc/lib/libcollections.tex

>>> from collections import deque
>>> d = deque('ghi')                 # make a new deque with three items
>>> for elem in d:                   # iterate over the deque's elements
...     print elem.upper()
G
H
I
>>> d.append('j')                    # add a new entry to the right side
>>> d.appendleft('f')                # add a new entry to the left side
>>> d                                # show the representation of the deque
deque(['f', 'g', 'h', 'i', 'j'])
>>> d.pop()                          # return and remove the rightmost item
'j'
>>> d.popleft()                      # return and remove the leftmost item
'f'
>>> list(d)                          # list the contents of the deque
['g', 'h', 'i']
>>> d[0]                             # peek at leftmost item
'g'
>>> d[-1]                            # peek at rightmost item
'i'
>>> list(reversed(d))                # list the contents of a deque in reverse
['i', 'h', 'g']
>>> 'h' in d                         # search the deque
True
>>> d.extend('jkl')                  # add multiple elements at once
>>> d
deque(['g', 'h', 'i', 'j', 'k', 'l'])
>>> d.rotate(1)                      # right rotation
>>> d
deque(['l', 'g', 'h', 'i', 'j', 'k'])
>>> d.rotate(-1)                     # left rotation
>>> d
deque(['g', 'h', 'i', 'j', 'k', 'l'])
>>> deque(reversed(d))               # make a new deque in reverse order
deque(['l', 'k', 'j', 'i', 'h', 'g'])
>>> d.clear()                        # empty the deque
>>> d.pop()                          # cannot pop from an empty deque
Traceback (most recent call last):
  File "<pyshell#6>", line 1, in -toplevel-
    d.pop()
IndexError: pop from an empty deque

>>> d.extendleft('abc')              # extendleft() reverses the input order
>>> d
deque(['c', 'b', 'a'])



>>> def delete_nth(d, n):
...     d.rotate(-n)
...     d.popleft()
...     d.rotate(n)
...
>>> d = deque('abcdef')
>>> delete_nth(d, 2)   # remove the entry at d[2]
>>> d
deque(['a', 'b', 'd', 'e', 'f'])



>>> def roundrobin(*iterables):
...     pending = deque(iter(i) for i in iterables)
...     while pending:
...         task = pending.popleft()
...         try:
...             yield task.next()
...         except StopIteration:
...             continue
...         pending.append(task)
...

>>> for value in roundrobin('abc', 'd', 'efgh'):
...     print value
...
a
d
e
b
f
c
g
h


>>> def maketree(iterable):
...     d = deque(iterable)
...     while len(d) > 1:
...         pair = [d.popleft(), d.popleft()]
...         d.append(pair)
...     return list(d)
...
>>> print maketree('abcdefgh')
[[[['a', 'b'], ['c', 'd']], [['e', 'f'], ['g', 'h']]]]

t
libreftestcCsÌddk}ttttf}ti|Œ|ovt|dƒofddk}dgd}xAt
t|ƒƒD]-}ti|Œ|iƒ|i
ƒ||<qnW|GHnddkl}ti||ƒdS(Niÿÿÿÿtgettotalrefcounti(t
test_deque(tsysRR‹R£R´Rtrun_unittestthasattrRˆRªRRR‰R·ttestR¸trun_doctest(tverboseR¹ttest_classesRˆtcountsRR¸((s+/usr/local/lib/python2.5/test/test_deque.pyt	test_main^s"	



	t__main__R¾(!tcollectionsRtunittestR¼RRtweakrefRR‚tcPickleR}t	cStringIORRARmRSRRRtTestCaseRR‹R R¡R£R²R´R¶t__test__RªRÁRR`(((s+/usr/local/lib/python2.5/test/test_deque.pys<module>s2	ÿaNi


Man Man