HEX
Server: Apache
System: Linux a16-asgard6.hospedagemuolhost.com.br 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: maoristu4c3dbd03 (1436)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/__pycache__/decorator.cpython-39.pyc
a

��Y^FC�@s�dZddlmZddlZddlZddlZddlZddlZddlZdZ	ej
dkrdddlmZdd�Zne�
d	d
�Zdd�Zd
d�Zz
ejZWney�dd�ZYn0zddlmZWney�dd�ZYn0e�d�ZGdd�de�Zd*dd�Zd+dd�ZzddlmZWn e�y0ddlmZYn0Gdd�de�Zeej�Zeej �Z!e!dk�rxej"�sxd d!�Zee_n,e!dk�r�ej"�r�ne!d"k�r�d#d!�Zee_ee�Z#d$d%�Z$d&d'�Z%d(d)�Z&dS),zT
Decorator module, see http://pypi.python.org/pypi/decorator
for the documentation.
�)�print_functionNz4.4.2)�)�getfullargspeccCs|jS�N)�__init__��cls�r	�-/usr/lib/python3.9/site-packages/decorator.py�get_init0sr�FullArgSpeczAargs varargs varkw defaults kwonlyargs kwonlydefaults annotationscCst�t�|�gdif�S)z?A quick and dirty replacement for getfullargspec for Python 2.XN)r�_make�inspectZ
getargspec��fr	r	r
r7srcCs|jjSr)r�__func__rr	r	r
r;scCsdS�NFr	rr	r	r
�iscoroutinefunctionBsr)�isgeneratorfunctioncCsdSrr	)�callerr	r	r
rHsrz\s*def\s*([_\w][_\w\d]*)\s*\(c@sZeZdZdZe��ZdZZZ	Z
ZZddd�Z
dd�Zdd	d
�Zeddd
��ZdS)�
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.
    r	NcCs�||_|�rZ|j|_|jdkr$d|_|j|_|j|_t�|��rZt	|�}t
|di�|_dD]}	t||	t
||	��qZt
|j�D]\}
}t|d|
|�q|t|j�}t|j�}
|jr�|�d|j�|
�d|j�n|jr�|�d�|jD]$}	|�d|	�|
�d|	|	f�q�|j�r6|�d	|j�|
�d	|j�d
�|�|_d
�|
�|_|j��|_|�rf||_|du�rv||_|�r�||_|�r�||_|�r�||_|�r�||_t|d��s�J�t|d��s�td
|��dS)N�<lambda>�_lambda_�__annotations__)�args�varargs�varkw�defaults�
kwonlyargs�kwonlydefaultszarg%d�*z%s=Nonez%s=%sz**�, �name�	signaturez%You are decorating a non function: %s)�shortsignature�__name__r"�__doc__�doc�
__module__�moduler�
isfunctionr�getattr�annotations�setattr�	enumerater�listr�appendrr�joinr#�__dict__�copy�dictr�hasattr�	TypeError)�self�funcr"r#rr'r)ZfuncdictZargspec�a�i�argZallargsZallshortargsr	r	r
r]sZ





zFunctionMaker.__init__cKs�|j|_t|dd�|_t|di�|_|j|_|jp4d|_t|dd�|_	zt
�d�}Wntyjd}Yn0|j
�dd�}t|d|�|_|j�|�dS)	z2Update the signature of func with the data in selfr'Nr4r,r�?r%r))r"r%r+r&r2r�__defaults__r�__kwdefaults__r�sys�	_getframe�AttributeError�	f_globals�getr(�update)r7r8�kw�frameZcallermoduler	r	r
rD�s
zFunctionMaker.updateFc
Ks|t|�}|pi}t�|�}|dur2td|��|�d�}t|gdd�|j�d�D��}|D]}	|	dvr`td|	|f��q`|�	d	�s�|d	7}d
t
|j�}
zt||
d�}t
||�Wn0ty�tdtjd
�t|tjd
��Yn0||}|r�||d<|j|fi|��|S)zBMake a new function from a given template and update the signatureNz not a valid function template
%s�cSsg|]}|�d��qS)z *)�strip��.0r;r	r	r
�
<listcomp>��z&FunctionMaker.make.<locals>.<listcomp>�,)�_func_�_call_z%s is overridden in
%s�
z<decorator-gen-%d>ZsinglezError in generated code:)�fileZ
__source__)�vars�DEF�search�SyntaxError�group�setr$�split�	NameError�endswith�next�_compile_count�compile�exec�	Exception�printr?�stderrrD)
r7Z	src_templ�evaldict�	addsource�attrs�src�mor"�names�n�filename�coder8r	r	r
�make�s6


�

zFunctionMaker.makeTcKs�t|t�r0|���dd�\}	}
|
dd�}d}nd}	d}|}|||	||||�}
d�dd�|��D��}|�d�}|r�t|�r�d	|�d
d�}nd|}|
j	|||fi|��S)
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.
        �(rGN���rPcss|]}d|VqdS)z    Nr	)rJ�liner	r	r
�	<genexpr>�rLz'FunctionMaker.create.<locals>.<genexpr>rOz#async def %(name)s(%(signature)s):
�returnzreturn awaitzdef %(name)s(%(signature)s):
)
�
isinstance�strrHrXr1�
splitlinesrCr�replacerk)r�obj�bodyrbrr'r)rcrdr"�restr#r8r7Zibodyrr	r	r
�create�s 	

�zFunctionMaker.create)NNNNNNN)NF)NNNT)r%r(�__qualname__r&�	itertools�countr\rrrrrrrrDrk�classmethodrxr	r	r	r
rPs�
4
"�rr	c
Cs�t||d�}d}t|�D]$\}}d|}|||<||d7}qdtjkrTdkrlnnt|�oht|�}nt|�}|r�tj|d|||d�}	ntj|d	|||d�}	t|d
�r�|j	|	_	|	S)z�
    decorate(func, caller) decorates a function using a caller.
    If the caller is a generator function, the resulting function
    will be a generator function.
    )rOrN�z_e%d_r!z3.5z3.6z?for res in _call_(_func_, %s%%(shortsignature)s):
    yield res��__wrapped__z,return _call_(_func_, %s%%(shortsignature)s)ry)
r4r.r?�versionrrrrxr5ry)
r8r�extrasrb�esr:Zextra�exZgeneratorcallerZfunr	r	r
�decorate�s6�����
r�c
Cs|durt||�Sd\}}t�|�r@|j��}d|j|jf}n~t�|�r�|jdkrZd}n|j}|j}|jj}t	|j
pxd�}d�|jj|||��}|r�|d7}|j
}n|j
j��}|jj}t|td	�}tjd
||fd||f|||j|d�}	|�rd
||	_
|	S)z=decorator(caller) converts a caller function into a decoratorN)r}r	zHdecorator(%s) converts functions/generators into factories of %s objectsrrr	r!rM)Z_callZ
_decorate_z%s(func, %s)zhif func is None: return lambda func:  _decorate_(func, _call, (%s))
return _decorate_(func, _call, (%s)))r'r)rr)r�rZisclassr%�lowerr*r&�__code__�co_argcount�lenr=r1�co_varnames�	__class__�__call__r4rrxr()
rZ_funcZdefaultargsrr"r'�nargsZndefsrb�decr	r	r
�	decorators@



�


�
�
r�)�_GeneratorContextManager)�GeneratorContextManagerc@seZdZdd�ZdS)�ContextManagercCstj|dt||d�|d�S)zContext manager decoratorz.with _self_: return _func_(%(shortsignature)s))Z_self_rNr~)rrxr4)r7r8r	r	r
r�0s�zContextManager.__call__N)r%r(ryr�r	r	r	r
r�/sr��cOst�|||i|���Sr�r�r�r7�gr9�kr	r	r
r:sr�cOst�||||�Srr�r�r	r	r
r@scCst|�Sr)�_contextmanager)r8r	r	r
�contextmanagerGsr�cCsPd}t|�D]0\}}t||�r&d}q>t||�r|||<d}q|rL|�|�dS)z_
    Append ``a`` to the list of the virtual ancestors, unless it is already
    included.
    TFN)r.�
issubclassr0)r9�
vancestors�add�j�var	r	r
r0Ns

r0csL�sJd��dd����tjdf�fdd�	����fdd�}d	�|_|S)
zr
    Factory of decorators turning a function into a generic function
    dispatching on the given arguments.
    zNo dispatch args passedz(%s,)r!r}cs0|t|�t���r,tdt��t|�|f��dS)z5Make sure one passes the expected number of argumentszExpected %d arguments, got %d%sN)r�r6)Z	argumentsZwrong�msg)�
dispatch_argsr	r
�checkhs�zdispatch_on.<locals>.checkcs�tt��j�}t��|ks&td���i����fdd����fdd����fdd�}��fdd	�}���fd
d�}tj�d�t|d
�|����|�d�
S)z4Decorator turning a function into a generic functionzUnknown dispatch arguments %scsn�|�dd�tt���D�}�D]<}t|||�D]*\}}}t||�r2||��vr2t||�q2q"dd�|D�S)zU
            Get a list of sets of virtual ancestors for the given types
            cSsg|]}g�qSr	r	)rJ�_r	r	r
rK}rLzIdispatch_on.<locals>.gen_func_dec.<locals>.vancestors.<locals>.<listcomp>cSsg|]}t|��qSr	)rW)rJ�rar	r	r
rK�rL)�ranger��zipr��mror0)�typesZras�types_�t�type_r�)r�r��typemapr	r
r�xsz5dispatch_on.<locals>.gen_func_dec.<locals>.vancestorscs��|�g}t|�|��D]p\}}t|�}|dkrDtd||f��n4|dkrp|\}td||fi���dd�}n|��}|�|dd��q|S)zG
            Get a list of virtual MROs, one for each type
            rGzAmbiguous dispatch for %s: %sr�Nrm)r�r��RuntimeError�typer�r0)r�Zlistsr�ZvasZn_vasr�r�)r�r�r	r
�	ancestors�s
�z4dispatch_on.<locals>.gen_func_dec.<locals>.ancestorscs������fdd�}|S)zU
            Decorator to register an implementation for the given types
            cs&�t|�jtjd|j�|��<|S)Nz in )rr�operator�ltr%r)r�r�r�r	r
r��sz@dispatch_on.<locals>.gen_func_dec.<locals>.register.<locals>.decr	)r�r�)r�r�)r�r
�register�sz3dispatch_on.<locals>.gen_func_dec.<locals>.registercs<�|�g}tj�|��D]}|�tdd�|D���q|S)zI
            An utility to introspect the dispatch algorithm
            css|]}|jVqdSr)r%)rJr9r	r	r
ro�rLzKdispatch_on.<locals>.gen_func_dec.<locals>.dispatch_info.<locals>.<genexpr>)rz�productr0�tuple)r�ZlstZanc)r�r�r	r
�
dispatch_info�s
z8dispatch_on.<locals>.gen_func_dec.<locals>.dispatch_infocs�tdd�|D��}z�|}Wnty0Yn0||i|��Stj�|��}t|�|D](}��|�}|durZ||i|��SqZ�|i|��S)Ncss|]}t|�VqdSr)r�rIr	r	r
ro�rLzGdispatch_on.<locals>.gen_func_dec.<locals>._dispatch.<locals>.<genexpr>)r��KeyErrorrzr�r[rC)r�rrEr�r�combinationsr�)r�r8r�r	r
�	_dispatch�s
z4dispatch_on.<locals>.gen_func_dec.<locals>._dispatchz#return _f_(%s, %%(shortsignature)s))Z_f_)r��defaultr�r�r�r�r)rWrrrYrrxr4)r8Zargsetr�r�r��r�r�Zdispatch_str)r�r8r�r�r
�gen_func_decns
�z!dispatch_on.<locals>.gen_func_dec�dispatch_on)r1r��ner%)r�r�r	r�r
r�`sW
r�)r	)N)'r&Z
__future__r�rer?rr�rz�collections�__version__�version_inforr�
namedtuplerrrAr�ImportErrorr]rS�objectrr�r��
contextlibr�r�r�r�initr�rZn_argsrr�r�r0r�r	r	r	r
�<module>s`

�


"
'