
    ^h                         S SK r S SKJr  S SKJr   " S S\5      rS rS rS\	S	\\S
   /\S\
4   4   4S jrS r\ R                  " S5      rS\S	\
4S jrg)    N)Timer)Callablec                       \ rS rSrS rSrg)KeyDict   c                     U$ N )selfkeys     R/home/james-whalen/.local/lib/python3.13/site-packages/ipyflow/utils/misc_utils.py__missing__KeyDict.__missing__   s    
    r
   N)__name__
__module____qualname____firstlineno__r   __static_attributes__r
   r   r   r   r      s    r   r   c                     U R                  U[        5       5      nUR                  U5        [        U5      S:X  a  U R	                  US 5        g g Nr   )getsetdiscardlenpop)dr   valss       r   cleanup_discardr       s=    	c35AIIcN
1v{	c4 r   c                     U R                  U0 5      nUR                  US 5        [        U5      S:X  a  U R                  US 5        g g r   )r   r   r   )r   r   r   d2s       r   cleanup_popr#      s=    	
sBBFF3
2w!|	c4 r   waitreturn.N.c                 H   ^  S[         S   S[         S[        4   4U 4S jjnU$ )z|Decorator that will postpone a functions
execution until after wait seconds
have elapsed since the last time it was invoked.fnr&   r%   .c                 ,   >^ ^ S[         4UU U4S jjmT$ )Nr%   c                    >^ ^ U UU4S jn TR                   R                  R                  5       nTR                   R                  5         [        TU5      Tl         TR                   R                  5         U$ ! [         a    Sn N;f = f)Nc                     > T" T 0 TD6  g r	   r
   )argsr(   kwargss   r   call_it?debounce.<locals>.decorator.<locals>.debounced.<locals>.call_it!   s    D#F#r   T)tfinishedis_setcancelAttributeErrorr   start)r,   r-   r.   did_start_new	debouncedr(   r$   s   ``  r   r7   .debounce.<locals>.decorator.<locals>.debounced    sq    $% ) 4 4 ; ; =""$  g.IKKK  	 " % $%s   >A8 8BB)bool)r(   r7   r$   s   `@r   	decoratordebounce.<locals>.decorator   s    	!$ 	! 	! r   )r   r9   )r$   r:   s   ` r   debouncer<      s,    
hy) hsDy.A   r   c               '   `   #    U  H  nU   S v   S S S 5        M     g ! , (       d  f       M&  = f7fr	   r
   )gensgens     r   yield_in_loopr@   2   s!      S Ss   ..
+	.z[/\\](ipyflow|pyccolo)[/\\]filenamec                 >    [        [        R                  U 5      5      $ r	   )r9   _PROJECT_FILE_REGEXsearch)rA   s    r   is_project_filerE   ;   s    #**8455r   )re	threadingr   typingr   dictr   r    r#   floatr9   r<   r@   compilerC   strrE   r
   r   r   <module>rM      s|    	  d 
5 Xx	':&;Xc4i=P&PQ 0 jj!?@ 6c 6d 6r   