AlkantarClanX12

Your IP : 18.222.163.134


Current Path : /opt/alt/python312/lib64/python3.12/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/multiprocessing/__pycache__/util.cpython-312.pyc

�

�Q�f�7��d�ddlZddlZddlZddlZddlZddlZddlmZddlm	Z	gd�Z
dZdZdZ
dZd	Zd
ZdZdadad
�Zd�Zd�Zd�Zd�Zd*d�Zd�Zd�Ze�Zd�Zd�Zej>�Z ejB�Z"d�Z#d�Z$iZ%ejB�Z&Gd�de'�Z(d*d�Z)d�Z*da+eee)e	jXe	jZfd�Z.ej^e.�Gd�de'�Z0Gd �d!ejb�Z2	ejfd"�Z4d$�Z6d%�Z7d&�Z8d'�Z9d(�Z:d)�Z;y#e5$rd#Z4Y�wxYw)+�N)�_args_from_interpreter_flags�)�process)�	sub_debug�debug�info�sub_warning�
get_logger�
log_to_stderr�get_temp_dir�register_after_fork�
is_exiting�Finalize�ForkAwareThreadLock�ForkAwareLocal�close_all_fds_except�SUBDEBUG�
SUBWARNING��
���multiprocessingz+[%(levelname)s/%(processName)s] %(message)sFc�N�trtjt|g|��ddi�yy�N�
stacklevel�)�_logger�logr��msg�argss  �;/opt/alt/python312/lib64/python3.12/multiprocessing/util.pyrr,s"������H�c�7�D�7�Q�7��c�N�trtjt|g|��ddi�yyr)rr�DEBUGr s  r#rr0s"������E�3�4��4�!�4�r$c�N�trtjt|g|��ddi�yyr)rr�INFOr s  r#rr4s"������D�#�3��3��3�r$c�N�trtjt|g|��ddi�yyr)rrrr s  r#r	r	8s"������J��9�d�9�q�9�r$c���ddl}|j�	ts�|jt�adt_t
td�r3tjt�tjt�nLtjjtdif�tjjtdif�|j�tS#|j�wxYw)z0
    Returns logger used by multiprocessing
    rN�
unregister�)�logging�_acquireLockr�	getLogger�LOGGER_NAME�	propagate�hasattr�atexitr+�_exit_function�register�
_exithandlers�remove�append�_releaseLock)r-s r#r
r
<s���
��������'�'��4�G� !�G���v�|�,��!�!�.�1�����/��$�$�+�+�^�R��,D�E��$�$�+�+�^�R��,D�E�	�����N��	����s�B5C!�!C3c���ddl}t�}|jt�}|j	�}|j|�|j
|�|r|j|�datS)zB
    Turn on logging and add a handler which prints to stderr
    rNT)
r-r
�	Formatter�DEFAULT_LOGGING_FORMAT�
StreamHandler�setFormatter�
addHandler�setLevel�_log_to_stderrr)�levelr-�logger�	formatter�handlers     r#rrWsb��
�
�\�F��!�!�"8�9�I��#�#�%�G�����#�
���g���������N��Nr$c�N�tjdk(ryttd�ryy)N�linuxT�getandroidapilevelF)�sys�platformr2r,r$r#�#_platform_supports_abstract_socketsrKls"��
�|�|�w����s�(�)��r$c��|syt|t�r|ddk(St|t�r|ddk(Std|�d���)NFr�zaddress type of z
 unrecognized)�
isinstance�bytes�str�	TypeError)�addresss r#�is_abstract_socket_namespacerStsN�����'�5�!��q�z�Q���	�G�S�	!��q�z�T�!�!�
�&�w�k��?�
@�@r$c�j�d�}|||��tj�}|�d|jd<yy)Nc�,�t|dt�s�y�Nr)�
issubclass�FileNotFoundError)�func�path�err_infos   r#�onerrorz!_remove_temp_dir.<locals>.onerror�s���(�1�+�'8�9��:r$)r\�tempdir)r�current_process�_config)�rmtreer]r\r^s    r#�_remove_temp_dirra�s>����7�G�$��-�-�/�O��"�-1����	�*�#r$c�0�tj�jjd�}|�fddl}ddl}|j
d��}td|�tdt|j|fd��|tj�jd<|S)Nr]rzpymp-)�prefixzcreated temp directory %si����)r"�exitpriority)rr^r_�get�shutil�tempfile�mkdtemprrrar`)r]rfrgs   r#rr�s����%�%�'�/�/�3�3�I�>�G�����"�"�'�"�2���
(�'�2�	��'�v�}�}�g�.F�"�	$�7>����!�)�)�)�4��Nr$c���ttj��}|j�|D]\\}}}}	||��y#t$r}td|�Yd}~�0d}~wwxYw)Nz after forker raised exception %s)�list�_afterfork_registry�items�sort�	Exceptionr)rl�index�identrY�obj�es      r#�_run_after_forkersrs�sa���$�*�*�,�-�E�	�J�J�L�%*�!����t�c�	8���I�&+���	8��3�Q�7�7��	8�s�A�	A%�A � A%c�H�|ttt�t|�|f<y�N)rk�next�_afterfork_counter�id)rqrYs  r#r
r
�s��EH���0�1�2�c�7�D�A�Br$c�N�eZdZdZdd�Zdeeejfd�Z	d�Z
d�Zd�Zy)	rzA
    Class which supports object finalization using weakrefs
    Nc�|�|�4t|t�s$tdj|t	|����|�tj||�|_n
|�td��||_	||_
|xsi|_|tt�f|_tj �|_|t$|j<y)Nz3Exitpriority ({0!r}) must be None or int, not {1!s}z+Without object, exitpriority cannot be None)rN�intrQ�format�type�weakref�ref�_weakref�
ValueError�	_callback�_args�_kwargsrv�_finalizer_counter�_key�os�getpid�_pid�_finalizer_registry)�selfrq�callbackr"�kwargsrds      r#�__init__zFinalize.__init__�s����$�j��c�.J��E�L�L� �$�|�"4�6�7�
7��?�#�K�K��T�2�D�M�
�
!��J�K�K�!�����
��|����!�4�(:�#;�<��	��I�I�K��	�)-��D�I�I�&r$c�r�	||j=|j|�k7r|d�d}nO|d|j|j|j�|j|ji|j��}dx|_x|_x|_x|_|_|S#t$r|d�YywxYw)zQ
        Run the callback unless it has already been called or cancelled
        z+finalizer ignored because different processNz/finalizer calling %s with args %s and kwargs %szfinalizer no longer registered)r�r�r�r�r�r��KeyError)r��wrr�rr��ress      r#�__call__zFinalize.__call__�s���	�#�D�I�I�.��y�y�F�H�$��G�H����K��.�.�$�*�*�d�l�l�D�$�d�n�n�d�j�j�A�D�L�L�A��7;�
<�D�M�
<�D�N�
<�T�Z�
<� �L�4�9��J���	8��6�7�	8�s�
B"�"B6�5B6c��	t|j=dx|_x|_x|_x|_|_y#t$rYywxYw)z3
        Cancel finalization of the object
        N)r�r�r�r�r�r�r��r�s r#�cancelzFinalize.cancel�sU��	<�#�D�I�I�.�
8<�
<�D�M�
<�D�N�
<�T�Z�
<� �L�4�9��	�	��	�s�7�	A�Ac�&�|jtvS)zS
        Return whether this finalizer is still waiting to invoke callback
        )r�r�r�s r#�still_activezFinalize.still_active�s���y�y�/�/�/r$c��	|j�}|�d|jjzSd|jj�dt|jd|j���}|jr|dt|j�zz
}|jr|dt|j�zz
}|jd�|dt|jd�zz
}|d	zS#ttf$rd}Y��wxYw)
Nz<%s object, dead>�<z object, callback=�__name__z, args=z	, kwargs=rz, exitpriority=�>)r��AttributeErrorrQ�	__class__r��getattrr�r�rPr�r�)r�rq�xs   r#�__repr__zFinalize.__repr__�s���	��-�-�/�C��;�&����)@�)@�@�@�����'�'�����
�D�N�N�C�
E���:�:�
��S����_�,�,�A��<�<�
��s�4�<�<�0�0�0�A��9�9�Q�<�#�
�"�S����1��%6�6�6�A��3�w����	�*�	��C�	�s�C(�(C<�;C<)r,NN)
r��
__module__�__qualname__�__doc__r�r�rr�r�r�r�r�r�r,r$r#rr�s3���.�&�&9�$�R�Y�Y�	�0
<�0�r$rc�|��t�y��d�}n�fd�}tt�D�cgc]
}||�s�|��}}|jd��|D].}tj|�}|��t	d|�	|��0��tj�yycc}w#t
$rddl}|j�Y�mwxYw)z�
    Run all finalizers whose exit priority is not None and at least minpriority

    Finalizers with highest priority are called first; finalizers with
    the same priority will be called in reverse order of creation.
    Nc��|dduSrVr,)�ps r#�<lambda>z!_run_finalizers.<locals>.<lambda>s
��q��t�4�'r$c�&��|dduxr|d�k\SrVr,)r��minprioritys �r#r�z!_run_finalizers.<locals>.<lambda>s���q��t�4�'�?�A�a�D�K�,?�?r$T)�reversez
calling %sr)	r�rjrmrerrn�	traceback�	print_exc�clear)r��f�key�keys�	finalizerr�s`     r#�_run_finalizersr�s�����"�	���'��?�� � 3�4�?�4�C��#��C�4�D�?��I�I�d�I����'�+�+�C�0�	�� ��l�I�.�
&���
����!�!�#���@���
&� ��#�#�%�
&�s�
B�B�5B�B;�:B;c�"�txstduS)z6
    Returns true if the process is shutting down
    N)�_exitingr,r$r#rr;s���'�x�4�'�'r$c�\�ts�da|d�|d�|d�|��u|�D]<}|js�|d|j�|jj	��>|�D]%}|d|j�|j��'|d�|�yy)NTzprocess shutting downz2running all "atexit" finalizers with priority >= 0rz!calling terminate() for daemon %szcalling join() for process %sz)running the remaining "atexit" finalizers)r��daemon�name�_popen�	terminate�join)rrr��active_childrenr^r�s      r#r4r4Cs�������
$�%�
�B�C������(�%�&���8�8��<�a�f�f�E��H�H�&�&�(�'�
%�&���4�a�f�f�=�����'�	�9�:���?r$c�$�eZdZd�Zd�Zd�Zd�Zy)rc���tj�|_|jj|_|jj|_t|tj�yru)�	threading�Lock�_lock�acquire�releaser
r�_at_fork_reinitr�s r#r�zForkAwareThreadLock.__init__tsC���^�^�%��
��z�z�)�)����z�z�)�)����D�"5�"E�"E�Fr$c�8�|jj�yru)r�r�r�s r#r�z#ForkAwareThreadLock._at_fork_reinitzs���
�
�"�"�$r$c�6�|jj�Sru)r��	__enter__r�s r#r�zForkAwareThreadLock.__enter__}s���z�z�#�#�%�%r$c�4�|jj|�Sru)r��__exit__)r�r"s  r#r�zForkAwareThreadLock.__exit__�s��"�t�z�z�"�"�D�)�)r$N)r�r�r�r�r�r�r�r,r$r#rrss��G�%�&�*r$rc��eZdZd�Zd�Zy)rc��t|d��y)Nc�6�|jj�Sru)�__dict__r�)rqs r#r�z)ForkAwareLocal.__init__.<locals>.<lambda>�s��s�|�|�/A�/A�/Cr$)r
r�s r#r�zForkAwareLocal.__init__�s
���D�"C�Dr$c��t|�dfS)Nr,)r}r�s r#�
__reduce__zForkAwareLocal.__reduce__�s���D�z�2�~�r$N)r�r�r�r�r�r,r$r#rr�s
��E�r$r�SC_OPEN_MAX�c���t|�dtgz}|j�|dtk(sJd��tt	|�dz
�D]$}tj||dz||dz��&y)N���zfd too larger)rj�MAXFDrm�range�lenr��
closerange)�fds�is  r#rr�si��
�s�)�r�5�k�
!�C��H�H�J��r�7�e��+�^�+��
�3�s�8�a�<�
 ��
�
�
�c�!�f�Q�h��A�a�C��)�!r$c��tj�y	tjj�	tjt
jt
j�}	t
|dd��t_y#ttf$rY�]wxYw#tj|��xYw#ttf$rYywxYw)Nzutf-8F)�encoding�closefd)	rI�stdin�close�OSErrorr�r��open�devnull�O_RDONLY)�fds r#�_close_stdinr��s���
�y�y���
��	�	����
�
�W�W�R�Z�Z����
-��	��R�'�5�A�C�I��

�Z� �
��
��	��H�H�R�L����Z� �
��
�s4�A=�2B-�%B�=B�B�B*�*B-�-B?�>B?c���	tjj�	tj
j�y#ttf$rY�1wxYw#ttf$rYywxYwru)rI�stdout�flushr�r��stderrr,r$r#�_flush_std_streamsr��s]��
��
�
����
��
�
�����
�J�'�
��
��
�J�'�
��
�s"�A�A�A�A�A'�&A'c��ddl}ddl}ttt	t
|���}t
j�\}}	|j||gd|dddddddd||dddddddd|j�t
j|�t
j|�S#t
j|�t
j|�wxYw)NrTr�F)�_posixsubprocess�
subprocess�tuple�sorted�mapr{r��pipe�	fork_exec�
_USE_VFORKr�)rZr"�passfdsr�r��errpipe_read�
errpipe_writes       r#�spawnv_passfdsr��s������F�3�s�G�,�-�.�G�"$�'�'�)��L�-� ��)�)��4�&�$���t���B��B��L�-��5�"�d�D�$��D��!�!�	#�	�����
������	�����
�����s�1B�,Cc�<�|D]}tj|��y)z/Close each file descriptor given as an argumentN)r�r�)r�r�s  r#�	close_fdsr��s����
�����r$c��ddlm}tj�ddlm}|jj�ddlm}|jj�t�|j�|j�y)zKCleanup multiprocessing resources when multiprocessing tests
    completed.r)�support)�
forkserver)�resource_trackerN)
�testr�r�_cleanuprr��_forkserver�_stopr��_resource_trackerr��
gc_collect�
reap_children)r�r�r�s   r#�_cleanup_testsr�sc�������+���� � �"�1��&�&�,�,�.����������r$ru)<r��	itertoolsrIr~r3r�r�r�r�__all__�NOTSETrr&r(rr0r<rrArrrr	r
rrKrS�abstract_sockets_supportedrar�WeakValueDictionaryrk�countrwrsr
r�r��objectrr�rr�r�r^r4r5r�localr�sysconfr�rnrr�r�r�r�rr,r$r#�<module>rs���
��
��
��3����
����
��	��
�
���F��
����8�5�4�:��6�*�A�A�B��
2��$2�g�1�1�3��$�Y�_�_�&��8�I���$�Y�_�_�&��S�v�S�l&$�X(����E�?�#*�#:�#:�#*�#:�#:�(�T������*�&�*�"�Y�_�_����B�J�J�}�%�E�*�
�.
�
 � ���Q���E��s�D%�%D/�.D/