__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

aptanhua@216.73.217.0: ~ $
�

`��gf4��:�ddlmZddlZddlZddlZddlmZddlmZddlmZddlZddl	Z	ddl
mZddlm
Z
dd	lmZd
dl
mZd
dl
mZd
d
lmZd
dlmZej(rd
dlmZd
dlmZd
dlmZGd�d�Ze�Ze
d��Ze
d��Ze
d��Ze
d��Z d$d�Z!Gd�d�Z"d%d�Z#ejH				d&									d'd��Z%ejH				d(									d)d��Z%						d*d�Z%d$d�Z&Gd �d!�Z'Gd"�d#�Z(y)+�)�annotationsN)�Any)�Dict)�Optional�)�config)�	decorator)�
gc_collect�)�event)�pool)�
await_only)�Literal)�Engine)�URL)�AsyncEnginec�r�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zy)�ConnectionKillerc��tj�|_tjt
�|_t�|_y�N)�weakref�WeakKeyDictionary�
proxy_refs�collections�defaultdict�set�testing_engines�dbapi_connections��selfs �K/opt/hc_python/lib64/python3.12/site-packages/sqlalchemy/testing/engines.py�__init__zConnectionKiller.__init__%s/��!�3�3�5���*�6�6�s�;���!$����c��tj|d|j�tj|d|j�tj|d|j�tj|d|j�y)N�checkout�checkin�close�close_detached)r�listen�	_add_conn�_remove_conn)r r
s  r!�add_poolzConnectionKiller.add_pool*sY��
���T�:�t�~�~�6�
���T�9�d�&7�&7�8�
���T�7�D�$5�$5�6�
���T�+�T�->�->�?r#c�X�|jj|�d|j|<y)NT)r�addr)r �	dbapi_con�
con_record�	con_proxys    r!r*zConnectionKiller._add_conn2s$�����"�"�9�-�%)����	�"r#c�:�|jj|�yr)r�discard)r �
dbapi_conn�args   r!r+zConnectionKiller._remove_conn6s�����&�&�z�2r#c��|j|j�|dvsJ�|j|j|�y)N)�class�global�function�fixture)r,r
rr.)r �engine�scopes   r!�
add_enginezConnectionKiller.add_engine9s:���
�
�f�k�k�"��B�B�B�B����U�#�'�'��/r#c�p�	|�y#t$r"}tjd|z�Yd}~yd}~wwxYw)Nz5testing_reaper couldn't rollback/close connection: %s��	Exception�warnings�warn�r �fn�es   r!�_safezConnectionKiller._safe?s5��	��D���	��M�M�G�!�K�
�
��	���
�	5�0�5c��t|j�D]-}|��|js�|j|j��/yr)�listr�is_validrF�rollback�r �recs  r!�rollback_allzConnectionKiller.rollback_allGs0������(�C���3�<�<��
�
�3�<�<�(�)r#c�d�t|j�D]R}|��|js�|jj	|j
�|j
|j��T|jD]}|j
|j��|jj�yr)
rIrrJrr3�dbapi_connectionrF�_checkinrK�clear)r rM�cons   r!�checkin_allzConnectionKiller.checkin_allLs�������(�C���3�<�<��&�&�.�.�s�/C�/C�D��
�
�3�<�<�(�)��)�)�C��J�J�s�|�|�$�*����$�$�&r#c�$�|j�yr)rTrs r!�	close_allzConnectionKiller.close_all[s�����r#c�~�tjsyddlm}|j	|j
j|�y�Nr)�	provision)r�bootstrapped_as_sqlalchemy�rY�prepare_for_drop_tablesr;�url)r �
connectionrYs   r!r\z(ConnectionKiller.prepare_for_drop_tables^s-���0�0����)�)�*�*;�*;�*?�*?��Lr#c��|j|}t|�D]�}t|j�D]S}|��|js�|j�� |j|j
us�9|j
|j��Ut|d�rt|j����|j���|j�y)N�sync_engine)rrIrrJ�_poolr
rFrQ�hasattrr�disposerR)r r<�engrM�	proxy_refs     r!�_drop_testing_enginesz&ConnectionKiller._drop_testing_enginesgs����"�"�5�)����9�C�!�$�/�/�2�	��(�Y�-?�-?�!���3�%�O�O�s�x�x�7��
�
�9�#5�#5�6�
3��s�M�*��3�;�;�=�)����
��	�	�	�r#c�&�|jd�y)Nr9)rfrs r!�
after_testzConnectionKiller.after_testxs���"�"�:�.r#c�2�tjsy|jjry|j	�ddlm}tjj�5}|j|jj|�ddd�y#1swYyxYwrX)rrZ�	__class__�"__leave_connections_for_teardown__rTr[rY�db�connectr\r;r])r �testrY�conns    r!�after_test_outside_fixturesz,ConnectionKiller.after_test_outside_fixtures{se���0�0���>�>�<�<������
	 �
�Y�Y�
�
�
 �D��-�-�d�k�k�o�o�t�D�!�
 �
 �s�'B
�
Bc�h�|j�|jd�|jd�y)Nr9r7)rTrfrs r!�stop_test_class_inside_fixturesz0ConnectionKiller.stop_test_class_inside_fixtures�s*�������"�"�:�.��"�"�7�+r#c�.�tjjr{t�tjjrVt	tjj�}tjjj�	Jd|z��yy)Nz/%d connection recs not cleared after test suite)r
�base�_strong_ref_connection_recordsr
�lenrR)r �lns  r!� stop_test_class_outside_fixturesz1ConnectionKiller.stop_test_class_outside_fixtures�sq���9�9�3�3��L��y�y�7�7�����A�A�B���	�	�8�8�>�>�@��L�D��K�L��	8�4r#c�h�|j�|jD]}|j|��yr)rTrrf)r r<s  r!�
final_cleanupzConnectionKiller.final_cleanup�s,�������)�)�E��&�&�u�-�*r#c�B�|jD]}|js�J�yr)rrJrLs  r!�assert_all_closedz"ConnectionKiller.assert_all_closed�s���?�?�C��|�|��u�#r#N)�__name__�
__module__�__qualname__r"r,r*r+r=rFrNrTrVr\rfrhrprrrxrzr|�r#r!rr$s[��'�
@�*�3�0��)�

'��M��"/�E�$,�
L�.�
r#rc�p�	||i|��tj�y#tj�wxYwr)�testing_reaperr|�rD�args�kws   r!�assert_conns_closedr��s+��+�
�D��B���(�(�*���(�(�*����5c�p�	||i|��tj�y#tj�wxYw)zBDecorator that rolls back all open connections after fn execution.N)r�rNr�s   r!�rollback_open_connectionsr��s+��&�
�D��B���#�#�%���#�#�%�r�c�<�tj�||i|��y)z:Decorator that closes all connections before fn execution.N�r�rTr�s   r!�close_firstr��s����� ���O��Or#c�p�	||i|��tj�y#tj�wxYw)z9Decorator that closes all connections after fn execution.Nr�r�s   r!�close_open_connectionsr��s+��%�
�D��B���"�"�$���"�"�$�r�c#��K�ddlm}|jD]L}|r||vr�
t||d�}|s"tt	d|z�j|�}|j����Ny�w)Nrzsqlalchemy.dialects.%s)�sqlalchemy.dialects�dialects�__all__�getattr�
__import__�dialect)�exclude�d�name�mods    r!�all_dialectsr��sb����#��	�	���t�w����a��t�$�����3�d�:�;�D�D�d��C��k�k�m���s�A#A%c�2�eZdZd�Zd�Zd�Zd�Zdd�Zd�Zy)	�ReconnectFixturec�.�||_g|_d|_y�NF)�dbapi�connections�
is_stopped)r r�s  r!r"zReconnectFixture.__init__�s����
������r#c�.�t|j|�Sr)r�r��r �keys  r!�__getattr__zReconnectFixture.__getattr__�s���t�z�z�3�'�'r#c��|jj|i|��}|jrC|j|j�|j�}|j
d�Jd��|jj|�|S)Nzselect 1z%simulated connect failure didn't work)	r�rmr�rFr'�cursor�executer��append)r r��kwargsro�curss     r!rmzReconnectFixture.connect�sq��!�t�z�z�!�!�4�2�6�2���?�?��J�J�t�z�z�"��;�;�=�D�
�L�L��$�A�A�A�5����#�#�D�)��Kr#c�p�	|�y#t$r"}tjd|z�Yd}~yd}~wwxYw)Nz.ReconnectFixture couldn't close connection: %sr?rCs   r!rFzReconnectFixture._safe�s4��	P��D���	P��M�M�J�Q�N�O�O��	P�rGc��||_t|j�D]}|j|j��g|_yr)r�rIr�rFr')r �stop�cs   r!�shutdownzReconnectFixture.shutdown�s8������d�&�&�'�A��J�J�q�w�w��(���r#c��d|_yr�)r�rs r!�restartzReconnectFixture.restarts	����r#N)F)	r}r~rr"r�rmrFr�r�r�r#r!r�r��s!�� �
(��P�	� r#r�c����|xstjj}tjjj}|si}t|�|d<t
||���j���fd�}�jjj�_	�jjj�_|�_�S)N�modulec����jjj�d�jj_��yr�)r�r�r�r�)�_disposer;s��r!rcz$reconnecting_engine.<locals>.disposes0��������%�%�'�*/������'��
r#)rrlr]r�r�r��testing_enginercr��
test_shutdownr��test_restart)r]�optionsr�rcr�r;s    @@r!�reconnecting_enginer�
s����

�
������C��I�I���#�#�E����(��/�G�H��
�C��
)�F��~�~�H��
"�>�>�/�/�8�8�F�� �.�.�.�.�6�6�F���F�N��Mr#c��yrr��r]r��asyncio�transfer_staticpools    r!r�r�s��r#c��yrr�r�s    r!r�r�'s��r#c���|r|rJ�ddlm}nddlm}ddlm}|sd}d}	d}
n6|j
dd�}|j
d	d�}	|j
d
d�}
|xstjj}||�}tj�1|jtjjjk(r/tjrtjj�}ni}|�|j|�||fi|��}|
rG|jdk(r8tj |d�d
��}
tj |d�d��}|rpddlm}tj�{t'tjj(|�rWd}|j(j+tjj(�n!|rtjj(|_|	dk(r|rd|j,_nd|_t'|j(t(j0�r.d|vr*d|vr&d|vr"d|j(_d|j(_|rt6j9||	�|S)Nr)�create_async_engine)�
create_engine)�make_urlTr9F�
use_reaperr<�sqlite_savepoint�sqlitermc��d|_yr)�isolation_level)rP�connection_records  r!�
do_connectz"testing_engine.<locals>.do_connect\s��/3��,r#�beginc�&�|jd�y)N�BEGIN)�exec_driver_sql)ros r!�do_beginz testing_engine.<locals>.do_begin`s��� � ��)r#)�
StaticPoolr8r
�pool_timeout�max_overflow)�sqlalchemy.ext.asyncior��
sqlalchemyr��sqlalchemy.engine.urlr��poprrlr]�
drivername�db_opts�copy�updater�r�listens_for�sqlalchemy.poolr��
isinstancer
�_transfer_fromr`�_has_events�	QueuePool�_timeout�
_max_overflowr�r=)r]r�r�r��
share_pool�_sqlite_savepointr�r�r�r<r��use_optionsr;r�r�r�s                r!r�r�0s���$�$�$�	
�	-�.���
��� ���[�[��t�4�
����G�Z�0��"�;�;�'9�5�A��

�
������C�
�3�-�C�	�	�	��S�^�^�v�y�y�}�}�/G�/G�G�
�.�.��n�n�)�)�+���������7�#�
�3�
.�+�
.�F��F�K�K�8�3�	�	�	�6�9�	-�	4�
.�	4�
�	�	�6�7�	+�	*�
,�	*��.��9�9� �Z��	�	���
�%K��J��K�K�&�&�v�y�y�~�~�6�	��i�i�n�n�������-1�F���*��
��
	�6�;�;����/��+�%��+�-��+�-� �����$%����!���!�!�&�%�0��Mr#c�����ddlm}|stjj}g��fd�}�fd�}�fd�}||dz|��t�d�rJ���_|�_|�_�S)a'Provides a mocking engine based on the current testing.db.

    This is normally used to test DDL generation flow as emitted
    by an Engine.

    It should not be used in other cases, as assert_compile() and
    assert_sql_execution() are much better choices with fewer
    moving parts.

    r)�create_mock_enginec�(���j|�yr)r�)�sql�ar��buffers   �r!�executorzmock_engine.<locals>.executor�s����
�
�c�r#c
����D�cgc]"}tjddt|����$}}||k(sJ|��ycc}w)Nz[\n\t]r[)�re�sub�str)�stmts�s�recvr�s   �r!�
assert_sqlzmock_engine.<locals>.assert_sql�s>���7=�>�v�!����y�"�c�!�f�-�v��>��u�}�"�d�"�}��?s�'<c�f����j�dj�fd��jD��S)N�
c3�T�K�|]}t|j�������!y�w))r�N)r��compile)�.0r�r�s  �r!�	<genexpr>z1mock_engine.<locals>.print_sql.<locals>.<genexpr>�s"�����H�K�q��Q�Y�Y�q�Y�1�2�K�s�%()r��join�mock)r�r;s@�r!�	print_sqlzmock_engine.<locals>.print_sql�s%����N�N���y�y�H�F�K�K�H�H�Hr#z://r�)	r�r�rrlr�rbr�r�r�)�dialect_namer�r�r�r�r�r;s     @@r!�mock_enginer�sl���.���y�y�~�~��
�F��#�I� ��u� 4�h�
?�F��v�v�&�&�&��F�K�"�F�� �F���Mr#c�0�eZdZdZd�Zdd�Zd�Zd�Zd�Zy)	�DBAPIProxyCursorzuProxy a DBAPI cursor.

    Tests can provide subclasses of this to intercept
    DBAPI-level cursor operations.

    c�N�||_||_|j|i|��|_yr)r;r^r�)r r;ror�r�s     r!r"zDBAPIProxyCursor.__init__�s'��������!�d�k�k�4�2�6�2��r#Nc�|�|r|jj||fi|��S|jj|fi|��Sr)r�r�)r �stmt�
parametersr�s    r!r�zDBAPIProxyCursor.execute�s?���&�4�;�;�&�&�t�Z�>�2�>�>�&�4�;�;�&�&�t�2�r�2�2r#c�>�|jj||fi|��Sr)r��executemany)r r�paramsr�s    r!rzDBAPIProxyCursor.executemany�s ��&�t�{�{�&�&�t�V�:�r�:�:r#c�,�t|j�Sr)�iterr�rs r!�__iter__zDBAPIProxyCursor.__iter__�s���D�K�K� � r#c�.�t|j|�Sr)r�r�r�s  r!r�zDBAPIProxyCursor.__getattr__�s���t�{�{�C�(�(r#r)	r}r~r�__doc__r"r�rrr�r�r#r!rr�s ���3�
3�;�!�)r#rc�(�eZdZdZd�Zd�Zd�Zd�Zy)�DBAPIProxyConnectionz}Proxy a DBAPI connection.

    Tests can provide subclasses of this to intercept
    DBAPI-level connection operations.

    c�.�||_||_||_yr)ror;�
cursor_cls)r r;rors    r!r"zDBAPIProxyConnection.__init__�s����	����$��r#c�X�|j|j|jg|��i|��Sr)rr;ro)r r�r�s   r!r�zDBAPIProxyConnection.cursor�s'���t���t�{�{�D�I�I�G��G��G�Gr#c�8�|jj�yr)ror'rs r!r'zDBAPIProxyConnection.close�s���	�	���r#c�.�t|j|�Sr)r�ror�s  r!r�z DBAPIProxyConnection.__getattr__�s���t�y�y�#�&�&r#N)r}r~rrr"r�r'r�r�r#r!rr�s���%�
H��'r#rr)NN)NNFF)
r]�
Optional[URL]r��Optional[Dict[str, Any]]r�zLiteral[False]r��bool�returnr)NNTF)
r]rr�rr�z
Literal[True]r�rrr)NNFFFF))�
__future__rrr��typingrrrrArr[r�utilr	r
rr
r�util.typingr�
TYPE_CHECKINGr;r�
engine.urlr�ext.asynciorrr�r�r�r�r�r�r�r��overloadr�rrrr�r#r!�<module>r"s���#��	�
������������!�
���� �)�C�C�L"�#���+��+��&��&������%��%��( �( �V�(����(,�#� %�	�	��
%�����	�
��������(,�!� %�	�	��
%�����	�
����	
������
P�f#�L)�)�:'�'r#

Filemanager

Name Type Size Permission Actions
__init__.cpython-312.pyc File 3.23 KB 0644
assertions.cpython-312.pyc File 40.76 KB 0644
assertsql.cpython-312.pyc File 19.71 KB 0644
asyncio.cpython-312.pyc File 4.03 KB 0644
config.cpython-312.pyc File 17.2 KB 0644
engines.cpython-312.pyc File 20.88 KB 0644
entities.cpython-312.pyc File 4.85 KB 0644
exclusions.cpython-312.pyc File 20.72 KB 0644
pickleable.cpython-312.pyc File 6.51 KB 0644
profiling.cpython-312.pyc File 12.66 KB 0644
provision.cpython-312.pyc File 20.55 KB 0644
requirements.cpython-312.pyc File 84.91 KB 0644
schema.cpython-312.pyc File 8.73 KB 0644
util.cpython-312.pyc File 21.24 KB 0644
warnings.cpython-312.pyc File 1.94 KB 0644