
    ^h                         S SK r S SKJrJrJrJrJr  S SKr\\\	   \\\	   S4   4   r
 " S S\	5      r " S S\R                  5      rg)    N)DictSetTupleTypeUnion.c                       \ rS rSrSrg)PlaceholderException	    N)__name__
__module____qualname____firstlineno____static_attributes__r       Z/home/james-whalen/.local/lib/python3.13/site-packages/ipyflow/tracing/interrupt_tracer.pyr	   r	   	   s    r   r	   c            	          ^  \ rS rSrSrSrSU 4S jjr\S\\	\
      S\4S j5       rS\S\4S	 jr\R"                  " \R$                  S
S9S\S\S\\S4   4S j5       rSrU =r$ )InterruptTracer   FreturnNc                 4   > [         TU ]  " U0 UD6  0 U l        g N)super__init__num_interrupts_by_node_id)selfargskwargs	__class__s      r   r   InterruptTracer.__init__   s    $)&)9;&r   exc_type_setc                     [         U ;   a  gg)N      )KeyboardInterrupt)r!   s    r   _get_interrupt_count_threshold.InterruptTracer._get_interrupt_count_threshold   s    , r   filenamec                     g)NFr   )r   r(   s     r   should_instrument_file&InterruptTracer.should_instrument_file   s     r   T)exempt_from_guardsexc_typenode_idc                 |   [         R                  " 5       S   [        L nU(       d  g [        U[        5      (       a  UOU4n[        S U 5       5      (       d  g U R                  R                  US5      S-   nXpR                  U'   [        U5      nXpR                  U5      :  a  g [        U;   a5  UR                  [        5        U[        [        R                  5       5      -  nUR                  [        5        UR                  [        5        [        U5      S:X  a  UR!                  ["        5        [	        U5      $ )Nr   c              3   p   #    U  H,  n[        U[        5      =(       a    [        U[        5      v   M.     g 7fr   )
isinstancetype
issubclassBaseException).0ts     r   	<genexpr>@InterruptTracer.handle_exception_handler_type.<locals>.<genexpr>+   s)      
JSQJq$@Jq-$@@)s   46r$   )sysexc_infor%   r1   tupleallr   getsetr&   r4   remove__subclasses__discard
SystemExitlenaddr	   )	r   r-   r.   ___is_handling_interrupt	exc_typesnum_interrupts_at_noder!   s	            r   handle_exception_handler_type-InterruptTracer.handle_exception_handler_type#   s    !$q 15F F$ *8U ; ;H(	 
JS
 
 
 !%!?!?!C!CGQ!ORS!S2H&&w/14Y!$G$G$UUL(.C < < >??L./Z(|!12\""r   )r   )r   N)r   r   r   r   global_guards_enabledrequires_ast_bookkeepingr   staticmethodr   r   r4   intr&   strboolr*   pycregister_raw_handlerexception_handler_type
T_EXC_TYPEr   rJ   r   __classcell__)r   s   @r   r   r      s    !$< Sm9L5M RU  s t 
 	c88TR#"#-0#	z4	 # S#r   r   )r9   typingr   r   r   r   r   pyccolorR   r4   rU   r	   
BaseTracerr   r   r   r   <module>rZ      sP    
 0 0 4&d=.A3.F(GGH
	= 	.#cnn .#r   