+
    ÖÇÜhS   ã                   ó  € R t Rt. ROt^ RIt]P                  R,          t]P                   U u. uF  q '       g   K  R]! V 4      9  g   K  V NK  	  up ]n        ^ RIt]]n        R tR t	RR lt
R tR	 tR
 tR tR t]R 4       tR# u up i )a  
Decorator module by Michele Simionato <michelesimionato@libero.it>
Copyright Michele Simionato, distributed under the terms of the BSD License (see below).
http://www.phyast.pitt.edu/~micheles/python/documentation.html

Included in NLTK for its support of a nice memoization decorator.
zrestructuredtext enN:NNNÚnltkc                ó"  € \        V 4      ^R P                  R4      p\        V4       FS  w  r#VP                  R4      ^ 8”  d'   V^ VP	                  R4       P                  4       W&   KA  VP                  4       W&   KU  	  RP                  V4      # )zÇ
For retrocompatibility reasons, we don't use a standard Signature.
Instead, we use the string generated by this method.
Basically, from a Signature we create a string and remove the default values.
Ú,Ú=z, éÿÿÿÿ)ÚstrÚsplitÚ	enumerateÚcountÚindexÚstripÚjoin)Ú	signatureÚlistsignatureÚcounterÚparams   &   Ú1/usr/lib/python3/dist-packages/nltk/decorators.pyÚ__legacysignaturer      s�   € ô ˜	“N 1 RÐ(×.Ñ.¨sÓ3€MÜ# MÖ2‰ˆØ�;‰;�sÓ˜aÔØ%*¨1¨u¯{©{¸3Ó/?Ð%@×%FÑ%FÓ%HˆMÓ"à%*§[¡[£]ˆMÓ"ñ	 3ð
 �9‰9�]Ó#Ð#ó    c                óŠ  € \         P                  ! V 4      '       g   \         P                  ! V 4      '       g   Q h\         P                  ! V 4      pVR,          w  r#p\	        V4      pV'       d   VP                  V4       V'       d   VP                  V4       \         P                  ! V 4      p\        V4      p\        V R4      '       d   V P                  pV P                  p	MV P                  pV P                  p	\        V P                  VVVV P                  V P                   V P"                  V P$                  V	VR7
      # )a‘  
Returns an info dictionary containing:
- name (the name of the function : str)
- argnames (the names of the arguments : list)
- defaults (the values of the default arguments : tuple)
- signature (the signature : str)
- fullsignature (the full signature : Signature)
- doc (the docstring : str)
- module (the module name : str)
- dict (the function __dict__ : str)

>>> def f(self, x=1, y=2, *args, **kw): pass

>>> info = getinfo(f)

>>> info["name"]
'f'
>>> info["argnames"]
['self', 'x', 'y', 'args', 'kw']

>>> info["defaults"]
(1, 2)

>>> info["signature"]
'self, x, y, *args, **kw'

>>> info["fullsignature"]
<Signature (self, x=1, y=2, *args, **kw)>
:Né   NÚ__closure__)
ÚnameÚargnamesr   ÚfullsignatureÚdefaultsÚdocÚmoduleÚdictÚglobalsÚclosure)ÚinspectÚismethodÚ
isfunctionÚgetfullargspecÚlistÚappendr   r   Úhasattrr   Ú__globals__Úfunc_closureÚfunc_globalsr   Ú__name__Ú__defaults__Ú__doc__Ú
__module__Ú__dict__)
ÚfuncÚargspecÚregargsÚvarargsÚ	varkwargsr   r   r   Ú_closureÚ_globalss
   &         r   Úgetinfor7   ,   s  € ô< ×Ò˜D×!Ò!¤W×%7Ò%7¸×%=Ò%=Ð=Ð=Ü×$Ò$ TÓ*€GØ")¨"¥+Ñ€G�iÜ�G‹}€HßØ�‰˜Ô ßØ�‰˜	Ô"Ü×%Ò% dÓ+€Mä! -Ó0€Iô ˆt�]×#Ò#Ø×#Ñ#ˆØ×#Ñ#‰à×$Ñ$ˆØ×$Ñ$ˆäØ�]‰]ØØØ#Ø×"Ñ"Ø�L‰LØ�‰Ø�]‰]ØØôð r   c                óð   € T;'       g    \        V4      pVR,          V n        VR,          V n        VR,          V n        V P                  P                  VR,          4       VR,          V n        Wn        V # )z akin to functools.update_wrapperr   r   r   r   r   )r7   r+   r-   r.   r/   Úupdater,   Úundecorated)ÚwrapperÚmodelÚinfodicts   &&&r   Úupdate_wrapperr>   l   si   € à×)Ð)œ7 5›>€HØ Õ'€GÔØ˜u•o€G„OØ! (Õ+€GÔØ×Ñ×Ñ˜H VÕ,Ô-Ø# JÕ/€GÔØÔØ€Nr   c                óÊ   € \        V\        4      '       d   TpM\        V4      pRVR,          9   d   Q R4       hRV,          p\        V\        V R7      4      p\	        WAV4      # )a)  
An improvement over functools.update_wrapper. The wrapper is a generic
callable object. It works by generating a copy of the wrapper with the
right signature and by updating the copy, not the original.
Moreovoer, 'model' can be a dictionary with keys 'name', 'doc', 'module',
'dict', 'defaults'.
Ú	_wrapper_r   z("_wrapper_" is a reserved argument name!z.lambda %(signature)s: _wrapper_(%(signature)s))r@   )Ú
isinstancer   r7   Úevalr>   )r;   r<   r=   ÚsrcÚfuncopys   &&   r   Únew_wrapperrE   x   sd   € ô �%œ×ÒØ‰ä˜5“>ˆà˜8 JÕ/Ô/ð2à1ó2Ø/à
:¸XÕ
E€CÜ�3œ wÔ/Ó0€GÜ˜'¨(Ó3Ð3r   c                 ó(   a a€ \        VV 3R  lS4      # )c                  ó0   <€ SP                   ! S.V O5/ VB # ©N)Úcall)ÚaÚkr0   Úselfs   *,€€r   Ú<lambda>Ú__call__.<locals>.<lambda>Ž   s   ø€  t§y¢y°Ð'?¸Ò'?¸QÒ'?r   )rE   )rL   r0   s   ffr   Ú__call__rO   �   s   ù€ ÜÕ?ÀÓFÐFr   c                óŒ   € \        \        V 4      4      pRV9   d   \        R4      hRV9  d   \        R4      h\        V n        V # )zÙ
Take a class with a ``.caller`` method and return a callable decorator
object. It works by adding a suitable __call__ method to the class;
it raises a TypeError if the class already has a nontrivial __call__
method.
rO   z=You cannot decorate a class with a nontrivial __call__ methodrI   z2You cannot decorate a class without a .call method)ÚsetÚdirÚ	TypeErrorrO   )ÚclsÚattrss   & r   Údecorator_factoryrV   ‘   sK   € ô ”�C“‹M€EØ�UÔÜØNó
ð 	
ð �UÔÜÐOÓPÐPÜ€C„LØ€Jr   c                óv   a € \         P                  ! S 4      '       d   \        S 4      # V 3R lp\        VS 4      # )aš  
General purpose decorator factory: takes a caller function as
input and returns a decorator with the same attributes.
A caller function is any function like this::

 def caller(func, *args, **kw):
     # do something
     return func(*args, **kw)

Here is an example of usage:

>>> @decorator
... def chatty(f, *args, **kw):
...     print("Calling %r" % f.__name__)
...     return f(*args, **kw)

>>> chatty.__name__
'chatty'

>>> @chatty
... def f(): pass
...
>>> f()
Calling 'f'

decorator can also take in input a class with a .caller method; in this
case it converts the class into a factory of callable decorator objects.
See the documentation for an example.
c                 ó®   <€ \        V 4      pVR ,          pRV9   g   RV9   d   Q R4       hRV,          p\        V\        V SR7      4      p\        W@V4      # )r   Ú_call_Ú_func_z2You cannot use _call_ or _func_ as argument names!z3lambda %(signature)s: _call_(_func_, %(signature)s))rZ   rY   )r7   rB   r   r>   )r0   r=   r   rC   Údec_funcÚcallers   &    €r   Ú
_decoratorÚdecorator.<locals>._decoratorÄ   sf   ø€ Ü˜4“=ˆØ˜JÕ'ˆà˜Ô  H°Ô$8ð	@à?ó	@ð 
ð DÀhÕNˆä˜œT¨°fÔ=Ó>ˆÜ˜h¨hÓ7Ð7r   )r!   ÚisclassrV   r>   )r\   r]   s   f r   Ú	decoratorr`   £   s3   ø€ ô< ‡‚�v×ÒÜ  Ó(Ð(õ	8ô ˜* fÓ-Ð-r   c                óf   €  \        W4      #   \         d    T! 4       p\        YT4       Tu # i ; i)z'Similar to .setdefault in dictionaries.)ÚgetattrÚAttributeErrorÚsetattr)Úobjr   Údefault_thunkÚdefaults   &&& r   Úgetattr_rh   Ò   s7   € ðÜ�sÓ!Ð!øÜô Ù“/ˆÜ�˜7Ô#ØŠðús   ‚
 � 0¯0c                 óX   € \        V R \        4      pW9   d	   W!,          # V ! V!  pW2V&   V# )Úmemoize_dic)rh   r   )r0   ÚargsÚdicÚresults   &*  r   Úmemoizern   Ü   s2   € ä
�4˜¬Ó
-€Cà„{Ø�yÐÙ�4‰[€FØˆ�IØ€Mr   )r`   rE   r7   rH   )r-   Ú__docformat__Ú__all__ÚsysÚpathÚOLD_SYS_PATHr   r!   r   r7   r>   rE   rO   rV   r`   rh   rn   )Úps   0r   Ú<module>ru      s¤   ðñð &€ò 2€ã 
ð �x‰x˜�{€Ø—x’xÓ>‘x�!£1ŒA¨±s¸1³vÑ)=�AˆA‘xÑ>€„Û à€„ò$ò=ô@	ò4ò*Gòò$,.ò^ð ñó òùòM ?s   ®	B¼
BÁB