Hacked By AnonymousFox

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

�

�܋f2���dZddlZddlZddlmZddlmZddlmZddlmZddlm	Z	d	d
lm
Z
dd�Zdd
�Zdd�Z
dd�Zdd�Zd�Z	dd�Zd�Zd�Z	dd�Zdd�ZdS)zSHelpers related to deprecation of functions, methods, classes, other
functionality.�N�)�compat)�_hash_limit_string)�	decorator)�inject_docstring_text)�inject_param_text�)�exc�c�H�tj|tj|���dS�N��
stacklevel��warnings�warnr
�SADeprecationWarning��msgrs  �S/opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/util/deprecations.py�warn_deprecatedrs"���M�#�s�/�J�G�G�G�G�G�G�c�l�|rt|d|��}tj|tj|��dS)zhIssue a deprecation warning with a parameterized string,
    limiting the number of registrations.

    �
N)rrrr
r)r�argsrs   r�warn_deprecated_limitedrs:��
�0� ��b�$�/�/���M�#�s�/��<�<�<�<�<rc�H�tj|tj|���dSr
)rrr
�SAPendingDeprecationWarningrs  r�warn_pending_deprecationr$s"���M�#�s�6�:�N�N�N�N�N�Nr�__init__c�.����d|�d�pd������fd�}|S)N�.. deprecated:: � �c	�`��t|�tj�t����z���S�N��func)�_decorate_cls_with_warningr
r�dict)�cls�constructor�header�messages ���r�decoratez deprecated_cls.<locals>.decorate+s7���)����$��d��,�,�,�,��
�
�	
r�)�versionr.r,r/r-s `` @r�deprecated_clsr2(sE������(/���'�-�R�-�
A�F�
�
�
�
�
�
�
��OrTc�<���|rd|�d�pd���nd���d���fd�}|S)a�Decorates a function and issues a deprecation warning on use.

    :param version:
      Issue version in the warning.

    :param message:
      If provided, issue message in the warning.  A sensible default
      is used if not provided.

    :param add_deprecation_to_docstring:
      Default True.  If False, the wrapped function's __doc__ is left
      as-is.  If True, the 'message' is prepended to the docs if
      provided, or sensible default if message is omitted.

    r"r#r$N�$Call to deprecated function %(func)sc�h��t|tj�t|j���z���Sr&)�_decorate_with_warningr
rr*�__name__��fnr-r.s ��rr/zdeprecated.<locals>.decoratePs6���%���$��d���,�,�,�,��	
�
�	
rr0�r1r.�add_deprecation_to_docstringr/r-s `  @r�
deprecatedr<7s]����"$���,3�G�G�g�m��m�E�������8��
�
�
�
�
�
��Orc�x���i�����D]\}\}}t|���|<���fd�}|S)a"Decorates a function to warn on use of certain parameters.

    e.g. ::

        @deprecated_params(
            weak_identity_map=(
                "0.7",
                "the :paramref:`.Session.weak_identity_map parameter "
                "is deprecated."
            )

        )

    c	�j�����tj|��}|j��tt	|jt
|j��t
|j��z
d�|j�����t��������t����	����nd�t����t����fd���}|jdur|jpd}|r,t|d��	�
��D����}||��}||_|S)Nr0c�����D];}||�|kr'tj�|tjd����<�D]-}||vr'tj�|tjd����.||i|��S�Nrrr)r9r�kwargs�m�check_defaults�check_kw�defaults�messagess    ����r�warnedz3deprecated_params.<locals>.decorate.<locals>.warned~s����#�
�
���!�9����+�+��M� ���S�%=�!�������
�
����;�;��M� ���S�%=�!�������2�t�&�v�&�&�&rr$c�0�i|]\}\}}|d|�d|pd����S)r"r#r$r0)�.0�paramr1r.s    r�
<dictcomp>z7deprecated_params.<locals>.decorate.<locals>.<dictcomp>�sD�����1��1����E�g�g�g��
�2�
�O���r)r�inspect_getfullargspecrEr*�zipr�len�set�intersection�
differencer�__doc__r�items)
r9�specrG�doc�	decoratedrCrDrErF�specss
     @@@��rr/z#deprecated_params.<locals>.decorateosS�������,�R�0�0���=�$����I�s�4�9�~�~��D�M�0B�0B�B�E�E�F��M�����H�!��]�]�7�7��A�A�N��8�}�}�/�/��9�9�H�H��N��8�}�}�H�	�	'�	'�	'�	'�	'�	'�	'�
��	'��j��$�3���9�r���	�#����5:�[�[�]�]������C��F�2�J�J�	��	���r)rS�_sanitize_restructured_text)rWrJr1r.r/rFs`    @r�deprecated_paramsrY[se���� �H�%*�[�[�]�]�?�?�!��!���5�g�>�>�����)�)�)�)�)�)�V�Orc�<���|rd|�d�pd���nd���d���fd�}|S)aEDecorates a function and issues a pending deprecation warning on use.

    :param version:
      An approximate future version at which point the pending deprecation
      will become deprecated.  Not used in messaging.

    :param message:
      If provided, issue message in the warning.  A sensible default
      is used if not provided.

    :param add_deprecation_to_docstring:
      Default True.  If False, the wrapped function's __doc__ is left
      as-is.  If True, the 'message' is prepended to the docs if
      provided, or sensible default if message is omitted.
    r"z (pending) r$Nr4c�h��t|tj�t|j���z���Sr&)r6r
rr*r7r8s ��rr/z%pending_deprecation.<locals>.decorate�s6���%���+��d���,�,�,�,��	
�
�	
rr0r:s `  @r�pending_deprecationr\�s]����&$���6=�g�g��
�2�
�O�������8��
�
�
�
�
�
��Orc�,�|�|St|��|S�N)r)�parameter_value�
default_value�warning_texts   r�deprecated_option_valuerb�s"��������%�%�%��rc�4�d�}tjd||��S)Nc�J�|�dd��\}}|dvr|dz
}|S)Nrr	)r(�methz())�group)rB�type_�names   r�replz)_sanitize_restructured_text.<locals>.repl�s1���g�g�a��m�m���t��$�$�$��D�L�D��rz\:(\w+)\:`~?(?:_\w+)?\.?(.+?)`)�re�sub)�textris  rrXrX�s(������6�3�T�4�@�@�@rc
��|jdur|jpd}|��|t|���z}t||d��}t|��tur=t|j��}||d<t|j|j|��}||}n||_t||��}t||t|||d����|S)Nr$r'rrR)
rRr*r�type�__dict__r7�	__bases__�getattr�setattrr6)r+r,�wtyper.�docstring_headerrU�clsdict�constructor_fns        rr)r)�s����+�T�
!�
1�c�k�
7�R�C��#��D�k�2�2�2�2��#�C�)9�1�=�=����9�9�����3�<�(�(�G�!$�G�I���s�|�S�]�G�<�<�C�$�[�1�N�N��C�K�$�S�+�6�6�N�����~�u�g�t�D�D�����Jrc����t����t��fd���}|jdur|jpd}|�)|t|j���z}t||d��}||��}||_��fd�|_|S)z=Wrap a function with a warnings.warn and augmented docstring.c�B��tj��d���||i|��Sr@�rr)r9rrAr.rss   ��rrGz&_decorate_with_warning.<locals>.warned�s/����
�g�u��3�3�3�3��r�4�"�6�"�"�"rNr$r'rc�2��tj��d���Sr@ry)r.rss��r�<lambda>z(_decorate_with_warning.<locals>.<lambda>s�����w��!�!L�!L�!L�r)rXrrRr*r7r�_sa_warn)r(rsr.rtrGrUrVs ``    rr6r6�s�����*�'�2�2�G��#�#�#�#�#��Y�#��,�d�
"�
3�t�|�
9�r�C��#��D�d�m�4�4�4�4��#�C�)9�1�=�=����t���I��I��L�L�L�L�L�I���r)r)r )NTr^)rRrjrr$r�langhelpersrrrrr
rrrr2r<rYr\rbrXr)r6r0rr�<module>r~s~����
�	�	�	�����������+�+�+�+�+�+�"�"�"�"�"�"�.�.�.�.�.�.�*�*�*�*�*�*�������H�H�H�H�=�=�=�=�O�O�O�O�����!�!�!�!�H?�?�?�F9=�#�#�#�#�L���A�A�A�8<�����6�����r

Hacked By AnonymousFox1.0, Coded By AnonymousFox