+
    BiC                    &   ^ RI t ^ RIt^ RIt^ RIHt ^ RIHtHt ^ RI5 ^ RIt^ RI	H
t
 ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIt^ RIt^ RIt^ RIt]P.                  t]) ^,
          tR tR	 tR
 tR tR tR tR t R t! ! R R4      t"R t#R t$R t%R t&R t'R t(])! ]PT                  ^,           4       U u. uF	  p V 3R lNK  	  up t+ ! R R]PX                  4      t- ! R R]PX                  4      t. ! R R]PX                  4      t/ ! R R ]PX                  4      t0R! t1 ! R" R#4      t2 ! R$ R%4      t3 ! R& R'4      t4 ! R( R)4      t5 ! R* R+4      t6 ! R, R-4      t7 ! R. R/4      t8 ! R0 R14      t9R2 t: ! R3 R4]PX                  4      t; ! R5 R6]PX                  4      t< ! R7 R8]PX                  4      t= ! R9 R:]PX                  4      t>]P~                   ! R; R<]PX                  4      4       t@R= tA]BR>8X  d   ]P                  ! 4        R# R# u up i )?    N)support)threading_helperscript_helper)*)Decimal)Fraction)reducec                  &    \        \        V !  4      # N)listzipargss   **/usr/lib/python3.14/test/test_itertools.pylzipr      s    T
    c                    ^V ,          # )zTest function of one argument xs   &r   oneargr      s    Q3Jr   c                     \         h)z"Test function that raises an error)
ValueErrorr   s   *r   errfuncr      s    
r   c               #  (   "   R F  p V x  K	  	  R# 5i)zNon-restartable source sequenceNr         r   )is    r   gen3r    "   s         c                    V ^,          ^ 8H  # zTest predicater   r   s   &r   isEvenr$   '       Q36Mr   c                    V ^,          ^8H  # r#   r   r   s   &r   isOddr'   +   r%   r   c                      V # r   r   r   s   *r   tupleizer)   /   s    Kr   c              #   :   "   \        V 4       F  pVx  K	  	  R # 5ir   range)nr   s   & r   iranger.   2   s     1X    c                   0   a  ] tR t^6t o RtR tR tRtV tR# )StopNowz"Class emulating an empty iterable.c                    V # r   r   selfs   &r   __iter__StopNow.__iter__8       r   c                    \         hr   StopIterationr3   s   &r   __next__StopNow.__next__:       r   r   N)	__name__
__module____qualname____firstlineno____doc__r5   r;   __static_attributes____classdictcell____classdict__s   @r   r1   r1   6   s     ( r   r1   c                *    \        \        W4      4      # )zHConvenience function for partially consuming a long of infinite iterable)r   islice)r-   seqs   &&r   takerJ   =   s    sr   c                 8    \        \        P                  V ^4      # r   )r	   operatormuliterables   &r   prodrQ   A   s    (,,!,,r   c                :    \        \        ^V ^,           4      4      # )	Factorial)rQ   r,   )r-   s   &r   factrT   D   s    a1r   c                     V ^ ,          # r   r   rs   &r   testRrY   I       Q4Kr   c                     V ^,          # r   r   rW   s   &r   testR2r]   L   rZ   r   c                     V ^
8  # )
   r   r   s   &r   undertenr`   O   s    R4Kr   c                 V    \         P                  ! \         P                  ! W4      4      # r   )pickleloadsdumps)sprotos   &&r   <lambda>rg   R   s    V\\!5K(Lr   c                     a  ] tR t^Ut o R<R ltR tR tR tR tR t	]
P                  R 4       t]
P                  ! R	4      R
 4       tR t]
P                  R 4       t]
P                  ! R	4      R 4       tR t]
P                  R 4       t]
P                  ! R	4      R 4       tR tR tR tR t]P4                  ! 4       R=R l4       tR tR tR tR tR t R t!]
P                  ! R	4      R 4       t"R t#]
P                  ! R	4      R 4       t$R t%R  t&R! t'R" t(R# t)R$ t*]
P                  R% 4       t+]
P                  ! R	4      R& 4       t,R' t-R( t.R) t/R* t0R+ t1R, t2R- t3R. t4R/ t5R0 t6R1 t7]P4                  ! 4       R2 4       t8R3 t9]
Pt                  R4 4       t;]
Pt                  R5 4       t<]
Pt                  R6 4       t=]
Pt                  R7 4       t>]
Pt                  R8 4       t?]
Pt                  R9 4       t@]
Pt                  R: 4       tAR;tBV tCR# )>TestBasicOpsNc                  aa RVV3R llo\         P                  ! W!4      p\         P                  ! V4      pV P                  \	        V4      \	        V4      4       S! V4      S! V4      rV P                  W4       V'       d   S! V4      p
V P                  W4       \         P                  ! V4      p^ p \        V4       F  p\        V4       V^,          pK  	  \         P                  ! W4      p\         P                  ! V4      pS! V4      S! V4      rV P                  W4       V'       d   S! W\R 4      p
V P                  W4       R# R#   \         d     Li ; i)zITest that an iterator is the same after pickling, also when part-consumedc                    < V^
8  d   \        R4      h\        V \        4      '       d   V #  \        \	        V S4      4      pT Uu. uF  pS! Y1^,           4      NK  	  up#   \
         d    T u # i ; iu upi )r_   zinfinite recursion encountered)RuntimeError
isinstancestrr   rH   	TypeError)itr   leexpandstops   &&  r   rs   'TestBasicOps.pickletest.<locals>.expandY   su    2v"#CDD"c""	D)* -..AqF1cNA..  	.s   A! A4!A10A1NrV   )rb   rd   rc   assertEqualtyper,   nextr:   )r4   protocolrp   rt   rJ   comparedumpi2abci3tookr   i4rs   s   &&&f&&         @r   
pickletestTestBasicOps.pickletestW   s%   
	/ 
	/ ||B)\\$b48,bz6":1wAQ" \\$	4[R	 !
 ||B)\\$bz6":1wu~&AQ"   		s   6&E EEc                   V P                  \        \        \        ^
4      4      4      . RO4       V P                  \        \        \        ^
4      R7      4      . RO4       \        \
        \        \        3 FO  pV P                  \        \        \        V\        ^
4      4      4      4      \        \        V. RO4      4      4       KQ  	  V P                  \        \        R4      4      . RO4       V P                  \        \        . 4      4      . 4       V P                  \        \        ^.4      4      ^.4       V P                  \        \        \        ^
4      ^^4       V P                  \        \        4       V P                  \        \        \        ^
4      R7       V P                  \        \        \        ^. .4      4       . ROpV P                  \        \        V\        4      4      . R	O4       V P                  \        \        V\        4      4      . R
O4       V P                  \        \        V\        P                  4      4      . RO4       V P                  \        4      ;_uu_ 4        \        \        V\        4      4       RRR4       V P                  \        \        . RORR7      4      . RO4       V P                  \        \        . RO^dR7      4      . RO4       V P                  \        \        . ^dR7      4      ^d.4       V P                  \        4      ;_uu_ 4        \        \        ^
^.^d4      4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r_   rO   abcr   N)initial)
r   r         r_            $   -   )r}   abr   )
r      	         r   r      r   r   )
r   r   r   r   r   r   r   r   r   r   )
r   r   r   r   r   r   r   r   r   r   )
r         i  i  r   r   r   r   r   )r_   r   r   )r_   r   r   )d   n   s   t   )rv   r   
accumulater,   intcomplexr   r   mapassertRaisesro   minmaxrM   rN   chr)r4   typre   s   &  r   test_accumulateTestBasicOps.test_accumulate   se   jr34>	@j%)<=>	@(2CZCr 345SBCDF 3 	j/02DEjn-r2j!o.4)ZrAqA)Z0)Z59=)T:q"g+>?*jC017	9jC017	9jHLL9:?	Ay))As#$ *jTBC\RjSABDXYjS9:SEBy))RHc*+ *) *)
 *))s   0M*MM	M0	c                  a V P                  \        \        R ^4      4      . RO4       V P                  \        \        R ^4      4      . RO4       V P                  \        \        R ^4      4      . RO4       V P                  \        \        R^RR7      4      . RO4       V P                  \        4      ;_uu_ 4        \        \        R ^RR7      4       RRR4       V P                  \
        4      ;_uu_ 4        \        \        R 4      4       RRR4       V P                  \
        4      ;_uu_ 4        \        \        R ^R4      4       RRR4       V P                  \
        4      ;_uu_ 4        \        \        R^4      4       RRR4       V P                  \
        4      ;_uu_ 4        \        \        R R4      4       RRR4       V P                  \        4      ;_uu_ 4        \        \        R ^ 4      4       RRR4       V P                  \        4      ;_uu_ 4        \        \        R R4      4       RRR4       Rp\        ^^4       EFZ  o\        \        V4      4       EF=  pVRV p\        \        VS4      4      pV P                  VSVR7      ;_uu_ 4        V P                  RP                  \        V!  4      V4       T P                  \        ;QJ d    R	 V 4       F  '       d   K   R
M	  RM! R	 V 4       4      4       V'       d   VP                  4       pT P                  \        ;QJ d    V3R lV 4       F  '       d   K   R
M	  RM! V3R lV 4       4      4       V P                  \        V4      S8*  4       VP                  V4       RRR4       EK@  	  EK]  	  R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELm; i  + '       g   i     ELF; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EK  ; i)ABCDEFGABCDEFT)strictNhelloABCDEFGHIJKLMNOPQRSTUVWXYZ)re   r-   batches c              3   D   "   T F  p\        V4      \        J x  K  	  R # 5ir   )rw   tuple).0batchs   & r   	<genexpr>,TestBasicOps.test_batched.<locals>.<genexpr>   s     'R'Uu(<'s    Fc              3   @   <"   T F  p\        V4      S8H  x  K  	  R # 5ir   len)r   r   r-   s   & r   r   r      s     +QCJ!Os   ))ABC)DEFG)r   r   r   r   r   r   r   ))r   )r   )r   )r   )r   )r   r   )r   r   r   )rv   r   batchedr   r   ro   r,   r   subTestjoinchain
assertTrueallpopappend)r4   datar   re   r   
last_batchr-   s   &     @r   test_batchedTestBasicOps.test_batched   s   gi34G	Igi34I	Kgi34T	Vgh$?@A	C z**Ad34 +y))#$ *y))At,- *y))q!" *y))G,- *z**A&' +z**B'( + ,q!A3t9%!Hwq!}-\\AG\<<$$RWWUG_%=qAOOCC'R''RCCC'R''R$RS%,[[]
+Q+Q+Q+Q(QRJ1(<=z2 =< & ! +**))))))))))))****** =<<sz   =N.:O4O0O*+O>&P!P&AP:	2 P:	%P:	9P:	A
P:	.N?	O	O'	*O;	>P	P#	&P7	:Qc           
        R  p\         V3 F  pV P                  \        V! RR4      4      \        R4      4       V P                  \        V! R4      4      \        R4      4       V P                  \        V! R4      4      . 4       V P                  \        ^V! RR4      4      \        R4      4       V P	                  \
        \        V! ^^4      4       K  	  R# )c               7  :   "   V  F  pV F  pVx  K	  	  K  	  R# 5i)zPure python version in the docsNr   )	iterablesrp   elements   *  r   chain2'TestBasicOps.test_chain.<locals>.chain2   s     !G!M  "  r/   r   defabcdefr   abcdN)r   rv   r   rJ   r   ro   )r4   r   r   s   &  r   
test_chainTestBasicOps.test_chain   s    	" AT!E5/2DNCT!E(^T%[9T!B%["-T!Que_5tF|Dia1g6 !r   c                   V P                  \        \        P                  R R.4      4      \        R4      4       V P                  \        \        P                  R .4      4      \        R 4      4       V P                  \        \        P                  R.4      4      . 4       V P                  \	        ^\        P                  R R.4      4      \        R4      4       V P                  \        \        \        P                  ^^.4      4       V P                  \        \        \        P                  \        \        ^4      4      4      ^4      4      ^ ^.4       R# )r   r   r   r   r   N)
rv   r   r   from_iterablerJ   r   ro   rH   repeatr,   r3   s   &r   test_chain_from_iterable%TestBasicOps.test_chain_from_iterable   s    e115%.ABDNSe115':;T%[Ie112$78"=a!4!4eU^!DEtF|T)T5+>+>1v+FGfU%8%8a9I%JANORSUVQWXr   c                  a
 V P                  \        \        R 4       V P                  \        \        R ^^4       V P                  \        \        R4       V P                  \        \        R R4       R pR pR p\	        ^4       EFE  p\	        V4       Uu. uF  p^V,          ^,
          NK  	  upo
\	        V^,           4       EF  p\        \        S
V4      4      pT P                  \        V4      Wd8  d   ^ M0\        V4      \        V4      ,          \        WF,
          4      ,          4       V P                  \        V4      \        \        V4      4      4       V P                  V\        V4      4       V F  pV P                  \        V4      V4       V P                  \        \        V4      4      V4       V P                  \        V4      \        V4      4       T P                  \        ;QJ d    V
3R lV 4       F  '       d   K   RM	  RM! V
3R lV 4       4      4       T P                  \        V4      S
 U	u. uF  qV9   g   K  V	NK  	  up	4       K  	  V P                  V\        V! S
V4      4      4       V P                  V\        V! S
V4      4      4       V P                  V\        V! S
V4      4      4       EK  	  EKH  	  R# u upi u up	i )	r   Nc              3  D  a"   \        V 4      o\        S4      pW8  d   R# \        \        V4      4      p\         ;QJ d    . V3R lV 4       F  NK  	  5M! V3R lV 4       4      x   \	        \        V4      4       F  pW4,          WB,           V,
          8w  g   K   M	  R# W4;;,          ^,          uu&   \        V^,           V4       F  pW5^,
          ,          ^,           W5&   K  	  \         ;QJ d    . V3R lV 4       F  NK  	  5M! V3R lV 4       4      x  K  5i)%Pure python version shown in the docsNc              3   6   <"   T F  pSV,          x  K  	  R # 5ir   r   r   r   pools   & r   r   HTestBasicOps.test_combinations.<locals>.combinations1.<locals>.<genexpr>        1AQ   c              3   6   <"   T F  pSV,          x  K  	  R # 5ir   r   r   s   & r   r   r           5WDGGWr   r   r   r   r,   reversed)rP   rX   r-   indicesr   jr   s   &&    @r   combinations15TestBasicOps.test_combinations.<locals>.combinations1   s     ?DD	Au58nG%11%%1111!%(+AzQUQY. , 
a
qsAA!(1!1GJ 'e5W5ee5W555s   BD AD 5+D c              3    a"   \        V 4      o\        S4      p\        \        V4      V4       FR  p\	        V4      \        V4      8X  g   K  \         ;QJ d    . V3R lV 4       F  NK  	  5M! V3R lV 4       4      x  KT  	  R# 5i)r   c              3   6   <"   T F  pSV,          x  K  	  R # 5ir   r   r   s   & r   r   HTestBasicOps.test_combinations.<locals>.combinations2.<locals>.<genexpr>        9AQr   N)r   r   permutationsr,   sortedr   rP   rX   r-   r   r   s   &&  @r   combinations25TestBasicOps.test_combinations.<locals>.combinations2   s\     ?DD	A'a!4'?d7m3%99%%9999 5   AB
B/Bc              3    a"   \        V 4      o\        S4      p\        \        V4      V4       FR  p\        \	        V4      4      V8X  g   K  \         ;QJ d    . V3R lV 4       F  NK  	  5M! V3R lV 4       4      x  KT  	  R# 5i)zPure python version from cwr()c              3   6   <"   T F  pSV,          x  K  	  R # 5ir   r   r   s   & r   r   HTestBasicOps.test_combinations.<locals>.combinations3.<locals>.<genexpr>  r   r   N)r   r   combinations_with_replacementr,   setr   s   &&  @r   combinations35TestBasicOps.test_combinations.<locals>.combinations3  s^     ?DD	A8q1Es7|$)%99%%9999 Fr   c              3   ,   <"   T F	  qS9   x  K  	  R # 5ir   r   r   rr   valuess   & r   r   1TestBasicOps.test_combinations.<locals>.<genexpr>       '?QVQ   FT)r   ro   combinationsr   r,   r   rv   r   rT   r   r   r   r   )r4   r   r   r   r-   r   rX   resultr   rr   r  s   &         @r   test_combinationsTestBasicOps.test_combinations   s   )\59)\5!Q?)\48*lE2>	6&	:	: qA&+Ah/hac"ffh/F1Q3Zl6156  V13aDGd1g<MPTUVUXPY<YZ  Vc#f+.>?  8A$$SVQ/$$SQ[!4$$T!WfQi8OOCC'?Q'?CCC'?Q'?$?@$$T!W17%BA6aa%BD     mFA.F)GH  mFA.F)GH  mFA.F)GH   / &Cs   KKKc                    V P                  \        \        34      ;_uu_ 4        \        R R4       RRR4       R#   + '       g   i     R# ; i)AANi    )r   OverflowErrorMemoryErrorr  r3   s   &r   test_combinations_overflow'TestBasicOps.test_combinations_overflow  s1    {;<<u% =<<<	   ;A	z"tuple reuse is specific to CPythonc                   V P                  \        \        \        \        \        R ^4      4      4      4      ^4       V P                  \        \        \        \        \        \        R ^4      4      4      4      4      ^4       R# abcdeN)rv   r   r   r   idr  assertNotEqualr   r3   s   &r   test_combinations_tuple_reuse*TestBasicOps.test_combinations_tuple_reuse"  W    SRgq)A!BCDaHCCDgq1I,J$K LMqQr   c                  a \         pV P                  \        VR 4       V P                  \        VR ^^4       V P                  \        VR4       V P                  \        VR R4       R pR pR p\	        ^4       EFj  p\	        V4       Uu. uF  p^V,          ^,
          NK  	  upo\	        V^,           4       EF&  p\        V! SV4      4      pV P                  \        V4      V! WW4      4       V P                  \        V4      \        \        V4      4      4       V P                  V\        V4      4       \        \        SV4      4      p	V^ 8X  g   V^8:  d   V P                  W4       M&V P                  \        V4      \        V	4      8  4       V EF  p
V P                  \        V
4      V4       \        V
4       UUu. uF  w  rVNK	  	  pppV P                  \        V4      \        \        V4      4      4       V P                  \        V
4      \        V
4      4       T P                  \        ;QJ d    V3R lV
 4       F  '       d   K   RM	  RM! V3R lV
 4       4      4       T P                  TS Uu. uF  qV
9   g   K  VNK  	  up4       EK  	  V P                  V\        V! SV4      4      4       V P                  V\        V! SV4      4      4       EK)  	  EKm  	  R# u upi u uppi u upi )	r   Nc              3    a"   \        V 4      o\        S4      pV'       g   V'       d   R# ^ .V,          p\         ;QJ d    . V3R lV 4       F  NK  	  5M! V3R lV 4       4      x   \        \        V4      4       F  pW4,          V^,
          8w  g   K   M	  R# W4,          ^,           .W,
          ,          W4R% \         ;QJ d    . V3R lV 4       F  NK  	  5M! V3R lV 4       4      x  K  5i)r   Nc              3   6   <"   T F  pSV,          x  K  	  R # 5ir   r   r   s   & r   r   PTestBasicOps.test_combinations_with_replacement.<locals>.cwr1.<locals>.<genexpr>6  r   r   c              3   6   <"   T F  pSV,          x  K  	  R # 5ir   r   r   s   & r   r   r  >  r   r   )r   r   r   r,   )rP   rX   r-   r   r   r   s   &&   @r   cwr1=TestBasicOps.test_combinations_with_replacement.<locals>.cwr1.  s      ?DD	AcAgG%11%%1111!%(+AzQU* , &zA~.!%8e5W5ee5W555s   &C3C3AC3AC3c              3    a"   \        V 4      o\        S4      p\        \        V4      VR7       FR  p\	        V4      \        V4      8X  g   K  \         ;QJ d    . V3R lV 4       F  NK  	  5M! V3R lV 4       4      x  KT  	  R# 5i)r   r   c              3   6   <"   T F  pSV,          x  K  	  R # 5ir   r   r   s   & r   r   PTestBasicOps.test_combinations_with_replacement.<locals>.cwr2.<locals>.<genexpr>F  r   r   N)r   r   productr,   r   r   r   s   &&  @r   cwr2=TestBasicOps.test_combinations_with_replacement.<locals>.cwr2@  s\     ?DD	A"58A6'?d7m3%99%%9999 7s   AB
B/Bc                     V '       g   V'       d   ^ # ^# \        W,           ^,
          4      \        V4      ,          \        V ^,
          4      ,          # rV   )rT   )r-   rX   s   &&r   numcombsATestBasicOps.test_combinations_with_replacement.<locals>.numcombsH  s8    q$1$A;a($qs)33r   c              3   ,   <"   T F	  qS9   x  K  	  R # 5ir   r   r  s   & r   r   BTestBasicOps.test_combinations_with_replacement.<locals>.<genexpr>a  r  r  FTr  )r   r   ro   r   r,   r   rv   r   r   r   r  r   groupbyr   )r4   cwrr   r'  r*  r-   r   rX   r	  regular_combsr   kvnorunsrr   r  s   &              @r   "test_combinations_with_replacement/TestBasicOps.test_combinations_with_replacement'  sK   +)S%0)S%A6)S$/*c5"5	6$	:	4
 qA&+Ah/hac"ffh/F1Q3Zc&!n-  Vhqn=  Vc#f+.>?  8 $\&!%< =6Q!V$$V;OOCK3}3E$EFA$$SVQ/+21:6:CAa:F6$$S[#c&k2BC$$T!WfQi8OOCC'?Q'?CCC'?Q'?$?@$$V17%BA6aa%BD     d61o)>?  d61o)>?-   /  7
 &Cs   K,K1=K7
K7c                    V P                  \        \        34      ;_uu_ 4        \        R R4       RRR4       R#   + '       g   i     R# ; i)r  N   @)r   r  r  r   r3   s   &r   +test_combinations_with_replacement_overflow8TestBasicOps.test_combinations_with_replacement_overflowg  s1    {;<<)$6 =<<<r  c                   \         pV P                  \        \        \	        \
        V! R ^4      4      4      4      ^4       V P                  \        \        \	        \
        \        V! R ^4      4      4      4      4      ^4       R# r  )r   rv   r   r   r   r  r  r   )r4   r/  s   & r   .test_combinations_with_replacement_tuple_reuse;TestBasicOps.test_combinations_with_replacement_tuple_reusem  sZ    +SRWa!9:;Q?CCDWa,A$B CDaHr   c                   a V P                  \        \        4       V P                  \        \        R ^^4       V P                  \        \        R4       V P                  \        \        R R4       V P	                  \        \        R ^ 4      4      . 4       V P                  \        \        R R4       V P	                  \        \        \        ^4      ^4      4      . R	O4       R
R lpR
R lp\        ^4       EF  p\        V4       Uu. uF  p^V,          ^,
          NK  	  upo\        V^,           4       EF  p\        \        SV4      4      pT P	                  \        V4      WS8  d   ^ M \        V4      \        W5,
          4      ,          4       V P	                  \        V4      \        \        V4      4      4       V P	                  V\        V4      4       V F  pV P	                  \        V4      V4       V P	                  \        \        V4      4      V4       T P                  \        ;QJ d    V3R lV 4       F  '       d   K   RM	  RM! V3R lV 4       4      4       K  	  V P	                  V\        V! SV4      4      4       V P	                  V\        V! SV4      4      4       WS8X  g   EK  V P	                  V\        \        SR4      4      4       V P	                  V\        \        S4      4      4       EK  	  EK  	  R# u upi )r   Nre   c              3    a"   \        V 4      o\        S4      pVf   TMTpW8  d   R# \        \        V4      4      p\        \        W!,
          ^,           V^,           4      4      RRR1,          p\         ;QJ d    . V3R lVRV  4       F  NK  	  5M! V3R lVRV  4       4      x  V'       d   \	        \        V4      4       F  pWE;;,          ^,          uu&   WE,          ^ 8X  d*   W5^,           R W5V^,            ,           W5R% W%,
          WE&   KM  WE,          pW6) ,          W5,          uW5&   W6) &   \         ;QJ d    . V3R lVRV  4       F  NK  	  5M! V3R lVRV  4       4      x   K  	  R# R# 5i)r   Nc              3   6   <"   T F  pSV,          x  K  	  R # 5ir   r   r   s   & r   r   HTestBasicOps.test_permutations.<locals>.permutations1.<locals>.<genexpr>  s     5AQr   c              3   6   <"   T F  pSV,          x  K  	  R # 5ir   r   r   s   & r   r   r@    s     #A[DGG[r   r   r   )rP   rX   r-   r   cyclesr   r   r   s   &&     @r   permutations15TestBasicOps.test_permutations.<locals>.permutations1}  s/    ?DD	AYAAu58nG%Aqs+,TrT2F%5!5%%5!555!%(+AINIyA~&-cdmg!n&D$%E	"I29"+wz/
GBK#e#AWRa[#Aee#AWRa[#AAA ,  s   B/E63CE6c              3  $  a"   \        V 4      o\        S4      pVf   TMTp\        \        V4      VR7       FR  p\        \	        V4      4      V8X  g   K  \         ;QJ d    . V3R lV 4       F  NK  	  5M! V3R lV 4       4      x  KT  	  R# 5i)r   Nr#  c              3   6   <"   T F  pSV,          x  K  	  R # 5ir   r   r   s   & r   r   HTestBasicOps.test_permutations.<locals>.permutations2.<locals>.<genexpr>  r   r   )r   r   r&  r,   r   r   s   &&  @r   permutations25TestBasicOps.test_permutations.<locals>.permutations2  sh     ?DD	AYAA"58A6s7|$)%99%%9999 7s   AB
B!/Bc              3   ,   <"   T F	  qS9   x  K  	  R # 5ir   r   r  s   & r   r   1TestBasicOps.test_permutations.<locals>.<genexpr>  r  r  FTr  )r   r   r   r   r   r   r   r   )r   r   )r   r   r   )r   ro   r   r   rv   r   r,   r   rT   r   r   r   r   )	r4   rC  rH  r-   r   rX   r	  pr  s	   &       @r   test_permutationsTestBasicOps.test_permutationss  s1   )\2)\5!Q?)\48*lE2>l5"56;)\5#>l58Q78+U	W	0	: qA&+Ah/hac"ffh/F1Q3Zl6156  V13aDGd13i<OP  Vc#f+.>?  8A$$SVQ/$$SQ[!4OOCC'?Q'?CCC'?Q'?$?@     mFA.F)GH  mFA.F)GH6$$VT,vt2L-MN$$VT,v2F-GH   /s   Lc                    V P                  \        \        34      ;_uu_ 4        \        R R4       RRR4       R#   + '       g   i     R# ; i)r   Nr7  )r   r  r  r   r3   s   &r   test_permutations_overflow'TestBasicOps.test_permutations_overflow  s1    {;<<e$ =<<<r  c                   V P                  \        \        \        \        \        R ^4      4      4      4      ^4       V P                  \        \        \        \        \        \        R ^4      4      4      4      4      ^4       R# r  )rv   r   r   r   r  r   r  r   r3   s   &r   test_permutations_tuple_reuse*TestBasicOps.test_permutations_tuple_reuse  r  r   c                   \        ^4       EF  pRRV p\        ^4       EF  p\        \        W#R7      4      p\        \        W#4      4      p\        \	        W#4      4      p\        \        W#4      4      pV P                  \        V4      W,          4       T P                  \        V4      V'       d@   \        W,           ^,
          4      \        V4      ,          \        V^,
          4      ,          MV'       * 4       T P                  \        V4      W18  d   ^ M \        V4      \        W,
          4      ,          4       T P                  \        V4      W18  d   ^ M0\        V4      \        V4      ,          \        W,
          4      ,          4       V P                  V\        \        V4      4      4       V P                  V\        \        V4      4      4       V P                  V\        \        V4      4      4       V P                  V\        \        V4      4      4       T P                  YT Uu. uF   p\        V4      \        V4      8X  g   K  VNK"  	  up4       T P                  Yd Uu. uF   p\        \        V4      4      V8X  g   K  VNK"  	  up4       T P                  Yv Uu. uF   p\        V4      \        V4      8X  g   K  VNK"  	  up4       T P                  Yu Uu. uF   p\        \        V4      4      V8X  g   K  VNK"  	  up4       V P                  V\        \        \        V4      P                  V4      4      4       V P                  V\        \        \        V4      P                  V4      4      4       V P                  V\        \        V4      \        V4      ,          4      4       EK  	  EK  	  R# u upi u upi u upi u upi )r   r   Nr#  )r,   r   r&  r   r   r  rv   r   rT   r   r   filter__contains__)	r4   r-   re   rX   rQ   r/  permcombts	   &        r   test_combinatoricsTestBasicOps.test_combinatorics  s    qA"1A1XGA018>?L./L./   TAD1  SQRDQK$q',A4!9,L]^Y^`  TA$q'DI:MN  TA$q'DG:KdSTSVi:WX   vc$i'89  fSX&67  vc$i'89  vc$i'89   $&M$Q&)T!W:Lqq$&MN  4'J4a3s1v;>4'JK  4'N4a6!9d1g;M4'NO  3'I3a#c!f+q.3'IJ  tF3s83H3H$,O'PQ  tF3t93I3I3,O'PQ  vc#hT.B'CD3  * 'N'J'N'Is0   0OO,OO(OO$OOc           	     X   V P                  \        \        R . R	OR7      4      \        R4      4       V P                  \        \        R . R	O4      4      \        R4      4       V P                  \        \        R . R
O4      4      \        R4      4       V P                  \        \        R . RO4      4      \        R 4      4       V P                  \        \        R . RO4      4      \        R4      4       V P                  \        \        R. RO4      4      \        R4      4       Rp\        P	                  \        \        ^4      V4      4      p\        P	                  \        R4      4      pV P                  \        \        W#4      4      . ROV,          4       V P                  \        \        R\        ^4      4       V P                  \        \        \        ^4      R4       V P                  \        \        \        ^4      4       V P                  \        \        \        ^4      R4       R# )r   )r   	selectorsACEFr   ACABCBC'  Nr   r   r   r   r   r   )r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   rL  r   r   r   )	rv   r   compressr   r   r   r,   r   ro   )r4   r-   r   rb  s   &   r   test_compressTestBasicOps.test_compress  su   hHNOQUV\Q]^hx?@$v,Ohx?@$r(Khx?@$x.Qhx9:DJGhum<=tDzJ""6%(A#67''v7	ht78'A+F)XtU1X>)XuQx>)XuQx8)XuQx>r   c                   V P                  \        R \        4       4      . RO4       V P                  \        R \        ^4      4      . RO4       V P                  \        ^\        R \        ^4      4      4      RR.4       V P                  \        ^\	        R \        R4      4      4      RR.4       V P                  \        ^\	        R \        R4      4      4      RR.4       V P                  \        \        ^^^4       V P                  \        \        R4       V P                  \        ^\        \        4      4      \        \        ^,           \        ^,           .4       V P                  \        ^
\        \        ^,
          4      4      \        \        \        ^,
          \        ^,           4      4      4       V P                  \        ^
\        \        ) ^,
          4      4      \        \        \        ) ^,
          \        ) ^,           4      4      4       V P                  \        ^\        R4      4      . RO4       V P                  \        ^\        R4      4      . RO4       V P                  \        ^\        \        R4      4      4      \        R4      \        R4      \        R4      .4       V P                  \        ^\        \        ^^4      4      4      \        ^^4      \        ^^4      \        ^^4      .4       ^R,          pV P                  \        ^\        V4      4      W^,           V^,           .4       \        ^4      pV P                  \        V4      R4       \        V4       V P                  \        V4      R4       \        R4      pV P                  \        V4      R	4       \        V4       V P                  \        V4      R 4       V P                  \        \        R
4      4      R4       V P                  \        \        R4      4      R4       V P                  \        \        \        4      4      R\         R24       \        \        ^,
          4      pV P                  \        V4      R\        ^,
           R24       \        V4       V P                  \        V4      R\         R24       \        V4       V P                  \        V4      R\        ^,            R24       V P                  \        \        \        R4      4      4      \        4       \         P                  ) ^,
          \         P                  ) ^,           R!R^ ^
\         P                  ^,
          \         P                  ^,           3 F9  p\        \        V4      4      pRP#                  V4      pV P                  WE4       K;  	  \        ^\        ^,           4       \         P$                  ! 4        R# )"r   r}         
@1.1z2.1z3.1  zcount(3)zcount(4)z	count(-9)g     $@zcount(10.25)g      $@zcount(10.0)count()z	count(%r)Nr}   r   r~   r   r   r   r}   r   r~   r   )rx  ry  )r   r   r   )r}   r   )r~   r   )r}   rz  )r~   r  )ro  g      @g      @      
@      )r{  y      @            @      ii)rv   r   countrJ   r   r   ro   maxsizer   r,   r   r   reprrx   rw   floatsys__mod__exc_info)r4   BIGINTr   r   r1r2s   &     r   
test_countTestBasicOps.test_count  s:   eEG,.LMeE!H-/MNaeE!H!5688LMaU59!56H8MNaU59!56I8NO)UAq!4)UC0aw0 'A+w{;	=b%	"23eGAIwqy9:	<b%
"34eWHQJ
;<	>at-/ABaw02MNawu~!67!%.'%.'%.I	Kax1~!67"1a.(1a.(1a.I	KDav/&(F1H1MN!Ha*-Qa*-"Ia+.Qa"%eEl+^<eDk*M:eGn-y/BC'A+aF7Q;-q"9:QaF7)1"56QaF7Q;-q"9:d5;/0%8;;,q.3;;,q.#r1b#++a-QTQ\Q\]^Q^_AeAhB$$Q'BR$	 ` 	aS\\^r   c                ^   V P                  \        R \        ^^4      4      . RO4       V P                  \        R \        ^^R7      4      . RO4       V P                  \        R \        RR7      4      . RO4       V P                  \        \        RR4       V P                  \        R \        ^^ 4      4      . RO4       V P                  \        R \        ^^4      4      . RO4       V P                  \        R \        ^^4      4      . RO4       V P                  \        ^\        \        ^,
          ^4      4      \        ^\        \        ^,
          \        ^d,           ^4      4      4       V P                  \        ^\        \        ) ^,
          ^4      4      \        ^\        \        ) ^,
          \        ) ^d,           ^4      4      4       V P                  \        ^\        ^
\        ^,           4      4      \        \        ^
^
^\        ^,           ,          ,           \        ^,           4      4      4       V P                  \        ^\        \        ^4      4      \        \        ^,           \        ^,           .4       V P                  \        ^\        \        \        4      4      \        ^\        ,          ^\        ,          .4       V P                  \        ^\        \        ) \        4      4      \        ) ^ \        .4       V P                  \        ^\        ^R4      4      . R O4       V P                  \        ^\        ^R!4      4      . R"O4       V P                  \        ^\        \        R4      \        R4      4      4      \        R4      \        R4      \        R	4      .4       V P                  \        ^\        \        ^^4      \        ^^4      4      4      \        ^^4      \        ^^4      \        ^^4      .4       ^R
,          pV P                  \        ^\        VR7      4      ^ V^V,          .4       V P                  \        \        ^\        ^
R4      4      4      \        . R#O4      4       \        ^^4      pV P                  \        V4      R4       \        V4       V P                  \        V4      R4       \        R$^ 4      pV P                  \        V4      R4       \        V4       V P                  \        V4      R4       \        R$R%4      pV P                  \        V4      R4       \        V4       V P                  \        V4      R4       V P                  \        V4      R4       V P                  \        \        RR4      4      R4       V P                  \        \        R^4      4      R4       V P                  \        \        RR4      4      R4       V P                  \        \        ^
R4      4      R4       \        ^
R4      pV P                  \        \        V4      4      \        4       V P                  \        \        V4      4      \        4       \        \        ^,
          ^4      pV P                  \        V4      R\        ^,
           R24       \        V4       V P                  \        V4      R\         R24       \        V4       V P                  \        V4      R\        ^,            R24       \        \        ^,           R4      pV P                  \        V4      R\        ^,            R24       \        V4       V P                  \        V4      R\         R24       \        V4       V P                  \        V4      R\        ^,
           R24       R# )&r   r}   r~   )startstepr  g      ?rp  z.1z1.2z1.3rq  g      @zcount(3, 5)zcount(8, 5)zcount(-9, 0)zcount(-9, -3)zcount(-12, -3)g      %@zcount(10.5, 1.25)zcount(10.5)g      ?zcount(10.5, 1.0)zcount(10, 1.0)rr  z, 2)z, -1)N)r}   r   )r~   r   )r   r   r   )ru  )r~   r   )r   r  )r  )r~   r   rw  )r  )r~   r   )r   r   )r   ro  g      @r{  )r   r|  y      !@       )r_   g      )@g      .@r}  rz  )rv   r   r~  r   ro   rJ   r  r,   r   r   r   r  rx   rw   r   r  )r4   r  r   s   &  r   test_count_with_step!TestBasicOps.test_count_with_step  s   eE!AJ/1OPeEq$9:7	9eErN39	;)UC5eE!AJ/1OPeE!AJ/1OPeE!AJ/1OPb%
A"67b%PR
T[\_T_abBc9deb%Q"78$r5'RTV]U]^aUacdCe:fgar719!56eB1gai=(8'!)DE	Gaw!23!7Q;!<	>aw!89!1w;G<	>ax!9:!1g.	0aq$0.Aaq'!235IJawu~wt}!EF!%.'%.'%.I	Kax!}hqm!DE"1Q-"R(2b/J	LDaF!34q&!F(6KLd1eBn56=M8NO!QKa-0Qa-0"aLa.1Qa.1"bMa/2Qa"23a"23eD$/02EFeD!n-}=eD$/02DEeBo.0@A"cNd1g,d1g.'1*a aF7Q;-t"<=QaF7)4"89QaF7Q;-t"<='A+r"aF7Q;-u"=>QaF7)5"9:QaF7Q;-u"=>r   c                T  aa R o^
p\        VR7      oVV3R lp. p\        V4       F;  p\        P                  ! VR7      pVP	                  4        VP                  V4       K=  	  V F  pVP                  4        K  	  V P                  \        S4      SV,          V,          4       R# )rg  r  c                  B   < \        S4       F  p \        S4       K  	  R # r   )r,   rx   )r   r   count_tos    r   counting_thread:TestBasicOps.test_count_threading.<locals>.counting_threadd  s    8_Q %r   )targetN)	r~  r,   	threadingThreadr  r   r   rv   rx   )	r4   r  num_threadsr  threadsr   threadr   r  s	   &&     @@r   test_count_threading!TestBasicOps.test_count_threading]  s     t	 {#A%%_=FLLNNN6" $ FKKM a(["84"?@r   c                *    V P                  ^R7       R# )r   r  N)r  r3   s   &r   test_count_with_step_threading+TestBasicOps.test_count_with_step_threadingp  s    !!q!)r   c           
        V P                  \        ^
\        R4      4      \        R4      4       V P                  \        \        R4      4      . 4       V P	                  \
        \        4       V P	                  \
        \        ^4       V P                  \        \        \        \        4       4      ^
4      4      . RO4       R# )r_   r   
abcabcabcar   N)
r   r   r   r   r   r   r   r   r   r   )rv   rJ   cycler   r   ro   rH   r    r3   s   &r   
test_cycleTestBasicOps.test_cycles  s    b%,/l1CDeBi"-)U+)UA.fU46]2679NOr   c                h
  aa V P                  . \        \        . 4      4      4       V P                  . \        \        . \        R 7      4      4       V P	                  \
        \        \        R. 4      4       V P	                  \
        \        R4       V P	                  \
        \        RR ^
4       . ROp. p\        VR 4       F7  w  r4V F,  pV P                  W5^ ,          4       VP                  V4       K.  	  K9  	  V P                  W4       . p\        V\        4       Fh  w  r4\        V\        4       FO  w  rgV FD  pV P                  W5^ ,          4       V P                  We^,          4       VP                  V4       KF  	  KQ  	  Kj  	  V P                  W4       \        V\        4       UUu. uF  w  r4VNK	  	  ppp\        V U	u. uF  q^ ,          NK  	  up	4      p
V P                  \        V4      V
4       V P                  \        V4      \        V
4      4       \        \        R\        ^	4      4      4      p\        V\        4      p\        V4      w  r\        V4      w  r\        V4      w  rV P                  \        V4      . 4       V P                  \        V4      . 4       V P                  \        V4      R4       \        V4       V P                  \        V4      . 4       Rp\        \        V4      4       UUu. uF  w  r4VNK	  	  p	ppV P                  V	. RO4       \        \        V4      4       UUu. uF%  w  r4\        \        V^^4      4      '       g   K#  VNK'  	  p	ppV P                  V	. RO4       \        \        V4      4       UUu. uF  w  r4\        \        V4      4      V3NK  	  p	ppV P                  V	. RO4       \        \        \        V4      4       UUu. uF  w  r4\        \        V4      4      V3NK  	  uppRR7      R	,          p	V P                  V	. RO4        ! R
 R\         4      oRV3R llpR\        3R lpV P	                  SVV! ^ 4      4       V P	                  SVV! ^4      4        ! V3R lR4      pV! 4       V! 4       R.pV P	                  SVV\        R7       V P	                  SVV4       VV3R lo^ Sn        V P	                  SVR.S4       ^Sn        V P	                  SVRR.S4       R# u uppi u up	i u uppi u uppi u uppi u uppi )keyr   Nc                     V # r   r   r   s   &r   rg   +TestBasicOps.test_groupby.<locals>.<lambda>      ar   c                     V ^ ,          # rV   r   rW   s   &r   rg   r        !r   	AABBBAAAAabracadabraTreverseNr   Nc                       ] tR tRtRtR# )0TestBasicOps.test_groupby.<locals>.ExpectedErrori  r   Nr>   r?   r@   rA   rC   r   r   r   ExpectedErrorr        r   r  c              3   <   <"   \        V 4       F  pR x  K	  	  Sh5iyor+   r-   r   r  s   & r   delayed_raise0TestBasicOps.test_groupby.<locals>.delayed_raise       1X
    c                 X    \        W4       UUu. uF  w  r4V! V4      NK  	  upp# u uppi r   )r.  )rP   keypfuncr1  gs   &&&  r   gulp'TestBasicOps.test_groupby.<locals>.gulp  s'    (/(?@(?DG(?@@@s   &c                   .   <a  ] tR tRt o V3R ltRtV tR# )+TestBasicOps.test_groupby.<locals>.DummyCmpi  c                   < Shr   r   r4   dstr  s   &&r   __eq__2TestBasicOps.test_groupby.<locals>.DummyCmp.__eq__  	    ##r   r   Nr>   r?   r@   rA   r  rC   rD   rF   r  s   @r   DummyCmpr         $ $r   r  r  c                 `   < SP                   ^ 8  d   S;P                   ^,          un         V # ShrV   skipobjr  keyfuncs   &r   r  *TestBasicOps.test_groupby.<locals>.keyfunc  (    ||a!
##r   )r   r_      )r      r   )r      r   )r      r   )r         )r   r   r  )r   r      )r      r  r   r   r}   r~   r   drX   r}   r~   rX   r   r}   r   r~   )r   r   )r   r  r   rX   r  r  r  rV   )rv   r   r.  r  r   ro   r   rY   r]   r   r   r   r,   rx   r   rH   	Exceptionr  )r4   re   dupr1  r  elemikigkeysrX   expectedkeysrp   _g1g2g3r  r  r  r  r  s   &                  @@r   test_groupbyTestBasicOps.test_groupbyz  sK   T'"+./T'"""567)T75"+=>)Wd3)WeZD.A}-DA  G,

4   . 	  Au%DA!!V,D$$QQ0$$Ra1JJt$  - & 	  &a/0/da/0!,!QaDD!,-TL1TC$56 [%(+,QRRRb2&b2&b8,Rb2& "6!9-.-41Q-.56"6!9-E-41fQqm1DQQ-EO,+26!9+=>+=41c$q'lA+=>NO76!93EF3E41Sa\A&3EFPTUVXY:;	I 		  !%4 	A 	-}Q/?@-}Q/?@	$ 	$ ZT* 	-qr:-q1	$ -vw?-d|WEO 1,( / F ? Gs*   0T	TT  T"%T"!T(-!T.
c                d   V P                  \        \        \        \	        ^4      4      4      . RO4       V P                  \        \        R. RO4      4      ^^.4       V P                  \        \        \
        . RO4      4      ^^.4       V P                  \        ^\        \        \        4       4      4      . RO4       V P                  \        \        4       V P                  \        \        R 4       V P                  \        \        R \	        ^4      ^4       V P                  \        \        \        ^4       V P                  \        \        \        \	        ^4      \	        ^4      4      4       . ROp\        \        \	        ^4      4      pV P                  \        \        P                  ! V4      4      V4       \        \        \	        ^4      4      pV P                  \        \        P                  ! V4      4      V4       \	        \        P                  ^,           4       F  p\        \        \	        ^4      4      pV P                  \        \        P                  ! \        P                   ! W#4      4      4      V4       \        V4       V P                  \        \        P                  ! \        P                   ! W#4      4      4      VR,          4       K  	  \	        \        P                  ^,           4       F-  p\        \        \	        ^4      4      pV P#                  W24       K/  	  R# )r   Nc                     V # r   r   r   s   &r   rg   *TestBasicOps.test_filter.<locals>.<lambda>      ar   c                     V # r   r   r   s   &r   rg   r    r  r   r   NN)r   r   r   r   r   r   r   r   )r   r   r   r   )rv   r   rZ  r$   r,   boolrJ   r~  r   ro   rx   copydeepcopyrb   HIGHEST_PROTOCOLrc   rd   r   )r4   ansr   rf   s   &   r   test_filterTestBasicOps.test_filter  s   fVU1X67AfT;781Q%@fT;781Q%@a!899E)V,)VZ8)VZq1E)VVQ7)T6%(E!H+EF 658$diil+S1658$dmmA./5622Q67EvuQx(AT&,,v||A/E"FGMGT&,,v||A/E"FGRQ	 8
 622Q67EvuQx(AOOE% 8r   c           
        V P                  \        \        \        \	        ^4      4      4      . RO4       V P                  \        \        R. RO4      4      . RO4       V P                  \        \        \
        . RO4      4      . RO4       V P                  \        ^\        \        \        4       4      4      . RO4       V P                  \        \        4       V P                  \        \        R 4       V P                  \        \        R \	        ^4      ^4       V P                  \        \        \        ^4       V P                  \        \        \        \	        ^4      \	        ^4      4      4       R# )r   Nc                     V # r   r   r   s   &r   rg   /TestBasicOps.test_filterfalse.<locals>.<lambda>      1r   c                     V # r   r   r   s   &r   rg   r
    r  r   rj  r   r   r   r   )r   r   r   r   )rv   r   filterfalser$   r,   r  rJ   r~  r   ro   rx   r3   s   &r   test_filterfalseTestBasicOps.test_filterfalse  s    k&%(;<gFk$<=wGk$<=wGaVUW!=>	J)[1)[*=)[*eAhJ)[&!<)T;uQxq+JKr   c           
     N   \        R \        4       4       UUu. uF  w  rW3NK
  	  pppV P                  V. RO4       V P                  \        \        R \	        ^4      4      4      \        R \	        ^4      4      4       V P                  \        \        R\	        ^4      4      4      \        R\	        ^4      4      4       V P                  \        ^\        R\        4       4      4      \        R\	        ^4      4      4       V P                  \        \        R4      4      \        R4      4       V P                  \        \        4       4      \        4       4       V P                  \        \         ^4       V P                  \        \         \	        ^4      ^4       T P                  \        R R4       Uu. uF  p\        \        V4      4      NK  	  up\        R R4      4       T P                  \        R R4       Uu. uF  qDNK  	  up\        R R4      4       R# u uppi u upi u upi )r   r   r   Nrt  )
r   r~  rv   r   r,   r   rJ   r   ro   r   )r4   r   yr  pairs   &    r   test_zipTestBasicOps.test_zip  s   !$U57!34!3u!34<=c%q23T%q5JKc(E!H56XuQx8PQaHeg 67ha9QRc(m,d8n=cedf-)S!,)S%(A6E58IJ8I%T
+8IJeU+	-3ue+<=+<4$+<=eU+	- 5 K=s   H1H9
H"c                Z   \        \        \        \        R R4      4      4      pV P	                  \        V4      \        V4      4       \        \        \        \        \        R R4      4      4      4      pV P	                  \        \        P                  V4      4      \        V4      4       R# r   r   N)
r   r   r  r   rv   r   r   r   dictfromkeysr4   idss   & r   test_zip_tuple_reuse!TestBasicOps.test_zip_tuple_reuse  sq    3r3ue,-.S3s8,3r4E5 1234T]]3/0#c(;r   c                n   R \        ^4      .\        ^4      R .\        R4      \        RR4      \        RR4      .\        R4      \        ^ 4      \        RR4      \        R4      \        R4      .\        R4      \        ^ 4      \        RR4      \        R4      \        R4      \        ^ 4      .3 EF  p\        \        \        \        V4      4      4       UUu. uF5  p\	        V Uu. uF  q2\        V4      8  d	   W2,          MRNK  	  up4      NK7  	  pppV P                  \        \        V!  4      V4       V P                  \        \        V/ / B 4      V4       V Uu. uF/  p\        ;QJ d    . R	 V 4       F  NK  	  5M! R	 V 4       4      NK1  	  ppV P                  \        \        V/ \        R
R7      B 4      V4       EK  	  V P                  \        ^\        R\        4       4      4      \        \        R\        ^4      4      4      4       V P                  \        \        4       4      \        \        4       4      4       V P                  \        \        . 4      4      \        \        . 4      4      4       V P                  \        \        R4      4      \        \        R4      4      4       V P                  \        \        R/ / B 4      \        \        \        R 4      R.,           R4      4      4       V P                  \        \        ^4       V P                  \        \        \        ^4      ^4       R F9  p \        V\        4       \!        4       4       V P#                  RV,           4       K;  	  T P                  \        R R4       Uu. uF  p\	        \        V4      4      NK  	  up\        \        R R4      4      4       T P                  \        R R4       Uu. uF  qwNK  	  up\        \        R R4      4      4       R# u upi u uppi u upi   \         d     K  i ; iu upi u upi )r   rq    i4  i  i  i  i  Nc              3   P   "   T F  qR J ;'       d    R;'       g    Tx  K  	  R # 5i)NXr   )r   rr   s   & r   r   /TestBasicOps.test_ziplongest.<locals>.<genexpr>)  s%     @a$Y..333!3as   &	&&r!  	fillvaluer   defgzDid not raise Type in:  r   )r   r%  )zzip_longest('abc', fv=1)z3zip_longest('abc', fillvalue=1, bogus_keyword=None))r,   r   r   r   r   rv   r   zip_longestr  rJ   r~  r   r   ro   evalglobalslocalsfail)r4   r   r   argr  r^  stmtr  s   &       r   test_ziplongestTestBasicOps.test_ziplongest  sG   a!q5!teD.d40@AteAhd4(8%+uT{SteAhd4(8%+uT{TYZ[T\]D  %SS$%89;9! N#3s8|SV=NO9  ;T+t"45v>T+t":r":;VDJPQ&Qee@a@ee@a@@&FQT+t"Ktc7J"KLfU 	aHeg >?c(TYZ[T\F]A^_km,d35k:k"o.SW>k(34d3x=6IJk>2>?c$u+tf"4f=>	@)[!4)[%(A>
D=T79fh/ 		4t;<
 	E58QR8Q%T
+8QRc%/0	2;ue+DE+D4$+DEc%/0	2? O ; R(  
 SEsB   P%"PPP/%PPP-$
P2PP*)P*c                Z   \        \        \        \        R R4      4      4      pV P	                  \        V4      \        V4      4       \        \        \        \        \        R R4      4      4      4      pV P	                  \        \        P                  V4      4      \        V4      4       R# r  )
r   r   r  r&  rv   r   r   r   r  r  r  s   & r   test_zip_longest_tuple_reuse)TestBasicOps.test_zip_longest_tuple_reuseG  sq    3r;ue456S3s8,3r4E5 9:;<T]]3/0#c(;r   c                   a \        4       o ! V3R  lR4      pV P                  \         4      ;_uu_ 4       p\        V! 4       4       RRR4       V P                  XP                  S4       R#   + '       g   i     L.; i)c                   .   <a  ] tR tRt o V3R ltRtV tR# )?TestBasicOps.test_zip_longest_bad_iterable.<locals>.BadIterableiQ  c                   < Shr   r   )r4   	exceptions   &r   r5   HTestBasicOps.test_zip_longest_bad_iterable.<locals>.BadIterable.__iter__R  s    r   r   N)r>   r?   r@   rA   r5   rC   rD   )rF   r6  s   @r   BadIterabler4  Q  s        r   r8  N)ro   r   r&  assertIsr6  )r4   r8  cmr6  s   &  @r   test_zip_longest_bad_iterable*TestBasicOps.test_zip_longest_bad_iterableN  sU    K		  	  y))R& * 	bllI. *)s   A--A=	c                    ! R  R4      pV! ^^\         4      pV! ^^\         4      pR pV P                  V! W#4      . RO4       V! ^^\        4      pV! ^^\         4      p\        W#^ R7      pV P                  \	        V4      R4       V P                  \	        V4      R4       V P                  \	        V4      R4       V P                  \        \        V4       R# )c                   2   a  ] tR tRt o R tR tR tRtV tR# ),TestBasicOps.test_bug_7244.<locals>.Repeateri\  c                >    Wn         \        V4      V n        W0n        R # r   )or   r^  rr   )r4   rA  r^  rr   s   &&&&r   __init__5TestBasicOps.test_bug_7244.<locals>.Repeater.__init__^  s    Qr   c                    V # r   r   r3   s   &r   r5   5TestBasicOps.test_bug_7244.<locals>.Repeater.__iter__b      r   c                    V P                   ^ 8  d&   V ;P                   ^,          un         V P                  # V P                  hrV   )r^  rA  rr   r3   s   &r   r;   5TestBasicOps.test_bug_7244.<locals>.Repeater.__next__d  s,    66A:FFaKF66M&&Lr   )rr   rA  r^  N	r>   r?   r@   rA   rB  r5   r;   rC   rD   rE   s   @r   Repeaterr?  \  s     ! !r   rJ  c                     . p\        W^ R7       FJ  w  r4\        P                  ! R4      ;_uu_ 4        \        W434       RRR4       VP	                  W434       KL  	  V#   + '       g   i     L(; i)r   r#  stdoutN)r&  r   captured_outputprintr   )r  r  r	  r   r   s   &&   r   run'TestBasicOps.test_bug_7244.<locals>.runo  sW    F#Ba8,,X661&M 7qf% 9 M 76s   A  A0r#  NrO  )rO  rO  rO  rM  )r:   rv   rl   r&  rx   r   )r4   rJ  r  r  rO  rp   s   &     r   test_bug_7244TestBasicOps.test_bug_7244Z  s    	! 	!" aM*aM*	 	R&BC aL)aM*1-b6*b6*b6*,b1r   c                   V P                  \        \        R 4      4      . 4       V P                  \        \        R4      4      . 4       V P                  \        \        R4      4      R.4      3 V P                  \        \        R4      4      . R	O4       V P                  \        \        \        R4      4      4      \        \	        \        R4      \        ^R4      4      4      4       V P                  \        4      ;_uu_ 4        \        4        RRR4       V P                  \        4      ;_uu_ 4        \        R^
4       RRR4       V P                  \        4      ;_uu_ 4        \        RR7       RRR4       V P                  \        4      ;_uu_ 4        \        R4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Li; i  + '       g   i     R# ; i)
r   r}   r   r  rg  Nr   rO   r}   r~   )rT  )r~   r   r   r  )r  rr   )rv   r   pairwiser,   r   r   ro   r3   s   &r   test_pairwiseTestBasicOps.test_pairwise  sJ   hrl+R0hsm,b1htn-)l	, 	-hw/0N	PhuV}56c%-q&1ABC	E y))J *y))UB *y))e$ *y))TN *) *))))))))s0   F/5G'GG(/F?	G	G%	(G9	c                  a  V 3R  lpV! ^0^.^.3^.3^.^.3.4       V! ^0^.^.^.33^.^.3^.3^.^.3.4       V! ^0^.^.3^.^.^.33^.^.3^.3^.^.3.4       V! ^^0^.^.3^.3^.3^.^.3.4       V! ^^0^.^.^.33^.3^.^.3.4       V! ^^0^.^.3^.^.3^.33^.^.3^.3^.3^.^.3.4       V! ^^0^.^.^.^.333^.^.^.33^.3^.^.3.4       R# )c                    <a a  ! VV 3R  lR4      p\        V! 4       4      oV F  pSP                  \        S4      V4       K   	  R# )c                   :   <a  ] tR tRt o ^ tR tVV3R ltRtV tR# )<TestBasicOps.test_pairwise_reenter.<locals>.check.<locals>.Ii  c                    V # r   r   r3   s   &r   r5   ETestBasicOps.test_pairwise_reenter.<locals>.check.<locals>.I.__iter__      Kr   c                   < V ;P                   ^,          un         V P                   S9   d   \        S4      # V P                   .# rL   )r~  rx   )r4   rp   
reenter_ats   &r   r;   ETestBasicOps.test_pairwise_reenter.<locals>.check.<locals>.I.__next__  s1    JJNJzzZ/#Bx JJ<'r   r   N	r>   r?   r@   rA   r~  r5   r;   rC   rD   )rF   rp   ra  s   @r   Ir\    s      ( (r   rd  N)rV  rv   rx   )ra  expectedrd  itemrp   r4   s   f&  @r   check1TestBasicOps.test_pairwise_reenter.<locals>.check  s8    ( ( !#B   b40 !r   Nr   r4   rg  s   f r   test_pairwise_reenter"TestBasicOps.test_pairwise_reenter  s   	1 	qccA3Z!S1#J
 	 	qcSA3*cA3Z!S1#J
 	
 	qcS1#JSA3*cA3Z!S1#J	
 	 	q!fsQCj1#$S1#J
 	 	q!fcQC!:$S1#J
 	 	q!fcA3ZA3*qc*+sQCj1#$S1#J
 	
 	q!fSA3!qc
#$cQC!:$S1#J
 	r   c                l   a  V 3R  lpV! ^. 4       V! ^. 4       V! ^. 4       V! ^^.^.3^.3.4       R# )c                 ~   <a a  ! VV 3R  lR4      p\        V! 4       4      oSP                  \        S4      V4       R# )c                   :   <a  ] tR tRt o ^ tR tVV3R ltRtV tR# )=TestBasicOps.test_pairwise_reenter2.<locals>.check.<locals>.Ii  c                    V # r   r   r3   s   &r   r5   FTestBasicOps.test_pairwise_reenter2.<locals>.check.<locals>.I.__iter__  r_  r   c                   < V P                   S8  d   \        hV ;P                   ^,          un         V P                   ^8X  d   \        SR4      # V P                   .# r   N)r~  r:   rx   )r4   rp   maxcounts   &r   r;   FTestBasicOps.test_pairwise_reenter2.<locals>.check.<locals>.I.__next__  sE    zzX-++JJNJzzQ#B~- JJ<'r   r   Nrc  )rF   rp   rt  s   @r   rd  ro    s      ( (r   rd  N)rV  rv   r   )rt  re  rd  rp   r4   s   f& @r   rg  2TestBasicOps.test_pairwise_reenter2.<locals>.check  s.    
( 
( !#BT"Xx0r   Nr   ri  s   f r   test_pairwise_reenter2#TestBasicOps.test_pairwise_reenter2  sA    	1  	aaaaQC!:s#$%r   c                   . R
.3R .RR.3\        ^4      \        ^4      .. RO3\        ^ 4      \        ^4      \        ^4      .. 3\        ^4      \        ^ 4      \        ^4      .. 3\        ^4      \        ^4      \        ^ 4      .. 33 F}  w  rV P                  \        \        V!  4      V4       \        ^4       FG  pV P                  \        \        W,          !  4      \        \        V/ \	        VR7      B 4      4       KI  	  K  	  V P                  \        \        \        \        ^4      .^,          !  4      4      R4       V P                  \        \        \        ^4      R4       R pR^/R lpRRR\        ^ 4      \        ^4      \	        ^^^R7      \        R	4      \        ^4      \        \        ^4      4      .	p\        ^d4       EF#  p\        \        P                  ! ^4      4       Uu. uF  p\        P                  ! V4      NK  	  pp\        \        \
        V4      4      p	V P                  \        \        \        V!  4      4      V	4       V P                  \        \        V!  4      \        V! V!  4      4       V P                  \        \        V!  4      \        V! V!  4      4       \        \        V4      pV P                  \        \        \        V!  4      4      V	4       EK&  	  R# u upi )r   r#  Nc               ?     "   \        \        \        V 4      4      VP                  R ^4      ,          p\	        V4      pV^ 8X  d   Rx  R# \
        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d   R# ^ .V,          p\        ;QJ d    . R \        W$4       4       F  NK  	  5M! R \        W$4       4       4      x   \        \        V4      4       F  pWE,          \	        W%,          4      ^,
          8X  d   K(  WE;;,          ^,          uu&   \        V^,           V4       F  p^ WF&   K	  	  \        ;QJ d    . R \        W$4       4       F  NK  	  5M! R \        W$4       4       4      x   K  	  R# 5i)r   Nc              3   >   "   T F  p\        V4      ^ 8H  x  K  	  R# 5ir   Nr   )r   r   s   & r   r   >TestBasicOps.test_product.<locals>.product1.<locals>.<genexpr>  s     4ed3t9>es   TFc              3   6   "   T F  w  rW,          x  K  	  R # 5ir   r   r   r   r   s   &  r   r   r}    s     C/BGD/B   c              3   6   "   T F  w  rW,          x  K  	  R # 5ir   r   r  s   &  r   r   r}    s     K7JGD7Jr  r   )	r   r   r   getr   anyr   r   r,   )r   kwdspoolsr-   r   r   r   s   *,     r   product1+TestBasicOps.test_product.<locals>.product1  s    UD)*TXXh-BBEE
AAvs4e4sss4e444cAgG%Cs5/BC%%Cs5/BCCC!%(+AzS]Q%66 J!OJ"1Q3]%&
 +%Ks57JK%%Ks57JKKK , s%   AFF*FFB.F<Fr   c              7    "   V ^ 8  d   \        R4      hV Uu. uF  p\        V4      NK  	  upV ,          p. .pV F%  pV UUu. uF  qR F  qeV.,           NK  	  K  	  pppK'  	  V F  p\        V4      x  K  	  R# u upi u uppi 5i)z Pure python version used in docsz"repeat argument cannot be negativeN)r   r   )r   r   r   r  r	  r   r  rQ   s   $*      r   product2+TestBasicOps.test_product.<locals>.product2  s     z !EFF-67YTU4[Y7&@ETF)/>AAQC%%%>  Dk!  8 ?s   BA=BB*Br   r   )r}   r~   r   abcdefgr   )r}   )r~   ))r   r   rL  rM  rN  )r   r   rO  i )r,   rv   r   r&  r  r   r   ro   r   r   random	randrangechoicerQ   r   iter)
r4   r   r	  rX   r  r  argtypesr   r   expected_lens
   &         r   test_productTestBasicOps.test_product  sZ   "JVff%&Aha!#MNAha%(+R0Aha%(+R0Aha%(+R0LD T'4.16:1X  g&8!9!%gt&Ft1~&F!GI  	T'E!H:a<"89:DA)WeAh=	,	" 	" r58U1Xta17J	NE"IuU2Y/?AsA5:6;K;KA;N5OP5OFMM(+5ODPC/LSgtn!56ET'4.14$3HIT'4.14$3HItT?DSgtn!56E Ps   2K7c                    V P                  \        \        34      ;_uu_ 4        \        R .^ ,          RR/  RRR4       R#   + '       g   i     R# ; i)r   r   Ni   )r   r  r  r&  r3   s   &r   test_product_overflow"TestBasicOps.test_product_overflow  s:    {;<<tfTk151 =<<<s   AA	c                   V P                  \        \        \        \        \        R R4      4      4      4      ^4       V P                  \        \        \        \        \        \        R R4      4      4      4      4      ^4       R# r  )rv   r   r   r   r  r&  r  r   r3   s   &r   test_product_tuple_reuse%TestBasicOps.test_product_tuple_reuse   sW    SR)>!?@A1ECCD1F,G$H IJANr   c           	     r   V P                  \        \        R ^R7      4      . RO4       V P                  \        \	        ^4      \        R 4      4      . RO4       V P                  \        \        R ^4      4      . RO4       V P                  \        ^\        R 4      4      . RO4       V P                  \        \        R ^ 4      4      . 4       V P                  \        \        R R4      4      . 4       V P                  \        \        4       V P                  \        \        R^^4       V P                  \        \        RR 4       \        R	4      pV P                  \        V4      R4       \        R	^4      pV P                  \        V4      R4       \        V4       V P                  \        V4      R4       R# )
r}   )objecttimesNzrepeat((1+0j))zrepeat((1+0j), 5)zrepeat((1+0j), 0))r}   r}   r}   ))r   r}   r   r}   )r   r}   rz  y      ?        )	rv   r   r   r   r,   rJ   r   ro   r  )r4   rX   s   & r   test_repeatTestBasicOps.test_repeat%  s@   fCq9:OLeAhvc{37	9fS!n-?a-?fS!n-r2fS"o.3)V,)VT1a8)VT374La"234Oa"56Qa"56r   c           	     2   V P                  \        \        R R4      4      R4       V P                  \        \        R R4      4      R4       V P                  \        \        R RR7      4      R4       V P                  \        \        R RR7      4      R4       R# )r}   zrepeat('a', 0)r  Nr   r  )rv   r  r   r3   s   &r   test_repeat_with_negative_times,TestBasicOps.test_repeat_with_negative_times7  st    fS"o.0@AfS"o.0@AfS346FGfS346FGr   c                <   V P                  \        \        \        P                  \        ^4      \        ^^4      4      4      . RO4       V P                  \        \        \        R\        ^4      4      4      . RO4       V P                  \        \        \        R\        4       4      4      . RO4       V P                  \        ^\        \        R\        4       4      4      RR.4       V P                  \        \        \        P                  . 4      4      . 4       V P                  \        \        4       V P                  \        \        \        R\        ^4      \        ^4      4      4       V P                  \        \        \        P                  4       V P                  \        \        \        ^
\        ^4      4      4       V P                  \        \        \        \        ^.^.4      4       V P                  \        \        \        \        ^.^.4      4       R# )r   r   Nr   r   r   ru  rv  rt  )rv   r   r   rM   powr,   r)   r~  rJ   r   ro   negrx   r   r   r   r3   s   &r   test_mapTestBasicOps.test_map=  sg   c(,,a%!*EF+	-c(E58<=2	4c(E57;<2	4aHeUW =>!'*	,c(,,34b9)S))T3tU1XuQx+HI)S(,,7)T3r58+<=*dC!qc,BC)T3vsQC+@Ar   c                   V P                  \        \        \        P                  \        \        ^4      \        ^^4      4      4      4      . RO4       V P                  \        ^\        \        P                  \        \        4       \        ^4      4      4      4      . RO4       V P                  \        \        \        P                  . 4      4      . 4       V P                  \        \        \        P                  \        ^^.4      .4      4      R.4       V P                  \        \        \        \        P                  R.4      4       V P                  \        \        4       V P                  \        \        \        P                  R.R4       V P                  \        \        \        ^
R.4      4       V P                  \        \        \        \        R.4      4       V P                  \        \        \        \        R.4      4       R# )r   Nextrar  i   r   r   )rv   r   starmaprM   r  r   r,   rJ   r~  r  r   ro   rx   r   r   r   r3   s   &r   test_starmapTestBasicOps.test_starmapN  sP   ghllCa%!*4MNO+	-as57E!H7M!NO+	-ghllB78"=ghllT1Q%[MBCdVL)T78<<$+HI)W-)WhllUGWM)T72w+?@*dGGeW,EF)T76E7+CDr   c                   R FB  pV P                  \        \        \        ^d4      .VO5!  4      \        \        V!  4      4       KD  	  R FD  w  rV P                  \        \        \        ^d4      .VO5!  4      \        \        V!  4      4       KF  	  V P                  \        \        \        ^
4      R4      4      \        \        ^
4      4      4       V P                  \        \        \        ^
4      RR4      4      \        \        ^
4      4      4       V P                  \        \        \        ^
4      RRR4      4      \        \        ^
4      4      4       V P                  \        \        \        ^
4      ^R4      4      \        \        ^^
4      4      4       V P                  \        \        \        ^
4      ^R^4      4      \        \        ^^
^4      4      4       \	        \        ^
4      4      pV P                  \        \        V^4      4      \        \        ^4      4      4       V P                  \        V4      \        \        ^^
4      4      4       \	        \        ^
4      4      pV P                  \        \        V^^4      4      . 4       V P                  \        V4      \        \        ^^
4      4      4       \        ^
4      pV P                  \        \        V4       V P                  \        \        V^^^^4       V P                  \        \        VR^
^4       V P                  \        \        V^RR	4       V P                  \        \        V^^
R	4       V P                  \        \        V^^
^ 4       V P                  \        \        VR4       V P                  \        \        VR^4       V P                  \        \        V^R4       V P                  \        \        VR^^4       V P                  \        \        V^R^4       V P                  \        \        \        \        4       ^^
\        4      4      4      ^4       \        4       pV P                  \        \        V^^^24      4      ^.4       V P                  \        V4      ^4       R R
 4       p\        P                  ! V4      p\        V^4      pV P                  V! 4       4       \        V4       \        P                   ! 4        V P#                  V! 4       4        ! R R\$        4      pV P                  \        \        \        ^d4      V! ^
4      4      4      \        \        ^
4      4      4       V P                  \        \        \        ^d4      V! ^
4      V! ^24      4      4      \        \        ^
^24      4      4       V P                  \        \        \        ^d4      V! ^
4      V! ^24      V! ^4      4      4      \        \        ^
^2^4      4      4       R# )r_   Nr}   c              3   $   "   T F  qx  K  	  R # 5ir   r   )r   r   s   & r   r   +TestBasicOps.test_islice.<locals>.<genexpr>  s      Aas   c                   ,   a  ] tR tRt o R tR tRtV tR# ))TestBasicOps.test_islice.<locals>.IntLikei  c                    Wn         R # r   valr4   r  s   &&r   rB  2TestBasicOps.test_islice.<locals>.IntLike.__init__  s    r   c                    V P                   # r   r  r3   s   &r   	__index__3TestBasicOps.test_islice.<locals>.IntLike.__index__  s    xxr   r  N)r>   r?   r@   rA   rB  r  rC   rD   rE   s   @r   IntLiker    s        r   r  ))r_   r  r   )r_   r   r  )r_   r  )r_   r_   r_   r   )r  )))r_   r   r   )r_   r   r   ))r_   r   )r_   r   ))r   )r   r   rO  )rv   r   rH   r,   r  r   ro   r   r   r~  r  rx   weakrefrefassertIsNotNoner   
gc_collectassertIsNoner  )r4   r   tgtargsrp   rar   wrr  s   &       r   test_isliceTestBasicOps.test_islice\  so   D T&s";d";<!%,/1MD
 T&s";d";<!%/24 	fU2Y56U2YHfU2Yd;<d59oNfU2YdDABDrOTfU2Y4894a;MNfU2Y4;<d5BPQ?>ST %)_fRm,d58n=b4a#56%)_fRA./4b4a#56 2Y)VR0)VRAq!<*fb"b!<*fb!R<*fb!R<*fb!R;*fb#6*fb#q9*fb!S9*fb#q!<*fb!S!<T&!R"ABCQG GfQ1b12QC8a!$ ! [[_B]RT"R"$	 f 	 
 	fU3Z=>U2YPfU3ZgbkJKeBm,	.fU3Zgbk7ST:VWeBr!n-	/r   c                   . ROpV P                  \        \        \        V4      4      . RO4       V P                  \        \        \        . 4      4      . 4       V P	                  \
        \        4       V P	                  \
        \        \        P                  4       V P	                  \
        \        \        P                  R.R4       V P	                  \
        \        \        ^
R.4      4       V P	                  \        \        \        \        R.4      4       \        \        . RO4      pV P                  \        V4      . RO4       V P	                  \        \        V4       R# )r   r  Nr   r   r   r  r   r   r   r   rj  r  )r   r   r   r   r   r   r   r   r   )rv   r   	takewhiler`   r   ro   rM   r  rx   r   r   r  r:   )r4   r   r^  s   &  r   test_takewhileTestBasicOps.test_takewhile  s    (i$78)Di"56;)Y/)Y=)YugwO)T9R%+AB*dIgw,GHd./a),-q1r   c                4   . ROpV P                  \        \        \        V4      4      . RO4       V P                  \        \        \        . 4      4      . 4       V P	                  \
        \        4       V P	                  \
        \        \        P                  4       V P	                  \
        \        \        P                  R.R4       V P	                  \
        \        \        ^
R.4      4       V P	                  \        \        \        \        R.4      4       R# )r   r  Nr  )r  r   r   r   r   r  )rv   r   	dropwhiler`   r   ro   rM   r  rx   r   r   )r4   r   s   & r   test_dropwhileTestBasicOps.test_dropwhile  s    (i$78:JKi"56;)Y/)Y=)YugwO)T9R%+AB*dIgw,GHr   c           
        ^p\        . 4      w  r#V P                  \        V4      . 4       V P                  \        V4      . 4       \        \        V4      4      w  r#V P                  \	        W#4      \	        \        V4      \        V4      4      4       \        \        V4      4      w  r#V P                  \        V4      \        \        V4      4      4       V P                  \        V4      \        \        V4      4      4       \        \        V4      4      w  r#\        ^d4       F  pV P                  \        V4      V4       K   	  ?V P                  \        V4      \        \        V4      4      4       \        \        V4      4      w  r#\        ^d4       F  pV P                  \        V4      V4       K   	  ?V P                  \        V4      \        \        ^dV4      4      4       \        ^4       F  p^ .V,          ^.V,          ,           p\        P                  ! V4       . . 3p\        \        V4      4      pV F+  p\        W,          4      p	Wt,          P                  V	4       K-  	  V P                  V^ ,          \        \        V4      4      4       V P                  V^,          \        \        V4      4      4       K  	  V P                  \        \         4       V P                  \        \         ^4       V P                  \        \         ^^.R4       V P                  \        \         ^^.^R4       \        R4      w  r#\        V4      ! R4      p
V P                  \        V
4      \        R4      4       \        \        R4      ^4      w  r#p
\        ^d4       F  pV P                  \        V4      V4       K   	  V P                  \        V4      \        \        R4      4      4       V P                  \        V
4      \        V
4      .\        \        ^4      4      4       V P                  \        V4      \        \        ^dR4      4      4       V P                  \        V
4      \        \        ^R4      4      4       V P                  \        \         RR4       V P                  \        \         . R4       \        ^4       F  p\        RV4      pV P                  \        V4      \        4       V P                  \        V4      V4       T P                  V Uu. uF  p\        V4      NK  	  up\        R4      .V,          4       K  	  \        R4      w  r#\        V4      w  r\        V
4      w  rV P!                  \        W#WW04      ^8H  4       \        R4      w  pp\        V4      pV P                  \        V4       V P                  \        V^
4       V! V4      pT P!                  \        V4      \        V4      u;8H  ;'       d&    \        V4      u;8H  ;'       d    \        R4      8H  Mu 4       \        \        ^
4      4      w  r#\"        P$                  ! V4      pV P                  \'        VR4      \        V4      4       ?\(        P*                  ! 4        V P                  \,        \&        VR4       \        R4      p\        \        R4      4      p\        R4      w  r#V P                  \        \.        P.                  ! V4      4      V4       V P                  \        \.        P.                  ! V4      4      V4       \        \        \        R4      4      4      w  r#V P                  \        \.        P.                  ! V4      4      V4       V P                  \        \.        P.                  ! V4      4      V4       \        R4      w  r#\1        ^V4       \1        ^V4       V P                  \        \.        P.                  ! V4      4      VR,          4       V P                  \        \.        P.                  ! V4      4      VR	,          4       V P                  \        V4      VR,          4       V P                  \        V4      VR	,          4       \        \        R4      4      w  r#\1        ^dV4       \1        ^<V4       V P                  \        \.        P.                  ! V4      4      VR
,          4       V P                  \        \.        P.                  ! V4      4      VR,          4       V P                  \        V4      VR
,          4       V P                  \        V4      VR,          4       R# u upi )   r   r   r   r  invalid	__class__rg  :r   NNr  :r   NN:<   NNNr   )teerv   r   r.   r   r,   rx   r  shuffler   r   ro   rw   r   r   r   r   r  proxygetattrr   r  ReferenceErrorr  rJ   )r4   r-   r}   r~   r   r   orderlistsitsvaluer   r	  r   r  rr   ft1t2tnewt3rP  r  long_anss   &                      r   test_teeTestBasicOps.test_tee  s   2wa"%a"%6!9~aDq58$<=6!9~a$uQx.1a$uQx.16!9~sAT!Wa( a$uQx.16!9~sAT!Wa( a$uS!}"56qACEQCEMENN5!HEfQi.CSV&  U1XtE!H~6U1XtE!H~6  	)S))S!,)S1Q%5)S1Q%C8 5zGENa$u+. eDk1%asAT!Wa( a$uT{"34$q'47+T%(^<a$uS"78a$uQt}"56 	)S%;*c2r2qA]FT&\51S[!,v6v!d1gv6eaH	  5z1v1vQ1./145 UBBx)T*)T2."XRDHGGRGGDKGH 59~MM!K0$q':.'1kB5ke% 5zdiil+S1diil+S14e%&diil+X6diil+X6 5zQ
Q
diil+SW5diil+SW5a#b'*a#b'*5< S!Rdiil+Xd^<diil+Xc];a(4.1a(3-0c 7s   e7
c                8    R p\         P                  ! RV4       R# )zHimport typing, copyreg, itertools; copyreg.buggy_tee = itertools.tee(())z-cN)r   assert_python_ok)r4   scripts   & r   test_tee_dealloc_segfault&TestBasicOps.test_tee_dealloc_segfault5  s    4 	 	&&tV4r   c                ^    \        \        R R4      4      w  r \        V4       ?R #    ??h ; i)Ni -1)r  r   r  )r4   forwardbackwards   &  r   test_tee_del_backward"TestBasicOps.test_tee_del_backward>  s4    tX 67	L	s   ' ,c                   a  ! V3R  lR4      p\        V! 4       4      w  poV P                  \        R4      ;_uu_ 4        \        V4       RRR4       R#   + '       g   i     R# ; i)c                   8   <a  ] tR tRt o RtR tV3R ltRtV tR# )(TestBasicOps.test_tee_reenter.<locals>.IiH  Tc                    V # r   r   r3   s   &r   r5   1TestBasicOps.test_tee_reenter.<locals>.I.__iter__J  rF  r   c                T   < V P                   pR V n         V'       d   \        S4      # R# )FN)firstrx   )r4   r  r~   s   & r   r;   1TestBasicOps.test_tee_reenter.<locals>.I.__next__L  s$    

"
7N r   )r  N)	r>   r?   r@   rA   r  r5   r;   rC   rD   )rF   r~   s   @r   rd  r  H  s     E# #r   rd  r  N)r  assertRaisesRegexrl   rx   )r4   rd  r}   r~   s   &  @r   test_tee_reenterTestBasicOps.test_tee_reenterG  sG    	# 	# 13x1##L%88G 9888s    AA'	c                .  aa \         P                  ! 4       o\         P                  ! 4       o ! VV3R  lR4      p\        V! 4       4      w  r#\         P                  ! \        V.R7      pVP                  4         SP                  4        V P                  \        R4      ;_uu_ 4        \	        V4       RRR4       SP                  4        VP                  4        R#   + '       g   i     L2; i  SP                  4        TP                  4        i ; i)c                   6   <a  ] tR tRt o R tVV3R ltRtV tR# )+TestBasicOps.test_tee_concurrent.<locals>.IiZ  c                    V # r   r   r3   s   &r   r5   4TestBasicOps.test_tee_concurrent.<locals>.I.__iter__[  rF  r   c                H   < SP                  4        SP                  4        R # r   )r   wait)r4   finishr  s   &r   r;   4TestBasicOps.test_tee_concurrent.<locals>.I.__next__]  s    		r   r   N)r>   r?   r@   rA   r5   r;   rC   rD   )rF   r  r  s   @r   rd  r  Z  s      r   rd  )r  r   r  N)r  Eventr  r  rx   r  r  r  rl   r   r   )r4   rd  r}   r~   r  r  r  s   &    @@r   test_tee_concurrent TestBasicOps.test_tee_concurrentV  s    !"	 	 13x!!QC8	JJL''e<<Q = JJLKKM	 =< JJLKKMs$   ;.C2 )C5C2 C/	*C2 2"Dc           
        V P                  \        \        \        4       4       \        \
        \        \        3 FM  pV P                  \        \        V! . 4      4       V P                  \        \        V! \        4       4      4       KO  	  V P                  \        \        \        . R 4      4       V P                  \        \        \        \        4       R 4      4       \        . 4      w  r#V P                  \        \        V4       V P                  \        \        V4       \        \        4       4      w  r#V P                  \        \        V4       V P                  \        \        V4       V P                  \        \        \        R ^ 4      4       \        \        \        \        \        \         3 FQ  pV P                  \        \        V! R . 4      4       V P                  \        \        V! R \        4       4      4       KS  	  R # )Nc                     V # r   r   r   s   &r   rg   1TestBasicOps.test_StopIteration.<locals>.<lambda>  r  r   c                     V # r   r   r   s   &r   rg   r    r  r   )r   r:   rx   r   r   r  r.  r1   rH   r  r   rZ  r  r   r  r  r  )r4   r  rP  qs   &   r   test_StopIterationTestBasicOps.test_StopIterationl  sQ   -su5W-AmT1R59mT1WY<@ . 	-vb$/?@-vgi/FG2w-q1-q179~-q1-q1-vdA?+sIy'JAmT1Z3DEmT1Z3KL Kr   c                    \        R . .^4      p\        V4       \        P                  ! 4        V P	                  \        P
                  ! \        V4      4      4       R # r   )r  rx   gccollectr   
is_trackedr4   rp   s   & r   test_combinations_result_gc(TestBasicOps.test_combinations_result_gc  s?    
 4*a(R


 	d2h/0r   c                    \        R . .^4      p\        V4       \        P                  ! 4        V P	                  \        P
                  ! \        V4      4      4       R # r   )r   rx   r  r  r   r  r  s   & r   ,test_combinations_with_replacement_result_gc9TestBasicOps.test_combinations_with_replacement_result_gc  s=     +D":q9R


d2h/0r   c                    \        R . .^4      p\        V4       \        P                  ! 4        V P	                  \        P
                  ! \        V4      4      4       R # r   )r   rx   r  r  r   r  r  s   & r   test_permutations_result_gc(TestBasicOps.test_permutations_result_gc  s=     4*a(R


d2h/0r   c                    \        R . .4      p\        V4       \        P                  ! 4        V P	                  \        P
                  ! \        V4      4      4       R # r   )r&  rx   r  r  r   r  r  s   & r   test_product_result_gc#TestBasicOps.test_product_result_gc  s;     dBZ R


d2h/0r   c                    \        . .4      p\        P                  ! 4        V P                  \        P                  ! \        V4      4      4       R # r   )r&  r  r  r   r  rx   r  s   & r   test_zip_longest_result_gc'TestBasicOps.test_zip_longest_result_gc  s2     "


d2h/0r   c                    \        R R .4      p\        P                  ! 4        V P                  \        P                  ! \        V4      4      4       R # r   )rV  r  r  r   r  rx   r  s   & r   test_pairwise_result_gc$TestBasicOps.test_pairwise_result_gc  s4     tTl#


d2h/0r   c                   ^ RI HpHpHp \        \
        \        \        \        \        \        \        \        \        \        V\        \         \"        \$        \&        \(        \*        VV\,        3pV FT  pV P/                  VR7      ;_uu_ 4        V P1                  \2        R4      ;_uu_ 4        ^Vn        RRR4       RRR4       KV  	  R#   + '       g   i     L; i  + '       g   i     K~  ; i)r   )_grouper_tee_tee_dataobject)tp	immutableN)	itertoolsr)  r*  r+  r   r   r   r  r   rk  r~  r  r  r  r.  rH   rV  r   r&  r   r  r  r&  r   r  ro   foobar)r4   r)  r*  r+  datasetr,  s   &     r   test_immutable_types!TestBasicOps.test_immutable_types  s    ==)-
0 B$$++I{CC !BI D %$ CC %$$s$   C-C5CCCC/r   )r   r   NrL   )Dr>   r?   r@   rA   r   r   r   r   r   r
  r   bigaddrspacetestr  impl_detailr  r4  r8  r;  rQ  rT  rW  r_  rl  r  r  r   requires_working_threadingr  r  r  r  r  r  r  r  r-  r0  r;  rQ  rW  rj  rw  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r  cpython_onlyr  r  r  r   r#  r&  r1  rC   rD   rE   s   @r   ri   ri   U   s    '$R,@(3T7Y9Iv & &
 =>R ?R>@@ 7 7
 =>I ?I
:Ix % % =>R ?REB? 1,f>?@ 002A 3A$*PdFL&6	L-  =>< ?<(2T =>< ?<
/&2P&0d&,<F| 2 2 =>O ?O7$HB"EM/^2Iq1f5 002 3*M. 
1 
1 1 1 1 1 1 1 1 1 1 1 " "r   ri   c                      a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tRtV tR# )TestExamplesi  c                V    V P                  \        \        . RO4      4      . RO4       R# r   N)r   r   r   r   r   )r   r   r   r_   r   )rv   r   r   r3   s   &r   r   TestExamples.test_accumulate  s    j568IJr   c                \    V P                  R P                  \        RR4      4      R4       R# r   re  DEFr   N)rv   r   r   r3   s   &r   r   TestExamples.test_chain  s"    ue!45x@r   c                r    V P                  R P                  \        P                  RR.4      4      R4       R# r=  )rv   r   r   r   r3   s   &r   r   %TestExamples.test_chain_from_iterable  s*    !4!4eU^!DExPr   c           	         V P                  \        \        R ^4      4      . RO4       V P                  \        \        \        ^4      ^4      4      . RO4       R# )ABCDN)r   r   r   )r   r   r   r   )r   r   r   )r   )r   r   r   )r   r   r   r   r   r   )rv   r   r  r,   r3   s   &r   r
  TestExamples.test_combinations  sE    l6156[	]l58Q78=	?r   c                T    V P                  \        \        R ^4      4      . RO4       R# )re  N))r   r   r   rD  )r   r   rE  )r   r   )rv   r   r   r3   s   &r   r4  /TestExamples.test_combinations_with_replacement  s#    ;E1EF[	]r   c           	     f    V P                  \        \        R . RO4      4      \        R4      4       R# )r   rc  Nrh  )rv   r   rk  r3   s   &r   rl  TestExamples.test_compress  s"    hx?@$v,Or   c           	     f    V P                  \        \        \        ^
4      ^4      4      . RO4       R# )r_   N)r_   r  r  r  r  )rv   r   rH   r~  r3   s   &r   r  TestExamples.test_count  s#    fU2Y235IJr   c           	     t    V P                  \        \        \        R 4      ^4      4      \        R4      4       R# )rC  ABCDABCDABCDN)rv   r   rH   r  r3   s   &r   r  TestExamples.test_cycle  s'    fU6]B78$~:NOr   c           	     Z    V P                  \        \        R  . RO4      4      . RO4       R# )c                     V ^8  # r   r   r   s   &r   rg   -TestExamples.test_dropwhile.<locals>.<lambda>      !A#r   Nr   r   r   r   r   )r   r   r   )rv   r   r  r3   s   &r   r  TestExamples.test_dropwhile  s    i{CDgNr   c           	     N   T P                  \        R 4       UUu. uF  w  rVNK	  	  upp\        R4      4       T P                  \        R4       UUu. uF  w  r\        V4      NK  	  upp\        R4      \        R4      \        R4      \        R4      .4       R# u uppi u uppi )AAAABBBCCDAABBBABCDAB
AAAABBBCCDAAAABBBCCr   N)rv   r.  r   )r4   r1  r  s   &  r   r  TestExamples.test_groupby  s    0A(BC(B!(BCh	)0EF0E470EFv,UT$ZcK	M DFs   B
B!
c           
     h    V P                  \        \        R  \        ^
4      4      4      . RO4       R# )c                     V ^,          # r\   r   r   s   &r   rg   *TestExamples.test_filter.<locals>.<lambda>  s    qsr   N)r   r   r   r   r   )rv   r   rZ  r,   r3   s   &r   r  TestExamples.test_filter  s"    f]E"I>?Mr   c           
     h    V P                  \        \        R  \        ^
4      4      4      . RO4       R# )c                     V ^,          # r\   r   r   s   &r   rg   /TestExamples.test_filterfalse.<locals>.<lambda>  s    AaCr   N)r   r   r   r   r   )rv   r   r  r,   r3   s   &r   r  TestExamples.test_filterfalse  s"    k-rCDkRr   c           	     ^    V P                  \        \        \        RR4      4      . RO4       R# )r   N)r   r   r_   )r   r   r       r   rq  )rv   r   r   r  r3   s   &r   r  TestExamples.test_map  s     c#x9:MJr   c           
     ~   V P                  \        \        R ^4      4      \        R4      4       V P                  \        \        R ^^4      4      \        R4      4       V P                  \        \        R ^R4      4      \        R4      4       V P                  \        \        R ^ R^4      4      \        R4      4       R# r   ABCDNCDEFGACEG)rv   r   rH   r3   s   &r   r  TestExamples.test_islice  s    fY23T$Z@fY156T
CfY4894=IfY4;<d6lKr   c                T    V P                  \        \        R R4      4      RR.4       R# )rC  xyNr   r   r   r  )rv   r   r   r3   s   &r   r  TestExamples.test_zip  s#    c&$/0:z2JKr   c           
     X    V P                  \        \        R RRR7      4      . RO4       R# )rC  rt  -r#  N)ru  rv  )r   ry  )r   ry  )rv   r   r&  r3   s   &r   test_zip_longestTestExamples.test_zip_longest  s$    k&$#FGI	Kr   c           
         V P                  \        \        R ^4      4      \        \        \        RP                  4       4      4      4       V P                  \        \        \        ^4      4      4      . RO4       R# )rC  z#AB AC AD BA BC BD CA CB CD DA DB DCN)r   )r   r   r   )r   r   r   )r   r   r   )r   r   r   )r   r   r   )rv   r   r   r   r   splitr,   r3   s   &r   rQ  TestExamples.test_permutations  sZ    l6156c%)N)T)T)VWX	Zl5845O	Qr   c           
         V P                  \        \        R R4      4      \        \        \        RP                  4       4      4      4       V P                  \        \        \        ^4      ^R7      4      . RO4       R# )rC  rt  zAx Ay Bx By Cx Cy Dx Dyr#  N)r  )r   r   r   )r   r   r   )r   r   r   )r   r   r   ri  )r   r   r   r  )rv   r   r&  r   r   r}  r,   r3   s   &r   r  TestExamples.test_product  s]    gfd34c%)B)H)H)JKL	NgeAhq9:=	>r   c                T    V P                  \        \        ^
^4      4      . RO4       R# )r_   N)r_   r_   r_   )rv   r   r   r3   s   &r   r  TestExamples.test_repeat!  s    fRm,l;r   c           	     `    V P                  \        \        \        . RO4      4      . RO4       R# )r   N))r   r   r   r   r  ri  )rv   r   r  r  r3   s   &r   test_stapmapTestExamples.test_stapmap$  s"    gc+ABC&	(r   c           	     Z    V P                  \        \        R  . RO4      4      ^^.4       R# )c                     V ^8  # rS  r   r   s   &r   rg   -TestExamples.test_takewhile.<locals>.<lambda>)  rU  r   NrV  )rv   r   r  r3   s   &r   r  TestExamples.test_takewhile(  s"    i{CDqeLr   r   N)r>   r?   r@   rA   r   r   r   r
  r4  rl  r  r  r  r  r  r  r  r  r  rz  rQ  r  r  r  r  rC   rD   rE   s   @r   r8  r8    s     KAQ?]PKPOMNSKLLKQ><(M Mr   r8  c                   H   a  ] tR tRt o R tR t]R 4       tR tR t	Rt
V tR# )	TestPurePythonRoughEquivalentsi,  c           
        R  p\        . RO. RO4       Fs  w  r#V P                  W#R7      ;_uu_ 4         R\        \        W#4      4      rT R\        V! W#4      4      rV P                  WX4       V P                  WG4       RRR4       Ku  	  R#   \         d   p\        T4      RrT Rp?L_Rp?ii ; i  \         d   p\        T4      Rr Rp?LpRp?ii ; i  + '       g   i     K  ; i)c              3     "   V^8  d   \        R4      h\        V 4      p\        \        W!4      4      ;p'       d   Vx  K"  R# 5i)zBBatch data into tuples of length n. The last batch may be shorter.zn must be at least oneN)r   r  r   rH   )rP   r-   rp   r   s   &&  r   batched_recipeJTestPurePythonRoughEquivalents.test_batched_recipe.<locals>.batched_recipe/  sA      1u !9::hB //%/ 0s   AAN)rP   r-   )	r   r}   r   r   r   r  r   r  N)r   r   r   r   r   r   r   r   r   r   r   N)r&  r   r   r   r  rw   rv   )	r4   r  rP   r-   e1r  rr   e2r  s	   &        r   test_batched_recipe2TestPurePythonRoughEquivalents.test_batched_recipe.  s    	 #R8:KH x55+!4(<#=+!4x(C#D   (  ( 65: ! +!!Wd+ ! +!!Wd+ 655sX   CBB1"CB.	B)	$C)B.	.C1C	<C	CC	CC&c                	  aaa RR loV P                  . \        S! . 4      4      4       V P                  . \        S! . \        R7      4      4       V P                  \        \        S! R. 4      4        T P                  \        SRR ^
4       . ROp. pS! TR 4       F7  w  r4T F,  pT P                  Y5^ ,          4       TP                  T4       K.  	  K9  	  T P                  Y4       . pS! T\        4       Fe  w  r4S! T\        4       FO  w  rgT FD  pT P                  Y5^ ,          4       T P                  Ye^,          4       TP                  T4       KF  	  KQ  	  Kg  	  T P                  Y4       S! T\        4       UUu. uF  w  r4TNK	  	  ppp\        T U	u. uF  q^ ,          NK  	  up	4      p
T P                  \        T4      T
4       T P                  \        T4      \        T
4      4       \        \        R\        ^	4      4      4      pS! T\        4      p\        T4      w  r\        T4      w  r\        T4      w  rT P                  \        T4      . 4       T P                  \        T4      . 4       T P                  \        T4      R4       \        T4       T P                  \        T4      . 4       RpS! \        T4      4       UUu. uF  w  r4TNK	  	  p	ppT P                  T	. RO4       S! \        T4      4       UUu. uF%  w  r4\        \        T^^4      4      '       g   K#  TNK'  	  p	ppT P                  T	. RO4       S! \        T4      4       UUu. uF  w  r4\        \        T4      4      T3NK  	  p	ppT P                  T	. RO4       \        S! \        T4      4       UUu. uF  w  r4\        \        T4      4      T3NK  	  uppRR	7      R
,          p	T P                  T	. RO4        ! R R\        4      oRT3R llpR \        3T3R llpT P                  STT! ^ 4      4       T P                  STT! ^4      4        ! T3R lR4      pT! 4       T! 4       R .pT P                  STT\        R7       T P                  STT4       TT3R lo^ Sn        T P                  STR .S4       ^Sn        T P                  STR R .S4       R # u uppi u up	i u uppi u uppi u uppi u uppi )Nc              3      aaaa	a
"   Vf   R MTo
\        V 4      o	RoVVVV	V
3R lp \        S	4      oS
! S4      oS'       g%   SpT! T4      pST3x  ST8X  g   K!  T F  pK  	  K,  R #   \         d     R # i ; i5i)Nc                     V # r   r   r   s   &r   rg   UTestPurePythonRoughEquivalents.test_groupby_recipe.<locals>.groupby.<locals>.<lambda>P  s    r   Fc              3   Z   <"   Sx  S F  oS! S4      oSV 8w  d    R # Sx  K  	  RoR # 5i)NTr   )
target_keycurr_key
curr_value	exhaustediteratorr  s   &r   r)  UTestPurePythonRoughEquivalents.test_groupby_recipe.<locals>.groupby.<locals>._grouperT  s8       "*J&z2H:-$$	 #+
 !	s   (+)r  rx   r:   )rP   r  r)  r  
curr_groupr  r  r  r  r  r  s   &&    @@@@@r   r.  CTestPurePythonRoughEquivalents.test_groupby_recipe.<locals>.groupbyL  s      (+{{GH~HI! !!(^
 z*H%
%j1

**z)' (  	 ! s3   !A<A* A<A<A<*A95A<8A99A<r  r   c                     V # r   r   r   s   &r   rg   DTestPurePythonRoughEquivalents.test_groupby_recipe.<locals>.<lambda>u  r  r   c                     V ^ ,          # rV   r   rW   s   &r   rg   r  {  r  r   r  r  Tr  r  c                       ] tR tRtRtR# )ITestPurePythonRoughEquivalents.test_groupby_recipe.<locals>.ExpectedErrori  r   Nr  r   r   r   r  r    r  r   r  c              3   <   <"   \        V 4       F  pR x  K	  	  Sh5ir  r+   r  s   & r   r  ITestPurePythonRoughEquivalents.test_groupby_recipe.<locals>.delayed_raise  r  r  c                 T   < S! W4       UUu. uF  w  r4V! V4      NK  	  upp# u uppi r   r   )rP   r  r  r1  r  r.  s   &&&  r   r  @TestPurePythonRoughEquivalents.test_groupby_recipe.<locals>.gulp  s(    (/(?@(?DG(?@@@s   $c                   .   <a  ] tR tRt o V3R ltRtV tR# )DTestPurePythonRoughEquivalents.test_groupby_recipe.<locals>.DummyCmpi  c                   < Shr   r   r  s   &&r   r  KTestPurePythonRoughEquivalents.test_groupby_recipe.<locals>.DummyCmp.__eq__  r  r   r   Nr  r  s   @r   r  r    r  r   r  r  c                 `   < SP                   ^ 8  d   S;P                   ^,          un         V # ShrV   r  r  s   &r   r  CTestPurePythonRoughEquivalents.test_groupby_recipe.<locals>.keyfunc  r  r   r   r  r  r  r  r  r  rV   )rv   r   r  r   ro   r   rY   r]   r   r   r   r,   rx   r   rH   r  r  )r4   re   r  r1  r  r  r  r  r  rX   r  rp   r  r  r  r  r  r  r  r  r.  r  s   &                  @@@r   test_groupby_recipe2TestPurePythonRoughEquivalents.test_groupby_recipeH  sF   	F 	T'"+./T'"""567)T75"+=> 	)WeZD.A}-DA  G,

4   . 	  Au%DA!!V,D$$QQ0$$Ra1JJt$  - & 	  &a/0/da/0!,!QaDD!,-TL1TC$56 [%(+,QRRRb2&b2&b8,Rb2& "6!9-.-41Q-.56"6!9-E-41fQqm1DQQ-EO,+26!9+=>+=41c$q'lA+=>NO76!93EF3E41Sa\A&3EFPTUVXY:;	I 		  !%4 	A 	-}Q/?@-}Q/?@	$ 	$ ZT* 	-qr:-q1	$ -vw?-d|WEO 1,( / F ? Gs*   SSS#
 S)/S) !S/1!S5
c              '  ~  "   \        V!  pVP                  f   ^ MVP                  pVP                  pVP                  f   ^MVP                  pV^ 8  g   Ve   V^ 8  g   V^ 8:  d   \        hVf   \        4       M\        \        W44      4      pTp\        W`4       F  w  rW8X  g   K  V	x  Wu,          pK  	  R # 5ir   )	slicer  rt   r  r   r~  r,   r   r   )
rP   r   re   r  rt   r  r   next_ir   r   s
   &*        r   rH   %TestPurePythonRoughEquivalents.islice  s      4LWW_!''vvFFNq19)dQh419!\%'uS5E/Fg0JA{ 1s   B$B=+B=c           
     .   V P                  \        V P                  R ^4      4      \        R4      4       V P                  \        V P                  R ^^4      4      \        R4      4       V P                  \        V P                  R ^R4      4      \        R4      4       V P                  \        V P                  R ^ R^4      4      \        R4      4       \        \	        ^
4      4      pV P                  \        V P                  V^4      4      \        \	        ^4      4      4       V P                  \        V4      \        \	        ^^
4      4      4       \        \	        ^
4      4      pV P                  \        V P                  V^^4      4      . 4       V P                  \        V4      \        \	        ^^
4      4      4       \        4       pV P                  \        V P                  V^^^24      4      ^.4       V P                  \        V4      ^4       R# rm  )rv   r   rH   r  r,   r~  rx   )r4   rp   r   s   &  r   test_islice_recipe1TestPurePythonRoughEquivalents.test_islice_recipe  s}   dkk)Q78$t*Edkk)Q:;T$ZHdkk)Q=>WNdkk)Qa@A4<P%)_dkk"a014a>Bb4a#56%)_dkk"a34b9b4a#56Gdkk!Q267!=a!$r   c           
       a RV3R llp ! V3R lR4      o^pV! . 4      w  r4V P                  \        V4      . 4       V P                  \        V4      . 4       V! \        V4      4      w  r4V P                  \        W44      \        \	        V4      \	        V4      4      4       V! \        V4      4      w  r4V P                  \        V4      \        \	        V4      4      4       V P                  \        V4      \        \	        V4      4      4       V! \        V4      4      w  r4\	        ^d4       F  pV P                  \        V4      V4       K   	  ?V P                  \        V4      \        \	        V4      4      4       V! \        V4      4      w  r4\	        ^d4       F  pV P                  \        V4      V4       K   	  ?V P                  \        V4      \        \	        ^dV4      4      4       \	        ^4       F  p^ .V,          ^.V,          ,           p\        P                  ! V4       . . 3pV! \        V4      4      p	V F+  p\        W,          4      p
W,          P                  V
4       K-  	  V P                  V^ ,          \        \	        V4      4      4       V P                  V^,          \        \	        V4      4      4       K  	  V P                  \        V4       V P                  \        V^4       V P                  \        V^^.R4       V P                  \        V^^.^R4       V! R4      w  r4\        V4      ! R4      pV P                  \        V4      \        R4      4       V! \	        R4      ^4      w  r4p\	        ^d4       F  pV P                  \        V4      V4       K   	  V P                  \        V4      \        \	        R4      4      4       V P                  \        V4      \        V4      .\        \	        ^4      4      4       V P                  \        V4      \        \	        ^dR4      4      4       V P                  \        V4      \        \	        ^R4      4      4       V P                  \        VRR4       V P                  \        V. R4       \	        ^4       F  pV! RV4      pV P                  \        V4      \        4       V P                  \        V4      V4       T P                  V Uu. uF  p\        V4      NK  	  up\        R4      .V,          4       K  	  V! R4      w  r4V! V4      w  rV! V4      w  ppV P                  \        W4WVV04      ^8H  4       V! R4      w  pp\        V4      pV P                  \        V4       V P                  \        V^
4       V! V4      pT P                  \        V4      \        V4      u;8H  ;'       d&    \        V4      u;8H  ;'       d    \        R4      8H  Mu 4       V! \	        ^
4      4      w  r4\         P"                  ! V4      pV P                  \%        VR	4      \        V4      4       ?\&        P(                  ! 4        V P                  \*        \$        VR	4       \        R4      p\        \	        R
4      4      p T! \1        RR4      4      w  pp \3        T4       ?R# u upi    ??h ; i)r   c                    < V^ 8  d   \         hV^ 8X  d   R# S! V 4      pV.p\        V^,
          4       F  pVP                  S! V4      4       K  	  \        V4      # )r   r   )r   r,   r   r   )rP   r-   r  r	  r  r*  s   &&   r   r  ;TestPurePythonRoughEquivalents.test_tee_recipe.<locals>.tee  sX    1u  Av	H~HZF1q5\d8n- "= r   c                   :   <a  ] tR tRt o V3R ltR tR tRtV tR# )<TestPurePythonRoughEquivalents.test_tee_recipe.<locals>._teei  c                   < \        V4      p\        VS4      '       d%   VP                  V n        VP                  V n        R # W n        R R .V n        R # r   )r  rm   r  link)r4   rP   rp   r*  s   && r   rB  ETestPurePythonRoughEquivalents.test_tee_recipe.<locals>._tee.__init__  s?    (^b$''$&KKDM "DI$&M!%tDIr   c                    V # r   r   r3   s   &r   r5   ETestPurePythonRoughEquivalents.test_tee_recipe.<locals>._tee.__iter__  rF  r   c                    V P                   pV^,          f    \        V P                  4      V^ &   RR.V^&   Vw  q n         V# rs  )r  rx   r  )r4   r  r  s   &  r   r;   ETestPurePythonRoughEquivalents.test_tee_recipe.<locals>._tee.__next__  sB    yy7?"4==1DG#TlDG#' yr   )r  r  NrI  )rF   r*  s   @r   r*  r    s     - r   r*  r   r   r   r  r  r  rg  Nr\   r   )rv   r   r.   r   r,   rx   r  r  r   r   ro   rw   r   r   r   r   r  r  r  r  r  r  r  rJ   r   r  )r4   r  r-   r}   r~   r   r   r  r  r  r  r   r	  r   r  rr   r  r  r  r  r  rP  r  r  r  r  r*  s   &                         @r   test_tee_recipe.TestPurePythonRoughEquivalents.test_tee_recipe  sM   		!	 	0 2wa"%a"%6!9~aDq58$<=6!9~a$uQx.1a$uQx.16!9~sAT!Wa( a$uQx.16!9~sAT!Wa( a$uS!}"56qACEQCEMENN5!HEfQi.CSV&  U1XtE!H~6U1XtE!H~6  	)S))S!,)S1Q%5)S1Q%C8 5zGENa$u+. eDk1%asAT!Wa( a$uT{"34$q'47+T%(^<a$uS"78a$uQt}"56 	)S%;*c2r2qA]FT&\51S[!,v6v!d1gv6eaH	  5z1v1v1Q1A./145 UBBx)T*)T2."XRDHGGRGGDKGH 59~MM!K0$q':


.'1kB5ke% 4  tT 23	Ls 7t	s   >[
[ [r   N)r>   r?   r@   rA   r  r  staticmethodrH   r  r  rC   rD   rE   s   @r   r  r  ,  s7     )4KF\  (%$c cr   r  c                      a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tRtV tR# )TestGCi  c                B    VP                  V4       \        V4       ??R # r   )r   rx   )r4   r  	containers   &&&r   	makecycleTestGC.makecycle  s    "Xxr   c                H    . pV P                  \        ^^V^.4      V4       R# rs  )r  r   r4   r}   s   & r   r   TestGC.test_accumulate  s"    z1Qq),a0r   c                J    . pV P                  \        ^^V^.^4      V4       R# rs  )r  r   r  s   & r   r   TestGC.test_batched  s$    w!Aay!,a0r   c                @    . pV P                  \        V4      V4       R # r   )r  r   r  s   & r   r   TestGC.test_chain  s    uQx#r   c                V    . pV P                  \        P                  V.4      V4       R # r   )r  r   r   r  s   & r   r   TestGC.test_chain_from_iterable  s"    u**A3/3r   c                J    . pV P                  \        ^^V^.^4      V4       R# rs  )r  r  r  s   & r   r
  TestGC.test_combinations  $    |Qq1Iq115r   c                J    . pV P                  \        ^^V^.^4      V4       R# rs  )r  r   r  s   & r   r4  )TestGC.test_combinations_with_replacement  s%    4a!AYBAFr   c                F    . pV P                  \        R . RO4      V4       R# )r   N)r   r   r   r   r   r   )r  rk  r  s   & r   rl  TestGC.test_compress  s    x-8!<r   c                    . p\        R \        3\        VR7      4      pV P                  \	        V! ^ 4      V! ^4      4      V4       R# )Intr   N)rw   r   r  r  r~  )r4   r}   r  s   &  r   r  TestGC.test_count  s8    53&$),uSVSV,a0r   c                P    . pV P                  \        V.^,          4      V4       R# r   N)r  r  r  s   & r   r  TestGC.test_cycle  s    uaSU|Q'r   c                N    . pV P                  \        \        ^ W.4      V4       R# r|  )r  r  r  r  s   & r   r  TestGC.test_dropwhile  s     y1y115r   c                T    . pV P                  \        V.^,          R 4      V4       R# )r   c                     V # r   r   r   s   &r   rg   %TestGC.test_groupby.<locals>.<lambda>  s    qr   N)r  r.  r  s   & r   r  TestGC.test_groupby  s"    ws1uj115r   c                    ^
pR p\        \        V4      VR7       F0  w  r4VP                  P                  R. 4      P	                  V4       K2  	  R# )r_   c                     V # r   r   r   s   &r   rg   'TestGC.test_issue2246.<locals>.<lambda>  s    Ar   r  r   N)r.  r,   __dict__
setdefaultr   )r4   r-   r  r   r   s   &    r   test_issue2246TestGC.test_issue2246  sD    E!H'2DA''B/66q9 3r   c                T    . pV P                  \        R  V.^,          4      V4       R# )c                     R # )Tr   r   s   &r   rg   $TestGC.test_filter.<locals>.<lambda>  s    tr   N)r  rZ  r  s   & r   r  TestGC.test_filter  s"    vmaSU3Q7r   c                D    . pV P                  \        R  V4      V4       R# )c                     R # )Fr   r   s   &r   rg   )TestGC.test_filterfalse.<locals>.<lambda>  s    Er   N)r  r  r  s   & r   r  TestGC.test_filterfalse  s    {>15q9r   c                b    . pV P                  \        V.^,          V.^,          4      V4       R# r  )r  r   r  s   & r   r  TestGC.test_zip  s(    sA3q51#a%(!,r   c                    . pV P                  \        V.^,          V.^,          4      V4       VR.pV P                  \        V.^,          V.^,          VR7      V4       R# )r   Nr#  )r  r&  )r4   r}   r~   s   &  r   rz  TestGC.test_zip_longest  sT    {A3q51#a%0!4I{A3q51#a%1=qAr   c                T    . pV P                  \        R  V.^,          4      V4       R# )c                     V # r   r   r   s   &r   rg   !TestGC.test_map.<locals>.<lambda>  s    Ar   N)r  r   r  s   & r   r  TestGC.test_map  s"    s:s1u-q1r   c                R    . pV P                  \        V.^,          R4      V4       R# r  )r  rH   r  s   & r   r  TestGC.test_islice  s"    vqc!eT*A.r   c                P    . pV P                  \        V.^,          4      V4       R# )r   N)r  rV  r  s   & r   rW  TestGC.test_pairwise  s    xA*r   c                J    . pV P                  \        ^^V^.^4      V4       R# rs  )r  r   r  s   & r   rQ  TestGC.test_permutations  r  r   c                L    . pV P                  \        ^^V^.^R7      V4       R# )r   r#  N)r  r&  r  s   & r   r  TestGC.test_product   s$    w!Aay3Q7r   c                @    . pV P                  \        V4      V4       R # r   )r  r   r  s   & r   r  TestGC.test_repeat  s    vay!$r   c                V    . pV P                  \        R  W3.^,          4      V4       R# )c                      V # r   r   )r^  s   *r   rg   %TestGC.test_starmap.<locals>.<lambda>
  s    !r   N)r  r  r  s   & r   r  TestGC.test_starmap  s$    w|qeWQY7;r   c           	     P    . pV P                  \        \        ^^ W.4      V4       R# rs  )r  r  r  r  s   & r   r  TestGC.test_takewhile  s"    y1a|4a8r   r   N)r>   r?   r@   rA   r  r   r   r   r   r
  r4  rl  r  r  r  r  r  r  r  r  rz  r  r  rW  rQ  r  r  r  r  rC   rD   rE   s   @r   r  r    s      
11$46G=1
(66:8:-B2/+68%<9 9r   r  c              #  (   "   V  F  pVx  K	  	  R# 5i)zRegular generatorNr   seqnr   s   & r   Rr    s      r!   c                   0   a  ] tR tRt o RtR tR tRtV tR# )r   i  zSequence using __getitem__c                    Wn         R # r   r  r4   r  s   &&r   rB  
G.__init__  s    	r   c                (    V P                   V,          # r   r  )r4   r   s   &&r   __getitem__G.__getitem__  s    yy|r   r  N)	r>   r?   r@   rA   rB   rB  r  rC   rD   rE   s   @r   r   r     s       r   r   c                   6   a  ] tR tRt o RtR tR tR tRtV t	R# )rd  i  z Sequence using iterator protocolc                     Wn         ^ V n        R# r|  r  r  s   &&r   rB  
I.__init__      	r   c                    V # r   r   r3   s   &r   r5   
I.__iter__!  r7   r   c                    V P                   \        V P                  4      8  d   \        hV P                  V P                   ,          pV ;P                   ^,          un         V# rL   r   r   r  r:   r4   r2  s   & r   r;   
I.__next__#  ?    66S^#=%8IIdff!r   r   r  N
r>   r?   r@   rA   rB   rB  r5   r;   rC   rD   rE   s   @r   rd  rd    s     & r   rd  c                   0   a  ] tR tRt o RtR tR tRtV tR# )Igi)  z9Sequence using iterator protocol defined with a generatorc                     Wn         ^ V n        R# r|  r  r  s   &&r   rB  Ig.__init__+  r!  r   c              #  <   "   V P                    F  pVx  K	  	  R # 5ir   r  r  s   & r   r5   Ig.__iter__.  s     99CI s   r)  N	r>   r?   r@   rA   rB   rB  r5   rC   rD   rE   s   @r   r,  r,  )  s     ? r   r,  c                   0   a  ] tR tRt o RtR tR tRtV tR# )r!  i2  z Missing __getitem__ and __iter__c                     Wn         ^ V n        R# r|  r  r  s   &&r   rB  
X.__init__4  r!  r   c                    V P                   \        V P                  4      8  d   \        hV P                  V P                   ,          pV ;P                   ^,          un         V# rL   r%  r&  s   & r   r;   
X.__next__7  r(  r   r)  N)	r>   r?   r@   rA   rB   rB  r;   rC   rD   rE   s   @r   r!  r!  2  s     & r   r!  c                   0   a  ] tR tRt o RtR tR tRtV tR# )Ni=  zIterator missing __next__()c                     Wn         ^ V n        R# r|  r  r  s   &&r   rB  
N.__init__?  r!  r   c                    V # r   r   r3   s   &r   r5   
N.__iter__B  r7   r   r)  Nr1  rE   s   @r   r8  r8  =  s     ! r   r8  c                   6   a  ] tR tRt o RtR tR tR tRtV t	R# )r   iE  zTest propagation of exceptionsc                     Wn         ^ V n        R# r|  r  r  s   &&r   rB  
E.__init__G  r!  r   c                    V # r   r   r3   s   &r   r5   
E.__iter__J  r7   r   c                    ^^ ,           R# r   Nr   r3   s   &r   r;   
E.__next__L  s    	Qr   r)  Nr*  rE   s   @r   r   r   E  s     $ r   r   c                   6   a  ] tR tRt o RtR tR tR tRtV t	R# )E2iO  z3Test propagation of exceptions after two iterationsc                     Wn         ^ V n        R# r|  r  r  s   &&r   rB  E2.__init__Q  r!  r   c                    V # r   r   r3   s   &r   r5   E2.__iter__T  r7   r   c                    V P                   ^8X  d   \        hV P                  V P                   ,          pV ;P                   ^,          un         V# r\   )r   ZeroDivisionErrorr  r&  s   & r   r;   E2.__next__V  s7    66Q;##IIdff!r   r)  Nr*  rE   s   @r   rF  rF  O  s     9 r   rF  c                   6   a  ] tR tRt o RtR tR tR tRtV t	R# )Si]  zTest immediate stopc                    R # r   r   r  s   &&r   rB  
S.__init___  s    r   c                    V # r   r   r3   s   &r   r5   
S.__iter__a  r7   r   c                    \         hr   r9   r3   s   &r   r;   
S.__next__c  r=   r   r   Nr*  rE   s   @r   rO  rO  ]  s      r   rO  c                d    \        \        R \        \        \	        V 4      4      4      4      4      # )z Test multiple tiers of iteratorsc                     V # r   r   r   s   &r   rg   L.<locals>.<lambda>h  s    ar   )r   r   r  r,  r   r  s   &r   LrY  f  s     Z2ag;011r   c                      a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tRtV tR# )TestVariousIteratorArgsik  c           
        . ROp. ROp\        V4      p\        \        \        \        \
        3 F-  pV P                  \        \        V! V4      4      4      V4       K/  	  V P                  \        \        \        V4      4      4      . 4       V P                  \        \        \        V4      4       V P                  \        \        \        V4      4       V P                  \        \        \        \        V4      4      4       R# r:  )r   r   rd  r,  rY  r  rv   r   r   rO  r   ro   r!  r8  rL  r   r4   re   rX   r-   r  s   &    r   r   'TestVariousIteratorArgs.test_accumulatem  s    FQAq!AT*QqT"23Q7 "j1./4)Z16)Z16+T:ad3CDr   c                   R p. ROp^p\         \        \        \        \        3 FQ  pV P                  VR7      ;_uu_ 4        V P                  \        \        V! V4      V4      4      V4       RRR4       KS  	  V P                  \        \        \        V4      ^4      4      . 4       V P                  \        \        \        V4      ^4       V P                  \        \        \        V4      ^4       V P                  \        \        \        \        V4      ^4      4       V P                  \        \        \        \!        V4      ^4      4       R#   + '       g   i     EK=  ; i)r  )r  N)rT  rU  )rr   )r   rd  r,  rY  r  r   rv   r   r   rO  r   ro   r!  r8  rL  r   rF  r]  s   &    r   r   $TestVariousIteratorArgs.test_batchedx  s    ,QAq!A""  gadA&6!7; #" " 	gadA./4)WadA6)WadA6+T71Q43CD+T72a5!3DE #""s   ,EE!c                   R R\        R4      R\        RR^4      3 EFA  p\        \        \        \        \
        \        3 F  pV P                  \        \        V! V4      4      4      \        V! V4      4      4       V P                  \        \        V! V4      V! V4      4      4      \        V! V4      4      \        V! V4      4      ,           4       K  	  V P                  \        \        \        \        V4      4      4       V P                  \        \        \        \        V4      4      4       V P                  \        \        \        \        V4      4      4       EKD  	  R# 123r   rq  r    Ndog333333?)r,   r   rd  r,  rO  rY  r  rv   r   r   r   ro   r!  r8  rL  r   r4   re   r  s   &  r   r   "TestVariousIteratorArgs.test_chain  s    U4[+uT$q7IJAB1a(  eAaDk!2D1J?  eAaD!A$&7!8$qt*T!A$Z:OP ) iuQqT{;iuQqT{;/uQqT{C Kr   c                ^   R R\        R4      R\        RR^4      3 EF  p\        V4      p\        \        \        \
        \        \        3 FF  pV P                  \        \        V! V4      \        ^4      4      4      \        V! V4      4      4       KH  	  V P                  \        \        \        V4      \        ^4      4       V P                  \        \        \        V4      \        ^4      4       V P                  \         \        \        \#        V4      \        ^4      4      4       EK  	  R# rb  )r,   r   r   rd  r,  rO  rY  r  rv   r   rk  r   r   ro   r!  r8  rL  r   )r4   re   r-   r  s   &   r   rl  %TestVariousIteratorArgs.test_compress  s    U4[+uT$q7IJAAAB1a(  hqtVAY&?!@$qt*M )i1Q4Ci1Q4C/x!fQi7PQ Kr   c           	     "   R R\        R4      R\        RR^4      3 Fo  pV P                  \        \        \	        V4      4       V P                  \        \        \        V4      4       V P                  \        \        \        V4      4       Kq  	  R# rb  )r,   r   ro   r&  r!  r8  rL  r   )r4   re   s   & r   r  $TestVariousIteratorArgs.test_product  sh    U4[+uT$q7IJAi!A$7i!A$7/!A$? Kr   c                B   R R\        R4      R\        RR^4      3 F  p\        \        \        \        \
        \        3 Fb  p\        V4      ^,          p\        V! V4      4      ^,          p\        \        \        V! V4      4      V4      4      pV P                  WT4       Kd  	  V P                  \        \        \        V4      4       V P                  \        \        \        V4      4       V P                  \         \        \        \#        V4      4      4       EK  	  R# rb  )r,   r   rd  r,  rO  rY  r  r   r   rH   r  rv   r   ro   r!  r8  rL  r   )r4   re   r  tgtlenre  actuals   &     r   r  "TestVariousIteratorArgs.test_cycle  s    U4[+uT$q7IJAB1a(Q!!:a<fU1Q4[&9:  2	 )
 i!5i!5/uQqT{C Kr   c           
     :   \        ^
4      \        ^ 4      \        R4      R\        RR^4      3 F  p\        \        \        \        \
        \        3 FG  pT P                  \        V! V4      4       UUu. uF  w  r4VNK	  	  upp\        V! V4      4      4       KI  	  V P                  \        \        \        V4      4       V P                  \        \        \        V4      4       V P                  \        \        \        \        V4      4      4       K  	  R# u uppi r_   rq  r  rd  Nr   r  )r,   r   rd  r,  rO  rY  r  rv   r.  r   r   ro   r!  r8  rL  r   )r4   re   r  r1  sbs   &    r   r  $TestVariousIteratorArgs.test_groupby  s    )U1XuT{FE$tA<NOAB1a(  1!?!!?adL )i!A$7i!A$7/wqt}E P!?s   3Dc                   \        ^
4      \        ^ 4      \        R4      R\        RR^4      3 EF  p\        \        \        \        \
        \        3 F[  pT P                  \        \        \        V! V4      4      4      V! V4       Uu. uF  p\        V4      '       g   K  VNK  	  up4       K]  	  V P                  \        \        \        \        V4      4       V P                  \        \        \        \        V4      4       V P                  \        \        \        \        \!        V4      4      4       EK
  	  R# u upi rr  )r,   r   rd  r,  rO  rY  r  rv   r   rZ  r$   r   ro   r!  r8  rL  r   r4   re   r  r   s   &   r   r  #TestVariousIteratorArgs.test_filter  s    )U1XuT{FE$tA<NOAB1a(  fVQqT&:!;-.qT!?TVAY!!T!?A ) i1>i1>/vfad7KL P "@   D< D<c                   \        ^
4      \        ^ 4      \        R4      R\        RR^4      3 EF  p\        \        \        \        \
        \        3 F[  pT P                  \        \        \        V! V4      4      4      V! V4       Uu. uF  p\        V4      '       g   K  VNK  	  up4       K]  	  V P                  \        \        \        \        V4      4       V P                  \        \        \        \        V4      4       V P                  \         \        \        \        \#        V4      4      4       EK
  	  R# u upi rr  )r,   r   rd  r,  rO  rY  r  rv   r   r  r$   r'   r   ro   r!  r8  rL  r   rw  s   &   r   r  (TestVariousIteratorArgs.test_filterfalse  s    )U1XuT{FE$tA<NOAB1a(  k&!A$&?!@-.qT!>TU1X!!T!>@ ) ifadCifadC/{61Q47PQ P "?ry  c                   R R\        R4      R\        RR^4      3 EF   p\        \        \        \        \
        \        3 F  pV P                  \        \        V! V4      4      4      \        V! V4      4      4       V P                  \        \        V! V4      V! V4      4      4      \        V! V4      V! V4      4      4       K  	  V P                  \        \        \        V4      4       V P                  \        \        \        V4      4       V P                  \        \        \        \!        V4      4      4       EK#  	  R# rb  )r,   r   rd  r,  rO  rY  r  rv   r   r   r   r   ro   r!  r8  rL  r   rg  s   &  r   r   TestVariousIteratorArgs.test_zip  s    U4[+uT$q7IJAB1a(  c!A$i$qt*=  c!A$!o!6QqT1Q48HI ) iad3iad3/s1Q4yA Kr   c                   R R\        R4      R\        RR^4      3 EF2  p\        \        \        \        \
        \        3 F  pV P                  \        \        V! V4      4      4      \        \        V! V4      4      4      4       V P                  \        \        V! V4      V! V4      4      4      \        \        V! V4      V! V4      4      4      4       K  	  V P                  \        \        \        V4      4       V P                  \        \        \        V4      4       V P                  \        \        \        \!        V4      4      4       EK5  	  R# rb  )r,   r   rd  r,  rO  rY  r  rv   r   r&  r   r   ro   r!  r8  rL  r   rg  s   &  r   r-  'TestVariousIteratorArgs.test_ziplongest  s    U4[+uT$q7IJAB1a(  k!A$&7!8$s1Q4y/J  k!A$!&=!>S1qQRt_@UV ) iad;iad;/{1Q47HI Kr   c                0   \        ^
4      \        ^ 4      \        ^d4      R\        ^^2^4      3 EFY  p\        \        \        \        \
        \        3 F  pT P                  \        \        \        V! V4      4      4      V! V4       Uu. uF  p\        V4      NK  	  up4       T P                  \        \        \        P                  V! V4      V! V4      4      4      V! V4       Uu. uF  q3V,          NK  	  up4       K  	  V P                  \        \        \        \        V4      4       V P                  \        \        \        \!        V4      4       V P                  \"        \        \        \        \%        V4      4      4       EK\  	  R# u upi u upi r_   Nrs  )r,   r   rd  r,  rO  rY  r  rv   r   r   r   rM   r  r   ro   r!  r8  rL  r   rw  s   &   r   r   TestVariousIteratorArgs.test_map  s   )U1XuSz65Bq>JAB1a(  c&!A$&7!856qT!:T&)T!:<  c(,,!ad&C!D01!!51Q$$!57 )
 ifad;ifad;/s61Q47HI K ";!5s   F'Fc                   R R\        R4      R\        RR^4      3 F  p\        \        \        \        \
        \        3 FF  pV P                  \        \        V! V4      ^R^4      4      \        V! V4      4      R,          4       KH  	  V P                  \        \        \        V4      ^
4       V P                  \        \        \        V4      ^
4       V P                  \        \        \        \        V4      ^
4      4       K  	  R# )12345r   rq  r  rd  N:r   Nr   re  )r,   r   rd  r,  rO  rY  r  rv   r   rH   r   ro   r!  r8  rL  r   rg  s   &  r   r  #TestVariousIteratorArgs.test_islice  s    2uT{KtD9KLAB1a(  fQqT!D&;!<d1Q4j>NO )i1r:i1r:/vadB7GH Mr   c           
     0   R R\        R4      R\        RR^4      3 F  p\        \        \        \        \
        \        3 FZ  p\        V! V4      4      p\        \        W3R,          4      4      p\        \        V! V4      4      4      pV P                  WT4       K\  	  V P                  \        \        \        V4      4       V P                  \        \        \        V4      4       V P                  \        \        \        \!        V4      4      4       K  	  R# )rc  r   rq  r  rd  r  Nre  )r,   r   rd  r,  rO  rY  r  r   r   rV  rv   r   ro   r!  r8  rL  r   )r4   re   r  rI   re  ro  s   &     r   rW  %TestVariousIteratorArgs.test_pairwise  s    U4[+uT$q7IJAB1a(1Q4jCR 12hqtn-  2	 )
 i1Q48i1Q48/x!~F Kr   c                   \        ^
4      \        ^ 4      \        ^d4      R\        ^^2^4      3 EF-  p\        \        \        \        \
        \        3 Fc  p\        W4      pT P                  \        \        \        P                  V! V4      4      4      V! V4       Uu. uF  qDV,          NK  	  up4       Ke  	  V P                  \        \        \        P                  \        X4      4       V P                  \        \        \        P                  \!        V4      4       V P                  \"        \        \        \        P                  \%        V4      4      4       EK0  	  R# u upi r  )r,   r   rd  r,  rO  rY  r  r   rv   r   r  rM   r  r   ro   r!  r8  rL  r   )r4   re   r  ssr   s   &    r   r  $TestVariousIteratorArgs.test_starmap  s    )U1XuSz65Bq>JAB1a(!Z  ghllAbE&B!C01!!51Q$$!57 ) i(,,"Fi(,,"F/wx||QrU7ST K "6s   E"c                   \        ^
4      \        ^ 4      \        R4      R\        RR^4      3 EF  p\        \        \        \        \
        \        3 Fg  p. pV! V4       F'  p\        V4      '       g    MVP                  V4       K)  	  V P                  \        \        \        V! V4      4      4      V4       Ki  	  V P                  \        \        \        \        V4      4       V P                  \        \        \        \        V4      4       V P                  \         \        \        \        \#        V4      4      4       EK  	  R# rr  )r,   r   rd  r,  rO  rY  r  r$   r   rv   r   r  r   ro   r!  r8  rL  r   r4   re   r  tgtr  s   &    r   r  &TestVariousIteratorArgs.test_takewhile  s    )U1XuT{FE$tA<NOAB1a(aDD!$<<JJt$ !   i!&=!>D ) iFAaDAiFAaDA/y17NO Pr   c                   \        ^
4      \        ^ 4      \        R4      R\        RR^4      3 EF  p\        \        \        \        \
        \        3 Fo  p. pV! V4       F/  pV'       g   \        V4      '       d   K  VP                  V4       K1  	  V P                  \        \        \        V! V4      4      4      V4       Kq  	  V P                  \        \        \        \        V4      4       V P                  \        \        \        \        V4      4       V P                  \         \        \        \        \#        V4      4      4       EK  	  R# rr  )r,   r   rd  r,  rO  rY  r  r'   r   rv   r   r  r   ro   r!  r8  rL  r   r  s   &    r   r  &TestVariousIteratorArgs.test_dropwhile	  s    )U1XuT{FE$tA<NOAB1a(aDD5;;JJt$ !   iqt&<!=sC ) iE1Q4@iE1Q4@/y!7MN Pr   c           
     b   R R\        R4      R\        RR^4      3 EF  p\        \        \        \        \
        \        3 Fj  p\        V! V4      4      w  r4V P                  \        V4      \        V! V4      4      4       V P                  \        V4      \        V! V4      4      4       Kl  	  V P                  \        \        \        V4      4       V P                  \        \        \        V4      4       V P                  \        \        \        \        V4      4      ^ ,          4       EK  	  R# rb  )r,   r   rd  r,  rO  rY  r  r  rv   r   r   ro   r!  r8  rL  r   )r4   re   r  it1it2s   &    r   r   TestVariousIteratorArgs.test_tee	  s    U4[+uT$q7IJAB1a(qt9  cD1J7  cD1J7 ) iad3iad3/s1Q4y|D Kr   r   N)r>   r?   r@   rA   r   r   r   rl  r  r  r  r  r  r  r-  r  r  rW  r  r  r  r  rC   rD   rE   s   @r   r[  r[  k  sw     	EFDR@	DFMRBJ	JI	GU
P
OE Er   r[  c                   ,   a  ] tR tRt o R tR tRtV tR# )LengthTransparencyi	  c                &   V P                  \        P                  ! \        R ^24      4      ^24       V P                  \        P                  ! \        R ^ 4      4      ^ 4       V P                  \        P                  ! \        R 4      ^4      ^4       R # r   rv   rM   length_hintr   r3   s   &r   r  LengthTransparency.test_repeat 	  sf    --fT2.>?D--fT1o>B--fTlB?Dr   c           	        V P                  \        P                  ! \        R R4      4      ^ 4       V P                  \        P                  ! \        R R4      4      ^ 4       V P                  \        P                  ! \        R RR7      4      ^ 4       V P                  \        P                  ! \        R RR7      4      ^ 4       R # )Nr  r   r  r  r3   s   &r   r  2LengthTransparency.test_repeat_with_negative_times%	  s    --fT2.>?C--fT2.>?C--fT.DEqI--fT.DEqIr   r   N)r>   r?   r@   rA   r  r  rC   rD   rE   s   @r   r  r  	  s     E
J Jr   r  c                      a  ] tR tRt o R tR t]P                  ]P                  ! R4      R 4       4       t	R t
R tRtV tR	# )
RegressionTestsi+	  c                t   a R  pV3R lp. oV! RVR4       \        \        4      pV P                  SV4       R# )c                    aa ^.3VV3R llp\        V4      p\        V 4      VR&   \        W44      p\        V.\        V 4      ,          !  o\	        S4       R# )r   c                 @   < V'       d   VR  S! \        S4      4       V # )NNNrx   )r  r  r  zs   &&r   r  @RegressionTests.test_sf_793826.<locals>.mutatingtuple.<locals>.g4	  s    ad1gJr   :r   r   NN)r   r   r   r   rx   )tuple1r  tuple2r  itemsgenr  s   &f&   @r   mutatingtuple5RegressionTests.test_sf_793826.<locals>.mutatingtuple0	  sQ     !"s  
 LEfE#Ja-CcU3v;&'AGr   c                 0   < V s \        \         4      SR &   R# )r  N)Tr   )r^  r  s   &r   r  )RegressionTests.test_sf_793826.<locals>.f?	  s    AAwE!Hr   NrF  )r   r   r   )r   r  rv   )r4   r  r  secondr  s   &   @r   test_sf_793826RegressionTests.test_sf_793826-	  s9    		
 gq'*a'r   c           
       a V3R  lpV3R lp. oV P                  \        \        \        V! 4       V! R4      4      4       V P	                  S^ ^.4       . oV P                  \        \        \        V! 4       V! R4      4      4       V P	                  S^ ^.4       . oV P                  \        \        \        V! 4       4      4       V P	                  S^ ^.4       R# )c               3   d   <"   S P                  ^ 4       ^x  S P                  ^4       \        h5irV   )r   AssertionError)hists   r   gen1,RegressionTests.test_sf_950057.<locals>.gen1N	  s'     KKNGKKN  s   -0c              3   \   <"   SP                  ^4       ^x  SP                  ^4       R# 5irC  )r   )r   r  s   &r   gen2,RegressionTests.test_sf_950057.<locals>.gen2U	  s!     KKNGKKNs   ),FTN)r   r  r   r   rv   r  )r4   r  r  r  s   &  @r   test_sf_950057RegressionTests.test_sf_950057J	  s    		
 .$dfd5k0JK!u%.$dfd4j0IJ!u%.$df>!u%r   cpuc                    \         P                  R  \        R4       4       4      pV P                  \        4      ;_uu_ 4        \        V4       RRR4       R#   + '       g   i     R# ; i)c              3   &   "   T F  pRx  K	  	  R # 5i)Nr   r   )r   unuseds   & r   r   ERegressionTests.test_long_chain_of_empty_iterables.<locals>.<genexpr>l	  s      B//s   i N)r   r   r,   r   r:   rx   r  s   & r   "test_long_chain_of_empty_iterables2RegressionTests.test_long_chain_of_empty_iterablesf	  sE        B%/ BB}--H .---s   AA*	c                h   a V3R  lp\        \        ^
4      V4       F  w  po\        S4       K  	  R# )c                 2   < V ^8X  d   \        S4       V ^8g  # rS  )r   )r-   r~   s   &r   r  ,RegressionTests.test_issue30347_1.<locals>.fq	  s    AvQ6Mr   N)r.  r,   r   )r4   r  r1  r~   s   &  @r   test_issue30347_1!RegressionTests.test_issue30347_1p	  s*    	 eBi+FQG ,r   c                   aa  ! VV3R  lR4      p^ o\        \        \        ^
4      V4      4      ^,          o\        ^4       F  p\        SR4       K  	  R# )c                   6   <a  ] tR tRt o R tVV3R ltRtV tR# ),RegressionTests.test_issue30347_2.<locals>.Kiy	  c                    R # r   r   r&  s   &&r   rB  5RegressionTests.test_issue30347_2.<locals>.K.__init__z	  s    r   c                @   < S^,          oS^8X  d   \        SR4       R# )r   NTr  )r4   otherr  r   s   &&r   r  3RegressionTests.test_issue30347_2.<locals>.K.__eq__|	  s    Q6DMr   r   N)r>   r?   r@   rA   rB  r  rC   rD   )rF   r  r   s   @r   Kr  y	  s      r   r  N)rx   r.  r,   )r4   r  r   r  r   s   &  @@r   test_issue30347_2!RegressionTests.test_issue30347_2x	  sE    	 	 rA&'*qADM r   r   N)r>   r?   r@   rA   r  r  r   skip_if_pgo_taskrequires_resourcer  r  r  rC   rD   rE   s   @r   r  r  +	  sK     (:&8 u% &  r   r  c                   &   a  ] tR tRt o R tRtV tR# )SubclassWithKwargsTesti	  c                2   \         R^^.3\        ^^.R3RR.3\        R^ ^.3^.3\        R^ ^.3^ .3\        ^^.^^.3. RO3\
        \        ^^.3RR.3\        \        P                  R3^^	.3\        . RO^^3^^.3\        \        . RO3^.3\        \        . RO3^^.3\        ^^.3. RO3\        R. RO3RR.3.pV F  w  r#pV P!                  V4      ;_uu_ 4         ! R R	V4      pV! V!  pV P#                  \%        V4      V4       V P'                  \)        \        V^ ^4      4      V4       V P+                  \,        4      ;_uu_ 4        V! VR
^/  RRR4       RRR4       K  	  V F  w  r#pV\         \        \
        \        39   d   K#  V P!                  V4      ;_uu_ 4         ! R RV4      pV! VR
^/ pV P#                  \%        V4      V4       V P'                  \)        \        V^ ^4      4      V4       V P'                  VP.                  ^4       RRR4       K  	  V F  w  r#pV P!                  V4      ;_uu_ 4         ! R RV4      pV! VR
^/ pV P#                  \%        V4      V4       V P'                  \)        \        V^ ^4      4      V4       V P'                  VP.                  ^4       RRR4       K  	  R#   + '       g   i     ELx; i  + '       g   i     EK-  ; i  + '       g   i     EK  ; i  + '       g   i     K  ; i)r   r   N12re  r   r   c                       ] tR tRtRtR# )BSubclassWithKwargsTest.test_keywords_in_subclass.<locals>.subclassi	  r   Nr  r   r   r   subclassr  	  s    r   r  newargc                   .   a  ] tR tRt o RR/R ltRtV tR# )LSubclassWithKwargsTest.test_keywords_in_subclass.<locals>.subclass_with_initi	  r  Nc                   Wn         R # r   r  )r4   r  r   s   &$*r   rB  USubclassWithKwargsTest.test_keywords_in_subclass.<locals>.subclass_with_init.__init__	  s    &,r   r  )r>   r?   r@   rA   rB  rC   rD   rE   s   @r   subclass_with_initr  	  s     -T - -r   r  c                   :   a a ] tR tRt oRR/V 3R lltRtVtV ;t# )KSubclassWithKwargsTest.test_keywords_in_subclass.<locals>.subclass_with_newi	  r  Nc               8   < \         SV `  ! V .VO5!  pWn        V# r   )super__new__r  )clsr  r   r4   r  s   &$* r   r  SSubclassWithKwargsTest.test_keywords_in_subclass.<locals>.subclass_with_new.__new__	  s     $ws:T:&,#r   r  )r>   r?   r@   rA   r  rC   rD   __classcell__)r  rF   s   @@r   subclass_with_newr  	  s     $4 $ $r   r  rO  r  r  rF  ))r   r   r  )r   r   r   r   )r   r   r   )r   r   r   ri  )r   r   rZ  r  r   r   rn   r  rM   r  rH   r  r$   r  r  rk  r   r9  rw   rv   r   r   ro   r  )	r4   	testcasesr  r   r	  r  ur  r  s	   &        r   test_keywords_in_subclass0SubclassWithKwargsTest.test_keywords_in_subclass	  s    VaV$Aq64.8X"67dQF^aS)4!Q.1#.aVaV$i03A-#s,x||%56A?lAq)Aq62+aS1+aV4aVIy)y)C:6
	 "+Cvc""s dOd1gx0  fQ1o!6?&&y11d-1- 2 #" "+ "+Cv vsC22c""- - '7Q7d1g'9:  fQ1o!6?  1- #" "+ "+Cvc""$ $
 &t6A6d1g'89  fQ1o!6?  1- #" "+% 211 #"" #"" #""s?   A0K	KK*A1K0A1LK	KK-0LLr   N)r>   r?   r@   rA   r  rC   rD   rE   s   @r   r  r  	  s     3. 3.r   r  c                   V   a  ] tR tRt o R t]P                  tR tR tR t	R t
RtV tR# )	
SizeofTesti	  c                <    \         P                  ! R 4      V n        R# )r-   N)structcalcsizessize_tr3   s   &r   setUpSizeofTest.setUp	  s    s+r   c                    \         P                  ! R 4      pV P                  pV! \        RR4      V^V P                  ,          ,           4       V! \        R!  V^
V P                  ,          ,           4       R# )3Pir   12N)
r   r   r   r   r   r   r   r   r   r   )r   calcobjsizecheck_sizeofr&  r  r4   basesizerg  s   &  r   test_product_sizeofSizeofTest.test_product_sizeof	  sY    &&u-!!gdD!8a$,,.>#>?g'B4E)EFr   c                   \         P                  ! R 4      pV P                  pV! \        R^4      V^V P                  ,          ,           4       V! \        \        ^
4      ^4      V^V P                  ,          ,           4       R# 3Pnir   N)r   r  r  r  r  r,   r  s   &  r   test_combinations_sizeof#SizeofTest.test_combinations_sizeof	  s_    &&v.!!l61%x!dll2B'BCl59a((Q5E*EFr   c                   \         p\        P                  ! R 4      pV P                  pV! V! R^4      V^V P                  ,          ,           4       V! V! \        ^
4      ^4      V^V P                  ,          ,           4       R# r  )r   r   r  r  r  r,   )r4   r/  r   rg  s   &   r   )test_combinations_with_replacement_sizeof4SizeofTest.test_combinations_with_replacement_sizeof	  sc    +&&v.!!c&!nhT\\)99:c%)QA,<!<=r   c                r   \         P                  ! R 4      pV P                  pV! \        R4      V^V P                  ,          ,           ^V P                  ,          ,           4       V! \        R^4      V^V P                  ,          ,           ^V P                  ,          ,           4       V! \        R^4      V^V P                  ,          ,           ^V P                  ,          ,           4       V! \        \        ^
4      ^4      V^
V P                  ,          ,           ^V P                  ,          ,           4       R# )4Pnir   r  N)r   r  r  r   r  r,   r  s   &  r   test_permutations_sizeof#SizeofTest.test_permutations_sizeof	  s    &&v.!!l6"T\\))A,<<	>l61%T\\))A,<<	>l7A&T\\))A,<<	>l59a(dll**Q-==	?r   )r  N)r>   r?   r@   rA   r  r   r  r  r  r	  r  rC   rD   rE   s   @r   r  r  	  s2     , ''LGG>
? 
?r   r  c                 X    VP                  \        P                  ! \        4      4       V# r   )addTestdoctestDocTestSuiter.  )loadertestspatterns   &&&r   
load_testsr  	  s    	MM'&&y12Lr   __main__)Dr  unittestr.  testr   test.supportr   r   r  decimalr   	fractionsr   rM   r  r  rb   	functoolsr	   r  r  r  r  MAX_Py_ssize_tr  minsizer   r   r   r    r$   r'   r)   r.   r1   rJ   rQ   rT   rY   r]   r`   r,   r  picklecopiersTestCaseri   r8  r  r  r  r   rd  r,  r!  r8  r   rF  rO  rY  r[  r  r  r  r6  r  r  r>   main)rf   s   0r   <module>r#     s%       8          
   	

 
 (1*
  -
 $F$;$;a$?@B@U "'L@B"8$$ "D,RM8$$ RMjtX%6%6 tnk9X k9Z
   	 	    2
qEh// qEfJ** JZh'' Zz4.X.. 4.n 	#?"" #? #?L
 zMMO sLBs   ;H