OwlCyberSecurity - MANAGER
Edit File: contextlib.cpython-311.opt-1.pyc
� �����/�gk�����������������������|����d�Z�ddlZddlZddlZddlZddlmZ�ddlmZ�ddl m Z mZ�g�d�Z�G�d��dej ��������������������Z�G�d ��d ej ��������������������Z�G�d��de������������Z�G�d ��de������������Z�G�d��d������������Z�G�d��deee������������Z�G�d��deee������������Zd��Zd��Z�G�d��de������������Z�G�d��de������������Z�G�d��de������������Z�G�d��de������������Z�G�d��d e������������Z�G�d!��d"e������������Z�G�d#��d$������������Z�G�d%��d&ee������������Z�G�d'��d(ee������������Z �G�d)��d*ee������������Z!�G�d+��d,e������������Z"dS�)-z4Utilities for with-statement contexts. See PEP 343.�����N)�deque��wraps)� MethodType�GenericAlias)�asynccontextmanager�contextmanager�closing�nullcontext�AbstractContextManager�AbstractAsyncContextManager�AsyncExitStack�ContextDecorator� ExitStack�redirect_stdout�redirect_stderr�suppress�aclosing�chdirc��������������������d�����e�Zd�ZdZ�ee������������Zd��Zej ��������d����������������Z ed����������������ZdS�)r���z,An abstract base class for context managers.c�����������������������|�S��z0Return `self` upon entering the runtime context.����selfs��� �1/opt/alt/python311/lib64/python3.11/contextlib.py� __enter__z AbstractContextManager.__enter__���s������������c�����������������������dS��z9Raise any exception triggered within the runtime context.Nr����r����exc_type� exc_value� tracebacks��� r����__exit__zAbstractContextManager.__exit__���s ��������tr���c������������������N�����|�t�����������u�rt����������j��������|dd������������S�t����������S�)Nr���r%���)r����_collections_abc�_check_methods�NotImplemented��cls�Cs��� r����__subclasshook__z'AbstractContextManager.__subclasshook__ ���s)�������(�(�(�#�2�1�k�:�N�N�N��r���N)�__name__� __module__�__qualname__�__doc__�classmethodr����__class_getitem__r����abc�abstractmethodr%���r-���r���r���r���r���r������ss��������������6�6�#��L�1�1�������� ����������������[�����r���r���c��������������������d�����e�Zd�ZdZ�ee������������Zd��Zej ��������d����������������Z ed����������������ZdS�)r ���z9An abstract base class for asynchronous context managers.c������������������� ���K����|�S�r���r���r���s��� r���� __aenter__z&AbstractAsyncContextManager.__aenter__-���s�����������r���c������������������� ���K����dS�r ���r���r!���s��� r���� __aexit__z%AbstractAsyncContextManager.__aexit__1���s ������������tr���c������������������N�����|�t�����������u�rt����������j��������|dd������������S�t����������S�)Nr8���r:���)r ���r'���r(���r)���r*���s��� r���r-���z,AbstractAsyncContextManager.__subclasshook__6���s3�������-�-�-�#�2�1�l�3>�@��@�� @��r���N)r.���r/���r0���r1���r2���r���r3���r8���r4���r5���r:���r-���r���r���r���r ���r ���'���ss��������������C�C�#��L�1�1�������� ����������������[�����r���r ���c�������������������������e�Zd�ZdZd��Zd��ZdS�)r���zJA base class or mixin that enables context managers to work as decorators.c�����������������������|�S�)a6��Return a recreated instance of self. Allows an otherwise one-shot context manager like _GeneratorContextManager to support use as a decorator via implicit recreation. This is a private interface just for _GeneratorContextManager. See issue #11647 for details. r���r���s��� r����_recreate_cmzContextDecorator._recreate_cmA���s ��������r���c������������������@��������t��������������������������fd���������������}|S�)Nc�������������������p�������������������������������������������5����|�i�|��cd�d�d��������������S�#�1�swxY�w�Y���d�S��N�r>�����args�kwds�funcr���s��� ��r����innerz(ContextDecorator.__call__.<locals>.innerN���s���������"�"�$�$�� +�� +��t�T�*�T�*�*� +�� +�� +�� +�� +�� +�� +�� +�� +�� +�� +�� +����� +�� +�� +�� +�� +�� +s����+�/�/r����r���rF���rG���s���`` r����__call__zContextDecorator.__call__M���s9�������� �t��� +�� +�� +�� +�� +�� �� +���r���N�r.���r/���r0���r1���r>���rI���r���r���r���r���r���>���s8��������������P�P� �� �� ���������r���r���c�������������������������e�Zd�ZdZd��Zd��ZdS�)�AsyncContextDecoratorzPA base class or mixin that enables async context managers to work as decorators.c�����������������������|�S�)z-Return a recreated instance of self. r���r���s��� r���r>���z"AsyncContextDecorator._recreate_cmX���s ��������r���c������������������@��������t��������������������������fd���������������}|S�)Nc������������������������K�����������������������������������������4��d�{V������|�i�|����d�{V���cd�d�d��������������d�{V����S�#�1��d�{V���swxY�w�Y���d�S�rA���rB���rC���s��� ��r���rG���z-AsyncContextDecorator.__call__.<locals>.inner^���s�������������(�(�*�*�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�!�T�4�0�4�0�0�0�0�0�0�0�0� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1�� 1����� 1�� 1�� 1�� 1�� 1�� 1s����?� A �A r���rH���s���`` r���rI���zAsyncContextDecorator.__call__]���s9�������� �t��� 1�� 1�� 1�� 1�� 1�� �� 1���r���NrJ���r���r���r���rL���rL���U���s8��������������V�V������ ��������r���rL���c�������������������������e�Zd�ZdZd��Zd��ZdS�)�_GeneratorContextManagerBasezBShared functionality for @contextmanager and @asynccontextmanager.c������������������������||i�|��|�_���������|||c|�_��������|�_��������|�_��������t ����������|dd�������������}|�t����������|�������������j��������}||�_��������d�S�)Nr1���)�genrF���rD���rE����getattr�typer1���)r���rF���rD���rE����docs��� r����__init__z%_GeneratorContextManagerBase.__init__h���s]�������4��&��&�&���*.��d�'�� �4�9�d�i��d�I�t�,�,���;��t�*�*�$�C�����r���c������������������N�����|�����������������������|�j��������|�j��������|�j��������������������S�rA���)� __class__rF���rD���rE���r���s��� r���r>���z)_GeneratorContextManagerBase._recreate_cmv���s ��������~�~�d�i���D�I�>�>�>r���N)r.���r/���r0���r1���rW���r>���r���r���r���rQ���rQ���e���s8��������������L�L������?��?��?��?��?r���rQ���c�������������������������e�Zd�ZdZd��Zd��ZdS�)�_GeneratorContextManagerz%Helper for @contextmanager decorator.c������������������t�����|�`�|�`|�` �t����������|�j��������������������S�#�t ����������$�r�t ����������d������������d��w�xY�w�Nzgenerator didn't yield)rD���rE���rF����nextrS���� StopIteration�RuntimeErrorr���s��� r���r���z"_GeneratorContextManager.__enter__����sU������� �I�t�y�$�)� C����>�>�!���� C�� C�� C��7�8�8�d�B� C���s������7c������������������f����|�T �t����������|�j��������������������� �t����������d�������������#�|�j��������������������������������������������w�xY�w#�t����������$�r�Y�dS�w�xY�w|� �|��������������} �|�j�����������������������������|||�������������n�#�t����������$�r}||ucY�d�}~S�d�}~wt����������$�rB}||u�r ||_��������Y�d�}~dS�t����������|t����������������������r|j��������|u�r ||_��������Y�d�}~dS���d�}~wt����������$�r}||ur��||_��������Y�d�}~dS�d�}~ww�xY�w �t����������d�������������#�|�j��������������������������������������������w�xY�w)N�generator didn't stopFz#generator didn't stop after throw()) r^���rS���r`����closer_����throw� __traceback__� isinstance� __cause__� BaseException�r����typ�valuer$����excs��� r���r%���z!_GeneratorContextManager.__exit__����s�������;� %��T�X����%�&�'>�?�?�?���H�N�N�$�$�$�$����� �!�� �� �� ��u�u� ������}�������# �����s�E�9�5�5�5�5�� �� (�� (�� (���%�'�'�'�'�'�'�'������� �� �� ��%�<�<�(1�C�%� �5�5�5�5�5���u�m�4�4�!�� ��.�.�*3�E�'� �5�5�5�5�5������ �� �� �� ���e�#�#��$-��!��u�u�u�u�u����� ���� !�"�#H�I�I�I������ � � � ���sh����A��(��A� A�A�$B�� D�B�D� D�!C�2%C�C� D�+C=�=D�D��D0N)r.���r/���r0���r1���r���r%���r���r���r���r[���r[���}���s=�������������� �0�/�C��C��C�7!��7!��7!��7!��7!r���r[���c�������������������������e�Zd�ZdZd��Zd��ZdS�)�_AsyncGeneratorContextManagerz*Helper for @asynccontextmanager decorator.c����������������������K����|�`�|�`|�` �t����������|�j����������������������d�{V���S�#�t ����������$�r�t ����������d������������d��w�xY�wr]���)rD���rE���rF����anextrS����StopAsyncIterationr`���r���s��� r���r8���z(_AsyncGeneratorContextManager.__aenter__����sk����������� �I�t�y�$�)� C��t�x���(�(�(�(�(�(�(��!�� C�� C�� C��7�8�8�d�B� C���s����$��?c���������������������K����|�` �t����������|�j����������������������d�{V���� �t����������d�������������#�|�j���������������������������������������������d�{V����w�xY�w#�t����������$�r�Y�dS�w�xY�w|� �|��������������} �|�j�����������������������������|||��������������d�{V����n�#�t����������$�r}||ucY�d�}~S�d�}~wt����������$�rI}||u�r ||_��������Y�d�}~dS�t����������|t����������t����������f������������r|j ��������|u�r ||_��������Y�d�}~dS���d�}~wt����������$�r}||ur��||_��������Y�d�}~dS�d�}~ww�xY�w �t����������d�������������#�|�j���������������������������������������������d�{V����w�xY�w)Nrb���Fz$generator didn't stop after athrow())rp���rS���r`����acloserq����athrowre���rf���r_���rg���rh���ri���s��� r���r:���z'_AsyncGeneratorContextManager.__aexit__����s����������;� ,��D�H�o�o�%�%�%�%�%�%�%�,�&�'>�?�?�?���(�/�/�+�+�+�+�+�+�+�+�+�+����� �&�� �� �� ��u�u� ������}�������# ��h�o�o�c�5�)�<�<�<�<�<�<�<�<�<�<��%�� (�� (�� (���%�'�'�'�'�'�'�'������� �� �� ��%�<�<�(1�C�%� �5�5�5�5�5���u�}�6H�&I�J�J�!�� ��.�.�*3�E�'� �5�5�5�5�5������ �� �� �� ���e�#�#��$-��!��u�u�u�u�u����� ���� (�"�#I�J�J�J���h�o�o�'�'�'�'�'�'�'�'�'�'���sh����A��0��!A� A"�!A"�2"B�� D�B(�"D�( D�5C9�,C9�8C9�9 D�D�D�!D0��0!EN)r.���r/���r0���r1���r8���r:���r���r���r���rn���rn�������s=�������������� �5�4�C��C��C�7(��7(��7(��7(��7(r���rn���c������������������<�������t��������������������������fd���������������}|S�)a���@contextmanager decorator. Typical usage: @contextmanager def some_generator(<arguments>): <setup> try: yield <value> finally: <cleanup> This makes this: with some_generator(<arguments>) as <variable>: <body> equivalent to this: <setup> try: <variable> = <value> <body> finally: <cleanup> c�������������������&������t�����������|�|������������S�rA���)r[����rD���rE���rF���s��� �r����helperzcontextmanager.<locals>.helper+��s�������'��d�D�9�9�9r���r����rF���rx���s���` r���r ���r �����s3�������6��4�[�[�:��:��:��:���[�:��Mr���c������������������<�������t��������������������������fd���������������}|S�)a���@asynccontextmanager decorator. Typical usage: @asynccontextmanager async def some_async_generator(<arguments>): <setup> try: yield <value> finally: <cleanup> This makes this: async with some_async_generator(<arguments>) as <variable>: <body> equivalent to this: <setup> try: <variable> = <value> <body> finally: <cleanup> c�������������������&������t�����������|�|������������S�rA���)rn���rw���s��� �r���rx���z#asynccontextmanager.<locals>.helperL��s�������,�T�4��>�>�>r���r���ry���s���` r���r���r���1��s3�������6��4�[�[�?��?��?��?���[�?��Mr���c��������������������$�����e�Zd�ZdZd��Zd��Zd��ZdS�)r ���a2��Context to automatically close something at the end of a block. Code like this: with closing(<module>.open(<arguments>)) as f: <block> is equivalent to this: f = <module>.open(<arguments>) try: <block> finally: f.close() c�����������������������||�_���������d�S�rA�����thing�r���r���s��� r���rW���zclosing.__init__c��� �������� � � r���c�����������������������|�j���������S�rA���r~���r���s��� r���r���zclosing.__enter__e��s �������z�r���c������������������8�����|�j���������������������������������������������d�S�rA���)r���rc����r����exc_infos��� r���r%���zclosing.__exit__g��s������� �������r���N�r.���r/���r0���r1���rW���r���r%���r���r���r���r ���r ���R��sK����������������� ������������������r���r ���c��������������������$�����e�Zd�ZdZd��Zd��Zd��ZdS�)r���a���Async context manager for safely finalizing an asynchronously cleaned-up resource such as an async generator, calling its ``aclose()`` method. Code like this: async with aclosing(<module>.fetch(<arguments>)) as agen: <block> is equivalent to this: agen = <module>.fetch(<arguments>) try: <block> finally: await agen.aclose() c�����������������������||�_���������d�S�rA���r~���r����s��� r���rW���zaclosing.__init__}��r����r���c����������������������K����|�j���������S�rA���r~���r���s��� r���r8���zaclosing.__aenter__��s�����������z�r���c�������������������H���K����|�j����������������������������������������������d�{V����d�S�rA���)r���rs���r����s��� r���r:���zaclosing.__aexit__���s2�����������j���!�!�!�!�!�!�!�!�!�!�!r���N)r.���r/���r0���r1���rW���r8���r:���r���r���r���r���r���k��sK�����������������"����������"��"��"��"��"r���r���c��������������������$�����e�Zd�ZdZd��Zd��Zd��ZdS�)�_RedirectStreamNc������������������"�����||�_���������g�|�_��������d�S�rA���)�_new_target�_old_targets)r���� new_targets��� r���rW���z_RedirectStream.__init__���s������%�������r���c�����������������������|�j������������������������������t����������t����������|�j���������������������������������t����������t����������|�j��������|�j���������������������|�j��������S�rA���)r�����appendrT����sys�_stream�setattrr����r���s��� r���r���z_RedirectStream.__enter__���sE�������� � ���d�l�!;�!;�<�<�<���T�\�4�#3�4�4�4���r���c������������������j�����t����������t����������|�j��������|�j��������������������������������������������������������d�S�rA���)r����r����r����r�����pop�r����exctype�excinst�exctbs��� r���r%���z_RedirectStream.__exit__���s+��������T�\�4�#4�#8�#8�#:�#:�;�;�;�;�;r���)r.���r/���r0���r����rW���r���r%���r���r���r���r����r�������sF���������������G������ �� �� � <��<��<��<��<r���r����c�������������������������e�Zd�ZdZdZdS�)r���aA��Context manager for temporarily redirecting stdout to another file. # How to send help() to stderr with redirect_stdout(sys.stderr): help(dir) # How to write help() to a file with open('help.txt', 'w') as f: with redirect_stdout(f): help(pow) �stdoutN�r.���r/���r0���r1���r����r���r���r���r���r������s�������������� �� ���G�G�Gr���r���c�������������������������e�Zd�ZdZdZdS�)r���zCContext manager for temporarily redirecting stderr to another file.�stderrNr����r���r���r���r���r������s��������������M�M��G�G�Gr���r���c��������������������$�����e�Zd�ZdZd��Zd��Zd��ZdS�)r���a?��Context manager to suppress specified exceptions After the exception is suppressed, execution proceeds with the next statement following the with statement. with suppress(FileNotFoundError): os.remove(somefile) # Execution still resumes here if the file was already removed c�����������������������||�_���������d�S�rA���)�_exceptions)r���� exceptionss��� r���rW���zsuppress.__init__���s������%����r���c�����������������������d�S�rA���r���r���s��� r���r���zsuppress.__enter__�����������r���c������������������4�����|d�uot����������||�j��������������������S�rA���)� issubclassr����r����s��� r���r%���zsuppress.__exit__���s!��������d�"�L�z�'�4�;K�'L�'L�Lr���Nr����r���r���r���r���r������sP�����������������&��&��&� �� �� � M�� M�� M�� M�� Mr���r���c��������������������j�����e�Zd�ZdZed����������������Zed����������������Zd��Zd��Zd��Z d��Z d��Zd ��Zd d�Z dS�)�_BaseExitStackz.A base class for ExitStack and AsyncExitStack.c������������������"�����t����������||�������������S�rA����r�����cm�cm_exits��� r����_create_exit_wrapperz#_BaseExitStack._create_exit_wrapper�����������'�2�&�&�&r���c������������������������������fd�}|S�)Nc���������������������������i�����d�S�rA���r����r"���rl����tbrD����callbackrE���s��� ���r���� _exit_wrapperz8_BaseExitStack._create_cb_wrapper.<locals>._exit_wrapper���s��������H�d�#�d�#�#�#�#�#r���r����r����rD���rE���r����s���``` r����_create_cb_wrapperz!_BaseExitStack._create_cb_wrapper���s.��������� $�� $�� $�� $�� $�� $�� $��r���c������������������,�����t������������������������|�_��������d�S�rA���)r����_exit_callbacksr���s��� r���rW���z_BaseExitStack.__init__���s������$�w�w����r���c������������������r������t����������|���������������������������}|�j��������|_��������t������������������������|�_��������|S�)z@Preserve the context stack by transferring it to a new instance.)rU���r����r���)r���� new_stacks��� r����pop_allz_BaseExitStack.pop_all���s0�������D��J�J�L�L� �$(�$8� �!�$�w�w����r���c�����������������������t����������|������������} �|j��������}|����������������������||�������������n%#�t����������$�r�|����������������������|�������������Y�nw�xY�w|S�)a��Registers a callback with the standard __exit__ method signature. Can suppress exceptions the same way __exit__ method can. Also accepts any object with an __exit__ method (registering a call to the method instead of the object itself). )rU���r%���� _push_cm_exit�AttributeError�_push_exit_callback�r����exit�_cb_type�exit_methods��� r����pushz_BaseExitStack.push���su���������:�:�� 2�"�+�K� � ���t�[�1�1�1�1�� ��� +�� +�� +��$�$�T�*�*�*�*�*� +���� ��s����/��A�Ac������������������������t����������|������������} �|j��������}|j��������}n/#�t����������$�r"�t ����������d|j����������d|j����������d�������������d�w�xY�w�||������������}|����������������������||�������������|S�)z�Enters the supplied context manager. If successful, also pushes its __exit__ method as a callback and returns the result of the __enter__ method. �'�.z6' object does not support the context manager protocolN)rU���r���r%���r����� TypeErrorr/���r0���r�����r���r����r+����_enter�_exit�results��� r���� enter_contextz_BaseExitStack.enter_context���s���������2�h�h�� S��]�F��L�E�E���� S�� S�� S���H����H��H��1A��H��H��H��I��I�NR� S� S��������������2�u�%�%�%�� s ���� ��,Ac�����������������`������|�j���������|g|�R�i�|��}||_��������|����������������������|�������������|S�)z\Registers an arbitrary callback and arguments. Cannot suppress exceptions. )r�����__wrapped__r�����r���r����rD���rE���r����s��� r���r����z_BaseExitStack.callback ��sI������ �0��/��H�4�H�H�H�4�H�H� ��%-� �!�� � ��/�/�/��r���c������������������^�����|�����������������������||������������}|����������������������|d�������������dS�)z;Helper to correctly register callbacks to __exit__ methods.TN)r����r�����r���r����r����r����s��� r���r����z_BaseExitStack._push_cm_exit��s3�������1�1�"�g�>�>� �� � ���5�5�5�5�5r���Tc������������������>�����|�j������������������������������||f�������������d�S�rA���)r����r����)r���r�����is_syncs��� r���r����z"_BaseExitStack._push_exit_callback��s$��������#�#�W�h�$7�8�8�8�8�8r���N)T)r.���r/���r0���r1����staticmethodr����r����rW���r����r����r����r����r����r����r���r���r���r����r�������s���������������8�8��'��'���\�'��������\�� '��'��'�����������(�����&�����6��6��6� 9��9��9��9��9��9r���r����c��������������������$�����e�Zd�ZdZd��Zd��Zd��ZdS�)r���a���Context manager for dynamic management of a stack of exit callbacks. For example: with ExitStack() as stack: files = [stack.enter_context(open(fname)) for fname in filenames] # All opened files will automatically be closed at the end of # the with statement, even if attempts to open files later # in the list raise an exception. c�����������������������|�S�rA���r���r���s��� r���r���zExitStack.__enter__+��s�������r���c��������������������� ��|d���������d�u}t����������j����������������������d���������� � fd�}d}d}|�j��������rf|�j�������������������������������������������\��}} ��||��rd}d}d}n6#��t����������j����������������������}�||d���������|d����������������������d}|}Y�nxY�w|�j���������f|r2 �|d���������j��������} |d����������#�t ����������$�r�| |d���������_����������w�xY�w|o|S�)Nr�������c������������������F������ �|�j���������}|�||u�rd�S�|�u�rn|}��||�_���������d�S�rA�����__context__��new_exc�old_exc�exc_context� frame_excs��� �r����_fix_exception_contextz2ExitStack.__exit__.<locals>._fix_exception_context4���M������� &�%�1���&�+��*@�*@��F��)�+�+��%�� &��#*�G���r���FT�NNN�r����r����r����r����r����rh���)r����exc_details�received_excr�����suppressed_exc� pending_raiser�����cb�new_exc_details� fixed_ctxr����s��� @r���r%���zExitStack.__exit__.��s8������"�1�~�T�1����L�N�N�1�%� � *�� *�� *�� *�� *� ���� ��"�� .��.�2�2�4�4�K�G�R� .��2�{�#��5�%)�N�$)�M�"4�K��� .�"%�,�.�.��&�&��q�'9�;�q�>�J�J�J� $� �-���������"�� .���� � ��(��N�6� �!�!�n�$�� �� �� �� �-6��A��*�� ������.��.s����A��1B�B3��3Cc������������������4�����|�����������������������ddd�������������dS��z%Immediately unwind the context stack.N)r%���r���s��� r���rc���zExitStack.close_��s������� � �d�D�$�'�'�'�'�'r���N)r.���r/���r0���r1���r���r%���rc���r���r���r���r���r��� ��sL����������������������//��//��//�b(��(��(��(��(r���r���c��������������������h�����e�Zd�ZdZed����������������Zed����������������Zd��Zd��Zd��Z d��Z d��Zd ��Zd ��Z dS�)r���a���Async context manager for dynamic management of a stack of exit callbacks. For example: async with AsyncExitStack() as stack: connections = [await stack.enter_async_context(get_connection()) for i in range(5)] # All opened connections will automatically be released at the # end of the async with statement, even if attempts to open a # connection later in the list raise an exception. c������������������"�����t����������||�������������S�rA���r����r����s��� r����_create_async_exit_wrapperz)AsyncExitStack._create_async_exit_wrapperr��r����r���c������������������������������fd�}|S�)Nc�������������������(����K�������i������d�{V����d�S�rA���r���r����s��� ���r���r����z>AsyncExitStack._create_async_cb_wrapper.<locals>._exit_wrapperx��s4������������(�D�)�D�)�)�)�)�)�)�)�)�)�)�)r���r���r����s���``` r����_create_async_cb_wrapperz'AsyncExitStack._create_async_cb_wrapperv��s.��������� *�� *�� *�� *�� *�� *�� *��r���c�����������������������K����t����������|������������} �|j��������}|j��������}n/#�t����������$�r"�t ����������d|j����������d|j����������d�������������d�w�xY�w�||��������������d{V���}|����������������������||�������������|S�)z�Enters the supplied async context manager. If successful, also pushes its __aexit__ method as a callback and returns the result of the __aenter__ method. r����r����zC' object does not support the asynchronous context manager protocolN)rU���r8���r:���r����r����r/���r0����_push_async_cm_exitr����s��� r����enter_async_contextz"AsyncExitStack.enter_async_context|��s�������������2�h�h�� '��^�F��M�E�E���� '�� '�� '���U����U��U��1A��U��U��U�����"&� '� '������v�b�z�z�!�!�!�!�!�!��� � ��U�+�+�+�� s ����"��,Ac�����������������������t����������|������������} �|j��������}|����������������������||�������������n&#�t����������$�r�|����������������������|d�������������Y�nw�xY�w|S�)a#��Registers a coroutine function with the standard __aexit__ method signature. Can suppress exceptions the same way __aexit__ method can. Also accepts any object with an __aexit__ method (registering a call to the method instead of the object itself). F)rU���r:���r����r����r����r����s��� r����push_async_exitzAsyncExitStack.push_async_exit���sw���������:�:�� 8�"�,�K� � �$�$�T�;�7�7�7�7�� ��� 2�� 2�� 2��$�$�T�5�1�1�1�1�1� 2���� ��s����/�� A�Ac�����������������b������|�j���������|g|�R�i�|��}||_��������|����������������������|d�������������|S�)zfRegisters an arbitrary coroutine function and arguments. Cannot suppress exceptions. F)r����r����r����r����s��� r����push_async_callbackz"AsyncExitStack.push_async_callback���sK������ �6��5�h�N��N�N�N��N�N� ��%-� �!�� � ���6�6�6��r���c�������������������D���K����|�����������������������ddd��������������d{V����dS�r����)r:���r���s��� r���rs���zAsyncExitStack.aclose���s4�����������n�n�T�4��.�.�.�.�.�.�.�.�.�.�.r���c������������������^�����|�����������������������||������������}|����������������������|d�������������dS�)zLHelper to correctly register coroutine function to __aexit__ method.FN)r����r����r����s��� r���r����z"AsyncExitStack._push_async_cm_exit���s5��������7�7��G�D�D� �� � ���6�6�6�6�6r���c������������������� ���K����|�S�rA���r���r���s��� r���r8���zAsyncExitStack.__aenter__���s�����������r���c�����������������������K����|d���������d�u}t����������j����������������������d�����������fd�}d}d}|�j��������rv|�j�������������������������������������������\��}} �|r�||��}n�||����d�{V���}|rd}d}d}n6#��t����������j����������������������} �|| d���������|d����������������������d}| }Y�nxY�w|�j���������v|r2 �|d���������j��������} |d����������#�t ����������$�r�| |d���������_����������w�xY�w|o|S�)Nr���r����c������������������F������ �|�j���������}|�||u�rd�S�|�u�rn|}��||�_���������d�S�rA���r����r����s��� �r���r����z8AsyncExitStack.__aexit__.<locals>._fix_exception_context���r����r���FTr����r����)r���r����r����r����r����r����r����r�����cb_suppressr����r����r����s��� @r���r:���zAsyncExitStack.__aexit__���si����������"�1�~�T�1����L�N�N�1�%� � *�� *�� *�� *�� *� ���� ��"�� .��.�2�2�4�4�K�G�R� .���9�"$�"�k�"2�K�K�(*��K�(8�"8�"8�"8�"8�"8�"8�K���5�%)�N�$)�M�"4�K��� .�"%�,�.�.��&�&��q�'9�;�q�>�J�J�J� $� �-�������#��"�� .�$��� � ��(��N�6� �!�!�n�$�� �� �� �� �-6��A��*�� ������.��.s����A0��01B#�0C��CN)r.���r/���r0���r1���r����r����r����r����r����r����rs���r����r8���r:���r���r���r���r���r���e��s��������������� �� ���'��'���\�'��������\�� �����$�����$�����/��/��/�7��7��7������3/��3/��3/��3/��3/r���r���c��������������������2�����e�Zd�ZdZdd�Zd��Zd��Zd��Zd��ZdS�) r���aO��Context manager that does no additional processing. Used as a stand-in for a normal context manager, when a particular block of code is only sometimes used with a normal context manager: cm = optional_cm if condition else nullcontext() with cm: # Perform operation, using optional_cm if condition is True Nc�����������������������||�_���������d�S�rA�����enter_result)r���r��s��� r���rW���znullcontext.__init__���s������(����r���c�����������������������|�j���������S�rA���r��r���s��� r���r���znullcontext.__enter__���s������� � r���c�����������������������d�S�rA���r����r����excinfos��� r���r%���znullcontext.__exit__��r����r���c����������������������K����|�j���������S�rA���r��r���s��� r���r8���znullcontext.__aenter__��s����������� � r���c������������������� ���K����d�S�rA���r���r��s��� r���r:���znullcontext.__aexit__��s�����������r���rA���) r.���r/���r0���r1���rW���r���r%���r8���r:���r���r���r���r���r������sn�����������������)��)��)��)�!��!��!� �� �� �!��!��!� �� �� �� �� r���r���c��������������������$�����e�Zd�ZdZd��Zd��Zd��ZdS�)r���zHNon thread-safe context manager to change the current working directory.c������������������"�����||�_���������g�|�_��������d�S�rA���)�path�_old_cwd)r���r��s��� r���rW���zchdir.__init__��s�������� ��� � � r���c�����������������������|�j������������������������������t����������j�����������������������������������t����������j��������|�j���������������������d�S�rA���)r��r�����os�getcwdr���r��r���s��� r���r���zchdir.__enter__��s6������� ���R�Y�[�[�)�)�)� ��������r���c������������������\�����t����������j��������|�j��������������������������������������������������������d�S�rA���)r��r���r��r����r��s��� r���r%���zchdir.__exit__��s&������ ����"�"�$�$�%�%�%�%�%r���Nr����r���r���r���r���r�����sG��������������R�R�����������&��&��&��&��&r���r���)#r1���r4���r��r����r'����collectionsr���� functoolsr����typesr���r����__all__�ABCr���r ����objectr���rL���rQ���r[���rn���r ���r���r ���r���r����r���r���r���r����r���r���r���r���r���r���r����<module>r�����s������:��:�� � � � �� � � � �� � � � ����������������������������������*��*��*��*��*��*��*��*����������������S�W�������,���������#�'�������.���������v�������. �� �� �� �� �F�� �� �� � ?��?��?��?��?��?��?��?�0G!��G!��G!��G!��G!� ���G!��G!��G!�RG(��G(��G(��G(��G(� ���G(��G(��G(�T�����B�����B���������$�������2"��"��"��"��"�*��"��"��"�4<��<��<��<��<�,��<��<��<�$ �� �� �� �� �o�� �� �� � ���������o�������M��M��M��M��M�%��M��M��M�<Q9��Q9��Q9��Q9��Q9��Q9��Q9��Q9�jA(��A(��A(��A(��A(�� 6��A(��A(��A(�JH/��H/��H/��H/��H/�^�%@��H/��H/��H/�V �� �� �� �� �(�*E�� �� �� �6&��&��&��&��&�"��&��&��&��&��&r���