OwlCyberSecurity - MANAGER
Edit File: util.cpython-312.pyc
� ����_��g2����������������������"����d�dl�mZ�d�dlZd�dlmZ�d�dlmZ�d�dlmZ�d�dlmZ�ddlmZ�dd lm Z �dd l mZ�ddlm Z �ddlmZ�ej������������������ses d dlmZ�d dlmZ�nd�dlmZ�d�dlmZ��edeg�ef�����������Zdd�Z�G�d��de �������Z�G�d��d�������Zy)�����)�annotationsN)�Any)�Callable)�Optional)�TypeVar����)�exc)�util)�HAS_CYEXTENSION)�Protocol)�Self����)�_distill_params_20)�_distill_raw_params�_C)�boundc�����������������8�������t���������j��������������������fd���������}|S�)z�Decorator, memoize a function in a connection.info stash. Only applicable to functions which take no arguments other than a connection. The memo will be stored in ``connection.info[key]``. c�����������������������|j��������������������������} �|j����������������������S�#�t��������$�r��|�||�������x|j�������������������<���}|cY�S�w�xY�w�N)�connect�info�KeyError)�fn�self� connection�val�keys��� ��G/opt/hc_python/lib64/python3.12/site-packages/sqlalchemy/engine/util.py� decoratedz%connection_memoize.<locals>.decorated+���sS��������'�'�)� � ��?�?�3�'�'���� �)+�D�*�)=�=�J�O�O�C� �3��J� �s����"��#A�A)r ���� decorator)r���r���s���` r����connection_memoizer!���$���s#�������� �^�^������������c������������������������e�Zd�ZU�ded<���y)� _TConsSubjectzOptional[TransactionalContext]�_trans_context_managerN)�__name__� __module__�__qualname__�__annotations__��r"���r���r$���r$���7���s������:�:r"���r$���c�������������������z�����e�Zd�ZU�dZdZded<���dd�Zdd�Zdd�Zdd�Z dd �Z dd �Zdd�Ze dd���������Zdd �Zdd�Zy)�TransactionalContextz�Apply Python context manager behavior to transaction objects. Performs validation to ensure the subject of the transaction is not used if the transaction were ended prematurely. )�_outer_trans_ctx�_trans_subject�__weakref__zOptional[_TConsSubject]r.���c����������������������t�����������������r�����NotImplementedError�r���s��� r����_transaction_is_activez+TransactionalContext._transaction_is_activeG����������!�#�#r"���c����������������������t�����������������r���r1���r3���s��� r����_transaction_is_closedz+TransactionalContext._transaction_is_closedJ���r5���r"���c����������������������t�����������������)a��indicates the object is in a state that is known to be acceptable for rollback() to be called. This does not necessarily mean rollback() will succeed or not raise an error, just that there is currently no state detected that indicates rollback() would fail or emit warnings. It also does not mean that there's a transaction in progress, as it is usually safe to call rollback() even if no transaction is present. .. versionadded:: 1.4.28 r1���r3���s��� r����_rollback_can_be_calledz,TransactionalContext._rollback_can_be_calledM���s �������"�#�#r"���c����������������������t�����������������r���r1���r3���s��� r����_get_subjectz!TransactionalContext._get_subject^���r5���r"���c����������������������t�����������������r���r1���r3���s��� r����commitzTransactionalContext.commita���r5���r"���c����������������������t�����������������r���r1���r3���s��� r����rollbackzTransactionalContext.rollbackd���r5���r"���c����������������������t�����������������r���r1���r3���s��� r����closezTransactionalContext.closeg���r5���r"���c�����������������l�����|j�������������������}|r&|j��������������������������st��������j������������������d��������y�y�)Nz�Can't operate on closed transaction inside context manager. Please complete the context manager before emitting further commands.)r%���r4���r ����InvalidRequestError)�cls�subject� trans_contexts��� r����_trans_ctx_checkz%TransactionalContext._trans_ctx_checkj���s>�������6�6� �� �7�7�9��-�-�8�����:��r"���c�����������������h�����|�j��������������������������}|j������������������}||�_��������||�_��������|�|_��������|�S�r���)r;���r%���r-���r.���)r���rE���rF���s��� r���� __enter__zTransactionalContext.__enter__u���s:�������#�#�%��� �6�6� � -���%���)-��&��r"���c���������������������t��������|�dd��������}|d�u�xs�|j������������������|�u}|�G|�j��������������������������r7 �|�j���������������������������|s|�J��|�j������������������|_��������d�x|�_ ��������|�_��������y� �|�j��������������������������s!|�j��������������������������s1|�j���������������������������n |�j ��������������������������r|�j���������������������������|s|�J��|�j������������������|_��������d�x|�_ ��������|�_��������y�#��t ��������j ��������������������������5��|�j ��������������������������r|�j���������������������������d�d�d���������n#�1�sw�Y���nxY�wY���xY�w#�|s|�J��|�j������������������|_��������d�x|�_ ��������|�_��������w�xY�w#�|s|�J��|�j������������������|_��������d�x|�_ ��������|�_��������w�xY�w)Nr.���)�getattrr%���r4���r=���r ����safe_reraiser9���r?���r-���r.���r7���rA���)r����type_�value� tracebackrE����out_of_band_exits��� r����__exit__zTransactionalContext.__exit__����s|������$� 0�$�7��� �t�O�I�w�=�=�T�I�� ���=�T�8�8�:� C���� ��(�"�.�.�.�59�5J�5J�G�2�>B�B��#�d�&;� C��2�2�4��6�6�8�� � ���3�3�5�� � ��'�"�.�.�.�59�5J�5J�G�2�>B�B��#�d�&;��+ (��&�&�(��3�3�5�� � ���)�(�(����(�"�.�.�.�59�5J�5J�G�2�>B�B��#�d�&;���(�"�.�.�.�59�5J�5J�G�2�>B�B��#�d�&;�s<����C#��,AE��#D1�9!D#� D1�#D, �(D1�/D4��4'E�'FN)�return�bool)rR���r$���)rR����None)rE���r$���rR���rT���)rR���r ���)rM���r���rN���r���rO���r���rR���rT���)r&���r'���r(����__doc__� __slots__r)���r4���r7���r9���r;���r=���r?���rA����classmethodrG���rI���rQ���r*���r"���r���r,���r,���;���sW��������F�I�+�+�$�$�$�"$�$�$�$������� �&Cr"���r,���)r����strrR���zCallable[[_C], _C])� __future__r����typingr���r���r���r�����r ���r ����util._has_cyr����util.typingr���r ���� TYPE_CHECKING�_py_utilr���r����sqlalchemy.cyextension.utilr���r!���r$���r,���r*���r"���r����<module>ra������sy������#�� ��������������*��"��� ����B�D���� �T��"�c�'�*�+���&;�H��;�lC��lCr"���