Your IP : 3.16.130.96


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

�

�Q�f��
��gd�ZddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZmZmZddlmZdd	lmZdd
lmZddlmZ	ddlmZd
Zej1d�d�Zej6eje�dD�cgc]}eei|�����c}Zd�ZeD]Z ej6e e��[ [Gd�de!�Z"difd�Z#d�Z$Gd�de%�Z&d�Z'd�Z(Gd�de!�Z)Gd�de!�Z*e
jVe
jXfe
jZe
j\fd �Z/Gd!�d"e!�Z0Gd#�d$e1�Z2Gd%�d&e!�Z3d'�Z4ifd(�Z5		dbd)�Z6Gd*�d+e!�Z7Gd,�d-e!�Z8dcd.�Z9Gd/�d0e3�Z:Gd1�d2e3�Z;Gd3�d4e;�Z<Gd5�d6e3�Z=Gd7�d8e3�Z>Gd9�d:e3�Z?Gd;�d<e3�Z@e5d=d>�ZAGd?�d@eA�ZBe5dAdB�ZCdCdDieC_De5dEdF�ZEe5dGdH�ZFdIdIdIdDdDdJ�eF_DGdK�dGeF�ZGGdL�dMe0�ZHeHj7dNej��eHj7dOej��eHj7dPej�e=�eHj7dQej�e;�eHj7dRej�e;�eHj7dSej�e;�eHj7dTej�e;�eHj7dUej�e<�eHj7dVej�e>�eHj7dWej�eG�eHj7dXeReB�eHj7dYeSeC�eHj7d-e8e@�eHj7dZe9eE�eHj7d+e7e?�eHj7dDe:d�[�eHj7dId�\�er!Gd]�d^�ZTGd_�d`e)�ZUGda�de0�ZVyy#e$rdZY���wxYwcc}w)d)�BaseManager�SyncManager�	BaseProxy�Token�N)�getpid)�
format_exc�)�
connection)�	reduction�get_spawning_popen�ProcessError)�pool)�process)�util)�get_context)�
shared_memoryT�SharedMemoryManagerFc�Z�tj|j|j�ffS�N)�array�typecode�tobytes)�as �?/opt/alt/python312/lib64/python3.12/multiprocessing/managers.py�reduce_arrayr/s ���;�;����Q�Y�Y�[�1�1�1�)�items�keys�valuesc�&�tt|�ffSr)�list��objs r�rebuild_as_listr$4s���$�s�)���rc�,�eZdZdZdZd�Zd�Zd�Zd�Zy)rz3
    Type to uniquely identify a shared object
    ��typeid�address�idc�0�|||c|_|_|_yrr&)�selfr'r(r)s    r�__init__zToken.__init__Ds��06���,���d�l�D�Grc�H�|j|j|jfSrr&�r+s r�__getstate__zToken.__getstate__Gs�����T�\�\�4�7�7�3�3rc�.�|\|_|_|_yrr&�r+�states  r�__setstate__zToken.__setstate__Js��/4�,���d�l�D�Grc��|jj�d|j�d|j�d|j�d�S)Nz(typeid=z
, address=z, id=�))�	__class__�__name__r'r(r)r.s r�__repr__zToken.__repr__Ms-�����'�'����d�l�l�D�G�G�M�	MrN)	r7�
__module__�__qualname__�__doc__�	__slots__r,r/r3r8�rrrr>s$���,�I�E�4�5�Mrrr=c�x�|j||||f�|j�\}}|dk(r|St||��)zL
    Send a message to manager using connection `c` and return response
    �#RETURN)�send�recv�convert_to_error)�cr)�
methodname�args�kwds�kind�results       r�dispatchrIUsB���F�F�B�
�D�$�'�(��6�6�8�L�D�&��y���
�
�4��
(�(rc	���|dk(r|S|dvrSt|t�s%tdj||t	|����|dk(rtd|z�St|�St
dj|��S)N�#ERROR)�
#TRACEBACK�#UNSERIALIZABLEz.Result {0!r} (kind '{1}') type is {2}, not strrMzUnserializable message: %s
zUnrecognized message type {!r})�
isinstance�str�	TypeError�format�type�RemoteError�
ValueError)rGrHs  rrBrB_s����x���
�	
�2�	2��&�#�&��@�G�G��D�$�v�,�0�1�
1��$�$��=��F�G�G��v�&�&��:�A�A�$�G�H�Hrc��eZdZd�Zy)rSc�>�dt|jd�zdzS)NzM
---------------------------------------------------------------------------
rzK---------------------------------------------------------------------------)rOrEr.s r�__str__zRemoteError.__str__os��$�s�4�9�9�Q�<�'8�8�6�A�BrN)r7r9r:rWr=rrrSrSns��CrrSc�|�g}t|�D]+}t||�}t|�s�|j|��-|S)z4
    Return a list of names of methods of `obj`
    )�dir�getattr�callable�append)r#�temp�name�funcs    r�all_methodsr`vs=���D��C����s�D�!���D�>��K�K�����Krc�P�t|�D�cgc]
}|ddk7s�|��c}Scc}w)zP
    Return a list of names of methods of `obj` which do not start with '_'
    r�_)r`)r#r^s  r�public_methodsrc�s-��)��-�@�-�T��a��C��D�-�@�@��@s�
#�#c��eZdZdZgd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
ee
ed�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�ServerzM
    Server class which runs in a process controlled by a manager object
    )	�shutdown�create�accept_connection�get_methods�
debug_info�number_of_objects�dummy�incref�decrefc�z�t|t�s$tdj|t	|����||_t
j|�|_t|\}}||d��|_
|jj|_ddi|_i|_
i|_tj �|_y)Nz&Authkey {0!r} is type {1!s}, not bytes�)r(�backlog�0�Nr=)rN�bytesrPrQrR�registryr�AuthenticationString�authkey�listener_client�listenerr(�	id_to_obj�id_to_refcount�id_to_local_proxy_obj�	threading�Lock�mutex)r+rur(rw�
serializer�Listener�Clients       rr,zServer.__init__�s����'�5�)��8�?�?��T�'�]�,�-�
-�!��
��3�3�G�<���*�:�6���&�!��#�>��
��}�}�,�,����z�*��� ���%'��"��^�^�%��
rc��tj�|_|tj�_	tj|j��}d|_|j�	|jj�s6|jjd�|jj�s�6tjtj k7rGt#j$d�tj t_tj&t_tj*d�y#ttf$rY��wxYw#tjtj k7rGt#j$d�tj t_tj&t_tj*d�wxYw)z(
        Run the server forever
        )�targetTr	zresetting stdout, stderrrN)r}�Event�
stop_eventr�current_process�_manager_server�Thread�accepter�daemon�start�is_set�wait�KeyboardInterrupt�
SystemExit�sys�stdout�
__stdout__r�debug�
__stderr__�stderr�exit)r+r�s  r�
serve_foreverzServer.serve_forever�s ��$�/�/�+���48����!�1�	� �'�'�t�}�}�=�H�"�H�O��N�N��
��/�/�0�0�2��O�O�(�(��+��/�/�0�0�2�
�z�z�S�^�^�+��
�
�5�6� �^�^��
� �^�^��
��H�H�Q�K��&�z�2�
��
���z�z�S�^�^�+��
�
�5�6� �^�^��
� �^�^��
��H�H�Q�K�s+�7E�,AD:�:E�	E�E�E�A?Gc���		|jj�}tj|j
|f��}d|_|j��U#t$rY�awxYw)NT�r�rE)ry�accept�OSErrorr}r��handle_requestr�r�)r+rC�ts   rr�zServer.accepter�sa���
��M�M�(�(�*��� � ��(;�(;�1�$�G�A��A�H�
�G�G�I����
��
�s�A�	A#�"A#c��d}	tj||j�tj||j�|j	�}|\}}}}t||�}	||g|��i|��}d|f}		|j|	�y#t$rdt�f}	Y�*wxYw#t$rdt�f}	Y�EwxYw#t$rx}
	|jdt�f�n#t$rYnwxYwtjd|	�tjd|�tjd|
�Yd}
~
yd}
~
wwxYw)Nr?rLzFailure to send message: %rz ... request was %r� ... exception was %r)r
�deliver_challengerw�answer_challengerArZ�	Exceptionrr@r�info)r+rC�request�ignore�funcnamerErFr_rH�msg�es           r�_handle_requestzServer._handle_request�s2����	*��(�(��D�L�L�9��'�'��4�<�<�8��f�f�h�G�+2�(�F�H�d�D��4��*�D�
*��a�/�$�/�$�/��!�&�)��		2�
�F�F�3�K��
�
3�#�Z�\�2��
3���	/����.�C�	/���	2�
�����j�l�3�4���
��
���I�I�3�S�9��I�I�+�W�5��I�I�-�q�1�1��	2�s[�A#B&�(B�9C�B#�"B#�&B>�=B>�	E�C'�&D=�'	C3�0D=�2C3�3AD=�=Ec��	|j|�|j�y#t$rY�wxYw#|j�wxYw)z)
        Handle a new connection
        N)r�r��close�r+�conns  rr�zServer.handle_request�s@��	�� � ��&�

�J�J�L��	�	��	��
�J�J�L�s�$�	0�3�0�3�Ac�$�tjdtj�j�|j
}|j}|j}|jj�s�	dx}}|�}|\}}}	}
	||\}}}||vrtd|�dt|��d|����t||�}	||	i|
��}|xr|j|d�}|r4|j!|||�\}}t#||j$|�}d||ff}nd|f}			|�|jj�s��yy#t$r.}
	|j|\}}}n#t$r|
�wxYwYd}
~
��d}
~
wwxYw#t&$r}d|f}Yd}~�sd}~wwxYw#t$rQ�
d	t)�f}n?	|j*|}|||g	��i
��}d|f}n#t&$rd	t)�f}YnwxYwY��t,$rKtjd
tj�j�t/j0d�Y��&t&$rd	t)�f}Y��=wxYw#t&$r|dt)�f�Y��UwxYw#t&$r�}tj2d
tj�j�tj2d�tj2d|�|j5�t/j0d�Yd}~���d}~wwxYw)zQ
        Handle requests from the proxies in a particular process/thread
        z$starting server thread to service %rNzmethod z of z object is not in exposed=�#PROXYr?rKrLz$got EOF -- exiting thread serving %rrrMzexception in thread serving %rz ... message was %rr�r	)rr�r}�current_threadr^rAr@rzr�r��KeyErrorr|�AttributeErrorrRrZ�getrgrr(r�r�fallback_mapping�EOFErrorr�r�r�r�)r+r�rAr@rzrDr#r��identrErF�exposed�	gettypeid�ke�function�resr'�rident�rexposed�tokenr�r��
fallback_funcrHs                        r�serve_clientzServer.serve_client�s��	
�
�
�9��+�+�-�2�2�	4��y�y���y�y���N�N�	��/�/�(�(�*�5
3�#'�'�
�S��&��07�-��z�4��!�.7��.>�+�C��)��W�,�(�#�T�#�Y��9���
#�3�
�3��/�"�D�1�D�1�C�'�J�9�=�=��T�+J�F��+/�;�;�t�V�S�+I�(��� %�f�d�l�l�F� C��'�(�E�):�;��(�#�.��.
�<���I�w�/�/�(�(�*�� �!�!� �6�6�u�=�0��W�i��#�!� ��!��'0��!��"!�(�#�Q�-�C��(��"�
;��%�'���6�C�;�(,�(=�(=�j�(I�
�!.� �$��s�"�59�"�=A�"�� )�&�1���$�;�+�Z�\�:��;���
��
�
�A�$�3�3�5�:�:�<�������
3�#�Z�\�2��
3��!�<��+�Z�\�:�;�<���
��	�	�:�!�0�0�2�7�7�9��	�	�/��5��	�	�1�1�5��
�
���������

�s��2F�	D<�-F�<E6�AF�I�<	E3�E�E.�E&�&E.�)F�.E3�3F�6	F
�?F�F�F
�
F�I�)"G�I�G$�!I�#G$�$I�)AI�;I�I�I5�1I8�4I5�5I8�8	L�BL
�
Lc��|Srr=�r+r�r�r#s    r�fallback_getvaluezServer.fallback_getvalue?s���
rc��t|�Sr�rOr�s    r�fallback_strzServer.fallback_strBs���3�x�rc��t|�Sr)�reprr�s    r�
fallback_reprzServer.fallback_reprEs���C�y�r)rWr8�	#GETVALUEc��yrr=�r+rCs  rrlzServer.dummyNs��rc
�r�|j5g}t|jj��}|j	�|D]K}|dk7s�	|jd|�d|j|�dt
|j|d�dd����Mdj|�cddd�S#1swYyxYw)	zO
        Return some info --- useful to spot problems with refcounting
        rrz  z:       refcount=z
    rN�K�
)	rr!r{r�sortr\rOrz�join)r+rCrHrr�s     rrjzServer.debug_infoQs���
�Z�Z��F���+�+�0�0�2�3�D��I�I�K����C�<��M�M�#(�$�*=�*=�e�*D�#&�t�~�~�e�'<�Q�'?�#@��"�#E�#G�H��
�9�9�V�$�		%�		%�Z�Z�s�AB-�AB-�-B6c�,�t|j�S)z*
        Number of shared objects
        )�lenr{r�s  rrkzServer.number_of_objectsas��
�4�&�&�'�'rc��	tjd�|jd�|j
j
�y#ddl}|j	�Y�3xYw#|j
j
�wxYw)z'
        Shutdown this process
        z!manager received shutdown message�r?NrN)rr�r@�	traceback�	print_excr��set)r+rCr�s   rrfzServer.shutdownhsZ��	"��J�J�:�;�
�F�F�$�%�

�O�O���!��		"�����!���O�O���!�s�&A�A�A�A:c	�n�|j5|j|\}}}}|�!|st|�dk7rtd��|d}	n||i|��}	|�t	|	�}|�Kt|t�s$tdj|t|����t|�t|�z}dt|	�z}
tjd||
�|	t|�|f|j|
<|
|j vrd|j |
<ddd�|j#|
�|
t%�fS#1swY�(xYw)z>
        Create a new shared object and return its id
        Nr	z4Without callable, must have one non-keyword argumentrz,Method_to_typeid {0!r}: type {1!s}, not dictz%xz&%r callable returned object with id %r)rrur�rTrcrN�dictrPrQrRr!r)rr�r�rzr{rm�tuple)r+rCr'rErFr[r��method_to_typeid�	proxytyper#r�s           rrgz
Server.createusE���Z�Z��m�m�F�+�
;�H�g�/�����C��I��N�$�N�P�P��1�g����-��-����(��-���+�!�"2�D�9�#�F�M�M�,�d�3C�.D�F�G�G��w�-�$�/?�*@�@���2�c�7�N�E��J�J�?���O�%(�#�g�,�8H�$I�D�N�N�5�!��D�/�/�/�-.��#�#�E�*�7�:	
���A�u���e�G�n�$�$�=�Z�s�C7D+�+D4c�L�t|j|jd�S)zL
        Return the methods of the shared object indicated by token
        r	)r�rzr))r+rCr�s   rrizServer.get_methods�s!���T�^�^�E�H�H�-�a�0�1�1rc�z�|tj�_|jd�|j	|�y)z=
        Spawn a new thread to serve this connection
        r�N)r}r�r^r@r�)r+rCr^s   rrhzServer.accept_connection�s0��+/�	� � �"�'�	��� �!����!�rc�F�|j5	|j|xxdz
cc<ddd�y#t$r\}||jvrBd|j|<|j||j|<tjd|�n|�Yd}~�id}~wwxYw#1swYyxYw)Nr	z&Server re-enabled tracking & INCREF %r)rr{r�r|rzrr�)r+rCr�r�s    rrmz
Server.incref�s���
�Z�Z�

��#�#�E�*�a�/�*��Z���
�
�D�6�6�6�12�D�'�'��.��2�2�5�9��N�N�5�)��J�J�G��O��H�P��
���Z�s,�B�/�	B�AB�
B�B�B�B c	�l�||jvr%||jvrtjd|�y|j5|j|dkr6tdj
||j||j|���|j|xxdzcc<|j|dk(r
|j|=ddd�||jvrHd|j|<tjd|�|j5|j|=ddd�yy#1swY�`xYw#1swYyxYw)NzServer DECREF skipping %rrz+Id {0!s} ({1!r}) has refcount {2:n}, not 1+r	)Nr=Nzdisposing of obj with id %r)r{r|rr�r�AssertionErrorrQrz)r+rCr�s   rrnz
Server.decref�s����+�+�+��T�/�/�/��J�J�2�E�:��
�Z�Z��"�"�5�)�Q�.�$�A�H�H��t�~�~�e�4��+�+�E�2�4�5�5�
����&�!�+�&��"�"�5�)�Q�.��'�'��.����+�+�+�%5�D�N�N�5�!��J�J�4�e�<�����N�N�5�)���,��Z��$��s�A?D�D*�D'�*D3N)r7r9r:r;�publicr,r�r�r�r�r�r�r�r�r�rlrjrkrfrgrirhrmrnr=rrrere�s���N�F�&�$�,�2�<
�O�b���� �%�
��
�%� (�"�"%�H2���"*rrec��eZdZdgZdZdZdZy)�State�valuerr	�N)r7r9r:r<�INITIAL�STARTED�SHUTDOWNr=rrr�r��s���	�I��G��G��Hrr�)�pickle�	xmlrpclibc��eZdZdZiZeZ		ddd�d�Zd�Zd�Z	dd�Z
e	dd	��Zd
�Z
dd�Zd�Zd
�Zd�Zd�Zed��Zed��Ze		dd��Zy)rz!
    Base class for managers
    Ng�?)�shutdown_timeoutc�P�|�tj�j}||_tj|�|_t
�|_tj|j_	||_
t|\|_|_
|xs
t�|_||_yr)rr�rw�_addressrv�_authkeyr��_stater�r��_serializerrx�	_Listener�_Clientr�_ctx�_shutdown_timeout)r+r(rwr��ctxr�s      rr,zBaseManager.__init__�s~���?��-�-�/�7�7�G���
��4�4�W�=��
��g���!�M�M�����%���'6�z�'B�$������(�;�=��	�!1��rc���|jjtjk7r�|jjtjk(rtd��|jjtjk(rtd��tdj|jj���t|j|j|j|j�S)zX
        Return server object with serve_forever() method and address attribute
        �Already started server�Manager has shut down�Unknown state {!r})
r�r�r�r�r�r
r�rQre�	_registryr�r�r�r.s r�
get_serverzBaseManager.get_server�s����;�;����
�
�-��{�{� � �E�M�M�1�"�#;�<�<����"�"�e�n�n�4�"�#:�;�;�"�(�/�/����0A�0A�B�D�D��d�n�n�d�m�m��m�m�T�%5�%5�7�	7rc���t|j\}}||j|j��}t	|dd�t
j|j_y)z>
        Connect manager object to the server process
        �rwNrl)	rxr�r�r�rIr�r�r�r�)r+r�r�r�s    r�connectzBaseManager.connectsI��+�4�+;�+;�<���&��d�m�m�T�]�]�;����t�W�%�!�M�M����rc
��|jjtjk7r�|jjtjk(rtd��|jjtjk(rtd��tdj|jj���|�t|�std��tjd��\}}|jjt|�j|j |j"|j$|j&|||f��|_d	j+d
�|j(j,D��}t|�j.dz|z|j(_|j(j3�|j5�|j7�|_|j5�tj|j_t9j:|t|�j<|j(|j"|j$|j|j>|j@fd�
�|_!y)z@
        Spawn a server process for this manager object
        r�r�r�Nzinitializer must be a callableF)�duplexr��:c3�2K�|]}t|����y�wrr�)�.0�is  r�	<genexpr>z$BaseManager.start.<locals>.<genexpr>0s����A�)@�A��Q��)@�s��-r�rE�exitpriority)"r�r�r�r�r�r
r�rQr[rPr
�Piper��ProcessrR�_run_serverr�r�r�r��_processr��	_identityr7r^r�r�rAr�Finalize�_finalize_managerr�r�rf)r+�initializer�initargs�reader�writerr�s      rr�zBaseManager.starts����;�;����
�
�-��{�{� � �E�M�M�1�"�#;�<�<����"�"�e�n�n�4�"�#:�;�;�"�(�/�/����0A�0A�B�D�D��"�8�K�+@��<�=�=�$����6�����	�	�)�)���:�)�)��.�.�$�-�-�����"�"�F�K��C�*���
�
���A����)@�)@�A�A��!�$�Z�0�0�C�7�%�?��
�
���
�
����	�������
��
�����"�M�M������
�
��$�t�*�.�.��-�-�����
�
�t�{�{��,�,�� 6� 6�8��	��
rc�T�tjtjtj�|�||�|j||||�}|j	|j
�|j
�tjd|j
�|j�y)z@
        Create a server, report its address and run it
        Nzmanager serving at %r)
�signal�SIGINT�SIG_IGN�_Serverr@r(r�rr�r�)	�clsrur(rwr�rrr�servers	         rrzBaseManager._run_serverBsz��	�
�
�f�m�m�V�^�^�4��"���"����X�w���D��	���F�N�N�#�����	
�	�	�)�6�>�>�:����rc��|j|j|j��}	t|dd|f|z|�\}}|j	�t||j|�|fS#|j	�wxYw)zP
        Create a new shared object; return the token and exposed tuple
        rNrg)r�r�r�rIr�r)r+r'rErFr�r)r�s       r�_createzBaseManager._createYsm��
�|�|�D�M�M�4�=�=�|�A��	�"�4��x�&��4���N�K�B���J�J�L��V�T�]�]�B�/��8�8��
�J�J�L�s�A(�(A:c��|j�>|jj|�|jj�sd|_yyy)zC
        Join the manager process (if it has been spawned)
        N)rr��is_alive�r+�timeouts  rr�zBaseManager.joinesA���=�=�$��M�M���w�'��=�=�)�)�+� $��
�,�%rc��|j|j|j��}	t|dd�|j	�S#|j	�wxYw)zS
        Return some info about the servers shared objects and connections
        rNrj�r�r�r�rIr�r�s  r�_debug_infozBaseManager._debug_infonsB���|�|�D�M�M�4�=�=�|�A��	��D�$��5��J�J�L��D�J�J�L���A�Ac��|j|j|j��}	t|dd�|j	�S#|j	�wxYw)z5
        Return the number of shared objects
        rNrkr&r�s  r�_number_of_objectszBaseManager._number_of_objectsxsC���|�|�D�M�M�4�=�=�|�A��	��D�$�(;�<��J�J�L��D�J�J�L�r(c���|jjtjk(r|j	�|jjtj
k7r�|jjtjk(rt
d��|jjtjk(rt
d��t
dj|jj���|S)NzUnable to start serverr�r�)	r�r�r�r�r�r�r
r�rQr.s r�	__enter__zBaseManager.__enter__�s����;�;����
�
�-��J�J�L��;�;����
�
�-��{�{� � �E�M�M�1�"�#;�<�<����"�"�e�n�n�4�"�#:�;�;�"�(�/�/����0A�0A�B�D�D��rc�$�|j�yr)rf�r+�exc_type�exc_val�exc_tbs    r�__exit__zBaseManager.__exit__�s���
�
�rc���|j��rtjd�	|||��}	t|dd�|j	�	|j|��|j�r�tjd�t|d�r�tjd�|j�|j|��|j�r7tjd	�|j�|j�tj|_	tj|=y#|j	�wxYw#t
$rY��wxYw#t$rYywxYw)
zQ
        Shutdown the manager process; will be registered as a finalizer
        z#sending shutdown message to managerrNrf)r$zmanager still alive�	terminatez'trying to `terminate()` manager processz#manager still alive after terminate)r"rr�rIr�r�r��hasattrr4�killr�r�r�r�_address_to_localr�)rr(rwr2r�r�r�s       rrzBaseManager._finalize_manager�s*���7�����I�I�;�<�
��w��8��!��T�4��4��J�J�L�
�G�L�L�!1�2��w���!��	�	�/�0��7�K�0��I�I�G�H�%�G�%�%�'� �G�L�L�)9�:�'�w�'�'�)��	�	�"G�H�$�����$������n�n���	��+�+�G�4��%�J�J�L���
��
��$�	��	�s:�
E�
E�E�.E%�E�E�	E"�!E"�%	E1�0E1c��|jSr)r�r.s rr(zBaseManager.address�s���}�}�rc�\���d|jvr|jj�|_��t�|xs
t	�dd�}|xs
t	�dd�}|r!t|j
��D]\}}�|||�f|j�<|r��fd�}	�|	_t|�|	�yy)z9
        Register a typeid with the manager type
        r�N�	_exposed_�_method_to_typeid_c�(��tjd��|j�g|��i|��\}}�||j||j|��}|j|j|j��}t|dd|jf�|S)Nz)requesting creation of a shared %r object��managerrwr�rrn)	rr�r r�r�r�r(rIr))	r+rErFr��exp�proxyr�r�r's	       ��rr]z"BaseManager.register.<locals>.temp�s�����
�
�F��O�)�T�\�\�&�@�4�@�4�@�
��s�!��4�+�+�T� �M�M�3����|�|�E�M�M�4�=�=�|�I����t�X����{�;��r)	�__dict__r��copy�	AutoProxyrZr!rr7�setattr)
rr'r[r�r�r��
create_method�keyr�r]s
 ` `      r�registerzBaseManager.register�s�����c�l�l�*��M�M�.�.�0�C�M���!�I��B�W�Y��T�B��+�J�"�9�.B�D�I�	��"�#3�#9�#9�#;�<�
��U�<�

�g�/��!��
�
�f���	
�#�D�M��C���&�r)NNr�Nrsr)NNNNT)r7r9r:r;r�rerr,r�rr��classmethodrr r�r'r*r,r2�staticmethodr�propertyr(rGr=rrrr�s�����I��G�>F��2�/2�2�
7�*�)�V�/1����,
9�%������ �� �D�����EI�6:�%'��%'rrc��eZdZd�Zd�Zy)�ProcessLocalSetc�2�tj|d��y)Nc�"�|j�Sr)�clearr"s r�<lambda>z*ProcessLocalSet.__init__.<locals>.<lambda>�s
��3�9�9�;r)r�register_after_forkr.s rr,zProcessLocalSet.__init__�s��� � ��'>�?rc��t|�dfSrs)rRr.s r�
__reduce__zProcessLocalSet.__reduce__�s���D�z�2�~�rN)r7r9r:r,rSr=rrrLrL�s
��@�rrLc��eZdZdZiZej�Z		dd�Zd�Z	difd�Z
d�Zd�Ze
d	��Zd
�Zd�Zd�Zd
�Zd�Zy)rz.
    A base for proxies of shared objects
    Nc��tj5tjj|jd�}|�;tj�t�f}|tj|j<ddd�d|_|d|_	||_
|jj|_||_
||_t|d|_||_|�t%j&|�|_nK|j�|jj(|_n#t%j*�j,|_|r|j/�tj0|tj2�y#1swY��xYw)Nrr	)r�_mutexr7r�r(r�ForkAwareLocalrL�_tls�_idset�_tokenr)�_id�_managerr�rxr��_owned_by_managerrrvr�r�rw�_increfrQ�_after_fork)	r+r�r�r>rwr�rm�
manager_owned�	tls_idsets	         rr,zBaseProxy.__init__�s+��
�
�
�!�3�3�7�7��
�
�t�L�I�� � �/�/�1�?�3D�D�	�=F�	�+�+�E�M�M�:�	��a�L��	�
 ��l�������;�;�>�>�����
�%���&�z�2�1�5���"/�����#�8�8��A�D�M�
�]�]�
&� �M�M�2�2�D�M�#�3�3�5�=�=�D�M���L�L�N�� � ��y�'<�'<�=�K�
�s�A(E<�<Fc��tjd�tj�j}tj�jdk7r$|dtj�jzz
}|j|jj|j��}t|dd|f�||j_
y)Nzmaking connection to manager�
MainThread�|rrh)rr�rr�r^r}r�r�rZr(r�rIrXr
)r+r^r�s   r�_connectzBaseProxy._connects����
�
�1�2��&�&�(�-�-���#�#�%�*�*�l�:��C�)�2�2�4�9�9�9�9�D��|�|�D�K�K�/�/����|�G����t�0�4�'�:�#��	�	�rr=c��	|jj}|j|j|||f�|j�\}}|dk(r|S|dk(r�|\}}|jj|jd}	|jj |_|	||j"|j|j$|��}
|j'|j |j$��}t)|dd|j*f�|
St-||��#t$r\tjdtj�j�|j�|jj}Y��awxYw)	zV
        Try to call a method of the referent and return a copy of the result
        z#thread %r does not own a connectionr?r����r=rNrn)rXr
r�rr�r}r�r^rer@r[rAr\r�r'rZr(r�r�r�rIr)rB)r+rDrErFr�rGrHr�r�r�r@s           r�_callmethodzBaseProxy._callmethod(s<��	(��9�9�'�'�D�	
�	�	�4�8�8�Z��t�4�5��y�y�{���f��9���M�
�X�
�#�N�G�U��
�
�/�/����=�b�A�I� �K�K�/�/�E�M���t�'�'�����
�
�w��E��<�<��
�
�t�}�}�<�E�D��T�4��E�H�H�;�7��L��t�V�,�,��-�	(��J�J�<� �/�/�1�6�6�
8��M�M�O��9�9�'�'�D�		(�s�D�A!E:�9E:c�$�|jd�S)z9
        Get a copy of the value of the referent
        r��rhr.s r�	_getvaluezBaseProxy._getvalueFs������,�,rc
��|jr+tjd|jj�y|j|jj|j��}t|dd|jf�tjd|jj�|jj|j�|jxr|jj}tj|tj |j|j||j"|j|j
fd��|_y)Nz%owned_by_manager skipped INCREF of %rrrmz	INCREF %r�
r)r]rr�rZr)r�r(r�rIr[rY�addr\r�rr�_decrefrX�_close)r+r�r2s   rr^zBaseProxy._increfLs����!�!��J�J�>������O���|�|�D�K�K�/�/����|�G����t�X����{�3��
�
�;������/���������!��
�
�6�$�-�-�"6�"6���m�m��)�#�#��+�+�t�}�}�e��)�)�T�[�[�$�,�,�8��	��rc�j�|j|j�|�|jtjk(rO	tjd|j�||j|��}t|dd|jf�n tjd|j�|s\t|d�rOtjdtj�j�|jj�|`yyy#t$r }tjd|�Yd}~��d}~wwxYw)Nz	DECREF %rrrnz... decref failed %sz%DECREF %r -- manager already shutdownr
z-thread %r has no more proxies so closing conn)�discardr)r�r�r�rr�r(rIr�r5r}r�r^r
r�)r�rwr2�tls�idsetr�r�r�s        rrozBaseProxy._decref`s���
�
�
�e�h�h���=�E�K�K�5�=�=�8�
6��
�
�;����1��u�}�}�g�>����t�X����{�;�

�J�J�>����I����l�3��J�J�F� �/�/�1�6�6�
8��N�N� � �"���	4�u���
6��
�
�1�1�5�5��
6�s�A
D	�		D2�D-�-D2c��d|_	|j�y#t$r"}tjd|z�Yd}~yd}~wwxYw)Nzincref failed: %s)r\r^r�rr�)r+r�s  rr_zBaseProxy._after_forkys<����
�	/��L�L�N���	/��I�I�)�A�-�.�.��	/�s��	A�A�Ac�
�i}t��|j|d<t|dd�r3|j|d<tt
|j|j|ffStt|�|j|j|ffS)Nrw�_isautoFr�)	rr�rZr:�RebuildProxyrCrZr�rR�r+rFs  rrSzBaseProxy.__reduce__�s�������+�"�m�m�D��O��4��E�*�"�n�n�D��O� �����T�-=�-=�t�D�F�
F�!��$�Z����d�.>�.>��E�G�
Grc�"�|j�Sr)rk)r+�memos  r�__deepcopy__zBaseProxy.__deepcopy__�s���~�~��rc�r�dt|�j|jjt	|�fzS)Nz<%s object, typeid %r at %#x>)rRr7rZr'r)r.s rr8zBaseProxy.__repr__�s3��.��T�
�#�#�T�[�[�%7�%7��D��B�C�	Crc�f�	|jd�S#t$rt|�dddzcYSwxYw)zV
        Return representation of the referent (or a fall-back if that fails)
        r8Nrgz; '__str__()' failed>)rhr�r�r.s rrWzBaseProxy.__str__�s=��	=��#�#�J�/�/���	=���:�c�r�?�%<�<�<�	=�s��0�0�NNNTF)r7r9r:r;r7r�ForkAwareThreadLockrVr,rerhrkr^rIror_rSr|r8rWr=rrrr�su�����
%�T�
%�
%�
'�F�26�HM�'>�R$�,.�B�-�<-��(����0/�G� �C�=rrc��ttj�dd�}|r||j|jk(rct	j
d|�d|d<|j|jvr0|j|j|j|j<|jdd�xr ttj�dd�}|||fd|i|��S)	z5
    Function used for unpickling proxy objects.
    r�Nz*Rebuild a proxy owned by manager, token=%rTr`rm�_inheritingF)
rZrr�r(rr�r)r|rz�pop)r_r�r�rFrrms      rrxrx�s����W�,�,�.�0A�4�
H�F�
�&�.�.�E�M�M�1��
�
�?��G� $��_���8�8�6�7�7�7�� � ����*�
�(�(����2�	
����4� �	E��G�+�+�-�}�e�D�D����z�9�&�9�D�9�9rc���t|�}	|||fS#t$rYnwxYwi}|D]}td|�d|�d�|��t|tf|�}||_||||f<|S)zB
    Return a proxy type whose methods are given by `exposed`
    zdef z:(self, /, *args, **kwds):
        return self._callmethod(z
, args, kwds))r�r��execrRrr:)r^r��_cache�dic�meth�	ProxyTypes      r�
MakeProxyTyper��s����G�n�G�
��t�W�o�&�&���
��
��
�C����6:�D�B�CF�	H���T�I�<��-�I�!�I��'�F�D�'�?���s��	 � c�p�t|d}|�4||j|��}	t|dd|f�}|j�|�|�|j}|�tj�j}td|jz|�}	|	||||||��}
d|
_
|
S#|j�wxYw)z*
    Return an auto-proxy for `token`
    r	Nrriz
AutoProxy[%s])r>rwrmr`T)rxr(rIr�r�rr�rwr�r'rw)r�r�r>rwr�rmr`r�r�r�r@s           rrCrC�s���
�j�)�!�,�G����u�}�}�g�6��	��t�T�=�5�(�C�G��J�J�L���7�.��"�"�����)�)�+�3�3���o����<�g�F�I��e�Z��'�#�=�
B�E��E�M��L��
�J�J�L�s�B#�#B5c��eZdZd�Zd�Zy)�	Namespacec�:�|jj|�yr)rA�updaterys  rr,zNamespace.__init__�s���
�
���T�"rc�&�t|jj��}g}|D]-\}}|jd�r�|j	|�d|����/|j�|jj�ddj|��d�S)Nrb�=�(�, r5)	r!rAr�
startswithr\r�r6r7r�)r+rr]r^r�s     rr8zNamespace.__repr__�sq���T�]�]�(�(�*�+���� �K�D�%��?�?�3�'����t�U�3�4�!�	
�	�	���>�>�2�2�D�I�I�d�O�D�DrN)r7r9r:r,r8r=rrr�r��s
��#�Err�c�8�eZdZdd�Zd�Zd�Zd�Zeee�Zy)�Valuec� �||_||_yr)�	_typecode�_value)r+rr��locks    rr,zValue.__init__�s��!�����rc��|jSr�r�r.s rr�z	Value.get�s���{�{�rc��||_yrr��r+r�s  rr�z	Value.set�s	����rc�f�t|�j�d|j�d|j�d�S)Nr�r�r5)rRr7r�r�r.s rr8zValue.__repr__�s!��!�$�Z�0�0�$�.�.�$�+�+�N�NrN�T)	r7r9r:r,r�r�r8rJr�r=rrr�r��s#�����O��S�#��Err�c�.�tj||�Sr)r)r�sequencer�s   r�Arrayr�s���;�;�x��*�*rc�.�eZdZdZd�Zd�Zd�Zd�Zd�Zy)�
IteratorProxy)�__next__r@�throwr�c��|Srr=r.s r�__iter__zIteratorProxy.__iter__����rc�&�|jd|�S)Nr�rj�r+rEs  rr�zIteratorProxy.__next__
s�����
�D�1�1rc�&�|jd|�S)Nr@rjr�s  rr@zIteratorProxy.sends�������-�-rc�&�|jd|�S)Nr�rjr�s  rr�zIteratorProxy.throw��������.�.rc�&�|jd|�S)Nr�rjr�s  rr�zIteratorProxy.closer�rN)	r7r9r:r:r�r�r@r�r�r=rrr�r�	s ��6�I��2�.�/�/rr�c�*�eZdZdZdd�Zd�Zd�Zd�Zy)�
AcquirerProxy)�acquire�releaseNc�8�|�|fn||f}|jd|�S�Nr�rj)r+�blockingr$rEs    rr�zAcquirerProxy.acquires'��%�o��{�H�g�3F�����	�4�0�0rc�$�|jd�S�Nr�rjr.s rr�zAcquirerProxy.release������	�*�*rc�$�|jd�Sr�rjr.s rr,zAcquirerProxy.__enter__r�rc�$�|jd�Sr�rjr.s    rr2zAcquirerProxy.__exit__ r�r)TN)r7r9r:r:r�r�r,r2r=rrr�r�s��&�I�1�+�+�+rr�c�.�eZdZdZdd�Zdd�Zd�Zdd�Zy)	�ConditionProxy)r�r�r��notify�
notify_allNc�(�|jd|f�S�Nr�rjr#s  rr�zConditionProxy.wait&��������
�3�3rc�(�|jd|f�S)Nr�rj)r+�ns  rr�zConditionProxy.notify(s������1�$�/�/rc�$�|jd�S)Nr�rjr.s rr�zConditionProxy.notify_all*s������-�-rc���|�}|r|S|�tj�|z}nd}d}|s<|�|tj�z
}|dkr	|S|j�|�}|s�<|S)Nr)�time�	monotonicr�)r+�	predicater$rH�endtime�waittimes      r�wait_forzConditionProxy.wait_for,s~�������M����n�n�&��0�G��G��H���"�"�T�^�^�%5�5���q�=���
�
�I�I�h���[�F�
��
rr)r	)r7r9r:r:r�r�r�r�r=rrr�r�$s��F�I�4�0�.�rr�c�*�eZdZdZd�Zd�Zd�Zdd�Zy)�
EventProxy)r�r�rOr�c�$�|jd�S)Nr�rjr.s rr�zEventProxy.is_setAs������)�)rc�$�|jd�S�Nr�rjr.s rr�zEventProxy.setC�������&�&rc�$�|jd�S)NrOrjr.s rrOzEventProxy.clearE�������(�(rNc�(�|jd|f�Sr�rjr#s  rr�zEventProxy.waitGr�rr)r7r9r:r:r�r�rOr�r=rrr�r�?s��2�I�*�'�)�4rr�c�T�eZdZdZd	d�Zd�Zd�Zed��Zed��Z	ed��Z
y)
�BarrierProxy)�__getattribute__r��abort�resetNc�(�|jd|f�Sr�rjr#s  rr�zBarrierProxy.waitMr�rc�$�|jd�S)Nr�rjr.s rr�zBarrierProxy.abortOr�rc�$�|jd�S)Nr�rjr.s rr�zBarrierProxy.resetQr�rc�&�|jdd�S)Nr�)�partiesrjr.s rr�zBarrierProxy.partiesSs����� 2�L�A�Arc�&�|jdd�S)Nr�)�	n_waitingrjr.s rr�zBarrierProxy.n_waitingVs����� 2�N�C�Crc�&�|jdd�S)Nr�)�brokenrjr.s rr�zBarrierProxy.brokenYs����� 2�K�@�@rr)r7r9r:r:r�r�r�rJr�r�r�r=rrr�r�KsR��>�I�4�)�)�
�B��B�
�D��D�
�A��Arr�c�"�eZdZdZd�Zd�Zd�Zy)�NamespaceProxy)r��__setattr__�__delattr__c�~�|ddk(rtj||�Stj|d�}|d|f�S)Nrrbrhr�)�objectr��r+rF�
callmethods   r�__getattr__zNamespaceProxy.__getattr__`sB���q�6�S�=��*�*�4��5�5��,�,�T�=�A�
��,�s�f�5�5rc��|ddk(rtj|||�Stj|d�}|d||f�S)Nrrbrhr�)r�r�r�)r+rFr�r�s    rr�zNamespaceProxy.__setattr__esE���q�6�S�=��%�%�d�C��7�7��,�,�T�=�A�
��-�#�u��6�6rc�~�|ddk(rtj||�Stj|d�}|d|f�S)Nrrbrhr�)r�r�r�r�s   rr�zNamespaceProxy.__delattr__jsA���q�6�S�=��%�%�d�C�0�0��,�,�T�=�A�
��-�#��0�0rN)r7r9r:r:r�r�r�r=rrr�r�^s��B�I�6�
7�
1rr�c�R�eZdZdZd�Zd�Zeee�Zee	j�Zy)�
ValueProxy)r�r�c�$�|jd�S)Nr�rjr.s rr�zValueProxy.getsr�rc�(�|jd|f�Sr�rjr�s  rr�zValueProxy.setus�������x�0�0rN)r7r9r:r:r�r�rJr�rH�types�GenericAlias�__class_getitem__r=rrr�r�qs.���I�'�1��S�#��E�#�E�$6�$6�7�rr��
BaseListProxy)�__add__�__contains__�__delitem__�__getitem__�__len__�__mul__�__reversed__�__rmul__�__setitem__r\�count�extend�index�insertr��remove�reverser��__imul__c��eZdZd�Zd�Zy)�	ListProxyc�,�|jd|f�|S)Nrrjr�s  r�__iadd__zListProxy.__iadd__�s������E�8�,��rc�,�|jd|f�|S)Nrrjr�s  rrzListProxy.__imul__�s������e�X�.��rN)r7r9r:rrr=rrr	r	�s���rr	�	DictProxy)r�r�r�r�r�rrOrBr�rrr��popitem�
setdefaultr�rr��Iterator�
ArrayProxy)r�r�r�	PoolProxy)�apply�apply_asyncr��imap�imap_unorderedr��map�	map_async�starmap�
starmap_asyncr4�AsyncResult)rrrrrc��eZdZd�Zd�Zy)rc��|Srr=r.s rr,zPoolProxy.__enter__�r�rc�$�|j�yr)r4r.s    rr2zPoolProxy.__exit__�s�����rN)r7r9r:r,r2r=rrrr�s���rc��eZdZdZy)ra(
    Subclass of `BaseManager` which supports a number of shared object types.

    The types registered are those intended for the synchronization
    of threads, plus `dict`, `list` and `Namespace`.

    The `multiprocessing.Manager()` function creates started instances of
    this class.
    N)r7r9r:r;r=rrrr�s��rr�Queue�
JoinableQueuer�r~�RLock�	Semaphore�BoundedSemaphore�	Condition�Barrier�Poolr!r�r�)r�rE)rEc�>�eZdZdZgfd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
y	)
�_SharedMemoryTrackerz+Manages one or more shared memory segments.c� �||_||_yr��shared_memory_context_name�
segment_names)r+r^r-s   rr,z_SharedMemoryTracker.__init__�s��.2�D�+�!.�D�rc��tjd|�dt����|jj	|�y)z6Adds the supplied shared memory block name to tracker.zRegister segment � in pid N)rr�rr-r\�r+�segment_names  r�register_segmentz%_SharedMemoryTracker.register_segment�s3���J�J�*�<�*:�(�6�8�*�M�N����%�%�l�3rc���tjd|�dt����|jj	|�tj|�}|j�|j�y)z�Calls unlink() on the shared memory block with the supplied name
            and removes it from the list of blocks being tracked.zDestroy segment r/N)	rr�rr-rr�SharedMemoryr��unlink)r+r1�segments   r�destroy_segmentz$_SharedMemoryTracker.destroy_segment�sX��
�J�J�)�,�)9��&�(��L�M����%�%�l�3�#�0�0��>�G��M�M�O��N�N�rc�N�|jddD]}|j|��y)z<Calls destroy_segment() on all tracked shared memory blocks.N)r-r7r0s  rr5z_SharedMemoryTracker.unlink�s%�� $� 2� 2�1� 5���$�$�\�2�!6rc��tjd|jj�dt	����|j�y)NzCall z.__del__ in )rr�r6r7rr5r.s r�__del__z_SharedMemoryTracker.__del__�s1���J�J��t�~�~�6�6�7�|�F�H�:�N�O��K�K�Mrc�2�|j|jfSrr+r.s rr/z!_SharedMemoryTracker.__getstate__�s���3�3�T�5G�5G�H�Hrc�"�|j|�yr)r,r1s  rr3z!_SharedMemoryTracker.__setstate__�s���D�M�M�5�!rN)r7r9r:r;r,r2r7r5r:r/r3r=rrr)r)�s,��5�/1�	/�	4�
	�	3�
	�	I�	"rr)c�R�eZdZejgd�zZd�Zd�Zd�Zd�Zd�Z	d�Z
y)	�SharedMemoryServer)�
track_segment�release_segment�
list_segmentsc��tj|g|��i|��|j}t|t�rtj|�}td|�dt����|_	tjdt����y)N�shm_rbz"SharedMemoryServer started by pid )rer,r(rNrt�os�fsdecoder)r�shared_memory_contextrr�)r+rE�kwargsr(s    rr,zSharedMemoryServer.__init__�sn���O�O�D�2�4�2�6�2��l�l�G��'�5�)��+�+�g�.��$�t�G�9�A�f�h�Z�%@�A�
�&��J�J�;�F�H�:�F�Grc��t|j|dd�r|j|d<tj|||g|��i|��S)z�Create a new distributed-shared object (not backed by a shared
            memory block) and return its id to be used in a Proxy Object.rg�_shared_memory_proxyrF)r5rurFrerg)r+rCr'rErGs     rrgzSharedMemoryServer.createsK���t�}�}�V�,�R�0�2H�I�26�2L�2L��.�/��=�=��q�&�B�4�B�6�B�Brc�b�|jj�tj||�S)zACall unlink() on all tracked shared memory, terminate the Server.)rFr5rerfr�s  rrfzSharedMemoryServer.shutdowns%���&�&�-�-�/��?�?�4��+�+rc�:�|jj|�y)z?Adds the supplied shared memory block name to Server's tracker.N)rFr2�r+rCr1s   rr?z SharedMemoryServer.track_segments���&�&�7�7��Erc�:�|jj|�y)z�Calls unlink() on the shared memory block with the supplied name
            and removes it from the tracker instance inside the Server.N)rFr7rLs   rr@z"SharedMemoryServer.release_segments��
�&�&�6�6�|�Drc�.�|jjS)zbReturns a list of names of shared memory blocks that the Server
            is currently tracking.)rFr-r�s  rrAz SharedMemoryServer.list_segments s���-�-�;�;�;rN)r7r9r:rer�r,rgrfr?r@rAr=rrr>r>�s6�����F�G��	H�	C�	,�
	F�	E�
	<rr>c�2�eZdZdZeZd�Zd�Zd�Zd�Z	d�Z
y)ra�Like SyncManager but uses SharedMemoryServer instead of Server.

        It provides methods for creating and returning SharedMemory instances
        and for creating a list-like object (ShareableList) backed by shared
        memory.  It also provides methods that create and return Proxy Objects
        that support synchronization across processes (i.e. multi-process-safe
        locks and semaphores).
        c���tjdk(rddlm}|j	�tj|g|��i|��tj|jj�dt����y)N�posixr	)�resource_trackerz created by pid )rDr^�rR�ensure_runningrr,rr�r6r7r)r+rErGrRs    rr,zSharedMemoryManager.__init__2s\���w�w�'�!�/� �/�/�1�� � ��7��7��7��J�J�$�.�.�1�1�2�2B�6�8�*�M�Nrc�p�tj|jj�dt	����y)Nz.__del__ by pid )rr�r6r7rr.s rr:zSharedMemoryManager.__del__>s'���J�J�$�.�.�1�1�2�2B�6�8�*�M�Nrc���|jjtjk7r�|jjtjk(rtd��|jjtjk(rtd��tdj|jj���|j|j|j|j|j�S)z@Better than monkeypatching for now; merge into Server ultimatelyz"Already started SharedMemoryServerz!SharedMemoryManager has shut downr�)
r�r�r�r�r�r
r�rQrr�r�r�r�r.s rr�zSharedMemoryManager.get_serverAs����{�{� � �E�M�M�1��;�;�$�$��
�
�5�&�'K�L�L��[�[�&�&�%�.�.�8�&�'J�K�K�&�,�3�3�D�K�K�4E�4E�F�H�H��<�<�����
�
� $�
�
�t�/?�/?�A�
Arc�,�|j|j|j��5}tjdd|��}	t|dd|jf�	ddd�|S#t$r}|j�|�d}~wwxYw#1swYSxYw)zoReturns a new SharedMemory instance with the specified size in
            bytes, to be tracked by the manager.rNT)rg�sizer?)	r�r�r�rr4rIr^�
BaseExceptionr5)r+rXr��smsr�s     rr4z SharedMemoryManager.SharedMemoryNs������d�m�m�T�]�]��C�t�#�0�0��d��N����T�4��3�8�8�+�F�D��J��%���J�J�L��G����	D��J�s)�B	�A&�&	B�/B�B�B	�	Bc�N�|j|j|j��5}tj|�}	t|dd|jjf�	ddd�|S#t$r!}|jj�|�d}~wwxYw#1swYSxYw)z�Returns a new ShareableList instance populated with the values
            from the input sequence, to be tracked by the manager.rNr?)
r�r�r�r�
ShareableListrI�shmr^rYr5)r+r�r��slr�s     rr\z!SharedMemoryManager.ShareableListZs������d�m�m�T�]�]��C�t�"�0�0��:����T�4��2�6�6�;�;�.�I�D��I��%���F�F�M�M�O��G����	D��I�s(�B�#A-�-	B�6B�B�B�B$N)r7r9r:r;r>rr,r:r�r4r\r=rrrr&s*��	�%��
	O�	O�	A�
	�
	rrr�)W�__all__r�r}rr�queuer�r�rDrr�rrSr
�contextrrr
rrrrr�	HAS_SHMEMr\�ImportErrorrrGrRrZ�
view_typesr$�	view_typer�rrIrBr�rSr`rcrer�r�r��XmlListener�	XmlClientrxrr�rLrrxr�rCr�r�r�r�r�r�r�r�r�r�r�r	r
r;r�
BasePoolProxyrrr r�r~r"r#r$r%r&r'r!r�r)r>r)r^s0r�<module>risX��A����
�����	�� ��@�@�����*���I��N�N�(�)�2��	���5�;�;��-�4M�
N�4M�D�d�$�7�2�t�$�&�'�4M�
N�
���I��I���y�/�2��
�z�M�F�M�.&(�b�)�
I�C�)�C�	�A�F*�V�F*�Z
�F���#�#�Z�%6�%6�7��)�)�:�+?�+?�@���t'�&�t'�t�c��m=��m=�f:�*)+��,8<�7<��:
E��
E�
�F�
�+�/�I�/�
+�I�
+��]��6	4��	4�A�9�A�&1�Y�1�&8��8��o�0��
��
��
�+�(�
�	��
� �	��
�<�*��
�
�k�,��
�
!��"�� �$�
� ��
��	�+�	����W�e�k�k�*����_�e�k�k�2����W�i�o�o�z�:����V�Y�^�^�]�;����W�i�o�o�}�=����[�)�"5�"5�}�E����'��)C�)C�"�$����[�)�"5�"5�~�F����Y�	� 1� 1�<�@����V�T�Y�Y�	�2����V�T�9�-����V�T�9�-����W�e�Z�0����W�e�Z�0����[�)�^�<����Z�=���N����]�%��8�
�""�""�J*<�V�*<�Z>�k�>�g
��]%���I���Os�O;�P	�;P�P

?>