+
    ĜiB                     H   R 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	H
t
Ht Rt]P                  ! R4      t]P                  P                   t]P                  P$                  t ! R R]4      tR tRR	 ltR
 tRR lt ! R R]4      t]! ]4      tR tR tR tR# )zv
Decorator module, see
https://github.com/micheles/decorator/blob/master/docs/documentation.md
for the documentation.
N)_GeneratorContextManager)getfullargspeciscoroutinefunctionisgeneratorfunctionz5.2.1z\s*def\s*([_\w][_\w\d]*)\s*\(c                      a  ] tR t^4t o Rt]P                  ! 4       tR;t;t	;t
;t;ttR	R ltR tR
R lt]RR l4       tRtV tR# )FunctionMakerz
An object with the ability to create functions with a given signature.
It has attributes name, doc, module, signature, defaults, dict and
methods update and make.
Nc           	     .   W0n         V'       Ed~   VP                  V n        V P                  R 8X  d   RV n        VP                  V n        VP
                  V n        \        P                  ! V4      '       g"   \        V\        P                  4      '       Ed   \        V4      p\        VR/ 4      V n        R F  p	\        W	\        W4      4       K  	  \!        V P"                  4       F  w  r\        V RV
,          V4       K  	  \%        V P"                  4      p\%        V P"                  4      pV P&                  '       dF   VP)                  RV P&                  ,           4       VP)                  RV P&                  ,           4       M#V P*                  '       d   VP)                  R4       V P*                   F3  p	VP)                  RV	,          4       VP)                  V	: RV	: 24       K5  	  V P,                  '       dE   VP)                  RV P,                  ,           4       VP)                  RV P,                  ,           4       RP/                  V4      V n        RP/                  V4      V n         VP2                  P5                  4       V n        V'       d   W n        Ve   W0n        V'       d   W@n        V'       d   WPn        V'       d   W`n        V'       d   Wpn        \;        V R
4      '       g   Q h\;        V R4      '       g   \=        RV,          4      hR	# )z<lambda>_lambda___annotations__zarg%d*z%s=None=z**, Nname	signaturez%You are decorating a non function: %s)argsvarargsvarkwdefaults
kwonlyargskwonlydefaults)shortsignature__name__r   __doc__doc
__module__moduleinspect	isroutine
isinstance	functoolspartialr   getattrannotationssetattr	enumerater   listr   appendr   r   joinr   __dict__copydictr   hasattr	TypeError)selffuncr   r   r   r   r   funcdictargspecaiargallargsallshortargss   &&&&&&&&      R/Users/mibo/.openclaw/workspace/.venv-ak/lib/python3.14/site-packages/decorator.py__init__FunctionMaker.__init__A   s,   '4DIyyJ&&	||DH//DK  &&*T9;L;L*M*M(.#*41BB#G ,ADWW%89, (		2FAD'A+s3 3tyy/#DII<<<NN3#56 ''dll(:;___NN3'ANN9q=1 ''1a(89 ) :::NN4$**#45 ''tzz(9:!%7!3&*ii&=# MM..0	I &N$MH K ItV$$$$t[))CdJKK *    c                   V P                   Vn        \        V RR4      Vn        \        V R/ 4      Vn        V P
                  Vn        V P                  ;'       g    RVn        \        V RR4      Vn	         \        P                  ! ^4      pVP                  P                  RR4      p\        V RV4      Vn        VP                  P!                  V4       R#   \         d    Rp L>i ; i)z4
Update the signature of func with the data in self
r   Nr*   r"   r   ?r   )r   r   r!   r   r(   r   __defaults__r   __kwdefaults__r
   sys	_getframe	f_globalsgetAttributeErrorr   update)r-   r.   kwframecallermodules   &&,  r6   rC   FunctionMaker.updateu   s     		tUD1fb1 MM"1199T&t]DA	@MM!$E !??..z3?L!$,?R   	L	s   5C C&%C&c           	        V\        V 4      ,          pT;'       g    / p\        P                  V4      pVf   \        RV,          4      hVP	                  ^4      p\        V.V P                  P                  R4       Uu. uF  qP                  R4      NK  	  up,           4      p	V	 F  p
V
R9   g   K  \        V
: RV: 24      h	  VP                  R4      '       g
   VR,          pR\        V P                  4      ,          p \        W[R4      p\        W4       Y',          pT'       d   YTR
&   T P&                  ! T3/ TB  T# u upi   \         d9    \!        R\"        P$                  R	7       \!        T\"        P$                  R	7       h i ; i)zD
Make a new function from a given template and update the signature
z not a valid function template
%s,z *z is overridden in

z<decorator-gen-%d>singlezError in generated code:)file
__source__)_func__call_)varsDEFsearchSyntaxErrorgroupsetr   splitstrip	NameErrorendswithnext_compile_countcompileexec	Exceptionprintr>   stderrrC   )r-   	src_templevaldict	addsourceattrssrcmor   r3   namesnfilenamecoder.   s   &&&&,         r6   makeFunctionMaker.make   s_    $t*$>>rZZ_:ACGHHxx{TF"1177<>< 36iio<> > ?A((Q DEE  ||D!!4KC
 ($t/B/B*CC	3(3D 
 ~"%,D"E"1>   	,3::>#CJJ'	s   ?E
E	 	AFc                   \        V\        4      '       d+   VP                  4       P                  R^4      w  rV
RR
 pRpMRp	RpTpV ! WWWV4      pRP	                  R VP                  4        4       4      pVP                  R4      pV'       d,   \        V4      '       d   RV,           P                  RR4      pM	R	V,           pVP                  ! W#V3/ VB # )z
Create a function from the strings name, signature and body.
evaldict is the evaluation dictionary. If addsource is true an
attribute __source__ is added to the result. The attributes attrs
are added, if any.
(NrJ   c              3   4   "   T F  pR V,           x  K  	  R# 5i)z    N ).0lines   & r6   	<genexpr>'FunctionMaker.create.<locals>.<genexpr>   s     F4ED&4--4Es   rO   z#async def %(name)s(%(signature)s):
returnzreturn awaitzdef %(name)s(%(signature)s):
)
r   strrW   rV   r'   
splitlinesrA   r   replacerk   )clsobjbodyrb   r   r   r   rc   rd   r   restr   r.   r-   ibodycallers   &&&&&&&&,       r6   createFunctionMaker.create   s     c3**32JDSb	IDDID4yC@		FDOO4EFFh')&11:UBKK.*D 4e;Dyy<e<<r9   )r"   r   r*   r   r   r   r   r   rp   )NNNNNNNNF)NNNT)r   r   __qualname____firstlineno__r   	itertoolscountr[   r   r   r   r   r   r   r7   rC   rk   classmethodr   __static_attributes____classdictcell____classdict__s   @r6   r   r   4   s`      __&N GIHDH7HUHXH
^2Lh!&"H = =r9   r   c                v    VP                   ! V / VB pVP                  4        VP                  VP                  3# )z9
Fix args and kwargs to be consistent with the signature
)bindapply_defaultsr   kwargs)r   r   sigbas   &&& r6   fixr      s6     
4	"6	"B77BIIr9   c                  a aaaa \         P                  ! S 4      o\        S \        P                  4      '       d"   \        P
                  ! S S P                  4      o \        S4      '       d   VVV VV3R lpM&\        S4      '       d   VVV VV3R lpM
VVV VV3R lpS P                  Vn	        S P                  Vn
        S Vn        SVn        S P                  Vn         S P                  Vn         S P                   Vn         S P"                  Vn         S P$                  Vn         S P                  Vn	         VP&                  P)                  S P&                  4       V#   \         d     L}i ; i  \         d     L|i ; i  \         d     L{i ; i  \         d     Lzi ; i  \         d    S P                  R8H    Li ; i  \         d     T# i ; i)aN  
Decorates a function/generator/coroutine using a caller.
If kwsyntax is True calling the decorated functions with keyword
syntax will pass the named arguments inside the ``kw`` dictionary,
even if such argument are positional, similarly to what functools.wraps
does. By default kwsyntax is False and the the arguments are untouched.
c                  r   <"   S'       g   \        WS4      w  rS! S.SV ,           O5/ VB G R j  xL
 #  L5iNr   r   rD   r   extrasr.   kwsyntaxr   s   *,r6   fundecorate.<locals>.fun   s6     t-=="====s   -757c               ?   x   <"   S'       g   \        WS4      w  rS! S.SV ,           O5/ VB  F  pVx  K	  	  R # 5ir   r   )r   rD   resr   r   r.   r   r   s   *, r6   r   r      s9     t-d;ftm;;	 <s   7:c                  V   < S'       g   \        WS4      w  rS! S.SV ,           O5/ VB # r   r   r   s   *,r6   r   r      s-    t-$7&4-7B77r9   noname)r   r   r   r   r    update_wrapperr.   r   r   r   r   __wrapped____signature__r   r<   rB   r=   r
   r   r(   rC   )r.   r   r   r   r   r   s   ffff @r6   decorater      s    

D
!C$	))**''dii86""	> 	> 
V	$	$	 		8 	8
 ==CL,,CKCOC((C,,!00"22"}}DMM* J-          "!"  Jsl   !E" 3E3 F F )F& ;%G "E0/E03F FFFF#"F#&GGGGc                   a  V 3R lpV# )z
A version of "decorator" implemented via "exec" and not via the
Signature object. Use this if you are want to preserve the `.__code__`
object properties (https://github.com/micheles/decorator/issues/129).
c           	      `   < \         P                  V R \        SV R7      W P                  R7      # )z)return _call_(_func_, %(shortsignature)s))rO   rN   )r   r   )r   r   r*   r   )r.   r   s   &r6   decdecoratorx.<locals>.dec  s4    ##7t,+<+<	 $ > 	>r9   rp   )r   r   s   f r6   
decoratorxr     s    > Jr9   c                  a aa Ve   \        VS RS4      # \        P                  ! S 4      pVP                  P	                  4        Uu. uF  qDP
                  \        J g   K  VNK  	  upoRV VV3R llpVP                  SR7      Vn        S P                  Vn	        S P                  Vn
        S Vn        S P                  Vn        \        S RR4      Vn        VP                  P!                  S P                  4       V# u upi )z?
decorator(caller) converts a caller function into a decorator
Nc                    <aa \        V4      ^,           pT\        ;QJ d    . V3R lSVR  4       F  NK  	  5M! V3R lSVR  4       4      ,           oV f	   VVV3R l# \        V SSS4      # )   c              3      <"   T FA  pVP                   \        Jg   K  SP                  VP                  VP                   4      x  KC  	  R # 5ir   )defaultEMPTYrA   r   )rq   prD   s   & r6   rs   )decorator.<locals>.dec.<locals>.<genexpr>*  s<      9'6!!"%!7 8bffQVVQYY77'6s
   A.ANc                     < \        V SSS4      # r   r   )r.   r   r   r   s   &r6   <lambda>(decorator.<locals>.dec.<locals>.<lambda>.  s    vvx Hr9   )lentupler   )r.   r   rD   nar   r   
dec_paramsr   s   &*l @r6   r   decorator.<locals>.dec(  sk    Y] 9'1"#9 9'1"#9 9 9 <HHD&&(;;r9   )
parametersr=   rp   r   )r   r   r   r   valueskindPOSry   r   r   r   r   r   r!   r=   r(   rC   )r   _funcr   r   r   r   r   s   f&f   @r6   	decoratorr     s     vr844


F
#C ^^224F4#!!4FJ< < z:C??CL..CKCO**C )94@CLL(J% Gs   C?"C?c                   ,   a  ] tR tRt o R tR tRtV tR# )ContextManageri>  c                4    \         P                  ! WW#4       R # r   )r   r7   )r-   gr1   ks   &&*,r6   r7   ContextManager.__init__?  s     ))$18r9   c                &   a  V 3R  lp\        W4      # )c                    < SP                   ! SP                  .SP                  O5/ SP                  B ;_uu_ 4        V ! V/ VB uuR R R 4       #   + '       g   i     R # ; ir   )	__class__r.   r   kwds)fr1   r   r-   s   &*,r6   r   'ContextManager.__call__.<locals>.callerC  sC    		CDIICCC!zqz DCCCs   AA"	r   )r-   r.   r   s   f& r6   __call__ContextManager.__call__B  s    	" %%r9   rp   N)r   r   r   r   r7   r   r   r   r   s   @r6   r   r   >  s     9& &r9   r   c                     \        V 4      # r   )_contextmanager)r.   s   &r6   contextmanagerr   L  s    4  r9   c                    Rp\        V4       F3  w  r4\        W@4      '       d   Rp M\        W4      '       g   K-  WV&   RpK5  	  V'       d   VP                  V 4       R# R# )zS
Append ``a`` to the list of the virtual ancestors, unless it is already
included.
TFN)r$   
issubclassr&   )r1   
vancestorsaddjvas   &&   r6   r&   r&   S  s\    
 C:&bCaqMC ' ! r9   c                    a aa S '       g   Q R4       hRRP                  S 4      ,          o\        P                  R3V 3R lloVV V3R lpRS,           Vn        V# )zf
Factory of decorators turning a function into a generic function
dispatching on the given arguments.
zNo dispatch args passedz(%s,)r    c                   < V! \        V 4      \        S4      4      '       d(   \        R\        S4      \        V 4      V3,          4      hR# )z5Make sure one passes the expected number of argumentszExpected %d arguments, got %d%sN)r   r,   )	argumentswrongmsgdispatch_argss   &&&r6   checkdispatch_on.<locals>.checkm  sI    Y]!344= /YEF G G 5r9   c                :  <a aaa \        \        S 4      P                  4      p\        S	4      V8:  g   \        RS
,          4      h/ oVV	V3R loVV3R loVV3R lpVV3R lpVV V3R lp\        P                  S RS
,          \        VR7      VS SSSVS R	7
      # )
z4Decorator turning a function into a generic functionzUnknown dispatch arguments %sc                 J  < S! V 4       \        \        S4      4       Uu. uF  p. NK  	  ppS	 FM  p\        WV4       F:  w  rEp\        WE4      '       g   K  WTP	                  4       9  g   K/  \        WV4       K<  	  KO  	  V Uu. uF  p\        V4      NK  	  up# u upi u upi )z=
Get a list of sets of virtual ancestors for the given types
)ranger   zipr   mror&   rU   )
types_rastypes_ttype_rar   r   typemaps
   *      r6   r   5dispatch_on.<locals>.gen_func_dec.<locals>.vancestors}  s     %L$S%7898!28C9!$'s$;LAb!!++UUW0Du) %< " '**cCGc** :
 +s   BB c                 >  < S! V 4       . p\        V S! V !  4       F}  w  r#\        V4      pV^8  d   \        RV: RV: 24      hV^8X  d)   Vw  p\        RW%3/ 4      P	                  4       R,          pMVP	                  4       pVP                  VRR 4       K  	  V# )z/
Get a list of virtual MROs, one for each type
zAmbiguous dispatch for z: r   :r   NNNrv   )r   r   RuntimeErrortyper   r&   )	r   listsr   vasn_vasr   r   r   r   s	   *      r6   	ancestors4dispatch_on.<locals>.gen_func_dec.<locals>.ancestors  s     %LEeZ%78C19&;<cBD DaZCBsQGR0446r:C%%'CS"X& 9 Lr9   c                 *   <a  S! S 4       VVV 3R lpV# )z=
Decorator to register an implementation for the given types
c                    < S! \        V 4      P                  \        P                  R V P                  ,           4       V SS&   V # )z in )r   r   operatorltr   )r   r   r   r   s   &r6   r   @dispatch_on.<locals>.gen_func_dec.<locals>.register.<locals>.dec  s5    nQ',,hkk6AJJ;NO!"r9   rp   )r   r   r   r   s   j r6   register3dispatch_on.<locals>.gen_func_dec.<locals>.register  s     %L Jr9   c                    < S! V 4       . p\         P                  ! S! V !  !   F>  pTP                  \        ;QJ d    . R V 4       F  NK  	  5M! R V 4       4      4       K@  	  V# )z1
An utility to introspect the dispatch algorithm
c              3   8   "   T F  qP                   x  K  	  R # 5ir   )r   )rq   r1   s   & r6   rs   Kdispatch_on.<locals>.gen_func_dec.<locals>.dispatch_info.<locals>.<genexpr>  s      :TT   )r   productr&   r   )r   lstancsr   r   s   *  r6   dispatch_info8dispatch_on.<locals>.gen_func_dec.<locals>.dispatch_info  sU     %LC!))9e+<=

55 :T :55 :T ::; >Jr9   c                 H  < \         ;QJ d    . R  V  4       F  NK  	  5M! R  V  4       4      p S	V,          pV! V/ VB #   \         d     Mi ; i\        P                  ! S! T!  !  p\	        T4       T F"  pS	P                  T4      pTf   K  T! T/ TB u # 	  S! T/ TB # )c              3   8   "   T F  p\        V4      x  K  	  R # 5ir   )r   )rq   r3   s   & r6   rs   Gdispatch_on.<locals>.gen_func_dec.<locals>._dispatch.<locals>.<genexpr>  s     =}$s))}r   )r   KeyErrorr   r  rZ   rA   )
r   r   rD   r   r   combinationsr   r   r.   r   s
   &*,    r6   	_dispatch4dispatch_on.<locals>.gen_func_dec.<locals>._dispatch  s    E=}=EE=}==E&EN $~"~%   %,,i.?@L&KK'=d>b>) ' $$$s   	A   AAz#return _f_(%s, %%(shortsignature)s))_f_)r   r   r   r   r   r  r   )rU   r   r   rX   r   r   r*   )r.   argsetr   r  r  r   r   r   r   r   dispatch_strs   f    @@@r6   gen_func_dec!dispatch_on.<locals>.gen_func_decs  s     ^D)../=!V+;lJKK
	+	&
			%$ ##7,FY(D
i'T	 $ ; 	;r9   dispatch_on)r'   r   ner   )r   r  r   r  s   j @@r6   r  r  e  sQ    
 333=TYY}55L'{{ GU;n *L8Lr9   )rp   Fr   )r   rer>   r   r   r   r   
contextlibr   r   r   r   __version__r\   rQ   	ParameterPOSITIONAL_OR_KEYWORDr   emptyr   objectr   r   r   r   r   r   r   r   r&   r  rp   r9   r6   <module>r     s   <
 
 
     / L Ljj12--Q=F Q=h:zB&- & N+!$fr9   