+
    Bi<             	       ~
   R 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 ]P                  P                   P#                  R4      t]P                  P                   P#                  R4      tR}tR tR tR tR tR	 t^t^t^tR
 t ! R R]
P<                  4      t ! R R4      t  ! R R] ]
P<                  4      t!]PD                  PF                  t$]$PJ                  R3]$PL                  R3]$PN                  R3]$PP                  R3]$PR                  R3]$PT                  R3.t+]$PX                  R3]$PZ                  R3]$P\                  R3.t/]+]/,           ]$P`                  R3]$Pb                  R3.,           t2]Pf                  ! ]Ph                  ]2 U Uu. uF  w  rV NK	  	  upp ^ 4      ]$Pj                  ,          t6R t7. R~O]7n#        R t8. RO]8n#        R t9. RO]9n#        R t:. RO]:n#        R  t;. RO];n#        ]	Px                  ]	Pz                  3t> ! R! R"] 4      t? ! R# R$]?]
P<                  4      t@]$Pb                  ]$P`                  ]$PN                  ]$PZ                  ]$PP                  3tA]$PJ                  ]$PL                  3tB^ R%ICHDtD  ! R& R']?]
P<                  4      tE ! R( R)4      tF ! R* R+4      tG ! R, R-] ]
P<                  4      tH ! R. R/] ]
P<                  4      tI ! R0 R1] ]
P<                  4      tJ ! R2 R3] ]
P<                  4      tK ! R4 R54      tL ! R6 R7] ]
P<                  4      tM ! R8 R9]L4      tN ! R: R;]L4      tO ! R< R=]L4      tP ! R> R?]L4      tQ ! R@ RA]L4      tR ! RB RC4      tS ! RD RE4      tT ! RF RG]M4      tU ! RH RI4      tV ! RJ RK4      tW ! RL RM]W4      tX ! RN RO]W4      tY]L]S]V]X]Y3tZ ! RP RQ]M4      t[ ! RR RS4      t\]\]V3t] ! RT RU]M4      t^ ! RV RW] ]
P<                  4      t_]S]V]X]Y3t` ! RX RY] ]
P<                  4      taRZ tb ! R[ R\4      tc ! R] R^]c4      td ! R_ R`]c4      te ! Ra Rb]c4      tf ! Rc Rd4      tg ! Re Rf]g4      th ! Rg Rh]g4      ti]c]d3tj]c]d]V3tk]c]d]V]L]T3tl]f]e3tm]h]i3tn ! Ri Rj]M4      to ! Rk Rl] ]
P<                  4      tp ! Rm Rn]M4      tq ! Ro Rp] ]
P<                  4      tr ! Rq Rr]
P<                  ] 4      ts ! Rs Rt] ]
P<                  4      tt ! Ru Rv] ]
P<                  4      tu ! Rw Rx]M4      tv ! Ry Rz]
P<                  4      tw ! R{ R|] ]
P<                  4      txR# u upp i )z"Test suite for the sys.monitoring.N)requires_specialization_ftscript_helper	_testcapi_testinternalcapic                      R # N r       +/usr/lib/python3.14/test/test_monitoring.pyf1r          r	   c                  H    \        . 4       \        P                  ! ^ 4       R#     N)lensys	getsizeofr   r	   r
   f2r      s    GMM!r	   c                       \          F  p K  	  R # r   )PAIR)items    r
   floopr      s     r	   c               #      "   R x  R x  R # 5ir   r   r   r	   r
   genr   !   s     		   c                  (    \        4        F  p K  	  R # r   )r   )_s    r
   g1r   %   s    U r	   c                 <    V P                   P                  V,           # r   )__code__co_firstlineno)funcoffsets   &&r
   nth_liner#   -   s    ==''&00r	   c                   8   a  ] tR t^0t o R tR tR tR tRtV t	R# )MonitoringBasicTestc                L    \         P                  P                  \        4       R # r   )r   
monitoringfree_tool_id	TEST_TOOLselfs   &r
   tearDownMonitoringBasicTest.tearDown2   s    ##I.r	   c                   \         P                  pVP                   VP                   VP                   VP
                   VP                   VP                   VP                   VP                   VP                   VP                   VP                   VP                   VP                   VP                  P                   R # r   )r   r'   eventsuse_tool_idclear_tool_idr(   get_tool
get_events
set_eventsget_local_eventsset_local_eventsregister_callbackrestart_eventsDISABLEMISSING	NO_EVENTS)r+   ms   & r
   test_has_objects$MonitoringBasicTest.test_has_objects5   s{    NN					

													r	   c                T   \         P                  P                  \        R 4       V P	                  \         P                  P                  \        4      R 4       \         P                  P                  \        ^4       V P	                  \         P                  P                  \        4      ^4       \         P                  P                  \        ^ 4       V P                  \        4      ;_uu_ 4        \         P                  P                  \        \         P                  P                  P                  4       RRR4       V P                  \        4      ;_uu_ 4        \         P                  P                  \        \         P                  P                  P                  4       RRR4       \         P                  P                  \        4       V P	                  \         P                  P                  \        4      R4       V P                  \        4      ;_uu_ 4        \         P                  P                  \        \         P                  P                  P                  4       RRR4       R#   + '       g   i     ELA; i  + '       g   i     L; i  + '       g   i     R# ; i)MonitoringTest.ToolN)r   r'   r0   r)   assertEqualr2   r4   r3   assertRaises
ValueErrorr/   C_RETURNC_RAISEr(   CALLr*   s   &r
   	test_toolMonitoringBasicTest.test_toolF   s   ""9.CD00;=RS!!)R0229=rB!!)Q/z**NN%%i1F1F1O1OP +z**NN%%i1F1F1N1NO +##I.00;TBz**NN%%i1F1F1K1KL +* +**** +**s'   0AI/AJAJ/J 	J	J'	c                  a . o\         P                  P                  \        R 4       \         P                  P	                  \        \
        P                  V3R l4       \         P                  P	                  \        \
        P                  V3R l4       R p\         P                  P                  \        VP                  \
        P                  4       \         P                  P                  \        \
        P                  4       V! 4        \         P                  P                  \        4       V! 4        V P                  \        S4      ^4       \         P                  P	                  \        \
        P                  R4      pV P                  VR4       \         P                  P                  \        4       . o\         P                  P                  \        R 4       \         P                  P	                  \        \
        P                  V3R l4       \         P                  P                  \        VP                  \
        P                  4       V! 4        \         P                  P                  \        4       \         P                  P                  \        R 4       V! 4        V P                  \        S4      ^4       \         P                  P                  \        4       R# )r@   c                  &   < SP                  V 4      # r   appendargsr/   s   *r
   <lambda>0MonitoringBasicTest.test_clear.<locals>.<lambda>X   s    fmm\`Nar	   c                  &   < SP                  V 4      # r   rK   rM   s   *r
   rO   rP   Y       &--X\J]r	   c                  
    ^p R#    Nr   as    r
   f)MonitoringBasicTest.test_clear.<locals>.fZ   s    Ar	   Nc                  &   < SP                  V 4      # r   rK   rM   s   *r
   rO   rP   n   rR   r	   )r   r'   r0   r)   r7   EPY_STARTLINEr6   r   r4   r1   rA   r   assertIsr(   )r+   rX   callbackr/   s   &  @r
   
test_clearMonitoringBasicTest.test_clearU   s   ""9.CD((AJJ@ab((AFF<]^	''	1::qvvF!!)QZZ8	$$Y/	
 	Va(>>33IqvvtLh%##I.""9.CD((AFF<]^''	1::qvvF	##I.""9.CD	 	Va(##I.r	   r   N)
__name__
__module____qualname____firstlineno__r,   r=   rG   r`   __static_attributes____classdictcell____classdict__s   @r
   r%   r%   0   s     /"M#/ #/r	   r%   c                   ,   a  ] tR t^{t o R tR tRtV tR# )MonitoringTestBasec                4   \        ^4       F2  pV P                  \        P                  P	                  V4      ^ 4       K4  	  V P                  \        P                  P                  \        4      R4       V P                  \        P                  P                  \        4      R4       V P                  \        P                  P                  \        4      R4       \        P                  P                  \        RV P                  P                  ,           4       \        P                  P                  \        RV P                  P                  ,           4       \        P                  P                  \        RV P                  P                  ,           4       R# )   Nztest ztest2 ztest3 )rangerA   r   r'   r3   r^   r2   r)   
TEST_TOOL2
TEST_TOOL3r0   	__class__rb   r+   tools   & r
   setUpMonitoringTestBase.setUp}   s    !HDS^^66t<a@ cnn--i8$?cnn--j94@cnn--j94@""9g8O8O.OP"":x$..:Q:Q/QR"":x$..:Q:Q/QRr	   c                Z   \        ^4       F2  pV P                  \        P                  P	                  V4      ^ 4       K4  	  \        P                  P                  \        4       \        P                  P                  \        4       \        P                  P                  \        4       R# )rm   N)	rn   rA   r   r'   r3   r(   r)   ro   rp   rr   s   & r
   r,   MonitoringTestBase.tearDown   se    !HDS^^66t<a@ ##I.##J/##J/r	   r   N)rb   rc   rd   re   rt   r,   rf   rg   rh   s   @r
   rk   rk   {   s     	S0 0r	   rk   c                   D   a  ] tR t^t o R tR tR tR tR tR t	Rt
V tR# )	MonitoringCountTestc                    ! R  R4      pV! 4       p\         P                  P                  \        W%4       V\        P
                  8X  g   V\        P                  8X  d4   \         P                  P                  \        \        P                  4       M$\         P                  P                  \        V4       V P                  VP                  ^ 4       ^ Vn
        V! 4        V P                  VP                  V4       \         P                  P                  \        VR4      p^ Vn
        V! 4        V P                  VP                  ^ 4       V P                  We4       \         P                  P                  \        ^ 4       R# )c                   ,   a  ] tR t^t o R tR tRtV tR# )6MonitoringCountTest.check_event_count.<locals>.Counterc                    ^ V n         R# r   countr*   s   &r
   __init__?MonitoringCountTest.check_event_count.<locals>.Counter.__init__   s	    
r	   c                8    V ;P                   ^,          un         R# rT   r~   r+   rN   s   &*r
   __call__?MonitoringCountTest.check_event_count.<locals>.Counter.__call__   s    

a
r	   r~   Nrb   rc   rd   re   r   r   rf   rg   rh   s   @r
   Counterr|      s        r	   r   N)r   r'   r7   r)   r[   rD   rE   r4   rF   rA   r   )r+   r!   eventexpectedr   counterprevs   &&&&   r
   check_event_count%MonitoringCountTest.check_event_count   s    	  	  )((ECAJJ%199"4NN%%i8NN%%i7*1~~//	5$G*'!!)Q/r	   c                P    V P                  \        \        P                  ^4       R# rT   )r   r   r[   r\   r*   s   &r
   test_start_count$MonitoringCountTest.test_start_count       r1::q1r	   c                P    V P                  \        \        P                  ^4       R#    N)r   r   r[   	PY_RESUMEr*   s   &r
   test_resume_count%MonitoringCountTest.test_resume_count       r1;;2r	   c                P    V P                  \        \        P                  ^4       R# rT   )r   r   r[   	PY_RETURNr*   s   &r
   test_return_count%MonitoringCountTest.test_return_count   r   r	   c                P    V P                  \        \        P                  ^4       R#    N)r   r   r[   rF   r*   s   &r
   test_call_count#MonitoringCountTest.test_call_count   s    r1661-r	   c                P    V P                  \        \        P                  ^4       R# r   )r   r   r[   rD   r*   s   &r
   test_c_return_count'MonitoringCountTest.test_c_return_count   r   r	   r   N)rb   rc   rd   re   r   r   r   r   r   r   rf   rg   rh   s   @r
   ry   ry      s(     02233.2 2r	   ry   startresumereturnyieldjumpbranchraiseunwindexception_handledc_raisec_returnc                      R # r   r   r   r	   r
   	just_passr      r   r	   c                      \         hr   	Exceptionr   r	   r
   
just_raiser      s    
Or	   c                      \        . 4       R # r   r   r   r	   r
   	just_callr      s	    Gr	   c                  >     ^^ ,           R#   \          d     R# i ; irT   r   r   r	   r
   caughtr      s"    	! s   	 c                      \        4        R # r   )r   r   r	   r
   nested_callr     s    Kr	   c                   0   a  ] tR tRt o R tRR ltRtV tR# )MonitoringEventsBasei  c                  a . o\          F3  w  r#R V/V3R llp\        P                  P                  \        W$4       K5  	  V3R lp\        P                  P                  \        \
        P                  V4       \        P                  P                  \        \        4       . o V! 4        \        P                  P                  \        ^ 4       SRR oS#     L/; i)
event_namec                 *   < SP                  V 4       R # r   rK   )r   rN   r/   s   $*r
   record2MonitoringEventsBase.gather_events.<locals>.record  s    j)r	   c                 |   < \        V\        4      '       d   SP                  R 4       R# SP                  R4       R# )py_callc_callN)
isinstancePY_CALLABLESrL   )coder"   objargr/   s   &&&&r
   record_call7MonitoringEventsBase.gather_events.<locals>.record_call  s(    #|,,i(h'r	   N)	SIMPLE_EVENTSr   r'   r7   r)   r[   rF   r4   SIMPLE_EVENT_SET)r+   r!   r   r   r   r   r/   s   &&    @r
   gather_events"MonitoringEventsBase.gather_events  s    !.E* *NN,,YF "/	(
 	((AFFKH!!)-=>	F 	!!)Q/	s   %C CNc                j    V P                  V4      pVf   VP                  pV P                  W24       R # r   )r   r/   rA   )r+   r!   r   r/   s   &&& r
   check_events!MonitoringEventsBase.check_events*  s/    ##D){{H*r	   r   r   )rb   rc   rd   re   r   r   rf   rg   rh   s   @r
   r   r     s     .+ +r	   r   c                   >   a  ] tR tRt o R tR tR tR tR tRt	V t
R# )	MonitoringEventsTesti0  c                0    V P                  \        4       R # r   )r   r   r*   s   &r
   test_just_pass#MonitoringEventsTest.test_just_pass2      )$r	   c                     V P                  \        4       V P                  \        P
                  P                  \        4      ^ 4       R#   \         d     LBi ; ir   )r   r   r   rA   r   r'   r3   r)   r*   s   &r
   test_just_raise$MonitoringEventsTest.test_just_raise5  sJ    	j) 	229=qA  		s   A AAc                0    V P                  \        4       R # r   )r   r   r*   s   &r
   test_just_call#MonitoringEventsTest.test_just_call<  r   r	   c                0    V P                  \        4       R # r   )r   r   r*   s   &r
   test_caught MonitoringEventsTest.test_caught?  s    &!r	   c                0    V P                  \        4       R # r   )r   r   r*   s   &r
   test_nested_call%MonitoringEventsTest.test_nested_callB  s    +&r	   r   N)rb   rc   rd   re   r   r   r   r   r   rf   rg   rh   s   @r
   r   r   0  s$     %B%"' 'r	   r   )testfuncc                   ,   a  ] tR tRt o R tR tRtV tR# )SimulateProfileTestiJ  c                T   V P                  \        4      p\        P                  ! V4      pV P	                  VR ,          VR,          4       V P	                  VR,          VR,          VR,          ,           4       V P	                  VR,          VR,          VR,          ,           4       R# )r   r   r   r   r   r   r   N)r   r   collectionsr   rA   )r+   r/   cs   &  r
   test_balanced!SimulateProfileTest.test_balancedL  s~    ##H-'8a
m47Qx[1X;%>?7Q':%;ak%IJr	   c                  aaa R V n         . o. o\        4       oVV3R lpVV3R lpV3R lp\         F'  p\        P                  P                  \        WA4       K)  	  \         F'  p\        P                  P                  \        WB4       K)  	  \        P                  P                  \        \        P                  V4       \        P                  P                  \        \        4       \        4        \        P                  P                  \        ^ 4       V P                  S. 4       V P                  S\        P                  ! 4       .4       V P                  \        S4      ^	4       R # )Nc                     < \         P                  ! ^4      pS'       g   SP                  R4       R# SP                  4       pW8w  d   SP                  RV RV 24       R# R# )rU   emptyz	 Popping z
 expected N)r   	_getframerL   pop)rN   framer   errorsstacks   *  r
   up0SimulateProfileTest.test_frame_stack.<locals>.upX  sO    MM!$Eg& 99;$MMIeWJxj"IJ %r	   c                     < \         P                  ! ^4      pSP                  V4       SP                  VP                  4       R# rT   )r   r   rL   addf_code)rN   r   seenr   s   * r
   down2SimulateProfileTest.test_frame_stack.<locals>.down`  s-    MM!$ELLHHU\\"r	   c                    < \        V\        4      '       g(   SP                  \        P                  ! ^4      4       R# R# rT   )r   r   rL   r   r   )r   r"   callabler   r   s   &&&&r
   call2SimulateProfileTest.test_frame_stack.<locals>.calld  s*    h55S]]1-. 6r	   )maxDiffset	UP_EVENTSr   r'   r7   r)   DOWN_EVENTSr[   rF   r4   r   r   rA   r   r   )r+   r   r   r  r   r   r   r   s   &    @@@r
   test_frame_stack$SimulateProfileTest.test_frame_stackS  s    u	K	#	/ ENN,,YB  ENN,,YD !((AFFDA!!)-=>
!!)Q/$ 12TA&r	   )r  N)rb   rc   rd   re   r   r  rf   rg   rh   s   @r
   r   r   J  s     K' 'r	   r   c                   ,   a  ] tR tRt o R tR tRtV tR# )CounterWithDisableit  c                "    R V n         ^ V n        R# FN)disabler   r*   s   &r
   r   CounterWithDisable.__init__v  s    
r	   c                    V ;P                   ^,          un         V P                  '       d   \        P                  P                  # R# rT   )r   r  r   r'   r9   r   s   &*r
   r   CounterWithDisable.__call__z  s-    

a
<<<>>))) r	   )r   r  Nr   rh   s   @r
   r  r  t  s     * *r	   r  c                   ,   a  ] tR tRt o R tR tRtV tR# )RecorderWithDisablei  c                     R V n         Wn        R# r  r  r/   r+   r/   s   &&r
   r   RecorderWithDisable.__init__  s    r	   c                    V P                   P                  V4       V P                  '       d   \        P                  P
                  # R # r   )r/   rL   r  r   r'   r9   )r+   r   r   s   &&&r
   r   RecorderWithDisable.__call__  s2    5!<<<>>))) r	   r  Nr   rh   s   @r
   r  r    s     * *r	   r  c                   ,   a  ] tR tRt o R tR tRtV tR# )MontoringDisableAndRestartTesti  c                    \        4       p\        P                  P                  \        \
        P                  V4       \        P                  P                  \        \
        P                  4       V P                  VP                  ^ 4       ^ Vn	        \        4        V P                  VP                  ^4       RVn        ^ Vn	        \        4        V P                  VP                  ^4       ^ Vn	        \        4        V P                  VP                  ^ 4       \        P                  P                  \        ^ 4       \        P                  P                  4        R#   \        P                  P                  4        i ; i)r   TN)r  r   r'   r7   r)   r[   r\   r4   rA   r   r   r  r8   r+   r   s   & r
   test_disable+MontoringDisableAndRestartTest.test_disable  s    	,(*GNN,,Y

GLNN%%i<W]]A.GMDW]]A."GOGMDW]]A.GMDW]]A.NN%%i3NN))+CNN))+s   D=E  E?c                    \        4       p\        P                  P                  \        \
        P                  V4       \        P                  P                  \        \
        P                  4       R Vn        \        4        ^ Vn
        \        4        V P                  VP                  ^ 4       \        P                  P                  4        ^ Vn
        \        4        V P                  VP                  ^4       \        P                  P                  \        ^ 4       \        P                  P                  4        R#   \        P                  P                  4        i ; iTN)r  r   r'   r7   r)   r[   r\   r4   r  r   r   rA   r8   r  s   & r
   test_restart+MontoringDisableAndRestartTest.test_restart  s    	,(*GNN,,Y

GLNN%%i<"GODGMDW]]A.NN))+GMDW]]A.NN%%i3NN))+CNN))+s   DD> > Er   N)rb   rc   rd   re   r  r"  rf   rg   rh   s   @r
   r  r    s     ,(, ,r	   r  c                   >   a  ] tR tRt o R tR tR tR tR tRt	V t
R# )	MultipleMonitorsTesti  c                    V P                  \        P                  P                  4       / 4       \	        4       p\	        4       p\        P                  P                  \        \        P                  V4       \        P                  P                  \        \        P                  V4       \        P                  P                  \        \        P                  4       \        P                  P                  \        \        P                  4       V P                  \        P                  P                  \        4      \        P                  4       V P                  \        P                  P                  \        4      \        P                  4       V P                  \        P                  P                  4       R ^\        ,          ^\        ,          ,          /4       ^ Vn        ^ Vn        \        4        VP                  pVP                  pV P                  W43R4       \        P                  P                  \        ^ 4       \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       \        P                  P                  \        \        P                  R4       V P                  \        P                  P                  4       / 4       R#   \        P                  P                  \        ^ 4       \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       \        P                  P                  \        \        P                  R4       T P                  \        P                  P                  4       / 4       i ; i)r\   NrU   rU   )rA   r   r'   _all_eventsr  r7   r)   r[   r\   ro   r4   r3   r   r   r+   counter1counter2count1count2s   &    r
   test_two_same"MultipleMonitorsTest.test_two_same  s>   	?S^^7792>)+H)+HNN,,Y

HMNN,,ZXNNN%%i<NN%%j!**=S^^66yA1::NS^^66zBAJJOS^^779Ji\]ak\kHl;mnHNHND^^F^^Ff-v6NN%%i3NN%%j!4NN,,Y

DINN,,ZTJS^^7792>	 NN%%i3NN%%j!4NN,,Y

DINN,,ZTJS^^7792>s   HK> >COc                
    V P                  \        P                  P                  4       / 4       \	        4       p\	        4       p\	        4       p\        P                  P                  \        \        P                  V4       \        P                  P                  \        \        P                  V4       \        P                  P                  \        \        P                  V4       \        P                  P                  \        \        P                  4       \        P                  P                  \        \        P                  4       \        P                  P                  \        \        P                  4       V P                  \        P                  P                  \        4      \        P                  4       V P                  \        P                  P                  \        4      \        P                  4       V P                  \        P                  P                  \        4      \        P                  4       V P                  \        P                  P                  4       R ^\        ,          ^\        ,          ,          ^\        ,          ,          /4       ^ Vn        ^ Vn        ^ Vn        \        4        VP                  pVP                  pVP                  pV P                  WEV3R4       \        P                  P                  \        ^ 4       \        P                  P                  \        ^ 4       \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       \        P                  P                  \        \        P                  R4       \        P                  P                  \        \        P                  R4       V P                  \        P                  P                  4       / 4       R#   \        P                  P                  \        ^ 4       \        P                  P                  \        ^ 4       \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       \        P                  P                  \        \        P                  R4       \        P                  P                  \        \        P                  R4       T P                  \        P                  P                  4       / 4       i ; i)r\   N)rU   rU   rU   )rA   r   r'   r(  r  r7   r)   r[   r\   ro   rp   r4   r3   r   r   )r+   r*  r+  counter3r,  r-  count3s   &      r
   test_three_same$MultipleMonitorsTest.test_three_same  s   	?S^^7792>)+H)+H)+HNN,,Y

HMNN,,ZXNNN,,ZXNNN%%i<NN%%j!**=NN%%j!**=S^^66yA1::NS^^66zBAJJOS^^66zBAJJOS^^779Ji\]ak\kHlpqup  IA  <B  CHNHNHND^^F^^F^^Fff5yANN%%i3NN%%j!4NN%%j!4NN,,Y

DINN,,ZTJNN,,ZTJS^^7792> NN%%i3NN%%j!4NN%%j!4NN,,Y

DINN,,ZTJNN,,ZTJS^^7792>s   K4P+ +D5U c                    V P                  \        P                  P                  4       / 4       \	        4       p\	        4       p\        P                  P                  \        \        P                  V4       \        P                  P                  \        \        P                  V4       \        P                  P                  \        \        P                  4       \        P                  P                  \        \        P                  4       V P                  \        P                  P                  \        4      \        P                  4       V P                  \        P                  P                  \        4      \        P                  4       V P                  \        P                  P                  4       R ^\        ,          R^\        ,          /4       ^ Vn        ^ Vn        \        4        VP                  pVP                  pV P                  W43R4       \        P                  P                  \        ^ 4       \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       \        P                  P                  \        \        P                  R4       V P                  \        P                  P                  4       / 4       R#   \        P                  P                  \        ^ 4       \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       \        P                  P                  \        \        P                  R4       T P                  \        P                  P                  4       / 4       i ; i)r\   r   Nr'  )rA   r   r'   r(  r  r7   r)   r[   r\   ro   r   r4   r3   r   r   r)  s   &    r
   test_two_different'MultipleMonitorsTest.test_two_different  s>   	?S^^7792>)+H)+HNN,,Y

HMNN,,ZhONN%%i<NN%%j!++>S^^66yA1::NS^^66zBAKKPS^^779JYXcefjtet;uvHNHND^^F^^Ff-v6NN%%i3NN%%j!4NN,,Y

DINN,,ZdKS^^7792>	 NN%%i3NN%%j!4NN,,Y

DINN,,ZdKS^^7792>s   HK9 9COc                    V P                  \        P                  P                  4       / 4       \	        4       p\	        4       p\        P                  P                  \        \        P                  V4       \        P                  P                  \        \        P                  V4       \        P                  P                  \        \        P                  4       \        P                  P                  \        \        P                  4       V P                  \        P                  P                  \        4      \        P                  4       V P                  \        P                  P                  \        4      \        P                  4       V P                  \        P                  P                  4       R ^\        ,          ^\        ,          ,          /4       ^ Vn        ^ Vn        RVn        \        4        VP                  pVP                  pV P                  W43R4       ^ Vn        ^ Vn        \        4        VP                  pVP                  pV P                  W43R4       \        P                  P                  \        ^ 4       \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       \        P                  P                  \        \        P                  R4       V P                  \        P                  P                  4       / 4       \        P                  P                  4        R#   \        P                  P                  \        ^ 4       \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       \        P                  P                  \        \        P                  R4       T P                  \        P                  P                  4       / 4       \        P                  P                  4        i ; i)r\   TNr'  r   rU   )rA   r   r'   r(  r  r7   r)   r[   r\   ro   r4   r3   r   r  r   r8   r)  s   &    r
   test_two_with_disable*MultipleMonitorsTest.test_two_with_disable
  s   	,S^^7792>)+H)+HNN,,Y

HMNN,,ZXNNN%%i<NN%%j!**=S^^66yA1::NS^^66zBAJJOS^^779Ji\]ak\kHl;mnHNHN#HD^^F^^Ff-v6HNHND^^F^^Ff-v6NN%%i3NN%%j!4NN,,Y

DINN,,ZTJS^^7792>NN))+ NN%%i3NN%%j!4NN,,Y

DINN,,ZTJS^^7792>NN))+s   I(M& &C<Q"c                Z   R pVP                   p V P                  \        P                  P	                  4       / 4       \        P                  P                  \        V\        P                  \        P                  ,          4       \        P                  P                  \        V\        P                  4       \        P                  P                  \        ^ 4       \        P                  P                  \        ^ 4       V P                  \        P                  P	                  4       / 4       R#   \        P                  P                  \        ^ 4       \        P                  P                  \        ^ 4       T P                  \        P                  P	                  4       / 4       i ; i)zWTest that the second tool can set events with instruction events set by the first tool.c                      R # r   r   r   r	   r
   rX   ;MultipleMonitorsTest.test_with_instruction_event.<locals>.f-      r	   N)r   rA   r   r'   r(  r6   r)   r[   INSTRUCTIONr]   ro   r4   )r+   rX   r   s   &  r
   test_with_instruction_event0MultipleMonitorsTest.test_with_instruction_event+  s    	zz	?S^^7792>NN++ItQ]]QVV=STNN++JaffENN%%i3NN%%j!4S^^7792> NN%%i3NN%%j!4S^^7792>s   B)D2 2A8F*r   N)rb   rc   rd   re   r.  r3  r6  r:  rA  rf   rg   rh   s   @r
   r%  r%    s%     ?2?B?2,B? ?r	   r%  c                   V   a  ] tR tRt o R tR tR t]3R ltR t	R t
R tR	 tR
tV tR# )LineMonitoringTesti;  c                4    V P                  \        P                  P                  4       / 4       . p\	        V4      p\        P                  P                  \        \        P                  V4       \        P                  P                  \        \        P                  4       \        4        \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       \        \        P                  ^ 4      pV P                  W^,           \        \        ^4      V^,           .4       \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       V P                  \        P                  P                  4       / 4       \        P                  P                  4        R#   \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       T P                  \        P                  P                  4       / 4       \        P                  P                  4        i ; ir   )rA   r   r'   r(  r  r7   r)   r[   r]   r4   r   r#   rD  test_lines_singler8   )r+   r/   recorderr   s   &   r
   rF  $LineMonitoringTest.test_lines_single=  s   	,S^^7792>F*62HNN,,YINN%%i8DNN%%i3NN,,YE/AA1EEVAgxAa%HINN%%i3NN,,YES^^7792>NN))+ NN%%i3NN,,YES^^7792>NN))+s   EG2 2B%Jc                \    V P                  \        P                  P                  4       / 4       . p\	        V4      p\        P                  P                  \        \        P                  V4       \        P                  P                  \        \        P                  4       \        4        \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       \        \        P                  ^ 4      p\        \        ^4      p\        \        ^4      pV P                  VV^,           WEWEWC^,           .4       \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       V P                  \        P                  P                  4       / 4       \        P                  P                  4        R#   \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       T P                  \        P                  P                  4       / 4       \        P                  P                  4        i ; ir   )rA   r   r'   r(  r  r7   r)   r[   r]   r4   r   r#   rD  test_lines_loopr8   )r+   r/   rG  r   floop_1floop_2s   &     r
   rJ  "LineMonitoringTest.test_lines_loopO  s   	,S^^7792>F*62HNN,,YINN%%i8GNN%%i3NN,,YE/??CEua(Gua(Gq'GgQwO
 NN%%i3NN,,YES^^7792>NN))+ NN%%i3NN,,YES^^7792>NN))+s   EH B%J+c                H    V P                  \        P                  P                  4       / 4       . p\	        V4      p. p\	        V4      p\        P                  P                  \        \        P                  V4       \        P                  P                  \        \        P                  V4       \        P                  P                  \        \        P                  4       \        P                  P                  \        \        P                  4       \        4        \        P                  P                  \        ^ 4       \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       \        P                  P                  \        \        P                  R4       \        \        P                  ^ 4      pV^
,           \        \        ^4      V^,           .pV P                  W4       V P                  W64       \        P                  P                  \        ^ 4       \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       \        P                  P                  \        \        P                  R4       V P                  \        P                  P                  4       / 4       \        P                  P                  4        R#   \        P                  P                  \        ^ 4       \        P                  P                  \        ^ 4       \        P                  P                  \        \        P                  R4       \        P                  P                  \        \        P                  R4       T P                  \        P                  P                  4       / 4       \        P                  P                  4        i ; ir   )rA   r   r'   r(  r  r7   r)   r[   r]   ro   r4   r   r#   rD  test_lines_twor8   )r+   r/   rG  events2	recorder2r   r   s   &      r
   rO  !LineMonitoringTest.test_lines_twof  si   	,S^^7792>F*62HG+G4INN,,YINN,,ZKNN%%i8#..:S:ST^`a`f`f:gDNN%%i3S^^5N5Nz[\5]NN,,YENN,,ZF/>>BEb(2q/58<HV.W/NN%%i3NN%%j!4NN,,YENN,,ZFS^^7792>NN))+ NN%%i3NN%%j!4NN,,YENN,,ZFS^^7792>NN))+s   H'L% %C<P!c                    V P                  \        P                  P                  4       / 4       . p\	        V4      p\        P                  P                  V\        P                  V4       \        P                  P                  V\        P                  4       V! 4        \        P                  P                  V^ 4       \        P                  P                  V\        P                  R4       V^R  Uu. uF  qfVP                  P                  ,
          NK!  	  ppV P                  Wr4       \        P                  P                  V^ 4       R# u upi   \        P                  P                  T^ 4       i ; i)r   Nr   )rA   r   r'   r(  r  r7   r[   r]   r4   r   r    )r+   r!   r   rs   r/   rG  lineliness   &&&&    r
   check_linesLineMonitoringTest.check_lines  s   	/S^^7792>F*62HNN,,T1668DNN%%dAFF3FNN%%dA.NN,,T1664@FLQrlTldT]]9999lETU-NN%%dA. U NN%%dA.s   C5E 7%EE E "E8c                4    R  pV P                  V. RO4       R# )c                      ^p ^p ^p ^p ^p R# rT   r   rT  s    r
   r!   ,LineMonitoringTest.test_linear.<locals>.func  s    DDDDDr	   N)rU   r   r         rV  r+   r!   s   & r
   test_linearLineMonitoringTest.test_linear  s    	 	{+r	   c                4    R  pV P                  V. RO4       R# )c                  L    R P                  R4      '       d	   ^p ^p ^p R# ^p ^p R# )truetN
startswithrZ  s    r
   r!   ,LineMonitoringTest.test_branch.<locals>.func  s0      %% D Dr	   NrU   r   r   rm   r^  r_  s   & r
   test_branchLineMonitoringTest.test_branch  s    	 	y)r	   c                b    R  pV P                  V. RO4       R pV P                  V. RO4       R# )c                  ,     ^p ^p ^p R#    ^p  ^p R# ; ir   r   rZ  s    r
   func11LineMonitoringTest.test_try_except.<locals>.func1  s)     DDs   
 c                  $     ^p ^h   ^p  ^p R# ; ir   r   rZ  s    r
   func21LineMonitoringTest.test_try_except.<locals>.func2  s"    Ds    Nri  )rU   r   r   r\  r]  rm   r^  )r+   rn  rq  s   &  r
   test_try_except"LineMonitoringTest.test_try_except  s0    	 		*	 	.r	   c                4    R  pV P                  V. RO4       R# )c                  :   a R  oV3R lp \        V ! 4       4       R# )c               3      "   R x  R # 5ir   r   r   r	   r
   rW   ALineMonitoringTest.test_generator_with_line.<locals>.f.<locals>.a  s        	c               3   2   <"   S ! 4        R j  xL
  R #  L5ir   r   rV   s   r
   bALineMonitoringTest.test_generator_with_line.<locals>.f.<locals>.b  s     3s   N)next)r{  rW   s    @r
   rX   6LineMonitoringTest.test_generator_with_line.<locals>.f  s    Ir	   N)rU   r   r]  r\  r   r\  r^  )r+   rX   s   & r
   test_generator_with_line+LineMonitoringTest.test_generator_with_line  s    	 	M*r	   r   N)rb   rc   rd   re   rF  rJ  rO  r)   rV  r`  rj  rs  r  rf   rg   rh   s   @r
   rD  rD  ;  s7     ,$,.,4 09 / 	,	*/,	+ 	+r	   rD  c                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )TestDisablei  c              #  V   "   \        ^
4       F  pV'       d   ^x  K  ^x  K  	  R# 5i)
   Nrn   )r+   condis   && r
   r   TestDisable.gen  s      rA	 s   ')c                &     ^^ ,           R#    h ; irT   r   r*   s   &r
   raise_handle_reraise TestDisable.raise_handle_reraise  s    	aCC	s   	 c                n   \          F  w  r \        4       pR Vn        \        P                  P                  \        W4       \        P                  P                  \        V4       V P                  ^4       F  pK  	  V P                  VP                  ^4       \        P                  P                  \        ^ 4       \        P                  P                  \        VR4       K  	  R#   \        P                  P                  \        ^ 4       \        P                  P                  \        TR4       i ; ir!  )INSTRUMENTED_EVENTSr  r  r   r'   r7   r)   r4   r   
assertLessr   )r+   r   namer   r   s   &    r
   test_disable_legal_events%TestDisable.test_disable_legal_events  s    .KE
I,."&00EK)))U;!A %q1)))Q700E4H / )))Q700E4Hs   BC))AD4c                   \          F  w  r \        4       pR Vn        \        P                  P                  \        W4       \        P                  P                  \        V4       V P                  \        4      ;_uu_ 4        V P                  4        RRR4       \        P                  P                  \        ^ 4       \        P                  P                  \        VR4       K  	  R#   + '       g   i     L_; i  \        P                  P                  \        ^ 4       \        P                  P                  \        TR4       i ; ir!  )EXCEPT_EVENTSr  r  r   r'   r7   r)   r4   rB   rC   r  )r+   r   r  r   s   &   r
   test_disable_illegal_events'TestDisable.test_disable_illegal_events  s    (KE	I,."&00EK)))U;&&z22--/ 3 )))Q700E4H ) 32 )))Q700E4Hs%   A6C>C+C>+C;6C>>AE	r   N)
rb   rc   rd   re   r   r  r  r  rf   rg   rh   s   @r
   r  r    s!     II Ir	   r  c                   D   a  ] tR tRt o ]P
                  tR tR tRt	V t
R# )ExceptionRecorderi  c                    Wn         R # r   r/   r  s   &&r
   r   ExceptionRecorder.__init__      r	   c                R    V P                   P                  R \        V4      34       R# )r   Nr/   rL   typer+   r   r"   excs   &&&&r
   r   ExceptionRecorder.__call__      GT#Y/0r	   r  N)rb   rc   rd   re   r[   RAISE
event_typer   r   rf   rg   rh   s   @r
   r  r    s     J1 1r	   r  c                   <   a  ] tR tRt o R t]]33R ltR tRt	V t
R# )CheckEventsi  c                :    V P                  \        P                  P                  4       / 4       . p^ pV F=  pVP                  p\        P                  P                  W'V! V4      4       WW,          pK?  	  \        P                  P                  W%4       V! 4        \        P                  P                  V^ 4       V F-  p\        P                  P                  W&P                  R4       K/  	  T\        P                  P                  V^ 4       V F-  p\        P                  P                  W&P                  R4       K/  	  #   \        P                  P                  T^ 4       T F-  p\        P                  P                  Y&P                  R4       K/  	  i ; ir   )rA   r   r'   r(  r  r7   r4   )r+   r!   rs   	recorders
event_list
all_eventsrG  evs   &&&&    r
   r3   CheckEvents.get_events  s-   	RS^^7792>JJ%((008J;OP 
 & NN%%d7FNN%%dA.%007J7JDQ &NN%%dA.%007J7JDQ & NN%%dA.%007J7JDQ &s   C/E AFc                L    V P                  WV4      pV P                  WR4       R # r   )r3   rA   )r+   r!   r   rs   r  r/   s   &&&&& r
   r   CheckEvents.check_events  s     Y7*r	   c                j   V P                  V\        V4      pV P                  \        V4      ^,          ^ 4       \	        VR,          VR,          4       F[  w  rEV^ ,          pV P                  VR4       V^ ,          pV P                  VR4       V P                  V^,          V^,          4       K]  	  R# )r   :NNr   :rU   Nr   N)r   reraise)handledr   )r3   r)   rA   r   zipassertIn)r+   r!   r  r/   rhr0h0s   &&&     r
   check_balancedCheckEvents.check_balanced  s    y)<VQ*sF4L1DA1BMM"231BMM"34QqT1Q4( 2r	   r   N)rb   rc   rd   re   r3   r)   r  r   r  rf   rg   rh   s   @r
   r  r    s%     R( 1:FWEY +) )r	   r  c                   .    ] tR tRt]P
                  tRtR# )StopiterationRecorderi"  r   N)rb   rc   rd   re   r[   STOP_ITERATIONr  rf   r   r	   r
   r  r  "  s    !!Jr	   r  c                   >   a  ] tR tRt o ]P
                  tR tRtV t	R# )ReraiseRecorderi&  c                R    V P                   P                  R \        V4      34       R# )r  Nr  r  s   &&&&r
   r   ReraiseRecorder.__call__*      ItCy12r	   r   N)
rb   rc   rd   re   r[   RERAISEr  r   rf   rg   rh   s   @r
   r  r  &  s     J3 3r	   r  c                   >   a  ] tR tRt o ]P
                  tR tRtV t	R# )UnwindRecorderi-  c                h    V P                   P                  R \        V4      VP                  34       R# )r   N)r/   rL   r  co_namer  s   &&&&r
   r   UnwindRecorder.__call__1  s#    Hd3i>?r	   r   N)
rb   rc   rd   re   r[   	PY_UNWINDr  r   rf   rg   rh   s   @r
   r  r  -  s     J@ @r	   r  c                   >   a  ] tR tRt o ]P
                  tR tRtV t	R# )ExceptionHandledRecorderi4  c                R    V P                   P                  R \        V4      34       R# )r  Nr  r  s   &&&&r
   r   !ExceptionHandledRecorder.__call__8  r  r	   r   N)
rb   rc   rd   re   r[   EXCEPTION_HANDLEDr  r   rf   rg   rh   s   @r
   r  r  4  s     $$J3 3r	   r  c                   >   a  ] tR tRt o ]P
                  tR tRtV t	R# )ThrowRecorderi;  c                R    V P                   P                  R \        V4      34       R# )throwNr  r  s   &&&&r
   r   ThrowRecorder.__call__?  r  r	   r   N)
rb   rc   rd   re   r[   PY_THROWr  r   rf   rg   rh   s   @r
   r  r  ;  s     J1 1r	   r  c                   D   a  ] tR tRt o ]P
                  tR tR tRt	V t
R# )CallRecorderiB  c                    Wn         R # r   r  r  s   &&r
   r   CallRecorder.__init__F  r  r	   c                V    V P                   P                  R VP                  V34       R# )r  N)r/   rL   rb   r+   r   r"   r!   r   s   &&&&&r
   r   CallRecorder.__call__I  s    FDMM378r	   r  N)rb   rc   rd   re   r[   rF   r  r   r   rf   rg   rh   s   @r
   r  r  B  s     J9 9r	   r  c                   D   a  ] tR tRt o ]P
                  tR tR tRt	V t
R# )ReturnRecorderiL  c                    Wn         R # r   r  r  s   &&r
   r   ReturnRecorder.__init__P  r  r	   c                V    V P                   P                  R VP                  V34       R# )r   N)r/   rL   r  )r+   r   r"   vals   &&&&r
   r   ReturnRecorder.__call__S  s    HdllC89r	   r  N)rb   rc   rd   re   r[   r   r  r   r   rf   rg   rh   s   @r
   r  r  L  s     J: :r	   r  c                      a  ] tR tRt o ]]]]3tR t	R t
R]3R]3.tR]3R]3.tR tR tR	 tR
 tR tR tR t]R 4       tRtV tR# )ExceptionMonitoringTestiW  c                >    R  pV P                  VR\        3.4       R# )c                  ,     ^p \         h   ^p  ^p R# ; ir   KeyErrorrZ  s    r
   rn  =ExceptionMonitoringTest.test_simple_try_except.<locals>.func1b  "    D   
 r   N)r   r  r+   rn  s   & r
   test_simple_try_except.ExceptionMonitoringTest.test_simple_try_except`  s!    	 	%7H"5!67r	   c                2  a R oRV3R llp\         \        3pR\        3.pV! \        \	        \
        P                  4      4      4       V P                  WVR7       \	        \
        P                  4       F
  pV! 4        K  	  V P                  WVR7       R# )a3  Generators are documented as raising a StopIteration
when they terminate.
However, we don't do that if we can avoid it, for speed.
sys.monitoring handles that by injecting a STOP_ITERATION
event when we would otherwise have skip the RAISE event.
This test checks that both paths record an equivalent event.
c               3      "   ^x  ^# 5irU   r   r   r	   r
   r   AExceptionMonitoringTest.test_implicit_stop_iteration.<locals>.genu  s     Gry  Nc                 0   < V f   S! 4       p V  F  pK  	  R # r   r   )iteratorr   r   s   & r
   implicit_stop_iterationUExceptionMonitoringTest.test_implicit_stop_iteration.<locals>.implicit_stop_iterationy  s    5 r	   r   r  r   )	r  r  StopIterationr  rn   r   SPECIALIZATION_THRESHOLDr   SPECIALIZATION_COOLDOWN)r+   r  r  r   r   r   s   &    @r
   test_implicit_stop_iteration4ExceptionMonitoringTest.test_implicit_stop_iterationl  s    		 %&;=	m,- 	 E*;*T*T$U VW 	1yQ (@@AA#% B 	1yQr	   r   r  r  c                F    R  pV P                  VV P                  R7       R# )c                  8      ^^ ,           R#    h ; i    R# ; irT   r   r   r	   r
   r!   ;ExceptionMonitoringTest.test_explicit_reraise.<locals>.func  s(    aCCs   	  r  Nr  exception_recordersr_  s   & r
   test_explicit_reraise-ExceptionMonitoringTest.test_explicit_reraise  (    	 	00 	 	2r	   c                F    R  pV P                  VV P                  R7       R# )c                  T      ^^ ,           R#   \          d   p h Rp ? ii ; i    R# ; irT   r   exs    r
   r!   AExceptionMonitoringTest.test_explicit_reraise_named.<locals>.func  s1    aCC  s   	 " 'r  Nr  r_  s   & r
   test_explicit_reraise_named3ExceptionMonitoringTest.test_explicit_reraise_named  r  r	   c                F    R  pV P                  VV P                  R7       R# )c                  P      ^^ ,           R#   \          d     R# i ; i    R# ; irT   rC   r   r	   r
   r!   ;ExceptionMonitoringTest.test_implicit_reraise.<locals>.func  s0    aCC! s   	     %r  Nr  r_  s   & r
   test_implicit_reraise-ExceptionMonitoringTest.test_implicit_reraise  r  r	   c                F    R  pV P                  VV P                  R7       R# )c                  ^      ^^ ,           R#   \          d   p  Rp ? R# Rp ? ii ; i    R# ; irT   r  r  s    r
   r!   AExceptionMonitoringTest.test_implicit_reraise_named.<locals>.func  s1    aCC! s   	 $' $' ,r  Nr  r_  s   & r
   test_implicit_reraise_named3ExceptionMonitoringTest.test_implicit_reraise_named  r  r	   c                F    R  pV P                  VV P                  R7       R# )c                  6      ^^ ,           R#   i ; i    R# ; irT   r   r   r	   r
   r!   6ExceptionMonitoringTest.test_try_finally.<locals>.func  s#    aCDs   	  r  Nr  r_  s   & r
   test_try_finally(ExceptionMonitoringTest.test_try_finally  r  r	   c                F    R  pV P                  VV P                  R7       R# )c                  l   a R  oV3R lp  V ! 4       P                  R4       R#   \         d     R# i ; i)c                 :   "   \        ^4       F  p \        h	  R# 5irT   )rn   ZeroDivisionError)r  s    r
   async_generatorMExceptionMonitoringTest.test_async_for.<locals>.func.<locals>.async_generator  s     qA++ "s   c                  b   <"    S! 4         R j  xL
  p K   LDR #   \          d     R # i ; i5ir   r   )r   r  s    r
   
async_loopHExceptionMonitoringTest.test_async_for.<locals>.func.<locals>.async_loop  s9     &5&7  d&7  s4   /   /,/,/Nsendr  )r"  r  s    @r
   r!   4ExceptionMonitoringTest.test_async_for.<locals>.func  s4    
!!$'     $ 33r  Nr  r_  s   & r
   test_async_for&ExceptionMonitoringTest.test_async_for  s(    	& 	00 	 	2r	   c                   a R  oV3R lpV P                  VV P                  R7       V P                  V\        V P                  \        3,           4      pV P                  V^ ,          R\        34       R# )c               3      "   ^x  ^x  R# 5irT   r   r   r	   r
   r   /ExceptionMonitoringTest.test_throw.<locals>.gen  s     GGr   c                  |   <  S! 4       p \        V 4       V P                  \        4       R #   \         d     R # i ; ir   )r}  r  
IndexError)gr   s    r
   r!   0ExceptionMonitoringTest.test_throw.<locals>.func  s4    EQ
# s   ', ;;r  r  N)r  r   r3   r)   r  rA   r.  )r+   r!   r/   r   s   &  @r
   
test_throw"ExceptionMonitoringTest.test_throw  sp    		 	00 	 	2 $$'77

 	Wj$9:r	   c                  a  ! R  R4      oV3R lp\        \        P                  4       F
  pV! 4        K  	  \        \        3pV P                  V\        V4      p\        P                  ! VRR7      pT P                  RV Uu. uF  qfP                  NK  	  up4       R\        R3R	.pV P                  WG4       R# u upi )
c                   &   a  ] tR tRt o R tRtV tR# )OExceptionMonitoringTest.test_no_unwind_for_shim_frame.<locals>.ValueErrorRaiseri  c                    \        4       hr   r  r*   s   &r
   r   XExceptionMonitoringTest.test_no_unwind_for_shim_frame.<locals>.ValueErrorRaiser.__init__  s
     l"r	   r   Nrb   rc   rd   re   r   rf   rg   rh   s   @r
   ValueErrorRaiserr5    s     # #r	   r9  c                  8   <  S ! 4       #   \          d     R # i ; ir   r  )r9  s   r
   rX   @ExceptionMonitoringTest.test_no_unwind_for_shim_frame.<locals>.f   s#    ')) s   
 T)adaptiveCALL_ALLOC_AND_ENTER_INITr   r   N)r   rX   N)rn   r   r  r  r  r3   r)   disget_instructionsr  opnamerC   rA   )	r+   rX   r   r  r/   adaptive_instsr  r   r9  s	   &       @r
   test_no_unwind_for_shim_frame5ExceptionMonitoringTest.test_no_unwind_for_shim_frame  s    	# 	#	 (AABAC C 
	 Iy9--a$?'-.~!XX~.	
 z:.!

 	* /s   B=
r   N)rb   rc   rd   re   r  r  r  r  r   r  r  r  initialr  r  r	  r  r  r  r(  r1  r   rB  rf   rg   rh   s   @r
   r  r  W  s      	 	
8$RN 
#$	%&G 
%&	%&G
222 2222;2  +  +r	   r  c                   D   a  ] tR tRt o ]P
                  tR tR tRt	V t
R# )LineRecorderi:  c                    Wn         R # r   r  r  s   &&r
   r   LineRecorder.__init__?  r  r	   c                v    V P                   P                  R VP                  W!P                  ,
          34       R# rT  N)r/   rL   r  r    )r+   r   rT  s   &&&r
   r   LineRecorder.__call__B  s(    FDLL$9L9L2LMNr	   r  N)rb   rc   rd   re   r[   r]   r  r   r   rf   rg   rh   s   @r
   rF  rF  :  s     JO Or	   rF  c                   ,   a  ] tR tRt o R tR tRtV tR# )CEventRecorderiE  c                    Wn         R # r   r  r  s   &&r
   r   CEventRecorder.__init__G  r  r	   c                j    V P                   P                  V P                  VP                  V34       R # r   )r/   rL   r   rb   r  s   &&&&&r
   r   CEventRecorder.__call__J  s#    DOOT]]C@Ar	   r  Nr   rh   s   @r
   rM  rM  E  s     B Br	   rM  c                   2    ] tR tRt]P
                  tRtRtR# )CReturnRecorderiM  C returnr   N)	rb   rc   rd   re   r[   rD   r  r   rf   r   r	   r
   rS  rS  M  s    JJr	   rS  c                   2    ] tR tRt]P
                  tRtRtR# )CRaiseRecorderiR  C raiser   N)	rb   rc   rd   re   r[   rE   r  r   rf   r   r	   r
   rV  rV  R  s    JJr	   rV  c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestManyEventsiY  c                    R  pV P                  V\        RRR\        P                  P                  3RRRR	R
.R7       R# )c                      ^p ^p^pR# rT   r   line1line2line3s      r
   rn  )TestManyEvents.test_simple.<locals>.func1]      EEEr	   r  rn  r  r   NrT  r3   r  rT  rn  rU   rT  rn  r   rT  rn  r   rT  r3      r  r4   r   r   MANY_RECORDERSr   r'   r:   r  s   & r
   test_simpleTestManyEvents.test_simple[  sJ    	
 	%^&Wcnn445   &%I' 	(r	   c                    R  pV P                  V\        RRR\        P                  P                  3RR	RR^.3RR^.3R
RR.	R7       R# )c                  0    ^p . P                  ^4       ^pR# rT   rK   r]  r_  s     r
   rq  )TestManyEvents.test_c_call.<locals>.func2m      EIIaLEr	   r  rq  rL   rT  rb  Nrc  rT  rq  rU   rT  rq  r   rT  rq  r   rg  ri  rj  r+   rq  s   & r
   test_c_callTestManyEvents.test_c_callk  sb    	
 	%^&Wcnn445  Xs#A3' &%	I' 		(r	   c                    R  pV P                  V\        RRR\        P                  P                  3RRR	R\
        3R
RRRR.R7       R# )c                  ,     ^p \         h   ^p  ^p R# ; ir   r  rZ  s    r
   func3-TestManyEvents.test_try_except.<locals>.func3  r  r  r  r{  r   rb  Nrc  rT  r{  rU   rT  r{  r   rT  r{  r   rT  r{  r\  rT  r{  r]  rT  r{  rm   rg  ri  )r   rk  r   r'   r:   r  r+   r{  s   & r
   rs  TestManyEvents.test_try_except}  s[    	 	%^&Wcnn445   h   &%I' 	(r	   r   N)	rb   rc   rd   re   rl  rw  rs  rf   rg   rh   s   @r
   rY  rY  Y  s     ( ($( (r	   rY  c                   D   a  ] tR tRt o ]P
                  tR tR tRt	V t
R# )InstructionRecorderi  c                    Wn         R # r   r  r  s   &&r
   r   InstructionRecorder.__init__  r  r	   c                |    VP                   R 8w  d+   V P                  P                  RVP                   V34       R# R# )r3   instructionN)r  r/   rL   )r+   r   r"   s   &&&r
   r   InstructionRecorder.__call__  s0    <<<'KKt||VDE (r	   r  N)rb   rc   rd   re   r[   r@  r  r   r   rf   rg   rh   s   @r
   r  r    s     JF Fr	   r  c                   B   a  ] tR tRt o RtR tR tR tR tR t	Rt
V tR# )	TestLineAndInstructionEventsi  Nc                @    R  pV P                  V\        . ROR7       R# )c                      ^p ^p^pR# rT   r   r\  s      r
   rn  7TestLineAndInstructionEvents.test_simple.<locals>.func1  ra  r	   rb  Nrc  rd  r  rn  r   r  rn  r\  re  r  rn  rm   )r  rn     rf  )r  rn  r  )r  rn     )r  rn     )r  rn     rg  r   LINE_AND_INSTRUCTION_RECORDERSr  s   & r
   rl  (TestLineAndInstructionEvents.test_simple  s%    	
 	%-K Y( 	)r	   c                @    R  pV P                  V\        . ROR7       R# )c                  0    ^p . P                  ^4       ^pR# rT   rK   rp  s     r
   rq  7TestLineAndInstructionEvents.test_c_call.<locals>.func2  rr  r	   rb  N)rc  rs  r  rq  r   )r  rq  r\  rt  )r  rq  rm   )r  rq  r  )r  rq     )r  rq     )r  rq  &   ru  )r  rq  (   )r  rq  *   )r  rq  ,   )r  rq  .   rg  r  rv  s   & r
   rw  (TestLineAndInstructionEvents.test_c_call  s%    	
 	%-K Y( 	)r	   c                @    R  pV P                  V\        . ROR7       R# )c                  ,     ^p \         h   ^p  ^p R# ; ir   r  rZ  s    r
   r{  ;TestLineAndInstructionEvents.test_try_except.<locals>.func3  r  r  rb  N)rc  r}  )r  r{  r   r~  )r  r{  r\  )r  r{  rm   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  r{  $   rg  r  r  s   & r
   rs  ,TestLineAndInstructionEvents.test_try_except  s%    	 	%-K Y( 	)r	   c                    R  pV P                  V\        . ROR7       \        P                  P	                  4        V P                  V\        . ROR7       R# )c                      ^p ^p^pR# rT   r   r\  s      r
   rn  =TestLineAndInstructionEvents.test_with_restart.<locals>.func1  ra  r	   rb  Nr  )r   r  r   r'   r8   r  s   & r
   test_with_restart.TestLineAndInstructionEvents.test_with_restart  sS    	
 	%-K Y( 	) 	%%'%-K Y( 	)r	   c                  a . oV3R lp\         P                  P                  \        ^ 4       \         P                  P	                  \        \
        P                  V4       \         P                  P	                  \        \
        P                  R 4       \         P                  P                  \        \
        P                  \
        P                  ,          4       \         P                  P                  \        \
        P                  4       . o^ p\         P                  P                  \        ^ 4       V P                  \        S4      ^ 4       R# )zF
LINE events should be recorded after INSTRUCTION event is turned off
c                  *   < SP                  R 4       R# rJ  rK   rM   s   *r
   rT  ITestLineAndInstructionEvents.test_turn_off_only_instruction.<locals>.line"  s    MM&!r	   c                      R # r   r   rN   s   *r
   rO   MTestLineAndInstructionEvents.test_turn_off_only_instruction.<locals>.<lambda>&  s    QUr	   N)
r   r'   r4   r)   r7   r[   r]   r@  assertGreaterr   )r+   rT  rW   r/   s   &  @r
   test_turn_off_only_instruction;TestLineAndInstructionEvents.test_turn_off_only_instruction  s     	"!!)Q/((AFFDA((AMMCUV!!)QVVamm-CD!!)QVV4!!)Q/3v;*r	   r   )rb   rc   rd   re   r  rl  rw  rs  r  r  rf   rg   rh   s   @r
   r  r    s*     G),)2 )D$)L+ +r	   r  c                      a  ] tR tRt o ]]33R lt]R 4       t. ROt	R t
R t]R 4       tRRR]P                  P                  3RRR.tR	 tR
 tRtV tR# )TestInstallIncrementallyi.  c                    V P                  \        P                  P                  4       / 4       . p^ pV F4  pWgP                  ,          p\        P                  P                  W64       K6  	  V F3  p\        P                  P                  W7P                  V! V4      4       K5  	  V! 4        \        P                  P                  V^ 4       V F-  p\        P                  P                  W7P                  R4       K/  	  V F  pV P                  W4       K  	  \        P                  P                  V^ 4       V F-  p\        P                  P                  W7P                  R4       K/  	  R#   \        P                  P                  T^ 4       T F-  p\        P                  P                  Y7P                  R4       K/  	  i ; ir   )rA   r   r'   r(  r  r4   r7   r  )	r+   r!   must_includers   r  r  r  rG  rT  s	   &&&&&    r
   r   %TestInstallIncrementally.check_events0  sN   	RS^^7792>JJ%111
))$; & &007J7JHU_L`a &FNN%%dA.%007J7JDQ &$d/ % NN%%dA.%007J7JDQ & NN%%dA.%007J7JDQ &s   DE0 0AGc                 
    ^p R# rT   r   )r]  s    r
   rn  TestInstallIncrementally.func1E  s    r	   c                l    \         \        .pV P                  V P                  WP                  R 7       R# )r  r  N)rF  r  r   rn  MUST_INCLUDE_LIr+   r  s   & r
   test_line_then_instruction3TestInstallIncrementally.test_line_then_instructionO  0    "$79	$**&/@T@T 	 	Vr	   c                l    \         \        .pV P                  V P                  WP                  R 7       R# r  )r  rF  r   rn  r  r  s   & r
   test_instruction_then_line3TestInstallIncrementally.test_instruction_then_lineT  /    )<9	$**&/@T@T 	 	Vr	   c                     \        R4       R # )Nr   r   r   r	   r
   rq  TestInstallIncrementally.func2Y  s	    Br	   rq  r  c                l    \         \        .pV P                  V P                  WP                  R 7       R# r  )r  r  r   rq  MUST_INCLUDE_CIr  s   & r
   test_call_then_instruction3TestInstallIncrementally.test_call_then_instructionf  r  r	   c                l    \         \        .pV P                  V P                  WP                  R 7       R# r  )r  r  r   rq  r  r  s   & r
   test_instruction_then_call3TestInstallIncrementally.test_instruction_then_callk  r  r	   r   N)r  re  r  r  r  )r  r   r   )r  rq  r  )r  rq  r  )rb   rc   rd   re   r)   r  r   staticmethodrn  r  r  r  rq  r   r'   r:   r  r  r  rf   rg   rh   s   @r
   r  r  .  s     4=J[I] R*  )OV
V
   (Wcnn445((*OV
V Vr	   r  c                   F   a  ] tR tRt o ]R3R ltR tR tR tR t	Rt
V tR# )	TestLocalEventsir  c                    V P                  \        P                  P                  4       / 4       . p^ pV F=  pVP                  p\        P                  P                  W8V! V4      4       Wh,          pK?  	  \        P                  P                  W1P                  V4       V! 4        \        P                  P                  W1P                  ^ 4       V F-  p\        P                  P                  W7P                  R4       K/  	  V P                  WR4       \        P                  P                  W1P                  ^ 4       V F-  p\        P                  P                  W7P                  R4       K/  	  R#   \        P                  P                  Y1P                  ^ 4       T F-  p\        P                  P                  Y7P                  R4       K/  	  i ; ir   )rA   r   r'   r(  r  r7   r6   r   )	r+   r!   r   rs   r  r  r  rG  r  s	   &&&&&    r
   r   TestLocalEvents.check_eventst  sJ   	RS^^7792>JJ%((008J;OP 
 & NN++D--LFNN++D--C%007J7JDQ &Z2NN++D--C%007J7JDQ & NN++D--C%007J7JDQ &s   DE5 5AGc                @    R  pV P                  V\        . ROR7       R# )c                      ^p ^p^pR# rT   r   r\  s      r
   rn  *TestLocalEvents.test_simple.<locals>.func1  ra  r	   rb  N)rd  re  rf  r   LOCAL_RECORDERSr  s   & r
   rl  TestLocalEvents.test_simple  s$    	
 	%_ J" 	#r	   c           
     V    R  pV P                  V\        RRRR^.3RR^.3R.R7       R# )	c                  0    ^p . P                  ^4       ^pR# rT   rK   rp  s     r
   rq  *TestLocalEvents.test_c_call.<locals>.func2  rr  r	   r  rL   rT  rb  Nrs  rt  ru  r  rv  s   & r
   rw  TestLocalEvents.test_c_call  sE    	
 	%_  Xs#A3' J" 	#r	   c                @    R  pV P                  V\        . ROR7       R# )c                  ,     ^p \         h   ^p  ^p R# ; ir   r  rZ  s    r
   r{  .TestLocalEvents.test_try_except.<locals>.func3  r  r  rb  N)r}  r~  r  r  r  r  r  r  s   & r
   rs  TestLocalEvents.test_try_except  s$    	 	%_ J" 	#r	   c                    V P                  \        4      ;_uu_ 4        \        P                  P	                  \
        \        P                  \        P                  4       R R R 4       R #   + '       g   i     R # ; ir   )
rB   rC   r   r'   r6   r)   r   r   r[   r  r*   s   &r
   test_set_non_local_event(TestLocalEvents.test_set_non_local_event  sB    z**NN++Iy7I7I177S +***s   AA**A;	r   N)rb   rc   rd   re   r)   r   rl  rw  rs  r  rf   rg   rh   s   @r
   r  r  r  s+     09R R*
###$T Tr	   r  c                     V P                  4        F8  w  r#pY!u;8:  d
   V8  g   K  M K  Vf	   RV R2u # W@P                  ,
          u # 	  R# )Nz[offset=]r   )co_linesr    )r   r"   r   endrT  s   &&   r
   line_from_offsetr    sO     MMOD S  |!&++----	 ,
 Ir	   c                   H   a  ] tR tRt o ]P
                  tRtR tR t	Rt
V tR# )JumpRecorderi  r   c                    Wn         R # r   r  r  s   &&r
   r   JumpRecorder.__init__  r  r	   c                    \        W4      p\        W4      pV P                  P                  V P                  VP                  WE34       R # r   )r  r/   rL   r  r  )r+   r   from_to	from_lineto_lines   &&&&  r
   r   JumpRecorder.__call__  s7    $T1	"4,DIIt||YHIr	   r  Nrb   rc   rd   re   r[   JUMPr  r  r   r   rf   rg   rh   s   @r
   r  r    s$     JDJ Jr	   r  c                   2    ] tR tRt]P
                  tRtRtR# )BranchRecorderi  r   r   N)	rb   rc   rd   re   r[   BRANCHr  r  rf   r   r	   r
   r  r    s    JDr	   r  c                   2    ] tR tRt]P
                  tRtRtR# )BranchRightRecorderi  branch rightr   N	rb   rc   rd   re   r[   BRANCH_RIGHTr  r  rf   r   r	   r
   r  r        JDr	   r  c                   2    ] tR tRt]P
                  tRtRtR# )BranchLeftRecorderi  branch leftr   N	rb   rc   rd   re   r[   BRANCH_LEFTr  r  rf   r   r	   r
   r  r        JDr	   r  c                   L   a  ] tR tRt o ]P
                  tRtRR ltR t	Rt
V tR# )JumpOffsetRecorderi  r   c                    Wn         R # r   r  )r+   r/   offsetss   &&&r
   r   JumpOffsetRecorder.__init__  r  r	   c                j    V P                   P                  V P                  VP                  W#34       R # r   )r/   rL   r  r  )r+   r   r  r  s   &&&&r
   r   JumpOffsetRecorder.__call__  s#    DIIt||U?@r	   r  NFr  rh   s   @r
   r  r    s$     JDA Ar	   r  c                   2    ] tR tRt]P
                  tRtRtR# )BranchLeftOffsetRecorderi  r  r   Nr  r   r	   r
   r  r    r  r	   r  c                   2    ] tR tRt]P
                  tRtRtR# )BranchRightOffsetRecorderi  r	  r   Nr
  r   r	   r
   r  r    r  r	   r  c                   H   a  ] tR tRt o RtR tR tR tR tR t	R t
R	tV tR# )
TestBranchAndJumpEventsi  Nc                   R  pRR lpV P                  V\        . ROR7       V P                  V\        . ROR7       V P                  V\        . ROR7       V P                  V\        . ROR7       V P                  V\        . R	OR7       R# )
c                  J    ^p \        ^4       F  pV'       d   ^p K  ^p K  	  R# rT   r  xrW   s     r
   r!   /TestBranchAndJumpEvents.test_loop.<locals>.func   '    A1XAA	 
 r	   c                 *    V ^8  d   V ^,          p K  R# r   r   ns   &r
   	whilefunc4TestBranchAndJumpEvents.test_loop.<locals>.whilefunc	      a%Qr	   rb  Nr   )r   r!   r   r   r   r!   r   rm   r   r!   rm   r   r.  r   r!   r   r\  r   r!   r\  r   r   r!   r      )rc  rT  r!   rU   rT  r!   r   r.  rT  r!   r   r/  )rT  r!   rm   r0  r6  r.  r7  r1  rT  r!   r\  r2  r6  r3  )rT  r!   r4  rg  )r  r!   r   r   )r	  r!   r   rm   r9  )r  r!   r   r\  )r	  r!   r   r4  )r  r*  rU   r   r:  r:  )r	  r*  rU   r   )r  r!   r  r  )r	  r!   r  :   r;  )r  r!   r  2   )r	  r!   r  F   )r   JUMP_AND_BRANCH_RECORDERSJUMP_BRANCH_AND_LINE_RECORDERSBRANCHES_RECORDERSBRANCH_OFFSET_RECORDERSr+   r!   r*  s   &  r
   	test_loop!TestBranchAndJumpEvents.test_loop  s    		
 	$,E S& 	' 	$,J X( 	)( 	$,> L, 	- 	)1C Q1 	2 	$,C Q. 	/r	   c                   a  ! R  R4      oV3R lpV P                  V\        . ROR7       V P                  V\        RRRR	R\        3R
RRRRRRRR.R7       R# )c                   &   a  ] tR tRt o R tRtV tR# )5TestBranchAndJumpEvents.test_except_star.<locals>.FooiA  c                    R # r   r   r*   s   &r
   meth:TestBranchAndJumpEvents.test_except_star.<locals>.Foo.methB      r	   r   Nrb   rc   rd   re   rJ  rf   rg   rh   s   @r
   FoorH  A        r	   rN  c                     <   \         h  . ;\         ;e$   p S! 4       qP                  4        R p ? NM	R p ? N NM N6;f     R # u i ; i  \          d     R # i ; ir   r  r   rJ  erX   rN  s     r
   r!   6TestBranchAndJumpEvents.test_except_star.<locals>.funcE  G    ("N(	 (Avvxx( 0   
 A3	AAA A AArb  r   Nrc  r5  r6  r7  r8  r   r!   r\  r\  rT  r!   r]  rT  rJ  rU   r   r!   r]  z[offset=120]r   r!   z[offset=124]z[offset=130]rg  )rc  r5  r6  r7  r8  rW  rX  rY  rZ  r[  rg  )r   rJ  N)r   r!   N)r   r@  FLOW_AND_LINE_RECORDERSr  r+   r!   rN  s   & @r
   test_except_star(TestBranchAndJumpEvents.test_except_star?  s}    	 		 	$,J X( 	) 	$,C&h$$/>$&Q( 	)r	   c           	     R    RR lpRpRpV P                  V\        VVVVV.R7       R# )r   c                 ,    V ^8  d    V ^,          p K  R# r\  Nr   r(  s   &r
   fooBTestBranchAndJumpEvents.test_while_offset_consistency.<locals>.foon      A#Qr	   rb  Nr-  )r  rc  r  r  )r	  rc  r  r  )r   rB  )r+   rc  in_loop	exit_loops   &   r
   test_while_offset_consistency5TestBranchAndJumpEvents.test_while_offset_consistencyl  s>    	 13	#+BP 	r	   c                @    R  pV P                  V\        . ROR7       R# )c                  l   a R  oV3R lp  V ! 4       P                  R4       R#   \         d     R# i ; i)c                 "   "   ^5x  ^5x  R# 5ir   r   r   r	   r
   r   ATestBranchAndJumpEvents.test_async_for.<locals>.func.<locals>.gen  s        c                  <   <"   S! 4         R j  xL
  p K   LDR # 5ir   r   yr   s    r
   rc  ATestBranchAndJumpEvents.test_async_for.<locals>.func.<locals>.foo  s$     "u  !u   Nr$  )rc  r   s    @r
   r!   4TestBranchAndJumpEvents.test_async_for.<locals>.func  s2    


4   r'  rb  N)r  rc  rU   rU   ru  )r	  rc  rU   r   )r  r!   r  r  r   rA  r_  s   & r
   r(  &TestBranchAndJumpEvents.test_async_for}  s%    	 	$,> L- 	.r	   c                D    RR lpV P                  V\        . ROR7       R# )rU   c                     ^ p\        ^4       F2  p T ;^8X  d    V^,          pK  ^8X  d   V^,          pK(   V^,          pK4  	  V# r-  r  )vr$  s   & r
   r!   0TestBranchAndJumpEvents.test_match.<locals>.func  sC    A1XQQQ  Hr	   rb  Nr  )r9  r	  r!   r\  rm   r	  r!   rm   r  r9  )r  r!   r\  r]  r9  r|  )r  r!   rm   r4  r9  r|  r}  )r	  r!   r   r  rv  r_  s   & r
   
test_match"TestBranchAndJumpEvents.test_match  s%    
	 	$,> L- 	.r	   c                0  a  R  R lpV 3R lp\         P                  P                  \        VP                  \
        P                  4       \         P                  P                  \        \
        P                  V4       S P                  V! R4      ^4       R# )c                0    V ^8  d   QhR\         R\        /# )r   sr   )strint)formats   "r
   __annotate__LTestBranchAndJumpEvents.test_callback_set_frame_lineno.<locals>.__annotate__  s     	 	C 	C 	r	   c                 8    V P                  R 4      '       d   ^# ^ # )re  rf  )r  s   &r
   r!   DTestBranchAndJumpEvents.test_callback_set_frame_lineno.<locals>.func  s    ||C  r	   c                    < \         P                  ! 4       pV'       d   VP                  V Jd   VP                  pK&  SP	                  V4       VP
                  ^,           Vn        R# rT   )inspectcurrentframer   f_backassertIsNotNonef_lineno)r   r  r  r   r+   s   &&& r
   r_   HTestBranchAndJumpEvents.test_callback_set_frame_lineno.<locals>.callback  sF    ((*EELL4  '"^^a/ENr	   rd  N)	r   r'   r6   r)   r   r[   r  r7   rA   )r+   r!   r_   s   f  r
   test_callback_set_frame_lineno6TestBranchAndJumpEvents.test_callback_set_frame_lineno  s[    		0 	''	4==!--P((AMM8Lfq)r	   r   )rb   rc   rd   re   r  rD  r^  rh  r(  r~  r  rf   rg   rh   s   @r
   r   r     s/     G?/B+)Z".0.8* *r	   r   c                   H   a  ] tR tRt o R]]3R ltR tR tR t	R t
RtV tR# )	TestBranchConsistencyi  Nc                   Vf   Tp V P                  \        P                  P                  4       / 4       . p^ pV F=  pVP                  p\        P                  P                  W8V! V4      4       Wh,          pK?  	  \        P                  P                  W2P                  V4       V! 4        \        P                  P                  W2P                  ^ 4       V F-  p\        P                  P                  W7P                  R 4       K/  	  \        4       p	\        4       p
VP                  P                  4        F*  w  rpV	P                  W34       V
P                  W34       K,  	  V FM  pVw  ppppRV9   d   V P                  VV3V	4       K'  V P                  RV4       V P                  VV3V
4       KO  	  \        P                  P                  W2P                  ^ 4       V F-  p\        P                  P                  W7P                  R 4       K/  	  R #   \        P                  P                  Y2P                  ^ 4       T F-  p\        P                  P                  Y7P                  R 4       K/  	  i ; i)Nleftright)rA   r   r'   r(  r  r7   r6   r   r  co_branchesr   r  )r+   run_func	test_funcrs   r  r  r  rG  r  leftsrightssrcr  r  r   wayr   dests   &&&&&             r
   check_branches$TestBranchConsistency.check_branches  s    I	RS^^7792>JJ%((008J;OP 
 & NN++D2D2DjQJNN++D2D2DaH%007J7JDQ &EEUF&/&8&8&D&D&F"E		3+&

C<( 'G $$)!QTS=MM3+u5MM'3/MM3+v6 $ NN++D2D2DaH%007J7JDQ & NN++D2D2DaH%007J7JDQ &s   F2H AI8c                Z    R  pV P                  V4       RR lpV P                  V4       R# )c                  J    ^p \        ^4       F  pV'       d   ^p K  ^p K  	  R# rT   r  r#  s     r
   r!   /TestBranchConsistency.test_simple.<locals>.func  r&  r	   c                 *    V ^8  d   V ^,          p K  R# r   r   r(  s   &r
   r*  4TestBranchConsistency.test_simple.<locals>.whilefunc  r,  r	   Nr-  r  rC  s   &  r
   rl  !TestBranchConsistency.test_simple  s,    	 	D!	
 	I&r	   c                J   a  ! R  R4      oV3R lpV P                  V4       R# )c                   &   a  ] tR tRt o R tRtV tR# )3TestBranchConsistency.test_except_star.<locals>.Fooi   c                    R # r   r   r*   s   &r
   rJ  8TestBranchConsistency.test_except_star.<locals>.Foo.meth  rL  r	   r   NrM  rh   s   @r
   rN  r     rO  r	   rN  c                     <   \         h  . ;\         ;e$   p S! 4       qP                  4        R p ? NM	R p ? N NM N6;f     R # u i ; i  \          d     R # i ; ir   rQ  rR  s     r
   r!   4TestBranchConsistency.test_except_star.<locals>.func  rU  rV  Nr  r]  s   & @r
   r^  &TestBranchConsistency.test_except_star  s"    	 		 	D!r	   c                2    RR lpV P                  V4       R# )r   c                 ,    V ^8  d    V ^,          p K  R# rb  r   r(  s   &r
   rc  (TestBranchConsistency.test4.<locals>.foo  re  r	   Nr-  r  )r+   rc  s   & r
   test4TestBranchConsistency.test4  s    	 	C r	   c                L   aa R  oV3R loV3R lpV P                  VS4       R# )c                 "   "   ^5x  ^5x  R# 5ir   r   r   r	   r
   r   1TestBranchConsistency.test_async_for.<locals>.gen  s     GGrn  c                  <   <"   S! 4         R j  xL
  p K   LDR # 5ir   r   rp  s    r
   rc  1TestBranchConsistency.test_async_for.<locals>.foo   s$     5  a5rs  c                  Z   <  S ! 4       P                  R 4       R #   \         d     R # i ; ir   r$  )rc  s   r
   r!   2TestBranchConsistency.test_async_for.<locals>.func%  s(    

4   s    **Nr  )r+   r!   rc  r   s   & @@r
   r(  $TestBranchConsistency.test_async_for  s$    		
	 	D#&r	   r   )rb   rc   rd   re   r)   rB  r  rl  r^  r  r(  rf   rg   rh   s   @r
   r  r    s-     15IQh RB'("$!' 'r	   r  c                   x   a  ] tR tRt o ]]]]3tR t	RR lt
R tRR ltR tRR ltR tRR	 ltR
 tR tRtV tR# )TestLoadSuperAttri.  c                "    / p\        WV4       V# r   )exec)r+   cods   && r
   _execTestLoadSuperAttr._exec1  s    RAr	   c                    V'       d   R MRpV R\         P                  ! V4       2p\        VRR4      pV P                  V P	                  V4      V4       V P                  V4      # )zx = 1zsuper = super
<string>r  )textwrapdedentcompilerA   _has_load_super_attrr  )r+   codestr	optimized
assignmentr  s   &&&  r
   _exec_superTestLoadSuperAttr._exec_super6  s^     !*W
L8??7#;"<=Wj&12226	Bzz"~r	   c                l  a  \         ;QJ d0    R  \        P                  ! V4       4       F  '       g   K   RM%	  RM!! R  \        P                  ! V4       4       4      pV'       gO   \         ;QJ d)    V 3R lVP                   4       F  '       g   K   RM	  RM! V 3R lVP                   4       4      pV# )c              3   >   "   T F  qP                   R 8H  x  K  	  R# 5i)LOAD_SUPER_ATTRN)r@  ).0instrs   & r
   	<genexpr>9TestLoadSuperAttr._has_load_super_attr.<locals>.<genexpr>E  s     ZAY,,"33AYs   TFc              3      <"   T F8  p\        V\        P                  4      ;'       d    SP                  V4      x  K:  	  R # 5ir   )r   typesCodeTyper  )r  r   r+   s   & r
   r  r  G  s9      %A 1enn-NN$2K2KA2NN%s
   %AA)anyr>  r?  	co_consts)r+   r  hass   f& r
   r  &TestLoadSuperAttr._has_load_super_attrD  sy    cZAUAUVXAYZcccZAUAUVXAYZZ# ###  C 
r	   c                *   R pV P                  W!4      pRRR\        P                  P                  3RRRVR,          3R	RR\        P                  P                  3RR\        P                  P                  3R
RR
RRVR,          3R	R	RR.pVR,          V3# )a[  
            class A:
                def method(self, x):
                    return x

            class B(A):
                def method(self, x):
                    return super(
                    ).method(
                        x
                    )

            b = B()
            def f():
                return b.method(1)
        r  rX   methodr{  superrT  rc  rT  rX   rU   rT  r  rU   rT  r  r   rT  r  r   rg  ri  r  r   r'   r:   r+   r  r  r  r   s   &&   r
   _super_method_call$TestLoadSuperAttr._super_method_callM  s      W0&S#..001Xqv&!Wcnn445#.."8"89!!!Xqv&!!&%
" vxr	   c                    V P                  R R7      w  rV P                  RR7      w  r4V P                  WP                  VR7       V P                  W0P                  VR7       R# F)r  Trb  N)r  r   	RECORDERSr+   nonopt_funcnonopt_expectedopt_funcopt_expecteds   &    r
   test_method_call"TestLoadSuperAttr.test_method_callr  s\    '+'>'>'>'O$!%!8!84!8!H+/Z(nn|Tr	   c                    R pV P                  W!4      pRRR\        P                  P                  3RRRRVR,          3RR	R
RRRRRRR.pVR,          V3# )a?  
            class A:
                def method(self, x):
                    return x

            class B(A):
                def method(self, x):
                    return super(
                        x,
                        self,
                    ).method(
                        x
                    )

            b = B()
            def f():
                try:
                    return b.method(1)
                except TypeError:
                    pass
                else:
                    assert False, "should have raised TypeError"
        r  rX   r  r{  rc  r  )rT  rX   r   r  r  r  )r  r  rU   )rW  r  rU   )rT  rX   r   )rT  rX   r\  rg  ri  r  r  s   &&   r
   _super_method_call_error*TestLoadSuperAttr._super_method_call_errory  s|    . W0&S#..001Xqv&!!!! #&%
" vxr	   c                    V P                  R R7      w  rV P                  RR7      w  r4V P                  WP                  VR7       V P                  W0P                  VR7       R# r  )r  r   r  r  s   &    r
   test_method_call_error(TestLoadSuperAttr.test_method_call_error  s\    '+'D'Du'D'U$!%!>!>!>!N+/Z(nn|Tr	   c                   R pV P                  W!4      pRRR\        P                  P                  3RRRVR,          3R	RR\        P                  P                  3RR\        P                  P                  3R
R	RR.pVR,          V3# )z
            class A:
                x = 1

            class B(A):
                def method(self):
                    return super(
                    ).x

            b = B()
            def f():
                return b.method()
        r  rX   r  r{  r  rT  rc  r  r  r  rg  ri  r  r  s   &&   r
   _super_attrTestLoadSuperAttr._super_attr  s     W0&S#..001Xqv&!Wcnn445#.."8"89!!&%
 vxr	   c                    V P                  R R7      w  rV P                  RR7      w  r4V P                  WP                  VR7       V P                  W0P                  VR7       R# r  )r  r   r  r  s   &    r
   	test_attrTestLoadSuperAttr.test_attr  s\    '+'7'7%'7'H$!%!1!1D!1!A+/Z(nn|Tr	   c                p   \         P                  ! R 4      pR pR EF   pV P                  VR7      ;_uu_ 4        V'       d   RMRpVP                  RVR7      pVP                  RVR7      p\	        VRR	4      pV P                  V P                  V4      4       V P                  V4      pV P                  V4      p	V P                  VR
,          V P                  V! RW84      R7       V P                  V	R
,          V P                  V! RW94      R7       RRR4       EK  	  R#   + '       g   i     EK  ; i)z
            class C:
                def method(self):
                    return {cls}().__repr__{call}
            c = C()
            def f():
                return c.method()
        c           	      @   V R 8X  d   ^ M\         P                  P                  pRRR\         P                  P                  3RRRVR,          3R	RV \         P                  P                  3RV \         P                  P                  3.V'       d   RRV3RRV3.M. OR
NRN# )r  r  rX   r  r   rT  __repr__rc  r  r  rg  ri  )r   r'   r:   )r  call_methodnsrepr_args   &&& r
   get_expected?TestLoadSuperAttr.test_vs_other_type_call.<locals>.get_expected  s     EMqs~~/E/EH*cnn445 2c7+%s~~556T3>>#9#9: %  X6#Z: +- + * r	   )r  z() r  )clsr  r  r  r  rX   rb  N)TF)
r  r  subTestr  r  
assertTruer  r  r   r  )
r+   code_templater  r  call_str
code_supercode_intco_superns_superns_ints
   &         r
   test_vs_other_type_call)TestLoadSuperAttr.test_vs_other_type_call  s     ) 	( )K+66#.4B*11gH1M
(//E/I":z6B 9 9( CD::h/H-!!SM"nn)';I " 
 !!3K"nn)%E "  76 )666s   CD##D5r   Nr  )rb   rc   rd   re   r  rF  rV  rS  r  r  r  r  r  r  r  r  r  r  r  rf   rg   rh   s   @r
   r  r  .  sO     lNOKI
# JU* XU <U1 1r	   r  c                   ,   a  ] tR tRt o R tR tRtV tR# )TestSetGetEventsi  c                .   \         P                  P                  \        \        P
                  4       V P                  \         P                  P                  \        4      \        P
                  4       \         P                  P                  \        \        P
                  4       V P                  \         P                  P                  \        4      \        P
                  4       \         P                  P                  \        ^ 4       V P                  \         P                  P                  \        4      ^ 4       \         P                  P                  \        ^ 4       V P                  \         P                  P                  \        4      ^ 4       R# r   )	r   r'   r4   r)   r[   r\   rA   r3   ro   r*   s   &r
   test_globalTestSetGetEvents.test_global  s    !!)QZZ8229=qzzJ!!*ajj922:>

K!!)Q/229=qA!!*Q/22:>Br	   c                   \         P                  p\        P                  P	                  \
        V\        P                  4       V P                  \        P                  P                  \
        V4      \        P                  4       \        P                  P	                  \
        V^ 4       \        P                  P	                  \
        V\        P                  4       V P                  \        P                  P                  \
        V4      \        P                  \        P                  ,          4       \        P                  P	                  \
        V^ 4       \        P                  P	                  \        V\        P                  4       V P                  \        P                  P                  \        V4      \        P                  4       \        P                  P	                  \
        V^ 4       V P                  \        P                  P                  \
        V4      ^ 4       \        P                  P	                  \        V^ 4       V P                  \        P                  P                  \        V4      ^ 4       R# r   )r   r   r   r'   r6   r)   r[   r\   rA   r5   r  r  r  ro   )r+   r   s   & r
   
test_localTestSetGetEvents.test_local  sn   {{''	4D88DI1::V''	4;''	4B88DI1==[\[i[iKij''	4;''
D!**E88TJAJJW''	4;88DI1M''
D!<88TJANr	   r   N)rb   rc   rd   re   r  r  rf   rg   rh   s   @r
   r  r    s     CO Or	   r  c                   6   a  ] tR tRt o ]R 4       tR tRtV tR# )TestUninitializedi   c                     R # r   r   r   r	   r
   rX   TestUninitialized.f"  s    r	   c                    V P                  \        P                  P                  \        V P
                  P                  4      ^ 4       R# r   )rA   r   r'   r5   r)   rX   r   r*   s   &r
   #test_get_local_events_uninitialized5TestUninitialized.test_get_local_events_uninitialized&  s,    88DFFOOTVWXr	   r   N)	rb   rc   rd   re   r  rX   r#  rf   rg   rh   s   @r
   r  r     s#      Y Yr	   r  c                   >   a  ] tR tRt o R tR tR tR tR tRt	V t
R# )	TestRegressionsi)  c                  aaa R oV3R loVV3R loV3R lpV! 4        V P                  SR4       R o \        P                  P                  \        \
        P                  4       V! 4        V P                  SR4       \        P                  P                  \        ^ 4       R #   \        P                  P                  \        ^ 4       i ; i)Nc               3   J   <"    R x  R #   \          d    Ro R x   R # i ; i5i)Ninnerr   )r   s   r
   r)  *TestRegressions.test_105162.<locals>.inner.  s$       s   # # # #c               3   d   <"    S! 4        R j  xL
  R #  L  \          d    Ro R x   R # i ; i5i)Nouterr   )r   r)  s   r
   r,  *TestRegressions.test_105162.<locals>.outer6  s,      7""  s(   0
  0 -0-0c                  b   < S! 4       p V P                  R 4       V P                  \        4       R # r   )r%  r  r   )r   r,  s    r
   run(TestRegressions.test_105162.<locals>.run>  s!    'CHHTNIIi r	   r)  )rA   r   r'   r4   r)   r[   r   )r+   r/  r   r)  r,  s   & @@@r
   test_105162TestRegressions.test_105162+  s    			! 	)	4NN%%i=EVW-NN%%i3CNN%%i3s   AB& &&Cc                   a  ! R  R4      oV3R lp V! 4        \         P                  P                  \        ^ 4       R#   \         P                  P                  \        ^ 4       i ; i)c                   &   a  ] tR tRt o R tRtV tR# )(TestRegressions.test_108390.<locals>.FooiN  c                ~    V'       d5   \         P                  P                  \        \        P
                  4       R # R # r   )r   r'   r4   r)   r[   r   )r+   	set_events   &&r
   r   1TestRegressions.test_108390.<locals>.Foo.__init__O  s"    NN--iE r	   r   Nr8  rh   s   @r
   rN  r5  N  s     F Fr	   rN  c                     < \        \        P                  ^,           4       F  p S! V \        P                  8H  4       K  	  R# rT   )rn   r   r  )r  rN  s    r
   !make_foo_optimized_then_set_eventFTestRegressions.test_108390.<locals>.make_foo_optimized_then_set_eventS  s3    ,EEIJA*CCCD Kr	   N)r   r'   r4   r)   )r+   r:  rN  s   & @r
   test_108390TestRegressions.test_108390L  sI    	F 	F
	E	4-/NN%%i3CNN%%i3s   A   &A&c                `   \         P                  P                  ^ R4       V P                  \         P                  P                  ^ 4       \         P                  P                  ^ ^ 4       \         P                  P                  ^ \        P                  R 4       \         P                  P                  ^ \        P                  R 4       \         P                  P                  ^ \        P                  \        P                  ,          4       \         P                  P                  ^ ^ 4       R# )r   testc                  B    \         P                  P                  ^ ^ 4      # r-  )r   r'   r4   r  s   *r
   rO   /TestRegressions.test_gh108976.<locals>.<lambda>`  s    #..B[B[\]_`Bar	   c                      ^ # r-  r   r  s   *r
   rO   rA  a  s    r	   N)
r   r'   r0   
addCleanupr(   r4   r7   r[   r]   r@  r*   s   &r
   test_gh108976TestRegressions.test_gh108976\  s    ""1f-33Q7!!!Q'((AFF4ab((AMM?K!!!QVVamm%;<!!!Q'r	   c                  a RR lpRp. p. o\         P                  P                  ^ R4       V P                  \         P                  P                  ^ 4       \         P                  P                  ^ ^ 4       \         P                  P                  ^ \        P                  V3R l4       \         P                  P                  ^ \        P                  4       V! V!   V! V!   \         P                  P                  ^ ^ 4       V P                  S^ ,          V^34       V P                  S^,          V\         P                  P                  34       R# )rU   c                     W,           # r   r   )rW   r{  s   &&r
   rX   0TestRegressions.test_call_function_ex.<locals>.ff  s	    5Lr	   r?  c                 (   < SP                  W#34      # r   rK   )r   r"   r  arg0	call_datas   &&&&r
   rO   7TestRegressions.test_call_function_ex.<locals>.<lambda>o  s    YbYiYiksjzY{r	   N)rU   r   )r   r'   r0   rC  r(   r4   r7   r[   rF   rA   r:   )r+   rX   rN   
empty_argsrK  s   &   @r
   test_call_function_ex%TestRegressions.test_call_function_exe  s    	
	""1f-33Q7!!!Q'((AFF4{|!!!QVV,	4	:!!!Q'11v.13>>+A+A'BCr	   c                8   R  p\         P                  P                  ^ R4       V P                  \         P                  P                  ^ 4       \         P                  P                  ^ \         P                  P                  P                  V4       \         P                  P                  ^ \         P                  P                  P                  4       V! R^ 4       \         P                  P                  4        \         P                  P                  ^ ^ 4       R# )c                     R # r   r   )r   instruction_offsets   &&r
   r_   DTestRegressions.test_instruction_explicit_callback.<locals>.callback{  r?  r	   r?  N)
r   r'   r0   rC  r(   r7   r/   r@  r4   r8   )r+   r_   s   & r
   "test_instruction_explicit_callback2TestRegressions.test_instruction_explicit_callbackw  s    	 	""1f-33Q7((CNN,A,A,M,MxX!!!S^^%:%:%F%FGq%%'!!!Q'r	   r   N)rb   rc   rd   re   r1  r<  rD  rN  rT  rf   rg   rh   s   @r
   r&  r&  )  s%     4B4 (D$( (r	   r&  c                   &   a  ] tR tRt o R tRtV tR# )TestOptimizeri  c                   R  pVP                   p\        P                  P                  \        V\
        P                  4       V P                  \        P                  P                  \        V4      \
        P                  4       V! R4       \        P                  P                  \        V^ 4       V P                  \        P                  P                  \        V4      ^ 4       R# )c                 ,    ^ pW8  d   V^,          pK  R# r   r   )r$  r  s   & r
   r  .TestOptimizer.test_for_loop.<locals>.test_func  s    A%Q r	   i  N)	r   r   r'   r6   r)   r[   r\   rA   r5   )r+   r  r   s   &  r
   test_for_loopTestOptimizer.test_for_loop  s    	
 !!''	4D88DI1::V$''	4;88DI1Mr	   r   N)rb   rc   rd   re   r[  rf   rg   rh   s   @r
   rW  rW    s     N Nr	   rW  c                   &   a  ] tR tRt o R tRtV tR# )TestTier2Optimizeri  c                   R  pV P                  \        P                  P                  4       / 4       . p\	        V4      p\        P                  P                  \        \        P                  V4        V! V4       \        P                  P                  \        \        P                  R4       \        P                  P                  \        ^ 4       V P                  \        V4      ^4       R#   \        P                  P                  \        \        P                  R4       \        P                  P                  \        ^ 4       i ; i)c           	         \         P                  P                  p\        P                  p^ p\        \        P                  ^3,           4       F3  pV! \        V\        V\        P                  8  4      ,          4         K5  	  R# r   )
r   r'   r4   r[   r]   rn   r   r  r)   r  )rG  r4   rT  r  s   &   r
   r  KTestTier2Optimizer.test_monitoring_already_opimized_loop.<locals>.test_func  sd    22J66DA,EEJK9dS6G6`6`1`-a&ab Lr	   N)rA   r   r'   r(  rF  r7   r)   r[   r]   r4   r  r   )r+   r  r/   rG  s   &   r
   %test_monitoring_already_opimized_loop8TestTier2Optimizer.test_monitoring_already_opimized_loop  s    		 	335r:'((AFFHE	4hNN,,YENN%%i33v;, NN,,YENN%%i3s   3C/ /AEr   N)rb   rc   rd   re   rb  rf   rg   rh   s   @r
   r^  r^    s     - -r	   r^  c                   &   a  ] tR tRt o R tRtV tR# )TestMonitoringAtShutdowni  c                p    \         P                  P                  R 4      p\        P                  ! V4       R# )z_test_monitoring_shutdown.pyN)r?  supportfindfiler   run_test_script)r+   scripts   & r
    test_monitoring_live_at_shutdown9TestMonitoringAtShutdown.test_monitoring_live_at_shutdown  s'     &&'EF%%f-r	   r   N)rb   rc   rd   re   rk  rf   rg   rh   s   @r
   re  re    s     . .r	   re  c                      a a ] tR tRt o ! R R4      tV 3R ltRR ltR tR tR t	]
P                  ]
P                  ]
P                  ]
P                  ]
P                  0tR	 tR
 tR tRtVtV ;t# )TestCApiEventGenerationi  c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestCApiEventGeneration.Scopei  c                    Wn         R # r   r  r   s   &*r
   r   &TestCApiEventGeneration.Scope.__init__  s    Ir	   c                B    \         P                  ! V P                  !   R # r   )r   monitoring_enter_scoperN   r*   s   &r
   	__enter__'TestCApiEventGeneration.Scope.__enter__  s    ,,dii8r	   c                .    \         P                  4        R # r   )r   monitoring_exit_scoper   s   &*r
   __exit__&TestCApiEventGeneration.Scope.__exit__  s    ++-r	   r  N)	rb   rc   rd   re   r   ru  ry  rf   rg   rh   s   @r
   Scoperp    s     		9	. 	.r	   r{  c                  < \         \        V `  4        \        pVP	                  ^4      V n        ^\        P                  VP                  3^\        P                  VP                  3^\        P                  VP                  ^
3^\        P                  VP                  ^3^\        P                  VP                   \"        ^(3^\        P$                  VP&                  ^<3^\        P(                  VP*                  ^F3^\        P,                  VP.                  ^P3^\        P0                  VP2                  \5        ^4      3^\        P6                  VP8                  \5        ^4      3^\        P:                  VP<                  \5        ^4      3^\        P>                  VP@                  \5        ^4      3^\        PB                  VPD                  ^3^\        PB                  VPD                  \G        ^4      3.V n$        \        P0                  \        P6                  \        P:                  \        P>                  .V n%        R# r   )&r  rn  rt   r   CodeLikecodeliker[   r\   fire_event_py_startr   fire_event_py_resumePY_YIELDfire_event_py_yieldr   fire_event_py_returnrF   fire_event_callr  r  fire_event_jumpr  fire_event_branch_rightr  fire_event_branch_leftr  fire_event_py_throwrC   r  fire_event_raiser  fire_event_exception_handledr  fire_event_py_unwindr  fire_event_stop_iterationr  casesEXPECT_RAISED_EXCEPTION)r+   capirq   s   & r
   rt   TestCApiEventGeneration.setUp  s   %t24a( T556d778T55r:d77<--x<--r2!=!=rB ; ;R@T55z!}E$//A?$$d&G&GTUWd77AG!!4#A#A1E!!4#A#A=QRCST

$ )*

AGGQ=P=PRSR]R]'^$r	   c           	     b    ! R  R4      p V! V4      p\         P                  P                  \        W4       V\        P
                  8X  g   V\        P                  8X  d4   \         P                  P                  \        \        P                  4       M$\         P                  P                  \        V4       \        \        P                  ! V4      4      pV P                  V P                  V4      ;_uu_ 4        ^ Vn         V! V!   V P                  VP                  V4        RRR4       \         P                  P                  \        TR4      p
T P                  T P                  T4      ;_uu_ 4        ^ Tn        T! T!   T P                  TP                  ^ 4       T P                  Y4       RRR4       \         P                  P                  \        ^ 4       R#   \          dr   p	T P#                  T\         4       T P                  \%        T	4      \%        T4      4        Rp	?	RRR4       \         P                  P                  \        ^ 4       R# Rp	?	ii ; i  + '       g   i     ELB; i  + '       g   i     L; i  \         P                  P                  \        ^ 4       i ; i)c                   ,   a  ] tR tRt o R tR tRtV tR# ):TestCApiEventGeneration.check_event_count.<locals>.Counteri  c                     Wn         ^ V n        R# r   callback_raisesr   )r+   r  s   &&r
   r   CTestCApiEventGeneration.check_event_count.<locals>.Counter.__init__  s    '6$
r	   c                    V ;P                   ^,          un         V P                  '       d   V P                  pRV n        VhR# rT   )r   r  )r+   rN   r  s   &* r
   r   CTestCApiEventGeneration.check_event_count.<locals>.Counter.__call__  s8    

a
'''..C+/D(I (r	   r  Nr   rh   s   @r
   r   r    s      r	   r   N)r   r'   r7   r)   r[   rD   rE   r4   rF   r  mathlog2r{  r~  r   rA   rC   assertIsInstancer  )r+   r   r!   rN   r   r  r   r   event_valuerS  r   s   &&&&&&     r
   r   )TestCApiEventGeneration.check_event_count  s   
	 
		4o.GNN,,YG

"eqyy&8)))QVV<)))U;dii./KDMM;77 !>$K $$W]]H= 8 >>33IudKDDMM;77 !d  2  /	 8 NN%%i3 " ))(J?$$SVS]; 8$ NN%%i3	 877 87 NN%%i3sm   C0J <I!G"I!(AJ 9;I54J "I-:I'I!+J II!!I2	,	J 5J	 J &J.c           	     H   V P                    F}  vrr4^ p\        P                  ^4      V n        V P	                  VP
                  4      ;_uu_ 4        V P                  V3\        V4      ,           pV P                  W#Wa4       RRR4       K  	  R#   + '       g   i     K  ; ir   )r  r   r}  r~  r  rb   tupler   r+   r   r   functionrN   r"   args_s   &      r
   test_fire_event'TestCApiEventGeneration.test_fire_event
	  s|    04

,HXF%..q1DMh//00/%+=&&uH 10 1; 100   1BB!c           	     ,   V P                    F  vrr4W P                  9  d   K  V'       d   \        VR,          \        4      '       g   Q h^ p\        P                  ^4      V n        V P                  VP                  4      ;_uu_ 4        V P                  V3\        VRR 4      ,           R,           p\        \        P                  ! V4      4      p\        RV R24      pV P                  W#Wh4       RRR4       K  	  R#   + '       g   i     EK  ; i)rU   NzFiring event z with no exception setr   r   )r  r  r   BaseExceptionr   r}  r~  r  rb   r  r  r  r  rC   r   )	r+   r   r   r  rN   r"   r  evtr   s	   &        r
   test_missing_exception.TestCApiEventGeneration.test_missing_exception	  s    )-%Ah888JtBx????F%..q1DMh//00/%Sb	2BBWL$))E*+%cU:P&QR&&uH	 10 *4 100s   
A)DDc                   V P                    F  vrr4^ p\        P                  ^4      V n        V P	                  VP
                  4      ;_uu_ 4        V P                  V3\        V4      ,           p\        ^*4      pV P                  \        V4      4      ;_uu_ 4        V P                  W#WaVR7       RRR4       RRR4       K  	  R#   + '       g   i     L; i  + '       g   i     K  ; i)r   )r  N)r  r   r}  r~  r  rb   r  OSErrorrB   r  r   )r+   r   r   r  rN   r"   r  r  s   &       r
    test_fire_event_failing_callback8TestCApiEventGeneration.test_fire_event_failing_callback	  s    04

,HXF%..q1DMh//00/%+=bk&&tCy11**5E;> + @ 2 10 1; 21 100s%   ACC2CCCC,c                    \        4       p\        P                  P                  \        W4       V\
        P                  8X  g   V\
        P                  8X  d4   \        P                  P                  \        \
        P                  4       M$\        P                  P                  \        V4       \        \        P                  ! V4      4      pV P                  V P                  V4      ;_uu_ 4        ^ Vn        V! V!   V P!                  VP                  V4       RVn        WP$                  9   d=    ^ Vn        V! V!   V P!                  VP                  V4       V P'                  R4       MY^ Vn        V! V!   V P!                  VP                  V4       ^ Vn        V! V!   V P!                  VP                  V^,
          4       RRR4       \        P                  P                  \        ^ 4       R#   \(         d     L;i ; i  + '       g   i     LG; i  \        P                  P                  \        ^ 4       i ; i)r   TzExpected a ValueErrorN)r  r   r'   r7   r)   r[   rD   rE   r4   rF   r  r  r  r{  r~  r   rA   r  CANNOT_DISABLEErrorrC   )r+   r   r!   rN   r   r   r  s   &&&&&  r
   check_disable%TestCApiEventGeneration.check_disable.	  s    	4(*GNN,,YG

"eqyy&8)))QVV<)))U;dii./KDMM;77 !d  9"&///<()d((A 

#:;$%GM$K$$W]]H=$%GM$K$$W]]HqLA- 80 NN%%i3 &  870 NN%%i3sJ   C2H 4AH	6)G8A+H	
H 8HH	HH		H	H &Ic           	     H   V P                    F}  vrr4^ p\        P                  ^4      V n        V P	                  VP
                  4      ;_uu_ 4        V P                  ^ 3\        V4      ,           pV P                  W#Wa4       RRR4       K  	  R#   + '       g   i     K  ; ir   )r  r   r}  r~  r  rb   r  r  r  s   &      r
   test_disable_event*TestCApiEventGeneration.test_disable_eventQ	  s|    04

,HXF%..q1DMh//00*U4[8""5ED 10 1; 100r  c                    \        4       p\        4       p\        P                  P                  \        \
        P                  V4       \        P                  P                  \        \
        P                  V4       \        P                  P                  \        \
        P                  \
        P                  ,          4       \        \        P                  ! \
        P                  4      4      p\        \        P                  ! \
        P                  4      4      p\        P                  ^4      pV^ 3pV P                  WSV4      ;_uu_ 4        ^ Vn        ^ Vn        \        P                   ! . VO\#        ^*4      N5!   VP                  ^ 8X  g   Q hVP                  ^8X  g   Q h\        P$                  ! . VO\#        ^*4      N5!   VP                  ^8X  g   Q hVP                  ^8X  g   Q hRVn        \        P$                  ! . VO\#        ^*4      N5!   VP                  ^8X  g   Q hVP                  ^8X  g   Q h\        P$                  ! . VO\#        ^*4      N5!   VP                  ^8X  g   Q hVP                  ^8X  g   Q h RRR4       \        P                  P                  \        ^ 4       R#   + '       g   i     L6; i  \        P                  P                  \        ^ 4       i ; i)r   TN)r  r   r'   r7   r)   r[   r  r  r4   r  r  r  r   r}  r{  r   r  rC   r  r  )r+   yield_counterunwind_counteryield_valueunwind_valueclcommon_argss   &      r
   test_enter_scope_two_events3TestCApiEventGeneration.test_enter_scope_two_eventsY	  s   !	4.0M/1NNN,,Y

MRNN,,Y^TNN%%iakk1IJdii

34Ktyy56L##A&Bq'KB\::&'#'($..LLZ^L$**a/0/%++q010--K{KJrNK$**a/0/%++q010(,%--K{KJrNK$**a/0/%++q010--K{KJrNK$**a/0/%++q010' ;, NN%%i3- ;:, NN%%i3s%   EK D6J5K 5K	 K &K.)r  r  r~  r   )rb   rc   rd   re   r{  rt   r   r  r  r  r[   r  r  r  r  r  r  r  r  r  rf   rg   __classcell__)rq   ri   s   @@r
   rn  rn    sn     . ._8'4RII	@ zz177AII**AKK:N!4FE"4 "4r	   rn  r9  )r   r   r   )r   r   r   r   )r   r   r   r   r   )r   r   r   r   r   r   )r   r   r   r   r   r   )y__doc__r   r>  	functoolsr  r  operatorr   r  r  unittesttest.supportr?  r   r   rg  import_helperimport_moduler   r   r   r   r   r   r   r   r)   ro   rp   r#   TestCaser%   rk   ry   r'   r/   r[   r\   r   r   r  r  r  r  r  r  r  r  rE   rD   r   reduceor_rF   r   r   r   r   r   r   FunctionType
MethodTyper   r   r   r  r  test.profileer   r   r  r  r  r%  rD  r  r  r  r  r  r  r  r  r  r  r  rF  rM  rS  rV  rk  rY  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r?  r@  r\  rA  rB  r   r  r  r  r  r&  rW  r^  re  rn  )r  r   s   00r
   <module>r     s   (  
     
     BLL&&44[A	LL..<<=PQ 	
 	

1H/(++ H/V0 0,(2,h.?.? (2V NN ZZ[[([[(ZZVVVXXx  WWg[[(-. $m3YY	ZZ7  ##HLL]2S]'22]2SUVWZ[Z`Z`` 		 
 	   ""E$4$45+- +>'/1B1B '* ZZAKKajjI	zz1;;' "''.0A0A ''T	* 	*	* 	*&,%79J9J &,RC?-x/@/@ C?LJ++X->-> J+X)I$h&7&7 )IX1 1")$h&7&7 ")J"- "3' 3@& @30 31% 19 9: :a+k a+F	O 	OB Bn 
^ 
 #L,Q__9([ 9(v
F 
F "5l!B I+; I+V@V183D3D @VD o~MET((*;*; ETNJ J\ 
, 
 
	A 	A1 
 2  ).8 !-~|!K &FWYgg ')<< 24MM I*k I*Xd'.0A0A d'NT TnO)8+<+< O6Y))+= Y[(((*;*; [(|N&(9(9 N- -2.x00 .B40(2C2C B4M? 3Ts   %T9