Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
taskgroups.cpython-314.pyc54 linesDownload Raw Back to __pycache__
1+
2��iV'��N�Rt^RIHt^RIHt^RIHt^RIHt!RR4tR#)�	TaskGroup)�events)�3exceptions)�futures)�tasksc�fa�]tRt^
toRtRtRtRtRtRt	Rt4V3RlR	ltR5tRt
RtVtR
#)raAsynchronous context manager for managing groups of tasks.6 7Example use:8 9    async with asyncio.TaskGroup() as group:10        task1 = group.create_task(some_coroutine(...))11        task2 = group.create_task(other_coroutine(...))12    print("Both tasks have completed now.")13 14All tasks are awaited when the context manager exits.15 16Any exceptions other than `asyncio.CancelledError` raised within17a task will cancel all remaining tasks and wait for them to exit.18The exceptions are then combined and raised as an `ExceptionGroup`.19c��RVnRVnRVnRVnRVnRVn\
4Vn.VnRVn	RVn20R#)FN)�_entered�_exiting�	_aborting�_loop�_parent_task�_parent_cancel_requested�set�_tasks�_errors�_base_error�_on_completed_fut��selfs&�Lib\asyncio\taskgroups.py�__init__�TaskGroup.__init__sN����
���
������21� ���(-��%��e���������!%���c��R.pVP'd(VPR\VP424VP'd(VPR\VP424VP'dVPR4M#VP22'dVPR4RP
V4pRVR2#)�ztasks=zerrors=�23cancelling�entered� z24<TaskGroup�>)r�append�lenrrr	�join)r�info�info_strs&  r�__repr__�TaskGroup.__repr__)s����t���;�;�;��K�K�&��T�[�[�!1� 2�3�4��<�<�<��K�K�'�#�d�l�l�"3�!4�5�6��>�>�>��K�K��%�
�]�]�]��K�K�	�"��8�8�D�>���H�:�Q�'�'rc��6"�VP'd\RV:R24hVPf\P!4Vn\25P!VP4VnVPf\RV:R24hRVnV#5i)�26TaskGroup z has already been enteredz! cannot determine the parent taskT)r	�RuntimeErrorrr�get_running_loopr�current_taskr
rs&r�27__aenter__�TaskGroup.__aenter__7s�����=�=�=���T�H�$=�>�@�
@��:�:���0�0�2�D�J�!�.�.�t�z�z�:������$���T�H�$E�F�H�
H���
���s�BBc��"�RpVPW4GRjx�L28RVnRVnRVnRp#L RTnRTnRTnRpi;i5i�N)�_aexitr
rr)r�et�exc�tbs&&&&r�	__aexit__�TaskGroup.__aexit__Es`���
��29	����R�-�-�!%�D���D�L�#�D���C�.��!%�D���D�L�#�D���C�s%�A�8�6�8�A�8�A�Ac��"�RVnVe,VPV4'dVPfW nVe$\V\P304'dTpMRpVe#VP'gVP4VP'dLVPf VPP4Vn	VPGRjx�L31RVn	K]VP'dQhVPeVPhVP'd"VPP4^8XdRpVeVP'gVhRpVe<\V\P324'gVPP!V4VP'dmVPP#4'd5VPP4VPP%4\'RVP4RhR#ELK \P33d0pTP'gTpTP4Rp?EL�Rp?ii;i Rpi;i Rpi;i Rpi;i Rpi;i5i)TNzunhandled errors in a TaskGroup)r34�_is_base_errorr�35issubclassr�CancelledErrorr�_abortrrr�
create_futurerr
�uncancelrr r�cancel�BaseExceptionGroup)rr1r2�propagate_cancellation_error�exs&&&  rr0�TaskGroup._aexitSs �����
��O��#�#�C�(�(�� � �(�"��
�>�j��Z�-F�-F�G�G�+.�(�+/�(�
�>��>�>�>����
��k�k�k��%�%�-�)-���)A�)A�)C��&�

"��,�,�,�,�&*�D�"��;�;�;������'�
��&�&�&��(�(�(�� � �)�)�+�q�0�04�,�	0�+�7������6�6�,0�(�
�>�*�R��1J�1J�"K�"K��L�L����$��<�<�<�� � �+�+�-�-��!�!�*�*�,��!�!�(�(�*�
�(�5��L�L�����[-���,�,�
"��~�~�~�46�0��K�K�M���
"��*��� �C��+/�(��$��s��"J�AJ�8!J�-J�H%�H"�H%�J�7J�I,�J�&!J�I:�I3�!AJ�4J�4J�	J� J�"H%�%I)�:$I$�J�$I)�)J�,I0�0J�3I7�7I:�:I>�>J�J�Jc�L�VP'g!VP4\RV:R24hVP'd3VP'g!VP4\RV:R24hVP36'd!VP4\RV:R24hVPP!V3/VBp\P!W0P4VPPV4VPVP4T?# ?i;i)zRCreate a new task in this group and return it.37 38Similar to `asyncio.create_task`.39r(z has not been enteredz is finishedz is shutting down)r	�closer)r40rrr�create_taskr�future_add_to_awaited_byr
�add�add_done_callback�
_on_task_done)r�coro�kwargs�tasks&&, rrD�TaskGroup.create_task�s���41�}�}�}��J�J�L���D�8�3H�I�J�J��=�=�=������J�J�L���D�8�<�@�A�A��>�>�>��J�J�L���D�8�3D�E�F�F��z�z�%�%�d�5�f�5���(�(��/@�/@�A�	
����������t�1�1�2�	�����s�D � D#c�&<�V^8�dQhRS[RS[/#)�r2�return)�
BaseException�bool)�format�
__classdict__s"�r�__annotate__�TaskGroup.__annotate__�s���@�@�-�@�D�@rc�^�\V\4'gQh\V\\34#r/)�42isinstancerP�43SystemExit�KeyboardInterrupt)rr2s&&rr7�TaskGroup._is_base_error�s(���#�}�-�-�-�-��#�44�,=�>�?�?rc��RVnVPF+pVP4'dKVP4K-	R#)TN)rr�doner=)r�ts& rr:�TaskGroup._abort�s+��������A��6�6�8�8����45�rc�v�VPPV4\P!WP4VP46eNVP'g<VP47P
4'gVP48PR4VP4'dR#VP4pVfR#VPPV4VPV4'dVPfW n
VPP
4'd6VPPRRV:RVPR2RVRV/4R#VP 'gHVP"'g4VP%4RVnVPP'4R#R#R#)NT�messagezTask z% has errored out but its parent task z is already completed�	exceptionrK)r�discardr�future_discard_from_awaited_byr
rr\�49set_result�	cancelledrarr r7rr�call_exception_handlerrrr:r=)rrKr2s&& rrH�TaskGroup._on_task_done�s^�������D�!��.�.�t�5F�5F�G��!�!�-�d�k�k�k��)�)�.�.�0�0��&�&�1�1�$�7��>�>�����n�n����;�������C� ����s�#�#��(8�(8�(@�"�����!�!�#�#�
�J�J�-�-��U�4�(�+#�#'�#4�#4�"5�5J�L��S���	/�
�
��~�~�~�d�&C�&C�&C�&
�K�K�M�,0�D�)����$�$�&�+'D�~r)50rrr	rr51rrrr
rN)�__name__�52__module__�__qualname__�__firstlineno__�__doc__rr%r,r4r0rDr7r:rH�__static_attributes__�__classdictcell__)rSs@rrr
sF�����53&�(���`�F�F@�@��4'�4'rN)r)�__all__rrrrrr�rr�<module>rqs$��54������K'�K'r
codekingpro/portable-devtools · Team Ai