+
    ;i                     @   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	H
t
 ^ RIHt ^ RIHtHt ^ RIHt ^ RIHt R tR	 t]R9   d   ]P,                  P.                  P0                  t]P,                  P.                  P2                  t]P,                  P.                  P4                  t]P,                  P.                  P6                  t]P,                  P.                  P8                  t]P,                  P.                  P:                  t^ R
^R^R^R/t]P>                  ! ]R8  R4       ! R R]4      4       t ]P>                  ! ]R8  R4       ! R R]4      4       t!]P>                  ! ]R8  R4       ! R R]4      4       t"]#R8X  d   ]PH                  ! 4        R# R# )    N)Counter)Mockcall)TestCase)jitobjmode)	PYVERSION)_numba_unpicklec                    RV n         V # )z4Decorator to enable sys.monitoring on the dispatcherT)_enable_sysmon)disps   &]/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/tests/test_sys_monitoring.pyr   r      s    DK    c                  L   a \         \        R 4      R 4       4       oV3R lp SV 3# )int64(int64)c                     V ^,           #     xs   &r   foogenerate_usecase.<locals>.foo   s     1ur   c                 0   < ^S! V ^,           4      ,          # )   r   )r   r   s   &r   call_foo"generate_usecase.<locals>.call_foo   s    3q1u:~r   )r   r   )r   r   s    @r   generate_usecaser      s3       =r   DebuggerCoverageProfiler	Optimizerzneeds Python 3.12+c                      a  ] tR t^0t o R tR tR tR tR tR t	RR lt
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tRtV tR# )TestMonitoringc                   . p\        ^4       FB  p\        P                  P                  V4      f   K&  VP	                  \
        V,          4       KD  	  V'       d&   RRP                  V4       2pV P                  V4       \        4       w  V n	        V n
        ^
V n        V P                  ^,           ^,           V n        ^V P                  ,          V n        \        P                  P                  V n        R# )   NzVCannot run monitoring tests when other monitors are active, found monitor(s) of type: z, )rangesys
monitoringget_toolappendTOOL2MONITORTYPEjoinskipTestr   r   r   arg
foo_resultcall_foo_resultPROFILER_IDtool_id)selfmonitor_kindsimsgs   &   r   setUpTestMonitoring.setUp9   s     qA~~&&q)5$$%5a%89  8ii./1C MM# #3"4$-((Q,* 4??2~~11r   c                    \        4       pV P                  P                  V P                  P                  0pVP                   F0  pVP
                  vrVWS9   g   K  W%.VO5;;,          ^,          uu&   K2  	  V# r   )r   r   __code__r   _mock_call_args_listargs)r4   	mockcallsmatchedtarget_codeobjscb_argscodeobjr=   s   &&     r   gather_mock_calls_multithreads-TestMonitoring.gather_mock_calls_multithreadsO   sf    )==114883D3DE 55G&||W)(4()Q.) 6 r   c                    V P                  V\        ,          4      pV P                  \        V4      ^4       \        P
                  ! V P                  4       Uu. uF  pVP                  R8X  g   K  VNK  	  ppV^ ,          P                  pV P                  W P                  P                  V3,          ^4       V P                  W P                  P                  ^ 3,          ^4       V P                  VP                  4       ^4       R# u upi r   RESUMEN)rC   PY_STARTassertEquallendisget_instructionsr   opnameoffsetr;   r   total)r4   allcallsr?   r   instrN   s   &&    r   !check_py_start_calls_multithreads0TestMonitoring.check_py_start_calls_multithreadsY   s     55hx6HIWq) //> )>a88x' > )a!7!7!?@!D!2!2A!56:!,)s   D2Dc                   V\         ,          pV P                  VP                  ^4       \        P                  ! V P
                  4       Uu. uF  pVP                  R8X  g   K  VNK  	  ppV^ ,          P                  p\        V P
                  P                  V4      \        V P                  P                  ^ 4      3pVP                  V4       R# u upi rF   )rH   rI   
call_countrK   rL   r   rM   rN   r   r;   r   assert_has_calls)r4   rP   r>   r   rQ   rN   callss   &&     r   check_py_start_calls#TestMonitoring.check_py_start_callsg   s     X&	--q1//> )>a88x' > )admm,,f5dhh''+-""5))s   C$Cc                   V P                  V\        ,          4      p\        P                  ! V P                  4       Uu. uF  q3NK  	  upR,          P
                  pV P                  W P                  P                  ^ V P                  3,          ^4       V P                  W P                  P                  W@P                  3,          ^4       V P                  VP                  4       ^4       R# u upi )r   N)rC   	PY_RETURNrK   rL   r   rN   rI   r   r;   r0   r1   rO   )r4   rP   r?   r   rN   s   &&   r   "check_py_return_calls_multithreads1TestMonitoring.check_py_return_calls_multithreadsu   s     55hy6IJ 11$--@A@!@A"ELL!2!2At!FGKMM**F4H4HHI1	
 	!, Bs   
C0c                   V\         ,          pV P                  VP                  ^4       \        P                  ! V P
                  4       Uu. uF  q3NK  	  upR,          P                  p\        V P                  P                  ^ V P                  4      \        V P
                  P                  W@P                  4      .pVP                  V4       R# u upi )r   Nr[   )r\   rI   rU   rK   rL   r   rN   r   r   r;   r0   r1   rV   )r4   rP   r>   r   rN   rW   s   &&    r   check_py_return_calls$TestMonitoring.check_py_return_calls   s     Y'	--q1 !11$--@A@!@A"ELLdhh''DOO<dmm,,f6J6JKM""5) Bs   
CNc                :    Vf   V P                   pMTp\        P                  P                  VR4       / p^ pV F9  p	\	        4       p
\        P                  P                  WiV
4       WV	&   W,          pK;  	  \        P                  P                  Wh4       Ve   V! 4        V! V!   Ve   V! 4        \        P                  P                  V\        4       V F#  p	\        P                  P                  WiR 4       K%  	  \        P                  P                  V4       V#   Te   T! 4        \        P                  P                  X\        4       T F#  p	\        P                  P                  YiR 4       K%  	  \        P                  P                  T4       i ; i)Ncustom_monitor)	r3   r(   r)   use_tool_idr   register_callback
set_events	NO_EVENTSfree_tool_id)r4   functionr=   eventsr3   barrier_tool_id	callbacksevent_bitmaskeventcallbacks   &&&&&&     r   run_with_eventsTestMonitoring.run_with_events   sB   
	2<<"NN&&x1ABIM600(K#+% &	   NN%%h>"	dO " 	NN%%h	:00$G  NN''1 " 	NN%%h	:00$G  NN''1s   B&D! !A9Fc                    V P                  V P                  V P                  3\        34      pV P	                  \        V4      ^4       V P                  V4       R# r   N)rq   r   r/   rH   rI   rJ   rX   r4   cbs   & r   test_start_eventTestMonitoring.test_start_event   sD    !!$--$((xkJR!$!!"%r   c                    V P                  V P                  V P                  3\        34      pV P	                  \        V4      ^4       V P                  V4       R# rt   )rq   r   r/   r\   rI   rJ   r`   ru   s   & r   test_return_event TestMonitoring.test_return_event   sD    !!$--$((ylKR!$""2&r   c                    V P                  V P                  V P                  3\        \        34      pV P                  \        V4      ^4       V P                  V4       V P                  V4       R# )r   N)	rq   r   r/   rH   r\   rI   rJ   r`   rX   ru   s   & r   test_call_event_chain$TestMonitoring.test_call_event_chain   sZ    !!$--$((#+Y"79 	R!$""2&!!"%r   c                d   \        R 4      R 4       p V P                  p\        P                  P	                  VR4       / p^ p\
        \        3pV F9  p\        4       p\        P                  P                  W&V4       WsV&   WF,          pK;  	  \        P                  P                  W!P                  V4       V! V P                  4      pV F#  p\        P                  P                  W&R4       K%  	  \        P                  P                  W!P                  ^ 4       \        P                  P                  V4       V P                  WP                  V P                  4      4       V P                  \        V4      ^4       V\
        ,          P!                  4        V\        ,          P!                  4        R#   X F$  p\        P                  P                  XTR4       K&  	  \        P                  P                  XTP                  ^ 4       \        P                  P                  T4       i ; i)r   c                     V ^,           # )   r   r   s   &r   r   PTestMonitoring.test_instrumented_code_does_not_trigger_numba_events.<locals>.foo       q5Lr   rc   N)r   r3   r(   r)   rd   rH   r\   r   re   set_local_eventsr;   r/   rh   rI   py_funcrJ   assert_not_called)	r4   r   r3   rm   rn   rj   ro   rp   results	   &        r   4test_instrumented_code_does_not_trigger_numba_eventsCTestMonitoring.test_instrumented_code_does_not_trigger_numba_events   s   	^		 
		1llGNN&&w0@AIM	*F600J#+% &	   NN++G\\,9;]F00F  NN++G\\1ENN''0 	TXX!67Y+(--/)..0  00%F  NN++GS\\1ENN''0s   B7F9 9A6H/c                V   R  p V P                   p\        P                  P                  VR4       \        P                  P	                  W!P
                  \        4       \        P                  P                  V\        \        4       4       \        V4      ! V P                  4      pV P                  W1! V P                  4      4       \        P                  P                  V\        R4       \        P                  P	                  W!P
                  ^ 4       \        P                  P                  V4       R#   \        P                  P                  X\        R4       \        P                  P	                  Y!P
                  ^ 4       \        P                  P                  T4       i ; i)c                     V ^,           # r   r   r   s   &r   r   BTestMonitoring.test_instrumented_code_can_be_compiled.<locals>.foo   s    q5Lr   rc   N)r3   r(   r)   rd   r   r;   rH   re   r   r   r/   rI   rh   )r4   r   r3   r   s   &   r   &test_instrumented_code_can_be_compiled5TestMonitoring.test_instrumented_code_can_be_compiled   s   		1llGNN&&w0@ANN++G\\8LNN,,WhGXdhh'FVS]3NN,,WhENN++G\\1ENN''0 NN,,WhENN++G\\1ENN''0s   CD8 8A0F(c                *   R  p\         P                  P                  P                  pR pV! V4      pV P	                  VRV34      pWR,          P                  4        V! \        4      pV P	                  VRV34      pWr,          P                  4        R# )c                 F   a V ! R 4      R 4       oV ! R4      V3R l4       pV# )zvoid()c               3      "   ^
x  R# 5i)
   Nr   r   r   r   producerTTestMonitoring.test_unhandled_events_are_ignored.<locals>.generate.<locals>.producer  s
     s   	zint64()c                  (   < S! 4       p \        V 4      # N)next)pr   s    r   consumerTTestMonitoring.test_unhandled_events_are_ignored.<locals>.generate.<locals>.consumer  s    JAwr   r   )decr   r   s   & @r   generateBTestMonitoring.test_unhandled_events_are_ignored.<locals>.generate  s8    ]  ^  Or   c                     R  # )c                     V # r   r   )fns   &r   <lambda>TTestMonitoring.test_unhandled_events_are_ignored.<locals>.<lambda>.<locals>.<lambda>  s    r   r   )sigs   &r   r   BTestMonitoring.test_unhandled_events_are_ignored.<locals>.<lambda>  s    mr   Nr   )r(   r)   rj   PY_YIELDrq   assert_called_oncer   r   )r4   r   ro   wrapperpy_consumerpy_cbnb_consumernb_cbs   &       r   !test_unhandled_events_are_ignored0TestMonitoring.test_unhandled_events_are_ignored  s~    
	 %%..+w'$$["x@'')sm$$["x@&&(r   c                    \         pV P                  p\        P                  P	                  VR 4       \        P                  P                  W!4       \        P                  P                  V4      pV P                  W14       V P                  V P                  4      p\        P                  P                  V4      pV P                  W14       V P                  W@P                  4       \        P                  P                  V\        4       \        P                  P                  V4       R#   \        P                  P                  X\        4       \        P                  P                  T4       i ; i)rc   N)rH   r3   r(   r)   rd   rf   
get_eventsrI   r   r/   r1   rg   rh   )r4   ro   r3   active_eventsr   s   &    r    test_event_with_no_callback_runs/TestMonitoring.test_event_with_no_callback_runs'  s    
	1EllGNN&&w0@ANN%%g5NN55g>M]2]]488,FNN55g>M]2V%9%9:NN%%gy9NN''0 NN%%gy9NN''0s   C'D. .AE3c                   \        \        P                  P                  R 7      p \        pV P
                  p\        P                  P                  VR4       \        P                  P                  W24       \        P                  P                  W2V4       \        P                  P                  V4      pV P                  WB4       V P                  V P                  4      p\        P                  P                  V4      pV P                  WB4       V P                  WPP                  4       VP                  4        \        P                  P                  4        \        P                  P                  W2R4       \        P                  P                  V\         4       \        P                  P#                  V4       R#   \        P                  P                  4        \        P                  P                  XXR4       \        P                  P                  T\         4       \        P                  P#                  T4       i ; i))return_valuerc   N)r   r(   r)   DISABLErH   r3   rd   rf   re   r   rI   r   r/   r1   assert_calledrestart_eventsrg   rh   )r4   rp   ro   r3   r   r   s   &     r   test_disable_from_callback)TestMonitoring.test_disable_from_callback<  sx    S^^%;%;<	1EllGNN&&w0@ANN%%g5NN,,WXFNN55g>M]2]]488,FNN55g>M]2V%9%9:""$ NN))+NN,,WTBNN%%gy9NN''0 NN))+NN,,WeTBNN%%gy9NN''0s   DG   BIc                  aaa  V P                   o\        P                  P                  SR 4       \        o\        4       p\        P                  P                  SSV4       VV3R lo\        \        R4      V3R l4       4       pV! ^ 4       VP                  4        V! ^4       \        P                  P                  S\        4       VP                  4        V P                  VP                  ^4       \        P                  P                  S\        4       \        P                  P                  SSR4       \        P                  P                  S4       R#   \        P                  P                  S\        4       \        P                  P                  SSR4       \        P                  P                  S4       i ; i)rc   c                 \   < V '       d#   \         P                  P                  SS4       R # R # r   )r(   r)   rf   )switch_on_eventro   r3   s   &r   objmode_enable_eventGTestMonitoring.test_mutation_from_objmode.<locals>.objmode_enable_eventl  s    "NN--gu= #r   r   c                    < \         ;_uu_ 4        S! V 4       R R R 4       V ^,           #   + '       g   i     T ^,           # ; ir   )r   )enabler   s   &r   r   6TestMonitoring.test_mutation_from_objmode.<locals>.foop  s3     W(0 z! Wz!s	   	*A	N)r3   r(   r)   rd   r\   r   re   r   r   r   rf   rg   r   rI   rU   rh   )r4   rp   r   ro   r   r3   s   &  @@@r   test_mutation_from_objmode)TestMonitoring.test_mutation_from_objmode`  sD   '	1 llGNN&&w0@AEvHNN,,WeXF>  " ! " F&&( F NN%%gy9""$ X00!4NN%%gy9NN,,WeTBNN''0 NN%%gy9NN,,WeTBNN''0s   C1E A&Gc           	        \         P                  P                  \        3\         P                  P                  \
        3\         P                  P                  \        3\         P                  P                  \
        \        3/p/ p VP                  4        Fz  w  r4\         P                  P                  VR V 24       ^ p/ pWbV&   V FD  p\        4       pV\        8w  d!   \         P                  P                  W7V4       WV&   WW,          pKF  	  K|  	  VP                  4        F#  p\         P                  P                  VX4       K%  	  V P                  V P                   4       VP                  4        F~  w  r4V F0  pV\        8w  g   K  \         P                  P                  W7R4       K2  	  \         P                  P                  V\        4       \         P                  P#                  V4       K  	  T\         P                  P                  ,          p	T P%                  \'        T	4      ^4       T	\        ,          pTP)                  4        T\         P                  P                  ,          p
T P%                  \'        T
4      ^4       T P+                  T
4       T\         P                  P                  ,          pT P%                  \'        T4      ^4       T P-                  T4       T\         P                  P                  ,          pT P%                  \'        T4      ^4       T P+                  T4       T P-                  T4       R#   TP                  4        F~  w  r4T F0  pT\        8w  g   K  \         P                  P                  Y7R4       K2  	  \         P                  P                  T\        4       \         P                  P#                  T4       K  	  i ; i)custom_monitor_N)r(   r)   DEBUGGER_IDrg   COVERAGE_IDrH   r2   r\   OPTIMIZER_IDitemsrd   r   re   keysrf   r   r/   rh   rI   rJ   r   rX   r`   )r4   tool_ids_2_eventsall_callbacksr3   rj   rn   rm   ro   rp   dbg_toolcov_tool	prof_toolopt_tools   &            r   test_multiple_tool_id$TestMonitoring.test_multiple_tool_id  s    !^^77) ^^77( ^^77) ^^88"*I!7	: 	5#4#:#:#<**7ogY4OP !	)2g&#E#vH	)889AC'/e$!*M $ $= -113))'=A 4MM$((# $5#:#:#<#E	)88N $ ))'9=++G4 $= !!;!;<X*I&""$ !!;!;<X*!!(+ "#.."<"<=	Y+""9- !!<!<=X*!!(+""8,= $5#:#:#<#E	)88N $ ))'9=++G4 $=s   C M #O 4A,O c                
  a \        4       p\        4       p\        4       pR o\        \        R4      V3R l4       4       pRp V P                  p\        P
                  P                  VR4       \        P
                  P                  V\        V4       \        P
                  P                  V\        V4       \        P
                  P                  V\        V4       \        P
                  P                  V\        \        ,          \        ,          4        V! 4        \        P
                  P                  V\        4       VP                  4        VP                  ^ ,          pV P!                  VP"                  ^ ,          \$        P&                  4       V P!                  VP"                  ^,          ^ ,          \        4       V P!                  VP"                  ^,          ^,          ^ ,          S4       VP)                  4        VP                  ^ ,          p	V P!                  V	P"                  ^ ,          \$        P&                  4       V P+                  V	P"                  ^,          \,        4       VP                  ^,          p
V P!                  V
P"                  ^ ,          VP.                  P&                  4       V P+                  V
P"                  ^,          \        4       V P1                  S\3        V
P"                  ^,          4      4       VP                  4        VP                  ^ ,          pV P!                  VP"                  ^ ,          VP.                  P&                  4       V P+                  VP"                  ^,          \        4       V P1                  S\3        VP"                  ^,          4      4       \        P
                  P                  V\        4       \        P
                  P                  V\        R4       \        P
                  P                  V\        R4       \        P
                  P                  V\        R4       \        P
                  P5                  V4       V P1                  S\3        V4      4       R#   \         d   pTp Rp?EL~Rp?ii ; i  \        P
                  P                  X\        4       \        P
                  P                  T\        R4       \        P
                  P                  T\        R4       \        P
                  P                  T\        R4       \        P
                  P5                  T4       i ; i)exception raised()c                     < \        S 4      hr   )
ValueErrorr7   s   r   r   9TestMonitoring.test_raising_under_monitoring.<locals>.foo  s     S/!r   Nrc   )r   r   r   r3   r(   r)   rd   re   r\   RAISE	PY_UNWINDrf   r   rg   r   call_args_listrI   r=   r
   r;   r   assertIsInstanceKeyErrorr   assertInstrrh   )r4   ret_callbackraise_callbackunwind_callbackr   store_raisedr3   raisesthe_callnumba_unpickle_callfoo_callunwind_callr7   s   &           @r   test_raising_under_monitoring,TestMonitoring.test_raising_under_monitoring  s   
 v& 		T	" 
 
	" .	1llGNN&&w0@ANN,,WiNNN,,We^LNN,,Wi-<>NN%%gy5/@9/LM& NN%%gy9 ++- $2215HX]]1-/G/GHX]]1-a0*=X]]1-a03S9 ((*"0"?"?"B055a8,557!!"5":":1"=xH%44Q7HX]]1-s{{/C/CD!!(--"2J?MM#s8==#345 ..0)88;K[--a0#++2F2FG!!+"2"21"5zBMM#s;#3#3A#678NN%%gy9NN,,WiFNN,,WeTBNN,,WiFNN''0c3|,-M  &%&@ NN%%gy9NN,,WiFNN,,WeTBNN,,WiFNN''0s9   CR% R
 JR% 
R"RR% R""R% %B4Uc                  a \        4       p\        4       p\        4       pR o\        \        R4      V3R l4       4       pRp V P                  p\        P
                  P                  VR4       \        P
                  P                  V\        V4       \        P
                  P                  V\        V4       \        P
                  P                  V\        V4       \        P
                  P                  V\        \        ,          \        ,          4        V! 4        \        P
                  P                  V\        4       VP                  4        VP                  ^ ,          pV P!                  VP"                  ^ ,          \$        P&                  4       V P!                  VP"                  ^,          ^ ,          \        4       V P!                  VP"                  ^,          ^,          ^ ,          S4       VP)                  4        V P!                  VP*                  ^4       VP                  ^ ,          p	V P!                  V	P"                  ^ ,          \$        P&                  4       V P-                  V	P"                  ^,          \.        4       VP                  ^,          p
V P!                  V
P"                  ^ ,          VP0                  P&                  4       V P-                  V
P"                  ^,          \        4       V P3                  S\5        V
P"                  ^,          4      4       VP                  ^,          p\        P6                  ! 4       P8                  pV P!                  VP"                  ^ ,          V4       V P-                  VP"                  ^,          \        4       V P3                  S\5        VP"                  ^,          4      4       VP;                  4        \        P
                  P                  V\        4       \        P
                  P                  V\        R4       \        P
                  P                  V\        R4       \        P
                  P                  V\        R4       \        P
                  P=                  V4       V P3                  S\5        V4      4       R#   \         d   pTp Rp?ELRp?ii ; i  \        P
                  P                  X\        4       \        P
                  P                  T\        R4       \        P
                  P                  T\        R4       \        P
                  P                  T\        R4       \        P
                  P=                  T4       i ; i)r   r   c                     < \        S 4      hr   )StopIterationr   s   r   r   @TestMonitoring.test_stop_iteration_under_monitoring.<locals>.foo  s      $$r   Nrc   )r   r   r   r3   r(   r)   rd   re   r\   r   STOP_ITERATIONrf   r   rg   r   r   rI   r=   r
   r;   r   rU   r   r   r   r   r   	_getframef_coder   rh   )r4   return_callbackr   stopiter_callbackr   r   r3   r   r   r   r   	meth_calltest_method_coder7   s   &            @r   $test_stop_iteration_under_monitoring3TestMonitoring.test_stop_iteration_under_monitoring  s    & F 		T	% 
 
	% :	1llGNN&&w0@ANN,,Wi-<>NN,,We-;=NN,,Wn->@NN%%g&/.&@5&HJ& NN%%gy9 ..0 '55a8HX]]1-/G/GHX]]1-a0-@X]]1-a03S9 ((*^66: #1"?"?"B055a8,557!!"5":":1"=xH &44Q7HX]]1-s{{/C/CD!!(--"2MBMM#s8==#345 '55a8I"}}55Y^^A.0@A!!).."3]CMM#s9>>!#456 //1NN%%gy9NN,,WiFNN,,WndKNN,,WeTBNN''0c3|,-_ ! &%&R NN%%gy9NN,,WiFNN,,WndKNN,,WeTBNN''0s9   CS R1 KS 1S	<S>S S		S B4V c                v   R p\        \        V4      R7      pRp \        pV P                  p\        P
                  P                  VR4       \        P
                  P                  WT4       \        P
                  P                  WTV4       V P                  V P                  4       \        P
                  P                  XXR4       \        P
                  P                  V\        4       \        P
                  P                  V4       VP                  4        V P                  V\        V4      4       R#   \         d   pTp Rp?LRp?ii ; i  \        P
                  P                  XXR4       \        P
                  P                  T\        4       \        P
                  P                  T4       i ; i)deliberately broken callbackside_effectNrc   )r   r   rH   r3   r(   r)   rd   rf   re   r   r/   rg   rh   r   r   r   )r4   r7   rp   r   ro   r3   r   s   &      r   6test_raising_callback_unwinds_from_jit_on_success_pathETestMonitoring.test_raising_callback_unwinds_from_jit_on_success_path`  s-   
 -JsO4	1EllGNN&&w0@ANN%%g5NN,,WXFHHTXX NN,,WeTBNN%%gy9NN''0##%c3|,-  	"!L	" NN,,WeTBNN%%gy9NN''0s+   BD8 8EE
E 
EE A&F8c                  aa R pRo\        \        V4      R7      p ! R R\        4      o\        \	        R4      VV3R l4       4       pRp \
        pV P                  p\        P                  P                  VR4       \        P                  P                  We4       \        P                  P                  WeV4       V! 4        \        P                  P                  XXR4       \        P                  P                  V\        4       \        P                  P                  V4       VP                  4        V P                  VP                   ^4       VP"                  ^ ,          pV P                  VP$                  ^ ,          \&        P(                  4       V P+                  VP$                  ^,          \,        4       VP"                  ^,          p	V P                  V	P$                  ^ ,          VP.                  P(                  4       V P1                  V	P$                  ^,          VP2                  4       VP"                  ^,          p
\        P4                  ! 4       P6                  pV P                  V
P$                  ^ ,          V4       V P1                  V
P$                  ^,          VP2                  4       V P1                  WBP2                  4       R#   \         d   pTp Rp?EL$Rp?ii ; i  \        P                  P                  XXR4       \        P                  P                  T\        4       \        P                  P                  T4       i ; i)	r   deliberately broken executionr   c                       ] tR tRtRtR# )]TestMonitoring.test_raising_callback_unwinds_from_jit_on_raising_path.<locals>.LocalExceptioni  r   N__name__
__module____qualname____firstlineno____static_attributes__r   r   r   LocalExceptionr        r   r	  r   c                     < S ! S4      hr   r   r	  msg_executions   r   raisingVTestMonitoring.test_raising_callback_unwinds_from_jit_on_raising_path.<locals>.raising       !//r   Nrc   )r   r   	Exceptionr   r   r   r3   r(   r)   rd   rf   re   rg   rh   r   rI   rU   r   r=   r
   r;   r   r   r   assertIsr   r   r   )r4   msg_callbackrp   r  r   ro   r3   r   r   raising_callr   r   r	  r  s   &           @@r   6test_raising_callback_unwinds_from_jit_on_raising_pathETestMonitoring.test_raising_callback_unwinds_from_jit_on_raising_path{  sp    67J|$<=	Y 	 
	T	0 
 
	0 	1EllGNN&&w0@ANN%%g5NN,,WXFI NN,,WeTBNN%%gy9NN''0 ,,a0 '55a8,11!4o6N6NO166q98D  ..q1**1-w/G/GHl''*H,@,@A ++A.	==?11*,<=innQ')=)=> 	l$8$899  	"!L	" NN,,WeTBNN%%gy9NN''0s,   A8K K- K("K0 (K--K0 0A&Mc                  a	a
 R pRo
\        \        V4      R7      p ! R R\        4      o	\        \	        R4      V	V
3R l4       4       pRp \
        pV P                  p\        P                  P                  VR4       \        P                  P                  We4       \        P                  P                  WeV4       V! 4        \        P                  P                  XXR4       \        P                  P                  V\        4       \        P                  P                  V4       VP                  4        VP                  ^ ,          pV P!                  VP"                  ^ ,          VP$                  P&                  4       V P!                  \)        VP"                  ^,          4      S	4       V P!                  \+        VP"                  ^,          4      S
4       V P-                  WBP.                  4       R#   \         d   pTp Rp?ELFRp?ii ; i  \        P                  P                  XXR4       \        P                  P                  T\        4       \        P                  P                  T4       i ; i)	r   r   r   c                       ] tR tRtRtR# )\TestMonitoring.test_raising_callback_unwinds_from_jit_on_unwind_path.<locals>.LocalExceptioni  r   Nr  r   r   r   r	  r    r
  r   r	  r   c                     < S ! S4      hr   r   r  s   r   r  UTestMonitoring.test_raising_callback_unwinds_from_jit_on_unwind_path.<locals>.raising  r  r   Nrc   )r   r   r  r   r   r   r3   r(   r)   rd   rf   re   rg   rh   r   r   rI   r=   r   r;   typer   r  r   )r4   r  rp   r  r   ro   r3   r   r  r	  r  s   &        @@r   5test_raising_callback_unwinds_from_jit_on_unwind_pathDTestMonitoring.test_raising_callback_unwinds_from_jit_on_unwind_path  s    67J|$<=	Y 	 
	T	0 
 
	0 	1EllGNN&&w0@ANN%%g5NN,,WXFI NN,,WeTBNN%%gy9NN''0##%  ..q1**1-w/G/GHl//23^D\..q12MB 	l$8$89!  	"!L	" NN,,WeTBNN%%gy9NN''0s,   A8G7 7HH
H 
HH A&I8c                  a a
a \         P                  ! ^4      o
V
3R loV3R lpV3R lp\        P                  ! 4       p\         P                  ! VS V3R7      p\        P                  ! 4       p\         P                  ! VS V3R7      pWF3pV F  pVP                  4        K  	  V F  pVP                  4        K  	  V 3R lp	V	! V4       V	! V4       R# )r   c                  (   < S P                  4        R # r   )wait)rk   s   r   
barrier_cbCTestMonitoring.test_monitoring_multiple_threads.<locals>.barrier_cb  s    LLNr   c                   <  V P                  V P                  V P                  3\        3\        P
                  P                  SR 7      pV P                  \        V4      ^4       V P                  V4       R#   \         d@   pTP                  RP                  \        P                  ! T4      4      4        Rp?R# Rp?ii ; i)r3   rk    N)rq   r   r/   rH   r(   r)   r   rI   rJ   rR   r  putr-   	tracebackformat_exceptionr4   qrv   er"  s   &&  r   t1_work@TestMonitoring.test_monitoring_multiple_threads.<locals>.t1_work  s    
>))$--$((+3+25..2L2L2< * >
   R!,66r: >bggi88;<==>   A4A9 9C4B>>Cc                   <  V P                  V P                  V P                  3\        3\        P
                  P                  SR 7      pV P                  \        V4      ^4       V P                  V4       R#   \         d@   pTP                  RP                  \        P                  ! T4      4      4        Rp?R# Rp?ii ; ir%  )rq   r   r/   r\   r(   r)   r   rI   rJ   r]   r  r'  r-   r(  r)  r*  s   &&  r   t2_work@TestMonitoring.test_monitoring_multiple_threads.<locals>.t2_work  s    
>))$--$((+4,25..2L2L2< * >
   R!,77; >bggi88;<==>r/  )targetr=   c                    < V P                  4       ^ 8w  dE   V P                  4       '       g   \        V P                  4       4       K1  SP	                  R4       R# R# )r   zqueue supposed to be emptyN)qsizeemptyprintgetfail)r+  r4   s   &r   assert_empty_queueKTestMonitoring.test_monitoring_multiple_threads.<locals>.assert_empty_queue  s:    wwyA~''))!%%'N		67 r   N)	threadingBarrierqueueQueueThreadstartr-   )r4   r-  r1  q1t1q2t2threadstr:  rk   r"  s   f         @@r    test_monitoring_multiple_threads/TestMonitoring.test_monitoring_multiple_threads  s     ##A&		>	> [[]WD":>[[]WD":>(AGGI AFFH 	8 	22r   )r/   r   r1   r   r0   r3   )NN)r  r  r  r  r8   rC   rR   rX   r]   r`   rq   rw   rz   r}   r   r   r   r   r   r   r   r   r   r   r  r  rH  r  __classdictcell____classdict__s   @r   r$   r$   0   s     2,-*	-* #J&'&.1B1&)21*"1H(1T?-BA.FP.d.69:v.:`8 8r   r$   c                   &   a  ] tR tRt o R tRtV tR# )TestMonitoringSelfTesti!  c                    V P                  \        P                  R RRR/R7      pV P                  R\	        V4      4       R# )r$   rw   z-mcProfile)flagsz	skipped=1N)subprocess_test_runnerr$   r  r   r   )r4   rs   & r   +test_skipping_of_tests_if_monitoring_in_useBTestMonitoringSelfTest.test_skipping_of_tests_if_monitoring_in_use$  sD     ''(A(A(8(:/3Z.@ ( B 	k3q6*r   r   N)r  r  r  r  rT  r  rJ  rK  s   @r   rN  rN  !  s     + +r   rN  c                      a  ] tR tRt o ]P
                  ! RR/R7      R 4       t]P
                  ! RR/R7      R 4       t]P
                  ! RR/R7      R	 4       tR
t	V t
R# )TestMonitoringEnvVarControli/  NUMBA_ENABLE_SYS_MONITORINGr&  )envvarsc                T    \         R  4       pV P                  VP                  4       R# )c                     V ^,           # r   r   r   s   &r   r   9TestMonitoringEnvVarControl.test_default_off.<locals>.foo4  r   r   Nr   assertFalser   r4   r   s   & r   test_default_off,TestMonitoringEnvVarControl.test_default_off1  ,     
	 
	 	++,r   0c                T    \         R  4       pV P                  VP                  4       R# )c                     V ^,           # r   r   r   s   &r   r   :TestMonitoringEnvVarControl.test_override_off.<locals>.foo=  r   r   Nr]  r_  s   & r   test_override_off-TestMonitoringEnvVarControl.test_override_off:  rb  r   1c                T    \         R  4       pV P                  VP                  4       R# )c                     V ^,           # r   r   r   s   &r   r   9TestMonitoringEnvVarControl.test_override_on.<locals>.fooF  r   r   N)r   
assertTruer   r_  s   & r   test_override_on,TestMonitoringEnvVarControl.test_override_onC  s*     
	 
	 	**+r   r   N)r  r  r  r  r   run_test_in_subprocessr`  rg  rn  r  rJ  rK  s   @r   rW  rW  /  sx     $$.35-5- $$.46-6- $$.46,6,r   rW  __main__r      )rr  )r      )r      )%rK   r>  r(   r<  r(  unittestcollectionsr   unittest.mockr   r   numba.tests.supportr   numbar   r   numba.core.utilsr	   numba.core.serializer
   r   r   r)   rj   rH   r\   r   r   r   rg   r,   
skipUnlessr$   rN  rW  r  mainr   r   r   <module>r     s   
  
     $ (  & 0	 ++~~$$--H%%//INN!!''E%%//I^^**99N%%//I 


%  
Y')+?@mX m Am` 
Y')+?@
+X 
+ A
+ 
Y')+?@,( , A,: zMMO r   