
    g)                     :   S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKrSSKJ	r	  S r
 " S S5      rS rSS	 jr " S
 S5      r " S S5      r " S S\5      r " S S5      r " S S\5      r\R(                  " S\R*                  5      rS rS rS rSS jrS rg)    )parseN   )importlib_metadata_getc                 4    Xl         UR                  U l        U $ N)__wrapped____name__)	decoratedfns     Q/Users/Alptekin/Desktop/izin_takip/venv/lib/python3.13/site-packages/mako/util.pyupdate_wrapperr      s    I    c                   &    \ rS rSrS rS rS rSrg)PluginLoader   c                     Xl         0 U l        g r   groupimpls)selfr   s     r   __init__PluginLoader.__init__   s    

r   c                 H   XR                   ;   a  U R                   U   " 5       $ [        U R                  5       H>  nUR                  U:X  d  M  UR                  U R                   U'   UR	                  5       s  $    SSKJn  UR                  SU R                  < SU< 35      e)Nr   )
exceptionszCan't load plugin  )r   r   r   nameloadmakor   RuntimeException)r   r   implr   s       r   r   PluginLoader.load   s    ::::d#%%*4::6DyyD #'99

4 yy{" 7
 	$)))-T:
 	
r   c                 2   ^^ UU4S jnX@R                   U'   g )Nc                  ~   > [        T5      n TR                  S5      SS   H  n[        X5      n M     [        U T5      $ )N.r   )
__import__splitgetattr)modtoken
modulepathobjnames     r   r   #PluginLoader.register.<locals>.load,   s@    Z(C#))#.qr2c) 33((r   )r   )r   r   r*   r+   r   s     `` r   registerPluginLoader.register+   s    	)  

4r   r   N)r	   
__module____qualname____firstlineno__r   r   r-   __static_attributes__ r   r   r   r      s    
 r   r   c                     Sn[         R                  R                  U 5      (       dD   US-  n[         R                  " U S5        [         R                  R                  U 5      (       d  MC  gg!   US:  a  e  N3= f)z,create and/or verify a filesystem directory.r   r   i     N)ospathexistsmakedirs)dir_triess     r   verify_directoryr<   5   sc     EggnnT""	QJEKKe$ ggnnT""	qy s   A, ,	A7c                 L    U c  U$ [        U [        [        45      (       d  U /$ U $ r   )
isinstancelisttuple)xdefaults     r   to_listrC   C   s)    ya$''s
r   c                   (    \ rS rSrSrSS jrS rSrg)memoized_propertyL   z2A read-only @property that is only evaluated once.Nc                 f    Xl         U=(       d    UR                  U l        UR                  U l        g r   fget__doc__r	   r   rI   docs      r   r   memoized_property.__init__P   "    	*dllr   c                 d    Uc  U $ U R                  U5      =UR                  U R                  '   nU$ r   )rI   __dict__r	   )r   objclsresults       r   __get__memoized_property.__get__U   s0    ;K/3yy~=T]]#fr   rJ   r	   rI   r   r	   r/   r0   r1   rJ   r   rT   r2   r3   r   r   rE   rE   L   s    <&
r   rE   c                   (    \ rS rSrSrSS jrS rSrg)memoized_instancemethod\   zDecorate a method memoize its return value.

Best applied to no-arg methods: memoization is not sensitive to
argument values, and will always return the same value even when
called with different arguments.

Nc                 f    Xl         U=(       d    UR                  U l        UR                  U l        g r   rH   rK   s      r   r    memoized_instancemethod.__init__f   rN   r   c                 f   ^ ^ Tc  T $ UU 4S jnT R                   Ul         T R                  Ul        U$ )Nc                     >^ TR                   " T/U Q70 UD6mU4S jnTR                  Ul        TR                  Ul        UTR                  TR                  '   T$ )Nc                     > T$ r   r3   )akwrS   s     r   memo>memoized_instancemethod.__get__.<locals>.oneshot.<locals>.memor   s    r   )rI   r	   rJ   rP   )argsra   rb   rS   rQ   r   s      @r   oneshot0memoized_instancemethod.__get__.<locals>.oneshoto   sO    YYs0T0R0F !MMDM<<DL*.CLL'Mr   )r	   rJ   )r   rQ   rR   re   s   ``  r   rT   memoized_instancemethod.__get__k   s0    ;K		  ==,,r   rV   r   rW   r3   r   r   rY   rY   \   s    &
r   rY   c                       \ rS rSrSrS rSrg)SetLikeDict   z0a dictionary that has some setlike methods on itc                 >    [        S0 U D6nUR                  U5        U$ )zproduce a 'union' of this dict and another (at the key level).

values in the second dict take precedence over that of the firstr3   )ri   update)r   otherrA   s      r   unionSetLikeDict.union   s!     $	r   r3   N)r	   r/   r0   r1   rJ   rn   r2   r3   r   r   ri   ri      s
    :r   ri   c                   .    \ rS rSrSrSS jrS rS rSrg)	FastEncodingBuffer   zRa very rudimentary buffer that is faster than StringIO,
and supports unicode data.Nc                     [         R                  " 5       U l        Xl        SU l        X l        U R                  R                  U l        g )N )collectionsdequedataencodingdelimerrorsappendwrite)r   rx   rz   s      r   r   FastEncodingBuffer.__init__   s4    %%'	 
YY%%
r   c                 n    [         R                  " 5       U l        U R                  R                  U l        g r   )ru   rv   rw   r{   r|   r   s    r   truncateFastEncodingBuffer.truncate   s#    %%'	YY%%
r   c                     U R                   (       aI  U R                  R                  U R                  5      R	                  U R                   U R
                  5      $ U R                  R                  U R                  5      $ r   )rx   ry   joinrw   encoderz   r   s    r   getvalueFastEncodingBuffer.getvalue   sS    ==::??499-44t{{  ::??499--r   )rw   ry   rx   rz   r|   )Nstrict)	r	   r/   r0   r1   rJ   r   r   r   r2   r3   r   r   rq   rq      s    "&&.r   rq   c                   T    \ rS rSrSr " S S5      rSS jrS rS rS r	S	 r
S
 rSrg)LRUCache   a  A dictionary-like object that stores a limited number of items,
discarding lesser used items periodically.

this is a rewrite of LRUCache from Myghty to use a periodic timestamp-based
paradigm so that synchronization is not really needed.  the size management
is inexact.
c                        \ rS rSrS rS rSrg)LRUCache._Item   c                 P    Xl         X l        [        R                  " 5       U l        g r   )keyvaluetimeitdefault_timer	timestampr   r   r   s      r   r   LRUCache._Item.__init__   s    HJ#113DNr   c                 ,    [        U R                  5      $ r   )reprr   r   s    r   __repr__LRUCache._Item.__repr__   s    

##r   )r   r   r   N)r	   r/   r0   r1   r   r   r2   r3   r   r   _Itemr      s    	4
	$r   r   c                     Xl         X l        g r   capacity	threshold)r   r   r   s      r   r   LRUCache.__init__   s     "r   c                 x    [         R                  X5      n[        R                  " 5       Ul        UR
                  $ r   )dict__getitem__r   r   r   r   )r   r   items      r   r   LRUCache.__getitem__   s,    *--/zzr   c                 j    [         R                  U 5       Vs/ s H  oR                  PM     sn$ s  snf r   )r   valuesr   )r   is     r   r   LRUCache.values   s'    !%T!23!2A!2333s   0c                      X;   a  X   $ X U'   U$ r   r3   r   s      r   
setdefaultLRUCache.setdefault   s    ;9S	r   c                     [         R                  X5      nUc(  U R                  X5      n[         R                  XU5        OX#l        U R                  5         g r   )r   getr   __setitem__r   _manage_size)r   r   r   r   s       r   r   LRUCache.__setitem__   sD    xx"<::c)DT-Jr   c                    [        U 5      U R                  U R                  U R                  -  -   :  a  [        [        R                  U 5      [        R                  " S5      SS9nXR                  S   H  n XR                  	 M     [        U 5      U R                  U R                  U R                  -  -   :  a  M  g g ! [         a       ME  f = f)Nr   T)r   reverse)
lenr   r   sortedr   r   operator
attrgetterr   KeyError)r   bytimer   s      r   r   LRUCache._manage_size   s    $i$--$--$..*HHHD!''4F
 }}/XX 0 $i$--$--$..*HHH    s   8B??
CCr   N)g      ?)r	   r/   r0   r1   rJ   r   r   r   r   r   r   r   r2   r3   r   r   r   r      s/    $ $#
4r   r   z([ \t\f]* \# .* coding[=:][ \t]*([-\w.]+)c                    U R                  5       nU R                  S5         U R                  5       nUR                  [        R
                  5      nU(       a  U[        [        R
                  5      S n[        R                  UR                  SS5      5      nU(       dQ   [        UR                  SS5      5        U R                  5       n[        R                  UR                  SS5      5      nU(       a%  U(       a  [        S5      e U R                  U5        gU(       a"  UR                  S5      U R                  U5        $  U R                  U5        g! [        [        4 a     Nzf = f! U R                  U5        f = f)a  Deduce the encoding of a Python source file (binary mode) from magic
comment.

It does this in the same way as the `Python interpreter`__

.. __: http://docs.python.org/ref/encodings.html

The ``fp`` argument should be a seekable file object in binary mode.
r   Nasciiignorez\python refuses to compile code with both a UTF8 byte-order-mark and a magic encoding commentutf_8r   )tellseekreadline
startswithcodecsBOM_UTF8r   _PYTHON_MAGIC_COMMENT_rematchdecoder   ImportErrorSyntaxErrorr   )fpposline1has_bommline2s         r   parse_encodingr      s;    '')CGGAJ"""6??3#foo.01E$**5<<+JKell7H56 ,22LL(3 !D   	 771: 	 
1  - 
 0 	s7   A>E0 "E =AE0 E0 E-*E0 ,E--E0 0Fc                    ^  [        T R                  5       5      nUR                  5         SSR                  U 4S jU 5       5      -   S-   $ )zsrepr() a dictionary with the keys in order.

Used by the lexer unit test to compare parse trees based on strings.

{z, c              3   :   >#    U  H  o< S TU   < 3v   M     g7f)z: Nr3   ).0kds     r   	<genexpr>#sorted_dict_repr.<locals>.<genexpr>"  s     >Aq!A$/s   })r?   keyssortr   )r   r   s   ` r   sorted_dict_reprr     s<     >DIIK>>>>DDr   c                 .   [        U S5      (       a  gSU l        [        SSSU R                  5      n[        U5      U l        U R                  R
                   H3  nUR                  S:X  a  X l        M  UR                  S:X  d  M-  X l        M5     [        UR                  S   5      U l
        [        UR                  S	   5      U l        [        UR                  S
   5      U l        [        UR                  S   R                  S   5      U l        [        UR                  S   R                  S   R                  5      U l        [        UR                  S   R"                  5      U l        [        UR                  S   R"                  R&                  5      U l        [        UR                  S   R"                  R*                  R&                  5      U l        [        UR                  S   R"                  R.                  R&                  5      U l        [        UR                  S   R"                  R.                  R*                  R&                  5      U l        [        UR                  S   R"                  R&                  5      U l        [        UR                  S   R"                  R*                  R&                  5      U l        [        UR                  S   R"                  R*                  R*                  R&                  5      U l        [        UR                  S   R"                  R*                  R*                  R*                  R&                  5      U l        [        UR                  S   R"                  R&                  5      U l        [        UR                  S   R"                  R*                  R&                  5      U l        [        UR                  S   R"                  R*                  R*                  R&                  5      U l         [        UR                  S   R"                  R&                  5      U l!        [        UR                  S   R"                  RD                  S   R&                  5      U l#        [        UR                  S   R"                  R.                  R&                  5      U l$        [        UR                  S   R"                  R*                  R.                  R&                  5      U l%        [        UR                  S   R"                  R*                  R.                  RL                  R&                  5      U l'        [        UR                  S   R"                  R*                  R*                  R&                  5      U l(        [        UR                  S   R"                  R&                  5      U l!        [        UR                  S   R"                  RD                  S   R&                  5      U l#        [        UR                  S   R"                  RR                  S   5      U l*        [        UR                  S   R"                  RR                  S	   5      U l+        [        UR                  S   R"                  R*                  RR                  S   5      U l,        [        UR                  S   R"                  R*                  RR                  S	   5      U l-        [        UR                  S   R"                  RR                  S   5      U l.        [        UR                  S   R"                  RR                  S	   5      U l/        [        UR                  S   R"                  RR                  S
   5      U l0        [        UR                  S   R"                  RR                  S   5      U l1        [        UR                  S   R"                  RR                  S   5      U l2        [        UR                  S   R"                  RR                  S	   5      U l3        g)z\Attempt to restore the required classes to the _ast module if it
appears to be missing them
ASTNi   a  def foo(): pass
class Bar: pass
if False: pass
baz = 'mako'
1 + 2 - 3 * 4 / 5
6 // 7 % 8 << 9 >> 10
11 & 12 ^ 13 | 14
15 and 16 or 17
-baz + (not +18) - ~17
baz and 'foo' or 'bar'
(mako is baz == baz) is not baz != mako
mako > baz < mako >= baz <= mako
mako in baz not in makoz	<unknown>execr(   r   r            r5            	   
         )4hasattrPyCF_ONLY_ASTcompiletypeModule__mro__r	   r(   r   bodyFunctionDefClassDefIftargetsNamectxStorer   StropSubleftAddrightDivMultRShiftLShiftModFloorDivBitOrBitXorBitAndOrr   AndInvertNotoperandUAddUSubopsIsNotNotEqIsEqGtLtGtELtEInNotIn)_astr   rR   s      r   restore__astr  %  sc    tUD	 	#	A& q'DK{{""<<5 H\\U"H	 # AFF1IDODM166!9oDGQVVAY&&q)*DIaffQi''*../DJAFF1IOO$DHAFF1IOO&&'DHAFF1IOO((++,DHAFF1IOO)),,-DHQVVAY__**//223DIqvvay))*DKqvvay++../DKAFF1IOO((--001DH--2277::;DMaffQioo(()DJqvvay++../DKqvvay++00334DK166!9??%%&DGAFF1IOO**1-001DHqvvay,,//0DKAFF1IOO((..112DHQVVAY__))//77::;DIQVVAY__))..112DI166!9??%%&DGAFF1IOO**1-001DHaffRj&&**1-.DJaffRj&&**1-.DJ166":##((,,Q/0DG166":##((,,Q/0DG166":##''*+DG166":##''*+DGAFF2J$$((+,DHAFF2J$$((+,DH166":##''*+DGaffRj&&**1-.DJr   c                 n    [        X5       nUR                  5       sS S S 5        $ ! , (       d  f       g = fr   )openread)r7   moder   s      r   	read_filer  v  s!    	d	Rwwy 
		s   &
4c                     [        U S5      n [        U5      nUR                  5       nU(       a  UR                  U5      nUUR	                  5         $ ! UR	                  5         f = f)Nrb)r  r   r  r   close)r7   r   rx   rw   s       r   read_python_filer"  {  sO    	dD	B!"%wwy;;x(D


s   4A A%r   )r   )astr   r   ru   r   r6   rer   compatr   r   r   r<   rC   rE   rY   r   ri   rq   r   r   VERBOSEr   r   r   r  r  r"  r3   r   r   <module>r'     s        	 	  *   <     F
$ 
. .2;t ;~ ::/ 
.bEN/b
	r   