+
    Nj:                    n  a  0 t $ ^ RIH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 ^ RIHt ^RIHt ]! ]P$                  ]P&                  04      t0 ]m]P*                  k]P,                  kt]! ]R4      '       d   ]P1                  ]P2                  4       ]! ]4      tA0 R#mtR R ltR	 R
 ltR R ltR R ltR R lt R R lt! ! R R4      t" ! R R]"4      t# ! R R]"4      t$R]#R]$/t%R]&R&    ]'! R4       ]%R,          ]%R&   R R  lt)R$R! R" llt*R#   ]( d    ]%R,          ]%R&    L%i ; i)%    )annotationsN)chain)PurePath)_logreal_prefixc                   V ^8  d   QhRR/# )   returnzt.Iterator[str] )formats   "T/data/cameron/venvs/serve_omidlab/lib/python3.14/site-packages/werkzeug/_reloader.py__annotate__r   +   s      O     c               #  n  "   \        \        P                  P                  4       4       F  p \	        V RR4      pVe   VP                  \        4      '       d   K1  \        P                  P                  V4      '       g,   Tp\        P                  P                  V4      pW8X  g   KN  K  Vx  K  	  R# 5i)z;Find the filesystem paths associated with imported modules.__file__N)listsysmodulesvaluesgetattr
startswith_ignore_alwaysospathisfiledirname)modulenameolds      r   _iter_module_pathsr    +   s~      s{{))+,vz40<4??>::''..&&C77??4(D{J -s   AB5&B5 $B5)B5c               $    V ^8  d   QhRRRRRR/# )r	   pathsset[str]exclude_patternsr
   Noner   )r   s   "r   r   r   ?   s&     @ @h @( @t @r   c                b    V F(  pV P                  \        P                  ! W4      4       K*  	  R # N)difference_updatefnmatchfilter)r"   r$   patterns   && r   _remove_by_patternr,   ?   s#    #u >? $r   c               $    V ^8  d   QhRRRRRR/# r	   extra_filesr#   r$   r
   t.Iterable[str]r   )r   s   "r   r   r   D   s$     0 00-500r   c           	        \        4       p\        \        \        P                  4      V 4       EF  p\
        P                  P                  V4      p\
        P                  P                  V4      '       d   VP                  V4       K[  \
        P                  P                  V4      R/p\
        P                  ! V4       F  w  rVpVP                  \        4      '       g)   \
        P                  P                  V4      \        9   d   VP                  4        K[  RpV FL  p	V	P!                  R4      '       g   K  RpVP                  \
        P                  P#                  WY4      4       KN  	  V'       g?   V\
        P                  P                  V4      ,          '       g   VP                  4        K  WV&   K  	  EK  	  VP%                  \'        4       4       \)        W!4       V# )a`  Find paths for the stat reloader to watch. Returns imported
module files, Python files under non-system paths. Extra files and
Python files under extra directories can also be scanned.

System paths have to be excluded for efficiency. Non-system paths,
such as a project root or ``sys.path.insert``, should be the paths
of interest to the user anyway.
TF)z.pyz.pyc)setr   r   r   r   r   abspathr   addr   walkr   _stat_ignore_scanbasename_ignore_common_dirsclearendswithjoinupdater    r,   )
r/   r$   r"   r   parent_has_pyrootdirsfileshas_pyr   s
   &&        r   _find_stat_pathsrB   D   sE    EEd388nk2wwt$77>>$IIdO.5!#D 12277##D)-@@

F==11!FIIbggll467  mBGGOOD,ABB

"($+ "/ 3B 
LL#%&u/Lr   c               $    V ^8  d   QhRRRRRR/# r.   r   )r   s   "r   r   r   w   s$     $ $$-5$$r   c                   \        4       p\        \        \        P                  4      V 4       Fw  p\
        P                  P                  V4      p\
        P                  P                  V4      '       d    \
        P                  P                  V4      pVP                  V4       Ky  	  \        4        F1  pVP                  \
        P                  P                  V4      4       K3  	  \        W!4       \        V4      # )zFind paths for the stat reloader to watch. Looks at the same
sources as the stat reloader, but watches everything under
directories instead of individual files.
)r2   r   r   r   r   r   r3   r   r   r4   r    r,   _find_common_roots)r/   r$   r?   r   s   &&  r   _find_watchdog_pathsrF   w   s     5Dd388nk2wwt$77>>$77??4(D 3 #$&' % t.d##r   c                    V ^8  d   QhRRRR/# )r	   r"   r0   r
   r   )r   s   "r   r   r      s      o / r   c                   aa / p\        R  V  4       \        RR7       F0  pTpV F  pVP                  V/ 4      pK  	  VP                  4        K2  	  \	        4       oR VV3R lloS! VR4       S# )c              3  L   "   T F  p\        V4      P                  x  K  	  R # 5ir'   )r   parts).0xs   & r   	<genexpr>%_find_common_roots.<locals>.<genexpr>   s     ;U(1+++Us   "$T)keyreversec               $    V ^8  d   QhRRRRRR/# )r	   nodez t.Mapping[str, dict[str, t.Any]]r   ztuple[str, ...]r
   r%   r   )r   s   "r   r   (_find_common_roots.<locals>.__annotate__   s#     ( (4 (O (PT (r   c                   < V P                  4        F  w  r#S! W1V3,           4       K  	  V '       g:   V'       d0   SP                  \        P                  P                  ! V!  4       R # R # R # r'   )itemsr4   r   r   r;   )rR   r   prefixchild_walkrvs   &&  r   rX   !_find_common_roots.<locals>._walk   sK    !ZZ\MF%	)* *
 FF277<<&' tr   r   )sortedlen
setdefaultr9   r2   )r"   r>   chunksrR   chunkrX   rY   s   &    @@r   rE   rE      so    (*D;U;dSE??5"-D  	

 T 
B( ( 
$OIr   c                   V ^8  d   QhRR/# )r	   r
   z	list[str]r   )r   s   "r   r   r      s     8 8 8r   c                    \         P                  R
8  d)   \         P                  .\         P                  R,          O# \         P                  .p \         P                  ^ ,          p\         P                  R,          p\         P
                  R,          p\        VRR4      ex   \        P                  R8X  Eds   VP                  R8X  Eda   \        P                  P                  V4      '       Eg;   \        P                  P                  V R24      '       Ed   \        P                  P                  V4      p\        P                  R8X  d   \        P                  P                  V4      '       g2   \        P                  P                  V R24      '       d
   VR,          p\        P                  P                  \         P                  4      ^,          R8X  d=   \        P                  P                  V4      ^,          R8X  d   V P                  ^ 4       V P                  V4       M\        P                  P!                  V4      '       d}   \"        P$                  ! \&        VP                  4      p\        P                  P                  \        P                  P)                  V4      4      ^ ,          pVR8w  d   VRV 2,          pMTpV P+                  R	VP-                  R4      34       V P+                  V4       V # )zhDetermine how the script was executed, and return the args needed
to execute it again in a new process.
:   NN__main____package__Nnt z.exe.z-m)   
   )r   version_info
executable	orig_argvargvr   r   r   r   rd   r   existsr3   splitextpopappendr   tcaststrr7   extendlstrip)rY   	py_scriptargsrc   	py_moduler   s         r   _get_args_for_reloadingrz      s    7" 3r!233
..	BI88B<D{{:&H
 x-5
4  B&y))GGNNi[-.. GGOOI.	77d? 77>>),,9+T@R1S1SV#	   03v=GG$$Y/2f<q	
		) 77>>)$$sH$8$89I77##BGG$4$4Y$?@CDz!qZ'	 "I
		4))#./0IIdOIr   c                  x    ] tR t^tRtRR R lltR R ltR tR R	 ltR
 R lt	R R lt
R R ltR R ltRtR# )ReloaderLooprf   Nc               (    V ^8  d   QhRRRRRRRR/# )r	   r/   t.Iterable[str] | Noner$   intervalint | floatr
   r%   r   )r   s   "r   r   ReloaderLoop.__annotate__   s2     ! !+! 1! 	!
 
!r   c                	    T;'       g    R Uu0 uF"  p\         P                  P                  V4      kK$  	  upV n        \	        T;'       g    R4      V n        W0n        R # u upi )Nr   )r   r   r3   r/   r2   r$   r   )selfr/   r$   r   rL   s   &&&& r   __init__ReloaderLoop.__init__   sY     CNBSBSQSBS%TBSQbggooa&8BS%T*-.>.D.D"*E  &Us   (A!c                   V ^8  d   QhRR/# r	   r
   r|   r   )r   s   "r   r   r      s      < r   c                &    V P                  4        V # )zWDo any setup, then run one step of the watch to populate the
initial filesystem state.
)run_stepr   s   &r   	__enter__ReloaderLoop.__enter__   s     	r   c                    R# )z4Clean up any resources associated with the reloader.Nr   r   exc_typeexc_valexc_tbs   &&&&r   __exit__ReloaderLoop.__exit__   s    r   c                   V ^8  d   QhRR/# r	   r
   r%   r   )r   s   "r   r   r      s     & &T &r   c                h     V P                  4        \        P                  ! V P                  4       K3  )zVContinually run the watch step, sleeping for the configured
interval after each step.
)r   timesleepr   r   s   &r   runReloaderLoop.run   s      MMOJJt}}%r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r     s      $ r   c                    R# )zmRun one step for watching the filesystem. Called once to set
up initial state, then repeatedly to update it.
Nr   r   s   &r   r   ReloaderLoop.run_step  s     	r   c                   V ^8  d   QhRR/# )r	   r
   intr   )r   s   "r   r   r   
  s     ! !s !r   c                     \        RRV P                   24       \        4       p\        P                  P                  4       pRVR&   \        P                  ! WRR7      pV^8w  g   Kh  V# )zlSpawn a new Python interpreter with the same arguments as the
current one, but running the reloader thread.
infoz * Restarting with trueWERKZEUG_RUN_MAINF)env	close_fds)r   r   rz   r   environcopy
subprocesscall)r   rx   new_environ	exit_codes   &   r   restart_with_reloader"ReloaderLoop.restart_with_reloader
  s]     .tyyk:;*,D**//+K/5K+,"OIA~  r   c                    V ^8  d   QhRRRR/# )r	   filenamert   r
   r%   r   )r   s   "r   r   r     s      s t r   c                	T    V P                  V4       \        P                  ! ^4       R# )rh   N)
log_reloadr   exitr   r   s   &&r   trigger_reloadReloaderLoop.trigger_reload  s    !r   c                    V ^8  d   QhRRRR/# r	   r   zstr | bytesr
   r%   r   )r   s   "r   r   r     s     G G; G4 Gr   c                	f    \         P                  P                  V4      p\        R RV: R24       R# )r   z * Detected change in z, reloadingN)r   r   r3   r   r   s   &&r   r   ReloaderLoop.log_reload  s(    77??8,V-h\EFr   )r$   r/   r   )NNrb   )__name__
__module____qualname____firstlineno__r   r   r   r   r   r   r   r   r   __static_attributes__r   r   r   r|   r|      s6    D!&!G Gr   r|   c                  >   a  ] tR tRtRtR V 3R lltR R ltRtV ;t# )StatReloaderLoopi!  statc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   StatReloaderLoop.__annotate__$  s     # #< #r   c                	.   < / V n         \        SV `	  4       # r'   )mtimessuperr   r   	__class__s   &r   r   StatReloaderLoop.__enter__$  s    (*w ""r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   (  s     * *$ *r   c                	J   \        V P                  V P                  4       Fl  p \        P                  ! V4      P
                  pT P                  P                  T4      pTf   Y P                  T&   KS  Y#8  g   K[  T P                  T4       Kn  	  R #   \         d     K  i ; ir'   )
rB   r/   r$   r   r   st_mtimeOSErrorr   getr   )r   r   mtimeold_times   &   r   r   StatReloaderLoop.run_step(  s    $T%5%5t7L7LMD.. {{t,H$)D!##D) N  s    BB"!B")r   )	r   r   r   r   r   r   r   r   __classcell__r   s   @r   r   r   !  s    D# #* *r   r   c                  j   a  ] tR tRtR V 3R lltR R ltR V 3R lltR tR	 R
 ltR R lt	Rt
V ;t# )WatchdogReloaderLoopi9  c               $    V ^8  d   QhRRRRRR/# )r	   rx   zt.Anykwargsr
   r%   r   )r   s   "r   r   !WatchdogReloaderLoop.__annotate__:  s!     */ */e */u */ */r   c           
     	B  <a
aaaaa ^ RI Ho
 ^ RI Ho ^ RI Ho ^ RI Ho ^ RI Ho ^ RI Hp ^ RI Hp ^ RIH	p \        SV `,  ! V/ VB  V P                  o ! V
VVVVV3R	 lR
V4      pVP                  P                  4       pVP                  R4      '       d   VRR pRV R2V n        V! 4       V n        R V P$                   4       pT! . ROVO. \&         U	u. uF	  p	RV	 R2NK  	  up	OV P(                  OR7      V n        \,        P.                  ! 4       V n        R# u up	i )r   )EVENT_TYPE_CLOSED)EVENT_TYPE_CREATED)EVENT_TYPE_DELETED)EVENT_TYPE_MODIFIED)EVENT_TYPE_MOVED)FileModifiedEvent)PatternMatchingEventHandler)Observerc                  4   < ] tR tRtR V VVVVV3R lltRtR# )3WatchdogReloaderLoop.__init__.<locals>.EventHandleriG  c                    V ^8  d   QhRRRR/# )r	   eventr   r
   r%   r   )r   s   "r   r   @WatchdogReloaderLoop.__init__.<locals>.EventHandler.__annotate__H  s     / /*; / /r   c                	\   < VP                   SSSSS09  d   R # S! VP                  4       R # r'   )
event_typesrc_path)r   r   r   r   r   r   r   r   s   &&r   on_any_event@WatchdogReloaderLoop.__init__.<locals>.EventHandler.on_any_eventH  s6    ##%&&'$,  u~~.r   r   N)r   r   r   r   r   r   )r   r   r   r   r   r   s   r   EventHandlerr   G  s    / / /r   r   observerNz
watchdog ()c              3  t   "   T F.  p\         P                  P                  V4      '       d   K*  Vx  K0  	  R # 5ir'   )r   r   isdir)rK   ps   & r   rM   0WatchdogReloaderLoop.__init__.<locals>.<genexpr>\  s#     N%5RWW]]1=M!!%5s   '8
8z*/z/*)patternsignore_patternsi)z*.pyz*.pycz*.zip)watchdog.eventsr   r   r   r   r   r   r   watchdog.observersr   r   r   r   r   lowerr:   r   r   r/   r8   r$   event_handler	threadingEventshould_reload)r   rx   r   r   r   r   r   reloader_nameextra_patternsdr   r   r   r   r   r   r   s   &*,       @@@@@@r   r   WatchdogReloaderLoop.__init__:  s   566745?/$)&),,	/ 	/6 	/ !))//1!!*--)#2.M q1	 
NT%5%5N)@@&9:&9Bqc*&9:&&
 '__.	 ;s   Dc                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   f  s     " "{ "t "r   c                	\    V P                   P                  4        V P                  V4       R # r'   )r   r2   r   r   s   &&r   r   #WatchdogReloaderLoop.trigger_reloadf  s"     	 !r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   m  s     # #< #r   c                	b   < / V n         V P                  P                  4        \        SV `  4       # r'   )watchesr   startr   r   r   s   &r   r   WatchdogReloaderLoop.__enter__m  s(    )+w ""r   c                	n    V P                   P                  4        V P                   P                  4        R # r'   )r   stopr;   r   s   &&&&r   r   WatchdogReloaderLoop.__exit__r  s"    r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   v  s      T r   c                	    V P                   P                  V P                  R 7      '       g   V P                  4        K>  \        P
                  ! ^4       R# ))timeoutN)r   waitr   r   r   r   r   s   &r   r   WatchdogReloaderLoop.runv  s4    $$))$--)@@MMOr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   |  s     0 0$ 0r   c                	   \        V P                  4      p\        V P                  V P                  4       FZ  pW P                  9  d7    V P
                  P                  V P                  VR R7      V P                  V&   VP                  V4       K\  	  V F@  pV P                  P                  VR4      pVf   K%  V P
                  P                  V4       KB  	  R#   \         d    RT P                  T&    Lyi ; i)T)	recursiveN)r2   r  rF   r/   r$   r   scheduler   r   discardrp   
unschedule)r   	to_deleter   watchs   &   r   r   WatchdogReloaderLoop.run_step|  s    %	()9)94;P;PQD<<'.)-)?)?**DD *@ *DLL& d# R DLL$$T40E ((/	   . *.DLL&	.s   
5CC98C9)r   r   r   r   r  )r   r   r   r   r   r   r   r   r   r   r   r   r   s   @r   r   r   9  s1    */ */X"# #
0 0r   r   r   watchdogzdict[str, type[ReloaderLoop]]reloader_loopszwatchdog.observersautoc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r     s     B B Br   c                    \         P                  e%   \         P                  P                  4       '       g   R#  ^ RIp T P                  \         P                  4      pT^,          T P                  ,          '       gM   T^;;,          T P                  ,          uu&   T P                  \         P                  T P                  T4       R# R#   \         d     R# i ; i)zqEnsure that echo mode is enabled. Some tools such as PDB disable
it which causes usability issues after a reload.N)	r   stdinisattytermiosImportError	tcgetattrECHO	tcsetattrTCSANOW)r   
attributess     r   ensure_echo_onr'    s     yy		 0 0 2 2 ""399-Ja=7<<''1%#))W__jA (  s   C CCc               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r	   	main_funczt.Callable[[], None]r/   r~   r$   r   r   reloader_typert   r
   r%   r   )r   s   "r   r   r     sD      #' - 	
  
r   c                   ^ RI pVP                  VP                  R 4       \        V,          ! WVR7      p \        P                  P                  R4      R8X  d`   \        4        \        P                  ! V RR7      pRVn	        V;_uu_ 4        VP                  ! 4        VP                  4        RRR4       R# \        P                  ! VP                  4       4       R#   + '       g   i     R# ; i  \         d     R# i ; i)	z<Run the given function in an independent Python interpreter.Nc                 .    \         P                  ! ^ 4      # )r   )r   r   )rx   s   *r   <lambda>#run_with_reloader.<locals>.<lambda>  s    r   )r/   r$   r   r   r   )targetrx   Tr   )signalSIGTERMr  r   r   r   r'  r   Threaddaemonr  r   r   r   r   KeyboardInterrupt)r)  r/   r$   r   r*  r0  reloaderrr   s   &&&&&   r   run_with_reloaderr6    s     
MM&..";<m,XH::>>-.&8  	;AAH 	  HHX3356	 
  s6   AC5 "C!1C5 ;$C5 !C2	,C5 2C5 5DD>   __pycache__.hg.git.nox.tox.mypy_cache.pytest_cache)NNrb   r  )+__conditional_annotations__
__future__r   r)   r   r   r   r   r   typingrr   	itertoolsr   pathlibr   	_internalr   tuplebase_prefixbase_exec_prefixr   rV   exec_prefixhasattrr4   r   r6   r8   r    r,   rB   rF   rE   rz   r|   r   r   r  __annotations__
__import__r!  r'  r6  )r>  s   @r   <module>rK     sH   " "  	  
       )=)=>?	7>	73::	7s	7
3
JJs&M 
 (@
0f$048v:G :Gz*| *0X0< X0x $1- 
8#$ ,J7N6B& 3  4+F3N64s   :D D43D4