+
    iݫ c                   sr   R t . RNRNRNRNRNRNRNRNR	NR
NRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNR NR!Nt^ R"It^ R"It^ R"It^ R"It^ R"It^ R"It^ R"It^ R"I	t	^ R"I
t
^ R"It^ R"It^ R#IHtHt ^ R$IHt ^ R"It^ R%IHtHt R&t ! R' R(]! R(R)4      4      t/ tR* t]! R4      t]! R4      t]! R4      t]! R4      t]! R4      t]! R4      t]],          ],          ],          ],          ],          t]! R	4      t ]! R
4      t!]! R4      t"]! R4      t#]! R4      t$] ]!,          ]",          ]#,          ]$,          t%R+t&R,t'R- t(RiR. lt)R/ t*R0 t+RjR1 lt,R2 t- ! R3 R4]4      t.R5 t/R6 t0R7 t1 ! R8 R9]Pd                  4      t3R: t4 ! R; R4      t5 ! R< R4      t6 ! R= R4      t7 ! R> R4      t8 ! R? R4      t9R@ RA lt: ! RB R4      t; ! RC R]<4      t= ! RD R]<4      t> ! RE R]94      t?R"s@RkRG ltAR&R"R"R"R"R&^ R"RF]7! 4       R"3RH ltBRlRI ltC^ sDRJ tE ! RK RL]P                  4      tG ! RM RN]G4      tH ! RO RP]P                  4      tJRmRQ ltK ! RR RS]G4      tLR&R"R"]7! 4       R"3RT ltMRU tNRV tORW tPRnRX ltQRnRY ltRRoRZ ltS ! R[ R\4      tTR\]TR]R^R_R`RaRbRcRdReRf/tURg tV]WRh8X  d   ]
P                  ! ]V! 4       4       R"# R"# )pzreStructuredText enregister_optionflagDONT_ACCEPT_TRUE_FOR_1DONT_ACCEPT_BLANKLINENORMALIZE_WHITESPACEELLIPSISSKIPIGNORE_EXCEPTION_DETAILCOMPARISON_FLAGSREPORT_UDIFFREPORT_CDIFFREPORT_NDIFFREPORT_ONLY_FIRST_FAILUREREPORTING_FLAGS	FAIL_FASTExampleDocTestDocTestParserDocTestFinderDocTestRunnerOutputCheckerDocTestFailureUnexpectedExceptionDebugRunnertestmodtestfilerun_docstring_examplesDocTestSuiteDocFileSuiteset_unittest_reportflagsscript_from_examples
testsource	debug_srcdebugN)StringIOIncrementalNewlineDecoder)
namedtuple)
ANSIColorscan_colorizeTc                   sF   a a ] tR t^rt oR^ /V 3R lltV 3R ltRtVtV ;t# )TestResultsskippedc               s4   < \         SV `  WV4      pW4n        V# N)super__new__r'   )Zclsfailed	attemptedr'   results	__class__s   &&&$  /usr/lib64/python3.14/doctest.pyr*   ZTestResults.__new__s   s    '/#y9!    c                s   < V P                   '       d+   R V P                   RV P                   RV P                    R2# \        SV `  4       # )zTestResults(failed=z, attempted=z
, skipped=))r'   r+   r,   r)   __repr__)selfr.   s   &r/   r2   ZTestResults.__repr__x   sP    <<<)$++ 7!!% 0 1#||nA/ 0 7#%%r0    )	__name__
__module____qualname____firstlineno__r*   r2   __static_attributes____classdictcell__Z__classcell__)r.   __classdict__s   @@r/   r&   r&   r   s     1 
& &r0   r&   zfailed attemptedc                 sV    \         P                  V ^\        \         4      ,          4      # )   )OPTIONFLAGS_BY_NAMEZ
setdefaultlen)name   &r/   r    r       s     ))$S9L5M0MNNr0   z<BLANKLINE>z...c                 s    ^ p\         P                   F=  pV P                  VR4      pV\        \         V4      J g   K+  WP                  ,          pK?  	  V# )    N)
__future__Zall_feature_namesgetgetattrZcompiler_flag)globsflagsZfnameZfeature   &   r/   _extract_future_flagsrH      sM    
 E--))E4(gj%00***E . Lr0   c                 s   \         P                  ! V 4      '       d   V # \        V \        4      '       d    \	        V \        4       \        4       R .4      # V f.     \        P                  \        P                  ! V4      ,          # \        R4      h  \         d@    \        P                  \        P                  ! T4      P                  R,          ,          u # i ; i  \         d     R# i ; i)Z*Nr5   z"Expected a module, string, or None)inspectismodule
isinstancestr
__import__ZglobalsZlocalssysmodulesZ_getframemodulenameAttributeError	_getframeZ	f_globalsZKeyError	TypeError)moduleZdepth   &&r/   _normalize_modulerU      s     	FC	 	 &')VXu==		O{{3#:#:5#ABB <== " O{{3==#7#A#A*#MNNO 		s+   *B ACC CC C,+C,c                 s:    \        R R4      P                  V R4      # )NT)r"   decode)Zdatar@   r/   _newline_convertrW      s    $T4077dCCr0   c                 s   V'       d   \        V^4      p\        W4      p \        VRR4      ;pf    VP                  P                  p\        VR4      '       d0   VP                  V 4      pVP                  V4      p\        V4      V 3# \        WR7      ;_uu_ 4       pVP                  4       V 3uuRRR4       #   \
         d     Li ; i  + '       g   i     R# ; i)i   Z
__loader__Nget_data)encoding)rU   _module_relative_pathrD   Z__spec__loaderrP   hasattrrX   rV   rW   ZopenZread)filenamepackagemodule_relativerY   r[   Zfile_contentsfs   &&&&   r/   _load_testfilera      s    #GQ/(;g|T::FC ))00 6:&&"OOH5M)00:M $M2H<<	h	*	*avvx! 
+	* "  
+	*	*s   B: C:CCC	c                 s@    \         P                  ! R VR,          V 4      # )z
(?m)^(?!$) )resub)sindentrT   r/   _indentrg     s     66,s
A..r0   c                 sp    \        4       pV w  r#p\        P                  ! W#WAR 7       VP                  4       # ))file)r!   	tracebackZprint_exceptiongetvalue)exc_infoZexcoutZexc_typeZexc_valZexc_tb   &    r/   _exception_tracebackrm     s2     ZF (HvhE??r0   c                   s0   a  ] tR tRt o R tRR ltRtV tR# )	_SpoofOuti  c                s    \         P                  ! V 4      pV'       d!   VP                  R 4      '       g
   VR ,          pV# )
)r!   rj   endswith)r3   Zresult   & r/   rj   Z_SpoofOut.getvalue  s3    ""4( &//$//dNFr0   Nc                sT    V P                  V4       \        P                  ! V 4       R # r(   )Zseekr!   truncate)r3   ZsizerT   r/   rr   Z_SpoofOut.truncate%  s    		$$r0   r4   r(   )r5   r6   r7   r8   rj   rr   r9   r:   r;      @r/   rn   rn     s        r0   rn   c                 s   \         V 9  d   W8H  # V P                  \         4      p^ \        V4      rCV^ ,          pV'       d)   VP                  V4      '       d   \        V4      pV^  MR# VR,          pV'       d0   VP	                  V4      '       d   V\        V4      ,          pVR MR# W48  d   R# V F1  pVP                  WSV4      pV^ 8  d    R# V\        V4      ,          pK3  	  R# )rA   FT)ELLIPSIS_MARKERsplitr>   
startswithrp   find)wantgotZwsZstartposZendposZw   &&    r/   _ellipsis_matchr}   *  s     d"{ 
O	$B #c(f
1A>>!1vH1
2A<<??c!fF2 
  88A0a<CF  r0   c                 sH    V P                  4       p V '       d
   R V ,           # R# )z# #)rstrip)liner@   r/   _comment_liner   [  s    ;;=DDyr0   c                 s    ^ \        V 4      r!V P                  R4      pV^ 8  d   TpV P                  R^ V4      pV^ 8  d   TpV P                  R^ V4      pV^ 8  d
   V^,           pWV # )rA   ro   :.)r>   ry   Zrfind)msgstartendirG   r/   _strip_exception_detailsr   c  sr     CH3AAvaAAv		#q#AAv!c?r0   c                   sD   a  ] tR tRt o R tR	RR/R lltR tR tRtV t	R# )
_OutputRedirectingPdbi}  c                sp    Wn         R V n        \        P                  P	                  WRR7       ^V n        R# )FT)stdoutnosigintN)_OutputRedirectingPdb__out$_OutputRedirectingPdb__debugger_usedpdbPdb__init__use_rawinput)r3   outrT   r/   r   Z_OutputRedirectingPdb.__init__  s.    
$D9r0   Ncommandsc               s    R V n         Vf    \        P                  ! 4       P                  p\        P
                  P                  WVR7       R# )TN)r   )r   rN   rQ   Zf_backr   r   	set_trace)r3   Zframer   s   &&$r/   r   Z_OutputRedirectingPdb.set_trace  s7    #=MMO**E$9r0   c                sl    V P                   '       d"   \        P                  P                  V 4       R # R # r(   )r   r   r   set_continuer3   r@   r/   r   Z"_OutputRedirectingPdb.set_continue  s'     GG  &  r0   c                s    \         P                  pV P                  \         n         \        P                  P
                  ! V .VO5!  V\         n        #   T\         n        i ; ir(   )rN   r   r   r   r   trace_dispatch)r3   argssave_stdouts   &* r/   r   Z$_OutputRedirectingPdb.trace_dispatch  sA    jjZZ
	%77))$66$CJCJs   !A A!)Z__debugger_usedZ__outr   r(   )
r5   r6   r7   r8   r   r   r   r   r9   r:   rs   rt   r/   r   r   }  s%     : :'% %r0   r   c                 s   \         P                  ! V 4      '       g   \        R V ,          4      hVP                  R4      '       d   \	        R4      h\
        P                  P                  ! VP                  R4      !  p\        V R4      '       d3   \
        P                  P                  V P                  4      ^ ,          pEM!V P                  R8X  d   \        \        P                  4      ^ 8  dY   \        P                  ^ ,          R8w  d=   \
        P                  P                  \        P                  ^ ,          4      ^ ,          pM\
        P                  pM\        V R4      '       d\   V P                    FK  p\
        P                  P                  W14      p\
        P                  P#                  V4      '       g   KI  Vu # 	  \	        RV P                  ,          4      h\
        P                  P                  W!4      # )zExpected a module: %rZ/z1Module-relative files may not have absolute paths__file____main__ __path__zBCan't resolve paths relative to the module %r (it has no __file__))rI   rJ   rR   rx   
ValueErrorospathjoinrw   r\   r   r5   r>   rN   argvZcurdirr   Zexists)rS   Z	test_pathZbasedirZ	directoryZfullpath   &&   r/   rZ   rZ     sT   F##/&899C  LMM ys35I vz""''--03	J	&sxx=?sxx{b0ggmmCHHQK03GiiG6:&&#__	77<<	=77>>(++#O -  3!??+ , 	,
 77<<++r0   c                   6   a  ] tR tRt o RR ltR tR tRtV tR# )r   i  Nc                s2   VP                  R 4      '       g
   VR ,          pV'       d!   VP                  R 4      '       g
   VR ,          pVe!   VP                  R 4      '       g
   VR ,          pWn        W n        W@n        WPn        Vf   / pW`n        W0n        R# )ro   N)rp   sourcerz   linenorf   optionsexc_msg)r3   r   rz   r   r   rf   r      &&&&&&&r/   r   ZExample.__init__  s|     t$$dNFd++DLDw'7'7'='=tOG	?bGr0   c                   \        V 4      \        V4      Jd   \        # V P                  VP                  8H  ;'       d    V P                  VP                  8H  ;'       d}    V P                  VP                  8H  ;'       d\    V P
                  VP
                  8H  ;'       d;    V P                  VP                  8H  ;'       d    V P                  VP                  8H  # r(   )typeNotImplementedr   rz   r   rf   r   r   r3   otherrT   r/   __eq__ZExample.__eq__  s    :T%[(!!{{ell* - -yyEJJ&- -{{ell*- - {{ell*- - ||u}},	- -
 ||u}},	-r0   c                s    \        V P                  V P                  V P                  V P                  V P
                  34      # r(   )hashr   rz   r   rf   r   r   r@   r/   __hash__ZExample.__hash__  s3    T[[$))T[[$++\\# $ 	$r0   )r   rf   r   r   r   rz   )NrA   rA   N)	r5   r6   r7   r8   r   r   r   r9   r:   rs   rt   r/   r   r     s     F$	-$ $r0   c                   s>   a  ] tR tRt o R tR tR tR tR tRt	V t
R# )	r   i  c                sl    Wn         W`n        VP                  4       V n        W0n        W@n        WPn        R # r(   )examples	docstringcopyrE   r?   r]   r   )r3   r   rE   r?   r]   r   r   r   r/   r   ZDocTest.__init__,  s*     !"ZZ\
	 r0   c                s@   \        V P                  4      ^ 8X  d   RpM9\        V P                  4      ^8X  d   RpMR\        V P                  4      ,          pRV P                  P                  : RV P                  : RV P
                  : RV P                  : RV: R	2# )
rA   zno examplesz	1 examplez%d examplesZ<rb   z from r    (z)>)r>   r   r.   r5   r?   r]   r   )r3   r   rq   r/   r2   ZDocTest.__repr__:  sp    t}}"$H1$"H$s4=='99H((DMM4;;B 	Cr0   c                r   r(   )r   r   r   r   rE   r?   r]   r   r   rT   r/   r   ZDocTest.__eq__E  s    :T%[(!!}}. + +~~0+ +zzU[[(+ + yyEJJ&+ + }}.	+ +
 {{ell*	+r0   c                p    \        V P                  V P                  V P                  V P                  34      # r(   )r   r   r?   r]   r   r   r@   r/   r   ZDocTest.__hash__P  s&    T^^TYYt{{KLLr0   c                s8   \        V\        4      '       g   \        # V P                  e   V P                  MRpVP                  e   VP                  MRpV P                  V P
                  V\        V 4      3VP                  VP
                  V\        V4      38  # )Nru   )rK   r   r   r   r?   r]   id)r3   r   Zself_lnoZ	other_lno   &&  r/   __lt__ZDocTest.__lt__T  sy    %))!!"&++"94;;r$)LL$<ELL"	DMM8RX>U^^Y5	BC 	Dr0   )r   r   r]   rE   r   r?   N)r5   r6   r7   r8   r   r2   r   r   r   r9   r:   rs   rt   r/   r   r     s'     0	C	+MD Dr0   c                   s  a  ] tR tRt o ]P
                  ! R]P                  ]P                  ,          4      t]P
                  ! R]P                  ]P                  ,          ]P                  ,          4      t
]P
                  ! R4      P                  tRR ltR tRR ltR t]P
                  ! R	]P                  4      tR
 t]P
                  ! R]P                  4      tR tR tR tRtV tR# )r   ia  a  
        # Source consists of a PS1 line followed by zero or more PS2 lines.
        (?P<source>
            (?:^(?P<indent> [ ]*) >>>    .*)    # PS1 line
            (?:\n           [ ]*  \.\.\. .*)*)  # PS2 lines
        \n?
        # Want consists of any non-blank lines that do not start with PS1.
        (?P<want> (?:(?![ ]*$)    # Not a blank line
                     (?![ ]*>>>)  # Not a line starting with PS1
                     .+$\n?       # But any other line
                  )*)
        a  
        # Grab the traceback header.  Different versions of Python have
        # said different things on the first traceback line.
        ^(?P<hdr> Traceback\ \(
            (?: most\ recent\ call\ last
            |   innermost\ last
            ) \) :
        )
        \s* $                # toss trailing whitespace on the header.
        (?P<stack> .*?)      # don't blink: absorb stuff until...
        ^ (?P<msg> \w+ .*)   #     a line *starts* with alphanum.
        z^[ ]*(#.*)?$c                s$   VP                  4       pV P                  V4      pV^ 8  d3   RP                  VP                  R4       Uu. uF  qDVR NK	  	  up4      p. p^ ^ rvV P                  P                  V4       F  pVP                  WVP                  4        4       WqP                  RWhP                  4       4      ,          pV P                  WV4      w  rrV P                  V	4      '       g?   VP                  \        WVVV\        VP                  R4      4      ,           V
R7      4       WqP                  RVP                  4       VP                  4       4      ,          pVP                  4       pK  	  VP                  WR 4       V# u upi )rA   ro   Nrf   )r   rf   r   )Z
expandtabs_min_indentr   rw   _EXAMPLE_REfinditerappendr   count_parse_example_IS_BLANK_OR_COMMENTr   r>   groupr   )r3   stringr?   Z
min_indentloutputZcharnor   mr   r   rz   r   s   &&&          r/   parseZDocTestParser.parse  sX    ""$%%f-
>YYT8JK8J1*+8JKLFA!!**62AMM&	23ll4;;F ((&9 -Vd ,,V44wvW+1+5c!''(:K6L+L,3 5 7
 ll4AEEG<<FUUWF# 3& 	fWo&3  Ls   Fc                s<    \        V P                  W4      VW4WQ4      # r(   )r   get_examples)r3   r   rE   r?   r]   r      &&&&&&r/   get_doctestZDocTestParser.get_doctest  s%     t((6v7 	7r0   c                s~    V P                  W4       Uu. uF  p\        V\        4      '       g   K  VNK  	  up# u upi r(   )r   rK   r   )r3   r   r?   Zx   &&& r/   r   ZDocTestParser.get_examples  s>      ::f3 +3aa) 3 + 	+ +s   ::c           	     s:   \        VP                  R 4      4      pVP                  R4      P                  R4      pV P                  WTW#4       V P	                  VR,          RV,          R,           W#4       RP                  V Uu. uF  qfV^,           R NK  	  up4      pVP                  R4      pVP                  R4      p	\        V	4      ^8  d(   \        P                  ! RV	R
,          4      '       d   V	R
 V P	                  V	RV,          VV\        V4      ,           4       RP                  V	 U
u. uF  qVR NK	  	  up
4      pV P                  P                  V4      pV'       d   VP                  R	4      pMRpV P                  WrV4      pW|W3# u upi u up
i )rf   r   ro   r<   NNrb   r   Nrz   z *$r   ru   )
r>   r   rw   _check_prompt_blank_check_prefixr   rc   match_EXCEPTION_RE_find_options)r3   r   r?   r   rf   source_linesZslr   rz   
want_linesZwlr   r   s   &&&&         r/   r   ZDocTestParser._parse_example  sh    QWWX&' wwx(..t4  tD<+SZ#-=tLLALbvaxyMLAB
 wwvZZ%
z?Q288FJrN#C#C2:s6z4!C$55	7yy
;
"VW+
;< $$T*ggenGG $$V6:--/ B <s   F2Fz#\s*doctest:\s*([^\n\'"]*)$c           
     s   / pV P                   P                  V4       F  pVP                  ^4      P                  RR4      P	                  4       pV Fc  pV^ ,          R9  g   VR,          \
        9  d   \        RV^,           : RV: RV: 24      h\
        VR,          ,          pV^ ,          R8H  WH&   Ke  	  K  	  V'       d/   V P                  V4      '       d   \        RV: RV: R	V: 24      hV# )
r<   Z,rb   z+-r   line z of the doctest for z has an invalid option: +z4 has an option directive on a line with no example: )_OPTION_DIRECTIVE_REr   r   Zreplacerw   r=   r   r   )	r3   r   r?   r   r   r   Zoption_stringsoptionZflags	   &&&&     r/   r   ZDocTestParser._find_options  s     **33F;AWWQZ//S9??AN(1IT)2J&99$&,Qhhf&> ? ? +6":6!'c!1 ) < t0088$dF4 5 5 r0   z^([ ]*)(?=\S)c                s    V P                   P                  V4       Uu. uF  p\        V4      NK  	  pp\        V4      ^ 8  d   \        V4      # ^ # u upi )rA   )
_INDENT_REZfindallr>   Zmin)r3   re   rf   Zindentsr   r/   r   ZDocTestParser._min_indent&  sJ    -1__-D-DQ-GH-G63v;-GHw<!w<	 Is   Ac                s    \        V4       Fc  w  rV\        V4      V^,           8  g   K  Wb^,           ,          R8w  g   K4  \        RWE,           ^,           : RV: RWbV^,            : RV: 24      h	  R# )   rb   r    of the docstring for z lacks blank after z: N)	enumerater>   r   )r3   linesrf   r?   r   r   r      &&&&&  r/   r   Z!DocTestParser._check_prompt_blank.  sa     !'GA4yF1H$Qh3)> "((1**d"&fQh"7"? @ @ (r0   c           	     s    \        V4       FJ  w  rVV'       g   K  VP                  V4      '       d   K(  \        R WE,           ^,           : RV: RV: 24      h	  R# )r   r   z& has inconsistent leading whitespace: N)r   rx   r   )r3   r   Zprefixr?   r   r   r   r   r/   r   ZDocTestParser._check_prefix<  sI    
 !'GAtDOOF33 "((1**dD": ; ; (r0   r4   N)z<string>)r5   r6   r7   r8   rc   compileZ	MULTILINEZVERBOSEr   ZDOTALLr   r   r   r   r   r   r   r   r   r   r   r   r   r9   r:   rs   rt   r/   r   r   a  s      **  \\BJJ&(K, JJ   ZZ",,&24M ::o6<<%N
7+*.f ::&D&(ll48 ,bll;J@	; 	;r0   c                   sd   a  ] tR tRt o R]! 4       RR3R ltRR ltR tR tR	 t	R
 t
R tRtV tR# )r   iL  FTc                s6    W n         Wn        W0n        W@n        R # r(   )_parser_verbose_recurse_exclude_empty)r3   verboseparserrecurseexclude_empty   &&&&&r/   r   ZDocTestFinder.__init__U  s    " +r0   Nc           	     s   Vf*   \        VRR 4      pVf   \        R\        V4      : 24      hVRJ d   R pMVf   \        P                  ! V4      p \        P
                  ! V4      pV'       g1   \        P                  ! V4      pV^ ,          VRR  ,           R8X  g   R pVf   R pMEVe"   \        P                  ! WcP                  4      pM\        P                  ! V4      pV'       g   R pVf#   Vf   / pM+VP                  P                  4       pMVP                  4       pVe   VP                  V4       RV9  d   RVR&   . pV P                  WW#Wt/ 4       VP                  4        V#   \         d    R p Li ; i)Nr5   zHDocTestFinder.find: name must be given when obj.__name__ doesn't exist: Fz<]>r   i)rD   r   r   rI   	getmoduleZgetsourcefileZgetfile	linecachegetlines__dict__rR   r   update_findsort)	r3   objr?   rS   rE   
extraglobsrh   r   tests	   &&&&&&   r/   ry   ZDocTestFinder.findk  sp   H <3
D1D| "&s)". / / U?F^&&s+F
	(((-D  s+AwtBCy(E1$4|#% $-#5#5dOO#LL $-#5#5d#;L##'L =~,,.JJLE!LL$U" *E* 

5t\"E
 	

Y  	 L	 s   E+ +E;:E;c                s   Vf   R# \         P                  ! V4      e   V\         P                  ! V4      J # \         P                  ! V4      '       d   VP                  VP                  J # \         P
                  ! V4      '       g   \         P                  ! V4      '       dZ   \        VR4      '       d   VP                  P                  pM!\        VR4      '       d   VP                  pMR# VP                  V8H  # \         P                  ! V4      '       d   VP                  VP                  8H  # \        VR4      '       d   VP                  VP                  8H  # \        V\        4      '       d   R# \        R4      h)NT__objclass__r6   z"object must be a class or function)rI   r   Z
isfunctionr   Z__globals__ZismethoddescriptorZismethodwrapperr\   r   r6   r5   isclassrK   propertyr   )r3   rS   objectZobj_modr   r/   _from_moduleZDocTestFinder._from_module  s%   
 >v&2W..v666''??f&8&888((00%%f--v~.. --88.. ++??g--__V$$??f&7&777V\**??f&7&777))ABBr0   c                s    Tp \         P                  ! V4      p\         P                  ! V4      #   \         d     L#i ; ir(   )rI   unwrapr   	isroutine)r3   r   Zmaybe_routines   && r/   _is_routineZDocTestFinder._is_routine  sC     	#NN=9M   //  		s   0 >>c           
     s   V P                   '       d   \        R V,          4       \        V4      V9   d   R# ^V\        V4      &   V P                  W#WFV4      pVe   VP	                  V4       \
        P                  ! V4      '       d   V P                  '       d   VP                  P                  4        Fp  w  rV: RV	: 2p	V P                  V
4      '       g   \
        P                  ! V
4      '       g   KC  V P                  WJ4      '       g   K\  V P                  WWVWg4       Kr  	  \
        P                  ! V4      '       Ed   V P                  '       d   \        VR/ 4      P                  4        F  w  r\        V	\         4      '       g   \#        R\%        V	4      : 24      h\
        P&                  ! V
4      '       gg   \
        P                  ! V
4      '       gK   \
        P                  ! V
4      '       g/   \        V
\         4      '       g   \#        R\%        V
4      : 24      hV: RV	: 2p	V P                  WWVWg4       K  	  \
        P                  ! V4      '       d   V P                  '       d   VP                  P                  4        F  w  r\        V
\(        \*        34      '       d   V
P,                  p
\
        P&                  ! V
4      '       g5   \
        P                  ! V
4      '       g   \        V
\.        4      '       g   K}  V P                  WJ4      '       g   K  V: RV	: 2p	V P                  WWVWg4       K  	  R# R# R# )zFinding tests in %sNr   __test__z3DocTestFinder.find: __test__ keys must be strings: z^DocTestFinder.find: __test__ values must be strings, functions, methods, classes, or modules: z
.__test__.)r   printr   	_get_testr   rI   rJ   r   r   itemsr   r   r   r   rD   rK   rL   r   r   r   ZstaticmethodZclassmethod__func__r   )r3   r   r   r?   rS   r   rE   ZseentestZvalnamevals   &&&&&&&&   r/   r   ZDocTestFinder._find  sp   
 ==='$./ c7d?RW ~~cELL C  T]]] # 2 2 4%)73 %%c**gooc.B.B%%f22JJu7L$, !5 C  T]]] 'Z < B B D!'3//$&*7m&6 7 7  ))#..'//#2F2F((--C1E1E$ '+3i&2 3 3 /3G<

5w ( !E  ??3DMMM # 2 2 4cL+#>??,,C &&s++ws/C/C h//''44)-w7GJJu7L$, !5 %2r0   c                s   \        V\        4      '       d   TpM? VP                  f   RpM-VP                  p\        V\        4      '       g   \        V4      pV P                  W4      pV P                  '       d   V'       g   R # Vf   R pM0\        VRR 4      ;'       g    VP                  pVRR  R8X  d   VR R pV P                  P                  WdVW4      #   \        \        3 d    Rp Li ; i)Nr   r   .pycru   )rK   rL   __doc__rR   rP   _find_linenor   rD   r5   r   r   )	r3   r   r?   rS   rE   r   r   r   r]   r   r/   r   ZDocTestFinder._get_test6  s     c3I;;& "I #I%i55$'	N	
 ""35 y >H vz48KKFOOH}&#CR=||''	$(0: 	:% ~. 	s   C -C C0/C0c           
     s   R p\        VRR 4      p\        P                  ! V4      '       d   Ve   ^ p\        P                  ! V4      '       dv   Ver   Vf   R # \        P
                  ! R\        P                  ! \        VRR4      4      ,          4      p\        V4       F   w  rgVP                  V4      '       g   K  Tp M	  \        P                  ! V4      '       d   VP                  p\        V\        4      '       d   VP                  p\        V\        P                  4      '       d   VP                   p\        P"                  ! V4      '       d7   \        VRR 4      '       d$   \        P$                  ! V4      p VP&                  p\        P*                  ! V4      '       d   VP,                  p\        P.                  ! V4      '       d   VP0                  p\        P2                  ! V4      '       d   VP4                  ^,
          pVea   Vf
   V^,           # \        P
                  ! R4      p\7        V\9        V4      4       F$  pVP                  W#,          4      '       g   K"  Vu # 	  R #   \(         d     R # i ; i)Nr  z^\s*class\s*%s\br5   Z-z(^|.*:)\s*\w*("|\'))rD   rI   rJ   r   rc   r   escaper   r   Zismethodr   rK   r   Zfget	functoolsZcached_propertyZfuncr   r   Z__code__rP   ZistracebackZtb_frameZisframeZf_codeZiscodeZco_firstlinenoranger>   )r3   r   r   r   r   Zpatr   r      &&&     r/   r  ZDocTestFinder._find_lineno\  s    CD1	 C  Y%:F
 ??3I$9#**0YYwsJ'DEF GC$\299T??F 3 C  #c8$$((Cc94455((CS!!gc9d&C&C..%Cll s##3<<S??3szz>>#''!+F #ax**34CL(9:99\122!M ;
 1 "  	s   ?I0 0I?>I?)r   r   r   r   NNNN)r5   r6   r7   r8   r   r   ry   r   r   r   r   r  r9   r:   rs   rt   r/   r   r   L  s@       %]_T,,dLC:	0;,z$:L= =r0   c                   s   a  ] tR tRt o RtRR ltR tR tR tR t	R t
R	 tR
 t]P                  ! R4      tRR ltRR ltRR ltR tRtV tR# )r   i  Nc                s    T;'       g    \        4       V n        Vf   R\        P                  9   pW n        W0n        W0n        ^ V n        ^ V n        ^ V n	        / V n
        \        4       V n        R # )N-v)r   _checkerrN   r   r   optionflagsoriginal_optionflagstriesfailuresskips_statsrn   _fakeout)r3   checkerr   r     &&&&r/   r   ZDocTestRunner.__init__  sb    "  22=??chh&G&$/! 

 "r0   c                s.   V P                   '       d   VP                  '       dF   V! R \        VP                  4      ,           R,           \        VP                  4      ,           4       R# V! R \        VP                  4      ,           R,           4       R# R# )zTrying:
zExpecting:
zExpecting nothing
N)r   rz   rg   r   )r3   r   r   exampler  r/   report_startZDocTestRunner.report_start  sn    
 ===|||K''.."99"#%,W\\%:; < K''.."99)* + r0   c                s>    V P                   '       d   V! R 4       R# R# )zok
N)r   r3   r   r   r  r{   r   r/   report_successZDocTestRunner.report_success  s    
 ===K r0   c                s    V! V P                  W#4      V P                  P                  W4V P                  4      ,           4       R # r(   )_failure_headerr  output_differencer  r  r   r/   report_failureZDocTestRunner.report_failure  s:     	D  /MM++G$:J:JKL 	Mr0   c                st    V! V P                  W#4      R ,           \        \        V4      4      ,           4       R# )zException raised:
N)r  rg   rm   r3   r   r   r  rk   r   r/   report_unexpected_exceptionZ)DocTestRunner.report_unexpected_exception"  s6     	D  /!"$+,@,J$KL 	Mr0   c                s   \        4       '       d!   \        P                  \        P                  3MRw  r4V V P                   V 2.pVP
                  '       dv   VP                  e4   VP                  e&   VP                  VP                  ,           ^,           pMRpVP                  RVP
                  : RV: RVP                  : 24       M4VP                  RVP                  ^,           : RVP                  : 24       VP                  R4       VP                  pVP                  \        V4      4       RP                  V4      # )	r   Z?zFile "", line , in zLine zFailed example:ro   )r   r   )r%   r$   REDRESETDIVIDERr]   r   r   r?   r   rg   r   )r3   r   r  redresetr   r   r   r  r/   r  ZDocTestRunner._failure_header)  s    2>..Z^^Z--.h 	 t||nUG,-==={{&7>>+Ew~~59JJvtyy: ; JJ7>>!+;+;TYYGH

$%

76?#yy~r0   c           
     s  a ^ ;p;rVV P                   p\        ^4      w  rp
V P                  P                  p\	        VP
                  4       EF  w  rV^,          pV P                   \        ,          ;'       d    V^ 8  pWpn         VP                  '       db   VP                  P                  4        FC  w  ppV'       d   V ;P                   V,          un         K)  V ;P                   V( ,          un         KE  	  V P                   \        ,          '       d   V^,          pK  V'       g   V P                  W1V4       RVP                  V3,          p \        \        VP                  VRVR4      VP                  4       V P                   P#                  4        RpT P.                  P1                  4       pT P.                  P3                  ^ 4       T	pTf)   T! TP4                  TT P                   4      '       d   TpEMS\6        P8                  ! TR,          !  p\;        T^ ,          \<        4      '       dd   T^ ,          P>                   R2T^ ,          P@                   RT^ ,          P>                   R23o\C        T3R l\	        T4       4       4      pTTR pR	PE                  T4      pT'       g   T\G        T4      ,          pTPH                  f   T
pM|T! TPH                  TT P                   4      '       d   TpMUT P                   \J        ,          '       d9   T! \M        TPH                  4      \M        T4      T P                   4      '       d   TpTTJ d   T'       g   T PO                  Y1TT4       MUTT	J d&   T'       g   T PQ                  Y1TT4       T^,          pM*TT
J d%   T'       g   T PS                  Y1TT4       T^,          pT'       g   EK  T P                   \T        ,          '       g   EK   M	  Wpn         V PW                  WWV4       \Y        WEVR
7      #   \$         d    h \&         dH   p\)        T4      TTP*                  P,                  3pT P                   P#                  4         Rp?ELRp?ii ; i)rA   z<doctest %s[%d]>ZsingleTN:N   Nr   r   c              3   s^   <"   T F"  w  rVP                  S4      '       g   K  Vx  K$  	  R # 5ir(   )rx   )Z.0indexr   exception_line_prefixess   &  r/   Z	<genexpr>Z&DocTestRunner.__run.<locals>.<genexpr>  s)      )+BKE??+BC +Bs   -
-r   r'   )-r  r  r  check_outputr   r   r   r   r   r   r  r?   execr   r   rE   debuggerr   ZKeyboardInterruptZBaseExceptionr   Z__traceback__Ztb_nextr  rj   rr   rz   ri   Zformat_exception_onlyZ
issubclassZSyntaxErrorr7   r6   Znextr   rm   r   r   r   r  r  r  r   _DocTestRunner__record_outcomer&   )r3   r   compileflagsr   r  r,   r  r  ZSUCCESSZFAILUREZBOOMZcheck
examplenumr  ZquietZ
optionflagr   r]   rk   Zexcr{   ZoutcomeZformatted_exZexc_msg_indexr   r'  s   &&&&                     @r/   Z__runZDocTestRunner.__run@  s    ()((9  $//!&q$** $-T]]#;JNI %%(AA " "\   4)0)>)>)@%Z((J6(((ZK7(	 *A $&&
 !!#W5
 *TYY
,CCH

-WW^^Xx)4126**>**, --((*CMM""1%G sD,<,<==%G  )>>Mhqk;77 $A;334A6#A;112!HQK4L4L3MQO/+ %) )+4\+B) %M
 $0#?L'',//99C ??*"G 7??GT5E5EFF%G %%(???5gooF5g>!--/ / #* '!''7C@G#''7C@AD44S5=?A xD,,y88a $<f 0 	di?8>>_ %   -9c3+<+<+D+DD**,,-s   A	PQ7/Q70<Q22Q7c                sJ   V P                   P                  VP                  R4      w  rVpW%,           W6,           WG,           3V P                   VP                  &   V ;P                  V,          un        V ;P                  V,          un        V ;P
                  V,          un        R# )rA   N)rA   rA   rA   )r  rC   r?   r  r  r  )r3   r   r  r  r  	failures2tries2skips2s   &&&&&   r/   Z__record_outcomeZDocTestRunner.__record_outcome  sq    
 %)KKOODIIy$I!	6"*"6"'."'."2DII 	!

e


e
r0   z.<doctest (?P<name>.+)\[(?P<examplenum>\d+)\]>$c                s`   V P                   P                  V4      pV'       d|   VP                  R 4      V P                  P                  8X  dR   V P                  P
                  \        VP                  R4      4      ,          pVP                  P                  RR7      # V P                  W4      # )r?   r.  TZkeepends)
%_DocTestRunner__LINECACHE_FILENAME_REr   r   r   r?   r   Zintr   
splitlinessave_linecache_getlines)r3   r]   Zmodule_globalsr   r     &&&  r/   Z__patched_linecache_getlinesZ*DocTestRunner.__patched_linecache_getlines  s}    ((..x8DIINN2ii((QWW\-B)CDG>>,,d,;;//IIr0   c                s0  aa Wn         Vf   \        VP                  4      p\        P                  oVf:   SP
                  oSe   SP                  4       R8X  d   SP                  pMVV3R lpV P                  \        n        \        P                  ! 4       p\        P                  p\        S4      V n        V P                  P                  4        V P                  P                  \        n        \        P                   V n        V P$                  \        n        \        P&                  p\        P(                  \        n        \*        P,                  pR \*        n        RR RR /p	V	 F%  p
\.        P0                  P3                  V
R 4      W&   K'  	   V P5                  WV4      S\        n        V\        n        \        P6                  ! V4       V P"                  \        n        V\        n        V\*        n        V	P9                  4        F  w  rVf   K  V\.        P0                  V
&   K   	  V'       d'   VP                  P;                  4        ^ R IpR Vn        # #   S\        n        T\        n        \        P6                  ! T4       T P"                  \        n        T\        n        T\*        n        T	P9                  4        F  w  rTf   K  T\.        P0                  T
&   K   	  T'       d'   TP                  P;                  4        ^ R IpR Tn        i i ; i)Nutf-8c                 sb   < \        V P                  SR 4      S4      p SP                  V 4       R# )backslashreplaceN)rL   encodewrite)re   rY   r   s   &r/   r   ZDocTestRunner.run.<locals>.out  s)    AHHX/ABHMA%%a(r0   c                      R # Fr4   )r   Zkwargss   *,r/   Z<lambda>Z#DocTestRunner.run.<locals>.<lambda>  s    r0   ZPYTHON_COLORSZFORCE_COLOR) r   rH   rE   rN   r   rY   Zlowerr:  r  Zgettracer   r   r   r+  r$  r   r   r5  *_DocTestRunner__patched_linecache_getlinesZdisplayhookZ__displayhook__	_colorizer%   r   Zenvironpop_DocTestRunner__runZsettracer   clearbuiltins_)r3   r   r-  r   clear_globsZ
save_traceZsave_set_traceZsave_displayhookZsaved_can_colorizeZcolor_variablesZkeyZvaluerB  rY   r   s   &&&&&        @@r/   runZDocTestRunner.run  sB   ( 	0<Ljj;"++H8>>#3w#>!'') ]]
 \\^
-k:// (1'9'9$!>>	 ??--&33!>	*D-F"C#%::>>#t#<O  #	"::d#6$CJ*CMLL$!%!=!=I.CO%7I"-335
$&+BJJsO 6 

  "!
  %CJ*CMLL$!%!=!=I.CO%7I"-335
$&+BJJsO 6 

  "!
 s   I A.LL.'Lc                s   Vf   V P                   p. . . rCp^ ;p;rgV P                  P                  4        Fj  w  pw  rpWZ,          pWi,          pW{,          pV
^ 8X  d   VP                  V4       K;  V	^ 8X  d   VP                  W34       KV  VP                  WW334       Kl  	  \        P
                  ! 4       pVP                  pVP                  pVP                  pVP                  pVP                  pVP                  pV'       d   V'       d?   \        \        V4       R24       VP                  4        V F  p\        RV 24       K  	  V'       dU   \        V \        V4       RV 24       \        V4       F*  w  ppV^8X  d   RMRp\        RV VR RV R	V V 24       K,  	  V'       da   \        V V P                    V 24       \        \        V4       R
24       \        V4       F  w  pw  rp\        RV	R RV
R R	V 24       K!  	  V'       db   V^8X  d   RMRp\        V RV R	\        V P                  4       R24       V'       d   RV V RV 2MRp\        V WV,
           RV V R24       V'       dH   V^8X  d   RMRpV RV RV V 2pV'       d   V^8X  d   RMRpV RV V RV V 2p\        V R24       MV'       d   \        V RV 24       \#        WeVR7      # )Nz had no tests:z    z passed all tests:r   re   rb   Z3dz testz in z had failures:z of r   z and z failedz passedz***Test Failed*** z failurez skipped testzTest passed.r(  )r   r  r   r   r>  Z
get_colorsZ
BOLD_GREENZBOLD_REDZGREENr   r!  ZYELLOWr   _n_itemsr   Zsortedr"  r&   )r3   r   ZnotestsZpassedr+   Ztotal_triesZtotal_failuresZtotal_skipsr?   r  r  r  ZansiZ
bold_greenZbold_redZgreenr#  r$  Zyellowr   re   Zand_fr   s   &&                     r/   	summarizeZDocTestRunner.summarize6  s     ?mmG"$b"5666n.2kk.?.?.A*D*8E K&N Kzt$Qtm,t%=>? /B ##%__
==

hh

'*+>:;#DD-( $  011CE7KL#)&>KD%#qjcAAeWU2JeA3d4&HI $2 SE$,,w/0Xf%&n5628...x(2d5*D?@ 3A !Q&CA[Mqcht{{.C-DAFG " u^,GE7;')  UGK89waPQ$)sAJ00@E7SC%*BU6(;-}QCwOSE)ZLUG45>LLr0   c                s    V P                   pVP                   P                  4        F8  w  pw  rEpW29   d$   W#,          w  rxp	WG,           pWX,           pWi,           pWEV3W#&   K:  	  R # r(   )r  r   )
r3   r   Zdr?   r  r  r  r/  r0  r1  s
   &&        r/   mergeZDocTestRunner.merge  s`    KK.3ll.@.@.B*D*8Ey,-G)	6#/.AG /Cr0   )r  r  r  r   r+  r  r  r  r5  r  r   r  zF**********************************************************************)NNrA   r(   NNT)r5   r6   r7   r8   r"  r   r  r  r  r  r  r@  r,  rc   r   r3  r=  rE  rG  rH  r9   r:   rs   rt   r/   r   r     sq     @ G$J+MM.K?Z !jj *F GJL"bKM`/ /r0   c                sF    V ^8  d   QhR\         \        ,          R\        /# )r%  r   Zreturn)listZdictrL   )Zformats   "r/   __annotate__rK    s      D4K C r0   c                 s<    \        V 4      pV^8X  d   RMRpV RV 2# )r<   r   re   z item)r>   )r   nre   s   &  r/   rF  rF    s*     	E
A1f#ASaS>r0   c                   s8   a  ] tR tRt o R tR tR tR tRtV t	R# )r   i  c                s:    \        VP                  R R4      R 4      # )ZASCIIr8  )rL   r9  )r3   re   rT   r/   _toAsciiZOutputChecker._toAscii  s     188G%78'BBr0   c                sz   V P                  V4      pV P                  V4      pW!8X  d   R # V\        ,          '       g   W!3R8X  d   R # W!3R8X  d   R # V\        ,          '       gX   \        P                  ! R\        P
                  ! \        4      ,          RV4      p\        P                  ! RRV4      pW!8X  d   R # V\        ,          '       dG   RP                  VP                  4       4      pRP                  VP                  4       4      pW!8X  d   R # V\        ,          '       d   \        W4      '       d   R # R# )Tz(?m)^%s\s*?$r   z(?m)^[^\S\n]+$rb   F)zTrue
z1
)zFalse
z0
)rM  r   r   rc   rd   r  BLANKLINE_MARKERr   r   rw   r   r}   r3   rz   r{   r  r  r/   r)  ZOutputChecker.check_output  s     mmC }}T" ; 444z..z// 33366/BII6F,GGd$D &&*B4C{
 ---((399;'C88DJJL)D{ !!t)) r0   c                s    V\         \        ,          \        ,          ,          '       g   R # V\        ,          '       d   R# VP                  R4      ^8  ;'       d    VP                  R4      ^8  # )FTro   )r   r	   r
   r   rO  r  r/   _do_a_fancy_diffZOutputChecker._do_a_fancy_diff  sa    l*+*+ , ,  %% zz$!#;;		$!(;;r0   c                s   VP                   pV\        ,          '       g   \        P                  ! R \        V4      pV P                  WBV4      '       Ed!   VP                  RR7      pVP                  RR7      pV\        ,          '       d.   \        P                  ! WV^R7      p\        V4      R,          pRpMV\        ,          '       d.   \        P                  ! WV^R7      p\        V4      R,          pRpMTV\        ,          '       dB   \        P                  ! \        P                  R7      p	\        V	P!                  WV4      4      pRpR	X,          \#        R
P%                  X4      4      ,           # V'       d%   V'       d   R\#        V4      : R\#        V4      : 2# V'       d   R\#        V4      ,          # V'       d   R\#        V4      ,          # R# )z(?m)^[ ]*(?=
)Tr2  )rL  :r%  NNz#unified diff with -expected +actualz-context diff with expected followed by actual)Zcharjunkzndiff with -expected +actualzDifferences (%s):
r   z
Expected:
zGot:
zExpected:
%sGot nothing
zExpected nothing
Got:
%szExpected nothing
Got nothing
)rz   r   rc   rd   rN  rP  r4  r   difflibZunified_diffrJ  r	   Zcontext_diffr
   ZDifferZIS_CHARACTER_JUNKZcomparerg   r   )
r3   r  r{   r  rz   r   Z	got_linesZdiffZkindZengines
   &&&&      r/   r  ZOutputChecker.output_difference  s[    || 333&&*,<cBC   K88$7J5I\))++JQGDz"~<|++++JQGDz"~F|++ 1J1JKFNN:AB5 )4/'"''$-2HHH CC.5dmWS\JJ/'$-??/'#,>>4r0   r4   N)
r5   r6   r7   r8   rM  r)  rP  r  r9   r:   rs   rt   r/   r   r     s      C<~<.,5 ,5r0   c                   ,   a  ] tR tRt o R tR tRtV tR# )r   i,  c                *    Wn         W n        W0n        R # r(   )r   r  r{   )r3   r   r  r{   r  r/   r   ZDocTestFailure.__init__7  s    	r0   c                ,    \        V P                  4      # r(   rL   r   r   r@   r/   __str__ZDocTestFailure.__str__<      499~r0   )r  r{   r   Nr5   r6   r7   r8   r   rV  r9   r:   rs   rt   r/   r   r   ,  s     
 r0   c                   rR  )r   i?  c                rS  r(   )r   r  rk   )r3   r   r  rk   r  r/   r   ZUnexpectedException.__init__J  s    	 r0   c                rT  r(   rU  r   r@   r/   rV  ZUnexpectedException.__str__O  rW  r0   )r  rk   r   NrX  rs   rt   r/   r   r   ?  s     !
 r0   c                   r   )r   iR  Nc                sx    \         P                  WW#R 4      pV'       d   VP                  P                  4        V# r<  )r   rE  rE   rA  )r3   r   r-  r   rD  Zrs   &&&&& r/   rE  ZDebugRunner.run  s.    d,UCJJr0   c                    \        W#V4      hr(   )r   r  r   r/   r  Z'DebugRunner.report_unexpected_exception  s    !$::r0   c                rY  r(   )r   r  r   r/   r  ZDebugRunner.report_failure  s    TC00r0   r4   rI  )	r5   r6   r7   r8   rE  r  r  r9   r:   rs   rt   r/   r   r   R  s     v;1 1r0   Fc	                 s6   V f    \         P                  P                  R4      p \        P                  ! V 4      '       g   \        RV : 24      hVf   V P                  p\        VR7      p	V'       d   \        W5R7      p
M\        W5R7      p
V	P                  WW&R7       F  pV
P                  V4       K  	  V'       d   V
P                  4        \        f   V
sM\        P                  V
4       \        V
P                   V
P"                  V
P$                  R7      # )Nr   ztestmod: module required; )r   r   r  rE   r   r(  )rN   rO   rC   rI   rJ   rR   r5   r   r   r   ry   rE  rG  masterrH  r&   r  r  r  )r   r?   rE   r   reportr  r   raise_on_errorr   finderrunnerr   s   &&&&&&&&&   r/   r   r     s    J 	y KKOOJ' A!=>> |zz 7FWFwHA5H

4 I ~VvfllKKr0   c                 sr   V'       d   V'       g   \        R 4      h\        YTT;'       g    R4      w  rVf    \        P                  P	                  V 4      pVf   / pMVP                  4       pVe   VP                  V4       RV9  d   RVR&   V	'       d   \        WWR7      pM\        WWR7      pV
P                  WW ^ 4      pVP                  V4       V'       d   VP                  4        \        f   VsM\        P                  V4       \        VP                  VP                   VP"                  R7      # )8Package may only be specified for module-relative paths.r7  r5   r   rZ  r(  )r   ra   r   r   basenamer   r   r   r   r   rE  rG  r\  rH  r&   r  r  r  )r]   r_   r?   r^   rE   r   r]  r  r   r^  r   rY   Ztextr`  r   s   &&&&&&&&&&&&   r/   r   r   +  s   d  + , 	, $H$,$7$79ND |ww) }

Z &jWFwH d41=D
JJt~VvfllKKr0   c                 s    \        VR R7      p\        W%R7      pVP                  WVR7       F  pVP                  WR7       K  	  R# )F)r   r   rZ  )rE   )r-  N)r   r   ry   rE  )	r`   rE   r   r?   r-  r  r_  r`  r   r   r/   r   r     s?    $ 7E:F7DFA51

4
3 2r0   c                 sR    V \         ,          V 8w  d   \        R V 4      h\        pV sV# )zOnly reporting flags allowed)r   r   _unittest_reportflags)rF   oldrq   r/   r   r     s/    : 	E)7??
C!Jr0   c                   s~   a  ] tR tRt o RR ltR tR tR tR tR t	R	 t
R
 tR tR t]P                  tR tRtV tR# )DocTestCasei  Nc                s    \         P                  P                  V 4       W n        WPn        Wn        W0n        W@n        R # r(   )unittestTestCaser   _dt_optionflags_dt_checker_dt_test	_dt_setUp_dt_tearDown)r3   r   r  setUptearDownr  r   r/   r   ZDocTestCase.__init__  s4     	""4(*"$r0   c                s    V P                   pVP                  P                  4       V n        V P                  e   V P	                  V4       R # R # r(   )rj  rE   r   	_dt_globsrk  r3   r   rq   r/   rm  ZDocTestCase.setUp  s8    }}*>>%NN4  &r0   c                s    V P                   pV P                  e   V P                  V4       VP                  P                  4        VP                  P	                  V P
                  4       R # r(   )rj  rl  rE   rA  r   ro  rp  rq   r/   rn  ZDocTestCase.tearDown  sM    }}(d# 	



$..)r0   c                s\   V P                   p\        P                  p\        4       pV P                  pV\
        ,          '       g   V\        ,          p\        VV P                  R R7      p RVn	        VP                  WP                  R R7      pVP                  VP                  8X  d   \        P                  ! R4      h V\        n        VP                   '       d>   V P#                  V P%                  VP'                  4       P)                  R4      4      4      hR#   T\        n        i ; i)Fr  r  r   )r   rD  zall examples were skippedro   NzF----------------------------------------------------------------------)rj  rN   r   r!   rh  r   rc  r   ri  r"  rE  r:  r'   r,   rf  ZSkipTestr+   ZfailureExceptionformat_failurerj   r   )r3   r   rd  Znewr  r`  r-   s   &      r/   runTestZDocTestCase.runTest	  s    }}jjj**o-- 00K;'+'7'7H	#FNjj99%jHG'"3"33''(CDD 4 CJ>>>''(;(;CLLN<Q<QRV<W(XYY  CJs   ,AD D+c           
     s   V P                   pVP                  f   RpMRVP                  ,          pRP                  VP                  P	                  R4      R	R  4      pRVP                  : RVP
                  : RV: RV: RV: 2
# )
Nzunknown line numberz%sr   Failed doctest test for 	
  File "r  r  z

ru   )rj  r   r   r?   rw   r]   )r3   errr   r   Zlnamer   r/   rr  ZDocTestCase.format_failure	  sj    }};;*FDKK'F-bc23 99dmmVUCA 	r0   c                s    V P                  4        \        V P                  V P                  R R7      pVP	                  V P
                  R R7       V P                  4        R# )Frq  )rD  N)rm  r   rh  ri  rE  rj  rn  )r3   r`  rq   r/   r    ZDocTestCase.debug*	  sI    D 	

)=)=%)%5%5uF

4==e
4r0   c                .    V P                   P                  # r(   rj  r?   r   r@   r/   r   ZDocTestCase.idr	  s    }}!!!r0   c                sx   \        V 4      \        V4      Jd   \        # V P                  VP                  8H  ;'       d}    V P                  VP                  8H  ;'       d\    V P                  VP                  8H  ;'       d;    V P
                  VP
                  8H  ;'       d    V P                  VP                  8H  # r(   )r   r   rj  rh  rk  rl  ri  r   rT   r/   r   ZDocTestCase.__eq__u	  s    :T%[(!!}}. 5 5##u'<'<<5 5~~05 5   E$6$665 5 5#4#44		5r0   c                r   r(   )r   rh  rk  rl  ri  r   r@   r/   r   ZDocTestCase.__hash__	  s3    T))4>>4;L;L%%' ( 	(r0   c                s    V P                   P                  P                  R 4      pVR,          : RR P                  VRR 4      : R2# )r   r   Nr1   ru   )rj  r?   rw   r   )r3   r?   rq   r/   r2   ZDocTestCase.__repr__	  s<    }}!!'', HHchhtCRy&9::r0   c                s<    R V P                   P                  ,           # )z	Doctest: rx  r   r@   r/   shortDescriptionZDocTestCase.shortDescription	  s    T]]////r0   )ri  ro  rh  rk  rl  rj  )rA   NNN)r5   r6   r7   r8   r   rm  rn  rs  rr  r    r   r   r   r2   r   rV  ry  r9   r:   rs   rt   r/   re  re    sO     %!*Z2
FP"5(; nnG0 0r0   re  c                   s<   a  ] tR tRt o R tR tR tR t]tRt	V t
R# )SkipDocTestCasei	  c                s>    Wn         \        P                  V R 4       R # r(   )rS   re  r   )r3   rS   rT   r/   r   ZSkipDocTestCase.__init__	  s    T4(r0   c                s(    V P                  R 4       R# )z-DocTestSuite will not work with -O2 and aboveN)ZskipTestr   r@   r/   rm  ZSkipDocTestCase.setUp	  s    EFr0   c                r;  r(   r4   r   r@   r/   	test_skipZSkipDocTestCase.test_skip	      r0   c                s<    R V P                   P                  ,          # )zSkipping tests from %s)rS   r5   r   r@   r/   ry  Z SkipDocTestCase.shortDescription	  s    '$++*>*>>>r0   )rS   N)r5   r6   r7   r8   r   rm  r{  ry  rV  r9   r:   rs   rt   r/   rz  rz  	  s!     )G? Gr0   rz  c                   s&   a  ] tR tRt o R tRtV tR# )_DocTestSuitei	  c                r;  r(   r4   )r3   r&  rT   r/   _removeTestAtIndexZ _DocTestSuite._removeTestAtIndex	  r|  r0   r4   N)r5   r6   r7   r8   r~  r9   r:   rs   rt   r/   r}  r}  	  s      r0   r}  c                 s   Vf   \        4       p\        V 4      p VP                  WVR7      pV'       gF   \        P                  P
                  ^8  d'   \        4       pVP                  \        V 4      4       V# VP                  4        \        4       pV Fm  p\        VP                  4      ^ 8X  d   K  VP                  '       g"   V P                  pVRR  R8X  d   VR R pWn        VP                  \        V3/ VB 4       Ko  	  V# )Nr[  r  r  ru   )r   rU   ry   rN   rF   Zoptimizer}  addTestrz  r   r>   r   r]   r   re  )	rS   rE   r   Ztest_finderr   r   suiter   r]   s	   &&&&,    r/   r   r   	  s    J #ov&FVZHESYY''!+of-.	JJLOEt}}"}}}H}&#CR=$Mk$2'23  Lr0   c                   2   a  ] tR tRt o R tR tR tRtV tR# )DocFileCasei	  c                sj    R P                  V P                  P                  P                  R4      4      # )rC  r   )r   rj  r?   rw   r   r@   r/   r   ZDocFileCase.id	  s&    xx**00566r0   c                rw  r(   )rj  r]   r   r@   r/   r2   ZDocFileCase.__repr__	  s    }}%%%r0   c                sn    R V P                   P                  : RV P                   P                  : RV: 2# )rt  ru  z", line 0

)rj  r?   r]   )r3   rv  rT   r/   rr  ZDocFileCase.format_failure	  s(    ==%%t}}'='=sD 	r0   r4   N)	r5   r6   r7   r8   r   r2   rr  r9   r:   rs   rt   r/   r  r  	  s     7& r0   r  c                 s*   Vf   / pMVP                  4       pV'       d   V'       g   \        R4      h\        YTT;'       g    R4      w  rpRV9  d   WR&   \        P                  P                  V 4      pVP                  WsW^ 4      p	\        V	3/ VB # )Nra  r7  r   )r   r   ra   r   r   rb  r   r  )
r   r_   r^   rE   r   rY   r   Zdocr?   r   s
   &&&&&&,   r/   DocFileTestr  	  s     }

 + , 	, to'2274IC  j 77D!D c$a8Dt'w''r0   c                  s    \        4       pVP                  R R4      '       d   \        VP                  R4      4      VR&   V  F  pVP                  \	        V3/ VB 4       K   	  V# )r_   Tr^   )r}  rC   rU   r  r  )ZpathsZkwr  r   s   *,  r/   r   r   

  s^    p OE
 
vv&&)"&&*;<9k$-"-.  Lr0   c                 s   . p\        4       P                  V 4       F  p\        V\        4      '       dy   VP	                  VP
                  R R 4       VP                  pV'       dE   VP	                  R4       YP                  R4      R R  Uu. uF  pRV,           NK  	  up,          pK  K  TVP                  R4      R R  Uu. uF  p\        V4      NK  	  up,          pK  	  V'       d!   VR,          R8X  d   VP                  4        K(  V'       d"   V^ ,          R8X  d   VP                  ^ 4       K)  RP                  V4      R,           # u upi u upi )Nz# Expected:ro   z## r~   ru   )r   r   rK   r   r   r   rz   rw   r   r?  r   )re   r   Zpiecerz   r   rl   r/   r   r   S
  s    t F&&q)eW%%MM%,,s+,::Dm,JJt,<Sb,AB,Aq577,ABB 
  %D 1#2 68 61 %Q' 68 8F * VBZ3&


VAY#%

1 99Vt## C8s   EEc                 s   \        V 4      p \        4       P                  V 4      pV Uu. uF  q3P                  V8X  g   K  VNK  	  ppV'       g   \	        VR 4      hV^ ,          p\        VP                  4      pV# u upi )znot found in tests)rU   r   ry   r?   r   r   r   )rS   r?   r   Ztr   testsrcr|   r/   r   r   
  sp     v&FO  (E/u!$AAuD/3447D"4>>2GN 0s   A< A<c                 s4    \        V 4      p\        W1V4       R # r(   )r   debug_script)srcpmrE   r  r   r/   r   r   
  s    "3'Ge$r0   c                 s   ^ RI pV'       d   VP                  4       pM/ pV'       d    \        WV4       R# VP                  ! RR7      P                  RV ,          W"4       R#    \        \        P
                  ! 4       ^,          4       TP                  ! RR7      pTP                  4        TP                  R\        P
                  ! 4       ^,          4        R# ; i)rA   NT)r   zexec(%r))
r   r   r*  r   rN   rk   r   r$  ZinteractionrE  )r  r  rE   r   Zpr6  r/   r  r  
  s    

		3U# 	"":#3UB	3#,,.#$&AGGIMM$q 12s   A# #A6Cc                 s^    \        V 4      p \        W4      p\        W2V P                  4       R # r(   )rU   r   r  r   )rS   r?   r  r  r   r/   r    r    
  s&     v&F&Gfoo.r0   c                   r  )
_TestClassi
  c                s    Wn         R # r(   r   )r3   r   rT   r/   r   Z_TestClass.__init__
  s	     r0   c                s6    V P                   ^,          V n         V # r%  r  r   r@   r/   squareZ_TestClass.square
  s     88q=r0   c                s    V P                   # r(   r  r   r@   r/   rC   Z_TestClass.get
  s     xxr0   r  N)	r5   r6   r7   r8   r   r  rC   r9   r:   rs   rt   r/   r  r  
  s      r0   r  r   z
                      Example of a string object, searched as-is.
                      >>> x = 1; y = 2
                      >>> x + y, x * y
                      (3, 2)
                      zbool-int equivalencea  
                                    In 2.2, boolean expressions displayed
                                    0 or 1.  By default, we still accept
                                    them.  This can be disabled by passing
                                    DONT_ACCEPT_TRUE_FOR_1 to the new
                                    optionflags argument.
                                    >>> 4 == 4
                                    1
                                    >>> 4 == 4
                                    True
                                    >>> 4 > 4
                                    0
                                    >>> 4 > 4
                                    False
                                    zblank linesz
                Blank lines can be marked with <BLANKLINE>:
                    >>> print('foo\n\nbar\n')
                    foo
                    <BLANKLINE>
                    bar
                    <BLANKLINE>
            Zellipsisz
                If the ellipsis flag is used, then '...' can be used to
                elide substrings in the desired output:
                    >>> print(list(range(1000))) #doctest: +ELLIPSIS
                    [0, 1, 2, ..., 999]
            zwhitespace normalizationa  
                If the whitespace normalization flag is used, then
                differences in whitespace are ignored.
                    >>> print(list(range(30))) #doctest: +NORMALIZE_WHITESPACE
                    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
                     15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
                     27, 28, 29]
            c            	      s:   ^ RI p V P                  RRR7      pVP                  RRRRR	R
7       VP                  RRR\        P	                  4       . RR7       VP                  RRRRR7       VP                  RRRR7       VP                  4       pVP                  pVP                  p^ pVP                   F  pV\        V,          ,          pK  	  VP                  '       d   V\        ,          pV F  pVP                  R4      '       dq   \        P                  P                  V4      w  r\        P                  P!                  ^ V4       \#        VRR 4      p	\        P                  ^  \%        WVR7      w  rM\'        VRWER7      w  rV
'       g   K   ^# 	  ^ # )rA   Nzdoctest runnerT)ZdescriptionZcolorr
  z	--verboseZ
store_trueFz'print very verbose output for all tests)actiondefaulthelpz-oz--optionr   zqspecify a doctest option flag to apply to the test run; may be specified more than once to apply multiple options)r  Zchoicesr  r  z-fz--fail-fastzystop running tests after first failure (this is a shorthand for -o FAIL_FAST, and is in addition to any other -o options))r  r  rh   r   z file containing the tests to run)Znargsr  z.pyrZ  )r_   r   r  i)argparseZArgumentParserZadd_argumentr=   ZkeysZ
parse_argsrh   r   r   Z	fail_fastr   rp   r   r   rw   rN   ZinsertrM   r   r   )r  r   r   Z	testfilesr   r   r   r]   Zdirnamer   r  rC  s               r/   _testr  ;  s   $$1A$NF
k,F  H
j 3 8 8 :BE  G
 mLF  H c?  AD		I llGG++&v.. ~~~9U## !#h 7GHHOOAw'8CR=)A!!'JKHa"8U-4KKH8  r0   r   r  )r   )	NNNNTrA   NFF)FZNoNameNrA   r	  )FNr<  )YZ__docformat__Z__all__rB   rQ  r  rI   r   r   r   rc   rN   ri   rf  Zior!   r"   Zcollectionsr#   r>  r$   r%   Z
__unittestr&   r=   r    r   r   r   r   r   r   r   r   r	   r
   r   r   r   rN  rv   rH   rU   rW   ra   rg   rm   rn   r}   r   r   r   r   rZ   r   r   r   r   r   rF  r   Z	Exceptionr   r   r   r\  r   r   r   rc  r   rg  re  rz  Z	TestSuiter}  r   r  r  r   r   r   r   r  r    r  r   r  r5   Zexitr4   r0   r/   <module>r     s  ` &++ + 	+
 + + + + + + + +  + + +$ %+& '+* ++. /+2 3+4 5+6 7+8 9+: ;+> ?+@ A+B C+F G+H I+J K+N O+P Q+R S+T U+Z      	 
 	 
   2 "  . 
&*],>? &L  O --EF +,CD *+AB z*6"-.GH *)*()  	
 ,,  #>2">2">2/0KL ,	   -- 	 ! &
>2D"$/	   /b4"%CGG "%J ,\B$ B$HGD GDZd; d;VM Mf
o/ o/dP5 P5dY &) &e1- e1\ 
fLR (,$dU=?yLx46  !Hb0(## b0Hk "H&& >@+  '+D=?(4CRP$d %
C(	/* *X *  # %(      ' )Q0f*Z zHHUW r0   