Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/alembic/util/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/alembic/util/__pycache__/langhelpers.cpython-311.pyc

�

�܋f�!���UddlmZddlZddlmZddlZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lmZdd
lm
Z
ddlmZddlmZdd
lmZddlmZddlZddlZddlmZddlmZddlmZddlmZddlmZddlmZe��Zded<ed��ZGd�de��Z Gd�de ���Z!d�Z"d4d!�Z#e
d5d&���Z$e
d6d7d)���Z$e
d6d8d+���Z$d6d,�Z$d9d/�Z%Gd0�d1��Z&d:d3�Z'dS);�)�annotationsN)�Iterable)�Any)�Callable)�Dict)�List)�Mapping)�Optional)�overload)�Sequence)�Tuple)�TypeVar)�Union)�asbool)�
immutabledict)�memoized_property)�to_list)�unique_list�)�inspect_getfullargspeczMapping[Any, Any]�
EMPTY_DICT�_Tc� ��eZdZd�fd�Z�xZS)	�_ModuleClsMeta�key�str�valuer�return�Nonec�v��t���||��|�|��dS�N)�super�__setattr__�_update_module_proxies)�clsrr�	__class__s   ��O/opt/cloudlinux/venv/lib64/python3.11/site-packages/alembic/util/langhelpers.pyr#z_ModuleClsMeta.__setattr__"s7���
�����C��'�'�'��"�"�3�'�'�'�'�'�)rrrrrr)�__name__�
__module__�__qualname__r#�
__classcell__)r&s@r'rr!s=�������(�(�(�(�(�(�(�(�(�(r(rc��eZdZUdZejd���Zded<edd	���Z	dd
�Z
dd�Zed���Zed
���Z
ed���Zed���ZdS)�ModuleClsProxyz�Create module level proxy functions for the
    methods on a given class.

    The functions will have a compatible signature
    as the methods.

    c�"�t��gfSr!)�set�r(r'�<lambda>zModuleClsProxy.<lambda>1s�������r(zDict[type, Tuple[set, list]]�_setups�namerrrc�f�|j|\}}|D]\}}|�||||���dSr!)r3�_add_proxied_attribute)r%r4�
attr_names�modules�globals_�locals_s      r'r$z%ModuleClsProxy._update_module_proxies4sR��!�k�#�.��
�G�!(�	L�	L��H�g��&�&�t�X�w�
�K�K�K�K�	L�	Lr(c�z�|j|j\}}|D]"\}}||d<|D]}t||��||<��#dS�N�_proxy)r3r&�getattr��selfr7r8r9r:�	attr_names      r'�_install_proxyzModuleClsProxy._install_proxy:sh��"�l�4�>�:��
�G�!(�	?�	?��H�g�!%�H�X��'�
?�
?�	�&-�d�I�&>�&>���#�#�
?�	?�	?r(c�Z�|j|j\}}|D]\}}d|d<|D]}||=��dSr<)r3r&r?s      r'�
_remove_proxyzModuleClsProxy._remove_proxyAs\��"�l�4�>�:��
�G�!(�	(�	(��H�g�!%�H�X��'�
(�
(�	��Y�'�'�
(�	(�	(r(c��|j|\}}|�||f��|�|||��dSr!)r3�append�_setup_proxy)r%r9r:r7r8s     r'�create_module_class_proxyz(ModuleClsProxy.create_module_class_proxyHsH��!�k�#�.��
�G�����'�*�+�+�+�����7�J�7�7�7�7�7r(c�Z�t|��D]}|�||||���dSr!)�dirr6)r%r9r:r7�methnames     r'rGzModuleClsProxy._setup_proxyNsB���C���	P�	P�H��&�&�x��7�J�O�O�O�O�	P�	Pr(c���|�d��sRt||��}t|��r|�|||��||<dS|�|��dSdS)N�_)�
startswithr>�callable�_create_method_proxy�add)r%rKr9r:r7�meths      r'r6z%ModuleClsProxy._add_proxied_attributeSs����"�"�3�'�'�	)��3��)�)�D���~�~�
)�$'�$<�$<��h��%�%���!�!�!����x�(�(�(�(�(�	)�	)r(c	����t�|��}�fd�}||d<t|dg��}|rot|��}|dr-|dddkr|d�d��dx}}	d|j�dt	|���d|�d	�}
d
�}||d<nd}d}	d}
tjd
||
||	|jd�z��}i}
t|||
��|
|S)Nc�<��td|�d�j�d���|�)NzCan't invoke function 'zE', as the proxy object has not yet been established for the Alembic 'z2' class.  Try placing this code inside a callable.)�	NameErrorr))r4�from_r%s  �r'�_name_errorz8ModuleClsProxy._create_method_proxy.<locals>._name_errorbs2����)�
�4�4�����	'����

r(rW�_legacy_translationsrr@z*args, **kwzargs, kw = _translate(z, z, args, kw)c
��i}g}|D]?\}}||vr6tjd|�d|�d|�d���|�|��||<�@|�|��t	|��}|dr%|ddt|d���}	n|d}	|	D]P}
|
|vrJ	|�|�d�����0#t$rtd|
z���wxYw�Q|�	|��||fS)Nz	Argument z is now named z for method z().�rz(missing required positional argument: %s)
�warnings�warn�pop�update�list�lenrF�
IndexError�	TypeError�extend)�fn_name�spec�translations�args�kw�	return_kw�return_args�oldname�newname�pos_only�args           r'�	translatez6ModuleClsProxy._create_method_proxy.<locals>.translatezsa���	� ��(4�=�=�$�G�W��"�}�}� �
�
�29�'�'�7�7�7�G�G�G�M����.0�V�V�G�_�_�	�'�*��� � ��$�$�$��D�z�z����7�'�#�A�w��#�d�1�g�,�,���7�H�H�#�A�w�H�#���C��)�+�+��'�.�.�t�x�x��{�{�;�;�;�;��)����"+� J�"%�!&�#�#������,��"�"�4�(�(�(�"�I�-�-s�)(C�C/�
_translate�a        def %(name)s(%(args)s):
            %(doc)r
            %(translate)s
            try:
                p = _proxy
            except NameError as ne:
                _name_error('%(name)s', ne)
            return _proxy.%(name)s(%(apply_kw)s)
            e
        )r4rorg�apply_kw�doc)	r>rr]r)�tuple�textwrap�dedent�__doc__�exec)r%r4r9r:�fnrWrfre�
outer_args�
inner_args�
translate_strro�	func_text�lcls`             r'rPz#ModuleClsProxy._create_method_proxy^sG���
�S�$�
�
��	�	�	�	�	�#.�����r�#9�2�>�>���/	�)�"�-�-�D��A�w�
�4��7�1�:��/�/��Q����A����&3�3�J��������d���������M�
.�
.�
.�>&/�H�\�"�"�&�J�&�J��M��O�

��*�"�&��z���
�
�
�	�(���Y��#�&�&�&��4�y�r(N)r4rrr)rr)r)r*r+rw�collections�defaultdictr3�__annotations__�classmethodr$rBrDrHrGr6rPr1r(r'r.r.'s���������-D�K�,C���-�-�G������L�L�L��[�L�
?�?�?�?�(�(�(�(��8�8��[�8�
�P�P��[�P��)�)��[�)��W�W��[�W�W�Wr(r.)�	metaclassc����fd�}|S)Nc����|_|Sr!)rX)ryrfs �r'�decoratez$_with_legacy_names.<locals>.decorate�s���".����	r(r1)rfr�s` r'�_with_legacy_namesr��s#���������Or(rrc�B�tj��jdd�S)Ni�)�uuid�uuid4�hexr1r(r'�rev_idr��s���:�<�<��C�D�D�!�!r(�xr�defaultrtc��dSr!r1�r�r�s  r'�to_tupler������Cr(r�Optional[_T]c��dSr!r1r�s  r'r�r��r�r(�Optional[tuple]c��dSr!r1r�s  r'r�r��r�r(c��|�|St|t��r|fSt|t��rt|��S|fSr!)�
isinstancerrrtr�s  r'r�r��sI���y���	�A�s�	�	���t��	�A�x�	 �	 ���Q�x�x���t�r(�tup�Tuple[str, ...]c�:�tt|����Sr!)rtr)r�s r'�dedupe_tupler��s����S�!�!�"�"�"r(c�>�eZdZddd�Z	ddd
�Zddd�Zdd�Zdd�ZdS)�
DispatcherF�uselist�boolrrc�"�i|_||_dSr!)�	_registryr�)r@r�s  r'�__init__zDispatcher.__init__�s��+-�������r(r��targetr�	qualifierrrc��������fd�}|S)Nc����jr1�j���fg���|��n��f�jvsJ�|�j��f<|Sr!)r�r��
setdefaultrF)ryr�r@r�s ���r'r�z)Dispatcher.dispatch_for.<locals>.decorate�si����|�
9���)�)�6�9�*=�r�B�B�I�I�"�M�M�M�M��	�*�$�.�@�@�@�@�68����	�2�3��Ir(r1)r@r�r�r�s``` r'�dispatch_forzDispatcher.dispatch_for�s/�����	�	�	�	�	�	�	��r(�objc��t|t��r|g}n1t|t��r|j}nt|��j}|D]f}|dkr/||f|jvr$|�|j||f��cS|df|jvr$|�|j|df��cS�gt
d|z���)Nr�z#no dispatch function for object: %s)r�r�type�__mro__r��_fn_or_list�
ValueError)r@r�r��targets�spclss     r'�dispatchzDispatcher.dispatch�s����c�3���	(�!$��G�G�
��T�
"�
"�	(��k�G�G��3�i�i�'�G��	J�	J�E��I�%�%�5�)�*<���*N�*N��'�'����y�7I�(J�K�K�K�K�K���#�t�~�5�5��'�'����y�7I�(J�K�K�K�K�K�6��B�S�H�I�I�Ir(�
fn_or_list�Union[List[Callable], Callable]c�$��|jr�fd�}|S�S)Nc�"���D]
}||i|���dSr!r1)rnrhryr�s   �r'�goz"Dispatcher._fn_or_list.<locals>.gos/���$�#�#�B��B��N�r�N�N�N�N�#�#r()r�)r@r�r�s ` r'r�zDispatcher._fn_or_lists5����<�	�
#�
#�
#�
#�
#��I��r(c����t��}�jr,|j��fd��jD����n|j��j��|S)zHReturn a copy of this dispatcher that is independently
        writable.c3�J�K�|]}|d��j|D��fV��dS)c��g|]}|��Sr1r1)�.0rys  r'�
<listcomp>z/Dispatcher.branch.<locals>.<genexpr>.<listcomp>s��4�4�4�B�R�4�4�4r(N)r�)r��kr@s  �r'�	<genexpr>z$Dispatcher.branch.<locals>.<genexpr>sO�������:;��4�4�$�.��"3�4�4�4�5������r()r�r�r�r^)r@�ds` r'�branchzDispatcher.branchs~���
�L�L���<�	/�
�K�������?C�~����
�
�
�
�
�K���t�~�.�.�.��r(N)F)r�r�rr)r�)r�rr�rrr)r�rr�rrr)r�r�rr)rr�)r)r*r+r�r�r�r�r�r1r(r'r�r��s������������
-6������J�J�J�J�J�"���������r(r�rc��|�J�|Sr!r1)rs r'�not_noner�!s�������Lr()rr)r�rr�rtrrtr!)r�rr�r�rr)r�rr�r�rrt)r�r�rr�)rr�rr)(�
__future__rr�collections.abcrru�typingrrrrr	r
rrr
rrr�r[�sqlalchemy.utilrrrrr�compatrrr�rr�rr.r�r�r�r�r�r�r1r(r'�<module>r�s
��"�"�"�"�"�"�"�����$�$�$�$�$�$�������������������������������������������������������������������������������"�"�"�"�"�"�)�)�)�)�)�)�-�-�-�-�-�-�#�#�#�#�#�#�'�'�'�'�'�'�*�*�*�*�*�*�!.�
���
�/�/�/�/��W�T�]�]��(�(�(�(�(�T�(�(�(�O�O�O�O�O�~�O�O�O�O�d���"�"�"�"�
����
���
�����
���
�����
�������#�#�#�#�;�;�;�;�;�;�;�;�|�����r(

Hacked By AnonymousFox1.0, Coded By AnonymousFox