+
     BiR              
       	   . RdOt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RI
Ht ^ RIHt ^RIHt ^RIHtHtHt ^R	IHt ^R
IHt ^RIHt ^RIHt  ^RIHt Rt] P5                  R4       R t]P:                  ! ]P                  ]4       Re U u. uF  p ]! ]! / V 4      ! 4       4      NK  	  up t R t!]  F  t"]P:                  ! ]"]!4       K  	  A"A  ! R R]#4      t$Rf/ 3R lt%R t& ! R R]'4      t(R t)R t* ! R R]#4      t+ ! R R]#4      t,R]PZ                  ]P\                  3R]P^                  ]P`                  3/t1 ! R  R ]#4      t2 ! R! R"]34      t4 ! R# R]#4      t5R$ t6/ 3R% lt7RgR& lt8 ! R' R(]#4      t9 ! R) R*]#4      t:RhR+ lt; ! R, R-]54      t< ! R. R/]54      t= ! R0 R1]=4      t> ! R2 R3]54      t? ! R4 R5]54      t@ ! R6 R7]54      tA ! R8 R9]54      tB]7! R:Ri4      tC ! R; R<]C4      tD]P                  P                  P;                  ]C4       ]7! R=Rj4      tGR>R?/]GnH         ! R@ RA]G4      tI]P                  P                  P;                  ]G4       ]7! RBRk4      tK ! RC RD]K4      tL]P                  P                  P;                  ]K4       ]7! RERl4      tM]7! RFRm4      tNRGRLRJRLRKRLRHR?RIR?/]NnH         ! RM RF]N4      tO ! RN R]24      tP]PP;                  RO]P                  4       ]PP;                  RP]P                  4       ]PP;                  RQ]P                  ]?4       ]PP;                  RR]P                  ]=4       ]PP;                  RS]P                  ]=4       ]PP;                  RT]P                  ]=4       ]PP;                  RU]P                  ]=4       ]PP;                  RV]P                  ]>4       ]PP;                  RW]P                  ]@4       ]PP;                  RX]P                  ]O4       ]PP;                  RY]Z]D4       ]PP;                  RZ][]I4       ]PP;                  R[]3]L4       ]PP;                  R*]:]B4       ]PP;                  R\];]M4       ]PP;                  R(]9]A4       ]PP;                  R?]<RR]7       ]PP;                  RLRR^7       ]'       d#    ! R_ R`4      t\ ! Ra Rb]+4      t] ! Rc R]24      t^R# R#   ] d    Rt ELHi ; iu up i )nBaseManagerSyncManager	BaseProxyTokenN)getpid)
format_exc)
connection)	reductionget_spawning_popenProcessError)pool)process)util)get_context)shared_memoryTSharedMemoryManagerFc                 Z    \         P                   V P                  V P                  4       33# N)arraytypecodetobytes)as   &//usr/lib/python3.14/multiprocessing/managers.pyreduce_arrayr   0   s     ;;QYY[111    c                 &    \         \        V 4      33# r   )listobjs   &r   rebuild_as_listr   5   s    $s)r   c                   @   a  ] tR t^?t o RtRtR tR tR tR t	Rt
V tR# )	r   z+
Type to uniquely identify a shared object
c                0    WVuV n         V n        V n        R # r   typeidaddressid)selfr#   r$   r%   s   &&&&r   __init__Token.__init__E   s    06,dlDGr   c                H    V P                   V P                  V P                  3# r   r"   r&   s   &r   __getstate__Token.__getstate__H   s    T\\47733r   c                0    Vw  V n         V n        V n        R # r   r"   r&   states   &&r   __setstate__Token.__setstate__K   s    /4,dlDGr   c                    V P                   P                  : R V P                  : RV P                  : RV P                  : R2# )z(typeid=z
, address=z, id=))	__class____name__r#   r$   r%   r*   s   &r   __repr__Token.__repr__N   s-    ''dllDGGM 	Mr   )r$   r%   r#   Nr"   )r5   
__module____qualname____firstlineno____doc__	__slots__r'   r+   r0   r6   __static_attributes____classdictcell____classdict__s   @r   r   r   ?   s-      ,IE45M Mr   c                    V P                  WW434       V P                  4       w  rVVR8X  d   V#  \        WV4      h  ?i ; i)zD
Send a message to manager using connection `c` and return response
#RETURN)sendrecvconvert_to_error)cr%   
methodnameargskwdskindresults   &&&&&  r   dispatchrL   V   sD     FFBD'(668LDyt,,s   ; >c           	         V R 8X  d   V# V R9   d_   \        V\        4      '       g%   \        RP                  W\	        V4      4      4      hV R8X  d   \        RV,          4      # \        V4      # \        RP                  V 4      4      # )#ERROR#UNSERIALIZABLEz.Result {0!r} (kind '{1}') type is {2}, not strzUnserializable message: %s
zUnrecognized message type {!r})
#TRACEBACKrO   )
isinstancestr	TypeErrorformattypeRemoteError
ValueError)rJ   rK   s   &&r   rE   rE   c   s    x	2	2&#&&@GG$v,01 1 $$=FGGv&&:AA$GHHr   c                   &   a  ] tR t^rt o R tRtV tR# )rV   c                V    R\        V P                  ^ ,          4      ,           R,           # )
zK---------------------------------------------------------------------------zM
---------------------------------------------------------------------------
)rR   rH   r*   s   &r   __str__RemoteError.__str__s   s    $s499Q<'886ABr    N)r5   r8   r9   r:   r[   r=   r>   r?   s   @r   rV   rV   r   s     C Cr   rV   c                    . p\        V 4       F2  p\        W4      p\        V4      '       g   K!  VP                  V4       K4  	  V# )z,
Return a list of names of methods of `obj`
)dirgetattrcallableappend)r   tempnamefuncs   &   r   all_methodsrf   z   s=     DCs!D>>KK  Kr   c                `    \        V 4       Uu. uF  q^ ,          R8w  g   K  VNK  	  up# u upi )zH
Return a list of names of methods of `obj` which do not start with '_'
_)rf   )r   rd   s   & r   public_methodsri      s-     )-@-TaCDD-@@@s   ++c                      a  ] tR t^t o Rt. ROtR tR tR tR t	R t
R tR tR	 tR
 tR]R]R]/tR tR tR tR tR tR tR tR tR tRtV tR# )ServerzE
Server class which runs in a process controlled by a manager object
c                   \        V\        4      '       g%   \        R P                  V\	        V4      4      4      hWn        \        P                  ! V4      V n        \        V,          w  rVV! V^R7      V n
        V P                  P                  V n        RR/V n        / V n        / V n        \        P                   ! 4       V n        R# )z&Authkey {0!r} is type {1!s}, not bytes)r$   backlog0NNr]   )rQ   bytesrS   rT   rU   registryr   AuthenticationStringauthkeylistener_clientlistenerr$   	id_to_objid_to_refcountid_to_local_proxy_obj	threadingLockmutex)r&   rq   r$   rs   
serializerListenerClients   &&&&&  r   r'   Server.__init__   s    '5))8??T'],- - !33G<*:6 !#>}},,z* %'"^^%
r   c                   \         P                  ! 4       V n        V \        P                  ! 4       n         \         P                  ! V P                  R7      pRVn        VP                  4         V P                  P                  4       '       g   V P                  P                  ^4       K=   \        P                  \        P                   8w  dI   \"        P$                  ! R4       \        P                   \        n        \        P&                  \        n        \        P*                  ! ^ 4       R#   \        \        3 d     Li ; i  \        P                  \        P                   8w  dI   \"        P$                  ! R4       \        P                   \        n        \        P&                  \        n        \        P*                  ! ^ 4       i ; i)z
Run the server forever
)targetTzresetting stdout, stderrN)ry   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_foreverServer.serve_forever   s    $//+48!1	 ''t}}=H"HONN//0022OO((+ 3
 zzS^^+

56 ^^
 ^^
HHQK &z2  zzS^^+

56 ^^
 ^^
HHQKs6   8E /D0 D0 ,E 0EE EE BG
c                      V P                   P                  4       p\        P                  ! T P
                  T3R7      pR Tn        TP                  4        KX    \         d     Kf  i ; i)Tr   rH   )ru   acceptOSErrorry   r   handle_requestr   r   )r&   rF   ts   &  r   r   Server.accepter   s\    MM((*   (;(;1$GAAHGGI	  s   A A('A(c                   R p \         P                  ! WP                  4       \         P                  ! WP                  4       VP	                  4       pVw  r4rVW@P
                  9   g   Q RV,          4       h\        W4      p V! V.VO5/ VB pRV3p	 TP                  T	4       R #   \         d    R\        4       3p	 L-i ; i  \         d    R\        4       3p	 LJi ; i  \         d   p
 TP                  R\        4       34       M  \         d     Mi ; i\        P                  ! RT	4       \        P                  ! RT4       \        P                  ! RT
4        R p
?
R # R p
?
ii ; i)Nz%r unrecognizedrB   rP   zFailure to send message: %rz ... request was %r ... exception was %r)r   deliver_challengers   answer_challengerD   publicr`   	Exceptionr   rC   r   info)r&   rF   requestignorefuncnamerH   rI   re   rK   msges   &&         r   _handle_requestServer._handle_request   sC   	*((LL9''<<8ffhG+2(Fd{{*H,=,HH*4*D*a/$/$/ !&)		2FF3K  3#Z\23  	/.C	/  	2jl34 II3S9II+W5II-q11	2s[   A>C B' C! 'C CCC!E*-D	E%	DE%DAE%%E*c                     V P                  V4       VP                  4        R#   \         d     Li ; i  TP                  4        i ; i)z
Handle a new connection
N)r   r   closer&   conns   &&r   r   Server.handle_request   s@    	  &
 JJL	  		 JJLs   % 36 36 Ac                h   \         P                  ! R\        P                  ! 4       P                  4       VP
                  pVP                  pV P                  pV P                  P                  4       '       g    R;rVV! 4       pVw  rr WH,          w  rkpY[9  d!   \        RT: R\        T4      : RT: 24      h\        Ye4      p T! T	/ T
B pT;'       d    TP                  TR4      pT'       d5   T P!                  TTT4      w  pp\#        TT P$                  T4      pRTT33pMRT3p   T! X4       K  R#   \         d3   p T P                  T,          w  rkp Rp?L  \         d    Thi ; iRp?ii ; i  \&         d   pRT3p Rp?LbRp?ii ; i  \         dZ    Xf   R	\)        4       3p L T P*                  T,          pT! YXX.X	O5/ X
B pRT3p L  \&         d    R	\)        4       3p  Li ; i\,         dO    \         P                  ! R
\        P                  ! 4       P                  4       \.        P0                  ! ^ 4        EL$\&         d    R	\)        4       3p EL=i ; i  \&         d    T! R\)        4       34        EK5  i ; i  \&         d   p\         P2                  ! R\        P                  ! 4       P                  4       \         P2                  ! RX4       \         P2                  ! RT4       TP5                  4        \.        P0                  ! ^4        Rp?EK  Rp?ii ; i)zA
Handle requests from the proxies in a particular process/thread
z$starting server thread to service %rNzmethod z of z object is not in exposed=#PROXYrB   rN   rP   z$got EOF -- exiting thread serving %rrO   zexception in thread serving %rz ... message was %rr   )r   r   ry   current_threadrd   rD   rC   rv   r   r   KeyErrorrx   AttributeErrorrU   r`   getcreater   r$   r   r   fallback_mappingEOFErrorr   r   r   r   )r&   r   rD   rC   rv   rG   r   r   identrH   rI   exposed	gettypeidkefunctionresr#   ridentrexposedtokenr   r   fallback_funcrK   s   &&                      r   serve_clientServer.serve_client   s    	

9++-22	4 yyyyNN	//((**53#''
&07-4!.7.>+C) ,(#T#Y9 
 #33/"D1D1C 'JJ9==T+JF+/;;tVS+I( %fdllF C'(E):;(#..<Iw +   !! 66u= 0i# ! !	!" ! (#Q-C( " ;%'6C;(,(=(=j(I!. s"59"=A"  )&1$ ;+Z\:;  

A$335::< 3#Z\23 ! <+Z\:;;< 		:!002779		/5		115

s   :F 
D: 1F E: #F 33F 'F .I- :E7E!F !E//E22E77F :FF	F FF I*4%GG62I*5G66I*AI*I*I*)I*-J
J JJ L1BL,,L1c                    V# r   r]   r&   r   r   r   s   &&&&r   fallback_getvalueServer.fallback_getvalueC  s    
r   c                    \        V4      # r   rR   r   s   &&&&r   fallback_strServer.fallback_strF  s    3xr   c                    \        V4      # r   )reprr   s   &&&&r   fallback_reprServer.fallback_reprI  s    Cyr   r[   r6   	#GETVALUEc                    R # r   r]   r&   rF   s   &&r   dummyServer.dummyR  s    r   c                   V P                   ;_uu_ 4        . p\        V P                  P                  4       4      pVP	                  4        V Fb  pVR8w  g   K  VP                  RV: RV P                  V,          : R\        V P                  V,          ^ ,          4      R,          : 24       Kd  	  RP                  V4      uuRRR4       #   + '       g   i     R# ; i)z?
Return some info --- useful to spot problems with refcounting
rn   z  z:       refcount=z
    :NK   NrZ   N)	r{   r   rw   keyssortrb   rR   rv   join)r&   rF   rK   r   r   s   &&   r   
debug_infoServer.debug_infoU  s    
 ZZZF++0023DIIKC<MM#($*=*=e*D*D#&t~~e'<Q'?#@#E#G H 
 99V$ ZZZs   ?CA*CC	c                ,    \        V P                  4      # )z
Number of shared objects
)lenrw   r   s   &&r   number_of_objectsServer.number_of_objectse  s    
 4&&''r   c                     \         P                  ! R4       VP                  R4       T P
                  P                  4        R#    ^ RIpTP	                  4         L4; i  T P
                  P                  4        i ; i)z
Shutdown this process
z!manager received shutdown messageNrB   N)r   r   rC   	traceback	print_excr   set)r&   rF   r   s   && r   shutdownServer.shutdownl  sZ    	"JJ:;FF$%
 OO!		"!OO!s   'A AA   A<c          
        V P                   ;_uu_ 4        V P                  V,          w  rVrxVf.   V'       g   \        V4      ^8w  d   \        R4      hV^ ,          p	MV! V/ VB p	Vf   \	        V	4      pVeV   \        V\        4      '       g%   \        RP                  V\        V4      4      4      h\        V4      \        V4      ,           pR\        V	4      ,          p
\        P                  ! RW*4       V	\        V4      V3V P                  V
&   WP                   9  d   ^ V P                   V
&   RRR4       V P#                  VX
4       V
\%        X4      3#   + '       g   i     L/; i)z.
Create a new shared object and return its id
Nz4Without callable, must have one non-keyword argumentz,Method_to_typeid {0!r}: type {1!s}, not dictz%xz&%r callable returned object with id %r)r{   rq   r   rW   ri   rQ   dictrS   rT   rU   r   r%   r   r   r   rv   rw   increftuple)r&   rF   r#   rH   rI   ra   r   method_to_typeid	proxytyper   r   s   """*,      r   r   Server.createy  sB    ZZZmmF+ ;H/ CIN$NP P1g--(-+!"2D99#FMM,d3C.DFG G w-$/?*@@2c7NEJJ?O%(#g,8H$IDNN5!///-.##E*7 : 	AueGn$$= Zs   "EC8EE'	c                \    \        V P                  VP                  ,          ^,          4      # )z<
Return the methods of the shared object indicated by token
)r   rv   r%   )r&   rF   r   s   &&&r   get_methodsServer.get_methods  s!     T^^EHH-a011r   c                ~    V\         P                  ! 4       n        VP                  R4       V P	                  V4       R# )z-
Spawn a new thread to serve this connection
Nr   )ry   r   rd   rC   r   )r&   rF   rd   s   &&&r   accept_connectionServer.accept_connection  s0     +/	  "'	 !!r   c                   V P                   ;_uu_ 4         V P                  V;;,          ^,          uu&   RRR4       R#   \         dc   pY P                  9   dL   ^T P                  T&   T P                  T,          T P                  T&   \
        P                  ! RT4        Rp?LpThRp?ii ; i  + '       g   i     R# ; i)   z&Server re-enabled tracking & INCREF %rN)r{   rw   r   rx   rv   r   r   )r&   rF   r   r   s   &&& r   r   Server.incref  s    ZZZ##E*a/* Z  
 66612D''.2259 NN5)JJGOOH ZZs5   B0A  B-AB(!B0&B((B--B00C	c           
        W P                   9  d*   W P                  9   d   \        P                  ! R V4       R# V P                  ;_uu_ 4        V P                   V,          ^ 8:  d>   \        RP                  W P                  V,          V P                   V,          4      4      hV P                   V;;,          ^,          uu&   V P                   V,          ^ 8X  d   V P                   V RRR4       W P                   9  dS   RV P                  V&   \        P                  ! RV4       V P                  ;_uu_ 4        V P                  V RRR4       R# R#   + '       g   i     Lt; i  + '       g   i     R# ; i)zServer DECREF skipping %rNz+Id {0!s} ({1!r}) has refcount {2:n}, not 1+zdisposing of obj with id %r)Nr]   N)rw   rx   r   r   r{   AssertionErrorrT   rv   )r&   rF   r   s   &&&r   decrefServer.decref  s   +++///JJ2E:ZZZ""5)Q.$AHH~~e4++E245 5 &!+&""5)Q.''.  +++ %5DNN5!JJ4e<NN5)  , Z$ s   BE:E'E$	'E8	)	r$   rs   rx   rv   rw   ru   r{   rq   r   N)	r   r   r   r   r   r   r   r   r   )r5   r8   r9   r:   r;   r   r'   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r=   r>   r?   s   @r   rk   rk      s     NF&$,2<
Ob 	,=%
% (""%H2"* *r   rk   c                   (    ] tR tRtR.t^ t^t^tRtR# )Statei  valuer]   N)	r5   r8   r9   r:   r<   INITIALSTARTEDSHUTDOWNr=   r]   r   r   r   r     s    	IGGHr   r   pickle	xmlrpclibc                      a  ] tR tRt o Rt/ t]tRRR/R lltR t	R t
RR	 lt]RR
 l4       tR tRR ltR tR tR tR t]R 4       t]R 4       t]RR l4       tRtV tR# )r   i  z
Base class for managers
Nshutdown_timeoutg      ?c               h   Vf    \         P                  ! 4       P                  pWn        \         P                  ! V4      V n        \        4       V n        \        P                  V P                  n	        W0n
        \        V,          w  V n        V n        T;'       g    \        4       V n        WPn        R # r   )r   r   rs   _addressrr   _authkeyr   _stater   r   _serializerrt   	_Listener_Clientr   _ctx_shutdown_timeout)r&   r$   rs   r|   ctxr  s   &&&&&$r   r'   BaseManager.__init__  s{    ?--/77G44W=g!MM%'6z'B$((;=	!1r   c                   V P                   P                  \        P                  8w  d   V P                   P                  \        P                  8X  d   \        R4      hV P                   P                  \        P                  8X  d   \        R4      h\        RP                  V P                   P                  4      4      h\        V P                  V P                  V P                  V P                  4      # )zH
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  rT   rk   	_registryr  r	  r  r*   s   &r   
get_serverBaseManager.get_server  s     ;;-{{  EMM1"#;<<""enn4"#:;;"(//0A0ABD DdnndmmmmT%5%57 	7r   c                    \         V P                  ,          w  rV! V P                  V P                  R7      p\	        VRR4       \
        P                  V P                  n        R# )z.
Connect manager object to the server process
rs   Nr   )	rt   r  r  r	  rL   r   r  r
  r   )r&   r}   r~   r   s   &   r   connectBaseManager.connect  sG     +4+;+;<dmmT]];tW%!MMr   c           
     <   V P                   P                  \        P                  8w  d   V P                   P                  \        P                  8X  d   \        R4      hV P                   P                  \        P                  8X  d   \        R4      h\        RP                  V P                   P                  4      4      hVe   \        V4      '       g   \        R4      h\        P                  ! RR7      w  r4V P                  P                  \        V 4      P                  V P                   V P"                  V P$                  V P&                  WAV3R7      V n        R	P+                  R
 V P(                  P,                   4       4      p\        V 4      P.                  R,           V,           V P(                  n        V P(                  P3                  4        VP5                  4        VP7                  4       V n        VP5                  4        \        P                  V P                   n        \8        P:                  ! V \        V 4      P<                  V P(                  V P"                  V P$                  V P                   V P>                  V P@                  3^ R7      V n!        R# )z0
Spawn a server process for this manager object
r  r  r  Nzinitializer must be a callableF)duplexr   :c              3   8   "   T F  p\        V4      x  K  	  R # 5ir   r   ).0is   & r   	<genexpr>$BaseManager.start.<locals>.<genexpr>4  s     A)@AQ)@s   -rH   exitpriority)"r
  r   r   r   r  r   r  rT   ra   rS   r   Piper  ProcessrU   _run_serverr  r  r	  r  _processr   	_identityr5   rd   r   r   rD   r   Finalize_finalize_managerr  r  r   )r&   initializerinitargsreaderwriterr   s   &&&   r   r   BaseManager.start  s    ;;-{{  EMM1"#;<<""enn4"#:;;"(//0A0ABD D "8K+@+@<== $6 		)):))..$--""FC * 
 A)@)@AA!$Z00C7%? 	 "MM$t*..--t{{,, 6 68	r   c                \   \         P                   ! \         P                  \         P                  4       Ve   V! V!   V P                  WW44      pVP	                  VP
                  4       VP                  4        \        P                  ! RVP
                  4       VP                  4        R# )z0
Create a server, report its address and run it
Nzmanager serving at %r)
signalSIGINTSIG_IGN_ServerrC   r$   r   r   r   r   )	clsrq   r$   rs   r|   r2  r/  r0  servers	   &&&&&&&& r   r*  BaseManager._run_serverF  sv     	fmmV^^4"" XD 	FNN# 			)6>>:r   c               ^   V P                   P                  \        P                  8X  g   Q R4       hV P	                  V P
                  V P                  R7      p \        VRRV3V,           V4      w  rVVP                  4        \        WP
                  V4      V3#   TP                  4        i ; i)z@
Create a new shared object; return the token and exposed tuple
zserver not yet startedr  Nr   )
r
  r   r   r  r  r  r	  rL   r   r   )r&   r#   rH   rI   r   r%   r   s   ""*,   r   _createBaseManager._create]  s     {{  EMM1K3KK1||DMM4==|A	"4x&4NKBJJLV]]B/88 JJLs   B B,c                    V P                   eG   V P                   P                  V4       V P                   P                  4       '       g
   RV n         R# R# R# )z3
Join the manager process (if it has been spawned)
N)r+  r   is_aliver&   timeouts   &&r   r   BaseManager.joini  sD     ==$MMw'==))++ $ , %r   c                    V P                  V P                  V P                  R7      p \        VRR4      VP	                  4        #   TP	                  4        i ; i)zC
Return some info about the servers shared objects and connections
r  Nr   r  r  r	  rL   r   r   s   & r   _debug_infoBaseManager._debug_infor  sB     ||DMM4==|A	D$5JJLDJJL   A Ac                    V P                  V P                  V P                  R7      p \        VRR4      VP	                  4        #   TP	                  4        i ; i)z%
Return the number of shared objects
r  Nr   rE  r   s   & r   _number_of_objectsBaseManager._number_of_objects|  sC     ||DMM4==|A	D$(;<JJLDJJLrH  c                   V P                   P                  \        P                  8X  d   V P	                  4        V P                   P                  \        P
                  8w  d   V P                   P                  \        P                  8X  d   \        R 4      hV P                   P                  \        P                  8X  d   \        R4      h\        RP                  V P                   P                  4      4      hV # )zUnable to start serverr  r  )	r
  r   r   r   r   r  r   r  rT   r*   s   &r   	__enter__BaseManager.__enter__  s    ;;-JJL;;-{{  EMM1"#;<<""enn4"#:;;"(//0A0ABD Dr   c                &    V P                  4        R # r   )r   r&   exc_typeexc_valexc_tbs   &&&&r   __exit__BaseManager.__exit__  s    r   c                (   V P                   ! 4       '       Ed   \        P                  ! R4        V! WR7      p \        VRR4       VP	                  4        T P                  ! TR7       T P                   ! 4       '       d   \        P                  ! R4       \        T R4      '       d   \        P                  ! R4       T P                  ! 4        T P                  ! TR7       T P                   ! 4       '       d9   \        P                  ! R	4       T P                  ! 4        T P                  ! 4        \        P                  Vn         \        P                  V R#   TP	                  4        i ; i  \
         d     EL'i ; i  \         d     R# i ; i)
zA
Shutdown the manager process; will be registered as a finalizer
z#sending shutdown message to managerr  Nr   )rB  zmanager still alive	terminatez'trying to `terminate()` manager processz#manager still alive after terminate)r@  r   r   rL   r   r   r   hasattrrW  killr   r  r   r   _address_to_localr   )r   r$   rs   r/   r  r  r   s   &&&&&& r   r.  BaseManager._finalize_manager  s$    II;<w8!T44JJL LL!12!!		/07K00IIGH%%'LL)9:''))		"GHnn	++G4% JJL $  		s:   	E0 E E0 F E--E0 0E?>E?FFc                    V P                   # r   )r  r*   s   &r   r$   BaseManager.address  s    }}r   c                   aa RV P                   9  d    V P                  P                  4       V n        Sf   \        oT;'       g    \	        SRR4      pT;'       g    \	        SRR4      pV'       de   \        VP                  4       4       FG  w  rx\        V4      \        J g   Q RV,          4       h\        V4      \        J d   K;  Q RV,          4       h	  W$VS3V P                  S&   V'       d   VV3R lp	SV	n	        \        V SV	4       R# R# )z)
Register a typeid with the manager type
r  N	_exposed__method_to_typeid_z%r is not a stringc                &  < \         P                  ! R S4       V P                  ! S.VO5/ VB w  r4S! W0P                  V V P                  VR7      pV P                  VP                  V P                  R7      p\        VRRVP                  34       V# )z)requesting creation of a shared %r objectmanagerrs   r   r  Nr   )	r   r   r=  r  r	  r  r$   rL   r%   )	r&   rH   rI   r   expproxyr   r   r#   s	   "*,    r   rc   "BaseManager.register.<locals>.temp  s    

FO!\\&@4@4@
!++T MM3 ||EMM4==|ItX{;r   )__dict__r  copy	AutoProxyr`   r   itemsrU   rR   r5   setattr)
r9  r#   ra   r   r   r   create_methodkeyr   rc   s
   &f&f&&&   r   registerBaseManager.register  s     cll*MM..0CM!IBBWYTB+ J J"9.BDI 	 "#3#9#9#;<
CyC'C)=)CC'E{c)G+?%+GG) =
 /!f 	 #DMC& r   )
r  r  r  r	  r  r+  r  r  r
  r   )NNr  Nro   r   )NNNNT)r5   r8   r9   r:   r;   r  rk   r8  r'   r  r  r   classmethodr*  r=  r   rF  rJ  rM  rT  staticmethodr.  propertyr$   rn  r=   r>   r?   s   @r   r   r     s      IG2/227*)V  ,
9%    D   %' %'r   c                   ,   a  ] tR tRt o R tR tRtV tR# )ProcessLocalSeti  c                6    \         P                  ! V R  4       R# )c                 "    V P                  4       # r   clearr   s   &r   <lambda>*ProcessLocalSet.__init__.<locals>.<lambda>  s
    399;r   N)r   register_after_forkr*   s   &r   r'   ProcessLocalSet.__init__  s      '>?r   c                    \        V 4      R3# ro   )rU   r*   s   &r   
__reduce__ProcessLocalSet.__reduce__  s    Dz2~r   r]   N)r5   r8   r9   r:   r'   r~  r=   r>   r?   s   @r   rt  rt    s     @ r   rt  c                      a  ] tR tRt o Rt/ t]P                  ! 4       t^t	RR lt
R tR/ 3R ltR tR t]R	 4       tR
 tR tR tR tR tRtV tR# )r   i  z&
A base for proxies of shared objects
Nc                   \         P                  ;_uu_ 4        \         P                  P                  VP                  R 4      pVf=   \
        P                  ! 4       \        4       3pV\         P                  VP                  &   \         P                  V n	        \         ;P                  ^,          un        R R R 4       X^ ,          V n
        V^,          V n        Wn        V P                  P                  V n        W0n        W n        \"        V,          ^,          V n        Wpn        Ve   \(        P*                  ! V4      V n        MNV P                  e   V P                  P,                  V n        M$\(        P.                  ! 4       P0                  V n        V'       d   V P3                  4        \
        P4                  ! V \         P6                  4       R #   + '       g   i     EL&; ir   )r   _mutexrZ  r   r$   r   ForkAwareLocalrt  _next_serial_serial_tls_all_serials_tokenr%   _id_managerr  rt   r  _owned_by_managerr   rr   r	  r   rs   _increfr{  _after_fork)	r&   r   r|   rc  rs   r   r   manager_ownedtls_serialss	   &&&&&&&& r   r'   BaseProxy.__init__  sH   #5599%--NK""113_5FF=H	++EMM:$11DL""a'"   N	
 (N;;>>%&z215 "/#88ADM]]& MM22DM#335==DMLLN  y'<'<=Q s   BGG$	c                   \         P                  ! R 4       \        P                  ! 4       P                  p\
        P                  ! 4       P                  R8w  d.   VR\
        P                  ! 4       P                  ,           ,          pV P                  V P                  P                  V P                  R7      p\        VRRV34       W P                  n        R# )zmaking connection to manager
MainThread|r  Nr   )r   r   r   r   rd   ry   r   r  r  r$   r	  rL   r  r   )r&   rd   r   s   &  r   _connectBaseProxy._connect*  s    

12&&(--##%**l:C)2249999D||DKK//|Gt04':#		r   c                    V P                   P                  pVP                  V P                  WV34       VP                  4       w  rVVR8X  d   V# VR8X  d   Vw  rxV P                  P                  VP                  ,          R,          p	V P                  P                   Vn        V	! WP"                  V P                  V P$                  VR7      p
V P'                  VP                   V P$                  R7      p\)        VRRVP*                  34       V
#  \-        WV4      h  \         d_    \        P                  ! R\
        P                  ! 4       P                  4       T P                  4        T P                   P                  p ELmi ; i  ?i ; i)	zF
Try to call a method of the referent and return a copy of the result
z#thread %r does not own a connectionrB   r   rb  r  Nr   )r  r   r   r   r   ry   r   rd   r  rC   r  rD   r  r  r#   r  r$   r  r	  r  rL   r%   rE   )r&   rG   rH   rI   r   rJ   rK   r   r   r   re  s   &&&&       r   _callmethodBaseProxy._callmethod3  s=   	(99''D 			488Zt45yy{9MX#NG//=bAI KK//EM''wE <<t}}<EDT4EHH;7L	"400/  	(JJ< //1668MMO99''D		(2 s   D F	 A%FF	Fc                $    V P                  R4      # )z)
Get a copy of the value of the referent
r   r  r*   s   &r   	_getvalueBaseProxy._getvalueT  s     ,,r   c                   V P                   '       d.   \        P                  ! R V P                  P                  4       R# V P                  V P                  P                  V P                  R7      p\        VRRV P                  34       \        P                  ! RV P                  P                  4       V P                  P                  V P                  4       V P                  ;'       d    V P                  P                  p\        P                  ! V \         P"                  V P                  V P                  V P                  VV P$                  V P                  V P
                  3^
R7      V n        R# )z%owned_by_manager skipped INCREF of %rNr  r   z	INCREF %rr&  )r  r   r   r  r%   r  r$   r	  rL   r  r  addr  r  r
  r-  r   _decrefr  _close)r&   r   r/   s   &  r   r  BaseProxy._increfZ  s    !!!JJ>O||DKK//|GtX{3

;/dll+66$--"6"6mm)##++t||T]]E))T..>	r   c                   VP                  V4       Ve    VP                  \        P                  8X  dQ    \        P
                  ! RV P                  4       V! V P                  VR7      p\        VR RV P                  34       M!\        P
                  ! RV P                  4       V'       gg   \        VR4      '       dS   \        P
                  ! R\        P                  ! 4       P                  4       VP                  P                  4        V=R # R # R #   \         d"   p\        P
                  ! RT4        R p?LR p?ii ; i)Nz	DECREF %rr  r   z... decref failed %sz%DECREF %r -- manager already shutdownr   z-thread %r has no more proxies so closing conn)discardr   r   r  r   r   r%   r$   rL   r   rX  ry   r   rd   r   r   )	r   serialrs   r/   tlsidsetr  r   r   s	   &&&&&&&  r   r  BaseProxy._decrefn  s    f =EKK5==86

;1u}}g>tX{;
 JJ>I l33JJF //1668NN  "	 4u  6

11556s   AD E!D==Ec                    R V n          V P                  4        R #   \         d)   p\        P                  ! RT,          4        R p?R # R p?ii ; i)Nzincref failed: %s)r  r  r   r   r   )r&   r   s   & r   r  BaseProxy._after_fork  s<    	/LLN 	/II)A-..	/s    AA		Ac                   / p\        4       e   V P                  VR&   \        V RR4      '       d4   V P                  VR&   \        \
        V P                  V P                  V33# \        \        V 4      V P                  V P                  V33# )Nrs   _isautoFr   )	r
   r	  r`   r_  RebuildProxyri  r  r  rU   r&   rI   s   & r   r~  BaseProxy.__reduce__  s    +"mmDO4E**"nnDO T-=-=tDF F !$Zd.>.>EG Gr   c                "    V P                  4       # r   )r  )r&   memos   &&r   __deepcopy__BaseProxy.__deepcopy__  s    ~~r   c                z    R \        V 4      P                  V P                  P                  \	        V 4      3,          # )z<%s object, typeid %r at %#x>)rU   r5   r  r#   r%   r*   s   &r   r6   BaseProxy.__repr__  s3    .T
##T[[%7%7DBC 	Cr   c                r     V P                  R4      #   \         d    \        T 4      RR R,           u # i ; i)zF
Return representation of the referent (or a fall-back if that fails)
r6   Nz; '__str__()' failed>r  )r  r   r   r*   s   &r   r[   BaseProxy.__str__  s=    	=##J// 	=:cr?%<<<	=s     66)r  r  r	  r  r  r  r  r  r  r  r  NNNTFr]   )r5   r8   r9   r:   r;   rZ  r   ForkAwareThreadLockr  r  r'   r  r  r  r  rq  r  r  r~  r  r6   r[   r=   r>   r?   s   @r   r   r     s}      %%'F L*>X$ ,.B B-(  0/G C= =r   c                   \        \        P                  ! 4       RR4      pV'       d   VP                  VP                  8X  dl   \        P
                  ! RV4       RVR&   VP                  VP                  9  d5   VP                  VP                  ,          VP                  VP                  &   VP                  RR4      ;'       d&    \        \        P                  ! 4       RR4      '       * pV ! W3RV/VB # )	z-
Function used for unpickling proxy objects.
r   Nz*Rebuild a proxy owned by manager, token=%rTr  r   _inheritingF)
r`   r   r   r$   r   r   r%   rx   rv   pop)re   r   r|   rI   r:  r   s   &&&&  r   r  r    s     W,,.0A4HF&..EMM1

?G $_886777  * ((2 	4  	E 	EG++-}eDD  9&9D99r   c                    \        V4      p W V3,          #   \         d     Mi ; i/ pT F  p\        RT: RT: R2T4       K  	  \        T \        3T4      pYn        YRY3&   T# )z:
Return a proxy type whose methods are given by `exposed`
zdef z:(self, /, *args, **kwds):
        return self._callmethod(z, args, kwds))r   r   execrU   r   r_  )rd   r   _cachedicmeth	ProxyTypes   &&&   r   MakeProxyTyper    s     GnGWo&&  C6:DBCF	H  TI<-I!'D?s   	 %%c           	        \         V,          ^,          pVf5   V! V P                  VR7      p \        VRRV 34      pVP                  4        Vf   Ve   VP                  pVf    \
        P                  ! 4       P                  p\        RV P                  ,          V4      p	V	! WW#WVR7      p
RV
n
        V
#   TP                  4        i ; i)z"
Return an auto-proxy for `token`
Nr  r   zAutoProxy[%s])rc  rs   r   r  T)rt   r$   rL   r   r	  r   r   rs   r  r#   r  )r   r|   rc  rs   r   r   r  r  r   r  re  s   &&&&&&&    r   ri  ri    s    
 j)!,Gu}}g6	tT=5(CGJJL7.""))+33o<gFIe#BEEML JJLs   B5 5Cc                   ,   a  ] tR tRt o R tR tRtV tR# )	Namespacei  c               <    V P                   P                  V4       R # r   )rg  updater  s   ",r   r'   Namespace.__init__  s    T"r   c                >   \        V P                  P                  4       4      p. pV F6  w  r4VP                  R 4      '       d   K  VP	                  V: RV: 24       K8  	  VP                  4        V P                  P                  : RRP                  V4      : R2# )rh   =(, r3   )	r   rg  rj  
startswithrb   r   r4   r5   r   )r&   rj  rc   rd   r   s   &    r   r6   Namespace.__repr__  sr    T]]((*+ KD??3''tU34 ! 			>>22DIIdODDr   r]   N)r5   r8   r9   r:   r'   r6   r=   r>   r?   s   @r   r  r    s     #E Er   r  c                   N   a  ] tR tRt o RR ltR tR tR t]! ]]4      t	Rt
V tR# )	Valuei  c                    Wn         W n        R # r   	_typecode_value)r&   r   r   locks   &&&&r   r'   Value.__init__  s    !r   c                    V P                   # r   r  r*   s   &r   r   	Value.get  s    {{r   c                    Wn         R # r   r  r&   r   s   &&r   r   	Value.set
  s    r   c                l    \        V 4      P                  : R V P                  : RV P                  : R2# )r  r  r3   )rU   r5   r  r  r*   s   &r   r6   Value.__repr__  s!    !$Z00$..$++NNr   r  NT)r5   r8   r9   r:   r'   r   r   r6   rr  r   r=   r>   r?   s   @r   r  r    s&     OS#Er   r  c                 .    \         P                   ! W4      # r   )r   )r   sequencer  s   &&&r   Arrayr    s    ;;x**r   c                   B   a  ] tR tRt o R	tR tR tR tR tR t	Rt
V tR# )
IteratorProxyi  c                    V # r   r]   r*   s   &r   __iter__IteratorProxy.__iter__      r   c                &    V P                  R V4      # )__next__r  r&   rH   s   &*r   r  IteratorProxy.__next__  s    
D11r   c                &    V P                  R V4      # )rC   r  r  s   &*r   rC   IteratorProxy.send  s    --r   c                &    V P                  R V4      # )throwr  r  s   &*r   r  IteratorProxy.throw      ..r   c                &    V P                  R V4      # )r   r  r  s   &*r   r   IteratorProxy.close!  r  r   r]   N)r  rC   r  r   )r5   r8   r9   r:   r_  r  r  rC   r  r   r=   r>   r?   s   @r   r  r    s(     6I2.// /r   r  c                   F   a  ] tR tRt o R	tR
R ltR tR tR tR t	Rt
V tR# )AcquirerProxyi%  Nc                :    Vf   V3MW3pV P                  RV4      # )Nacquirer  )r&   blockingrB  rH   s   &&& r   r  AcquirerProxy.acquire'  s%    %o{H3F	400r   c                $    V P                  R 4      # releaser  r*   s   &r   r  AcquirerProxy.release*      	**r   c                $    V P                  R 4      # )lockedr  r*   s   &r   r  AcquirerProxy.locked,      ))r   c                $    V P                  R 4      # )r  r  r*   s   &r   rM  AcquirerProxy.__enter__.  r   r   c                $    V P                  R 4      # r  r  rP  s   &&&&r   rT  AcquirerProxy.__exit__0  r   r   r]   )r  r  r  )TN)r5   r8   r9   r:   r_  r  r  r  rM  rT  r=   r>   r?   s   @r   r  r  %  s(     0I1+*++ +r   r  c                   H   a  ] tR tRt o RtR	R ltR
R ltR tR	R ltRt	V t
R# )ConditionProxyi4  Nc                (    V P                  R V34      # r   r  rA  s   &&r   r   ConditionProxy.wait6      
33r   c                (    V P                  R V34      # )notifyr  )r&   ns   &&r   r  ConditionProxy.notify8  s    1$//r   c                $    V P                  R 4      # )
notify_allr  r*   s   &r   r  ConditionProxy.notify_all:  s    --r   c                
   V! 4       pV'       d   V# Ve   \         P                  ! 4       V,           pMR pR pV'       gE   Ve'   V\         P                  ! 4       ,
          pV^ 8:  d    V# V P                  X4       V! 4       pKL  V# r   )time	monotonicr   )r&   	predicaterB  rK   endtimewaittimes   &&&   r   wait_forConditionProxy.wait_for<  sw    Mnn&0GGH""T^^%55q=  IIh[Fr   r]   )r  r  r  r   r  r  r   )r   )r5   r8   r9   r:   r_  r   r  r  r  r=   r>   r?   s   @r   r
  r
  4  s#     PI40. r   r
  c                   @   a  ] tR tRt o RtR tR tR tR	R ltRt	V t
R# )

EventProxyiO  c                $    V P                  R 4      # )r   r  r*   s   &r   r   EventProxy.is_setQ  r  r   c                $    V P                  R 4      # r   r  r*   s   &r   r   EventProxy.setS      &&r   c                $    V P                  R 4      # rw  r  r*   s   &r   rx  EventProxy.clearU      ((r   Nc                (    V P                  R V34      # r  r  rA  s   &&r   r   EventProxy.waitW  r  r   r]   )r   r   rx  r   r   )r5   r8   r9   r:   r_  r   r   rx  r   r=   r>   r?   s   @r   r  r  O  s#     2I*')4 4r   r  c                   j   a  ] tR tRt o R
tRR ltR tR t]R 4       t	]R 4       t
]R 4       tR	tV tR# )BarrierProxyi[  Nc                (    V P                  R V34      # r  r  rA  s   &&r   r   BarrierProxy.wait]  r  r   c                $    V P                  R 4      # )abortr  r*   s   &r   r0  BarrierProxy.abort_  r(  r   c                $    V P                  R 4      # )resetr  r*   s   &r   r3  BarrierProxy.reseta  r(  r   c                &    V P                  R R4      # )__getattribute__)partiesr  r*   s   &r   r7  BarrierProxy.partiesc  s     2LAAr   c                &    V P                  R R4      # )r6  )	n_waitingr  r*   s   &r   r:  BarrierProxy.n_waitingf  s     2NCCr   c                &    V P                  R R4      # )r6  )brokenr  r*   s   &r   r=  BarrierProxy.brokeni  s     2K@@r   r]   )r6  r   r0  r3  r   )r5   r8   r9   r:   r_  r   r0  r3  rr  r7  r:  r=  r=   r>   r?   s   @r   r,  r,  [  sU     >I4))B BD DA Ar   r,  c                   6   a  ] tR tRt o RtR tR tR tRtV t	R# )NamespaceProxyin  c                    V^ ,          R8X  d   \         P                  W4      # \         P                  V R4      pV! RV34      # )    rh   r  r6  )objectr6  r&   rm  
callmethods   && r   __getattr__NamespaceProxy.__getattr__p  s@    q6S=**455,,T=A
,sf55r   c                    V^ ,          R8X  d   \         P                  WV4      # \         P                  V R4      pV! RW34      # )rB  rh   r  __setattr__)rC  rI  r6  )r&   rm  r   rE  s   &&& r   rI  NamespaceProxy.__setattr__u  sA    q6S=%%d77,,T=A
-#66r   c                    V^ ,          R8X  d   \         P                  W4      # \         P                  V R4      pV! RV34      # )rB  rh   r  __delattr__)rC  rL  r6  rD  s   && r   rL  NamespaceProxy.__delattr__z  s?    q6S=%%d00,,T=A
-#00r   r]   N)r6  rI  rL  )
r5   r8   r9   r:   r_  rF  rI  rL  r=   r>   r?   s   @r   r@  r@  n  s     BI6
7
1 1r   r@  c                   f   a  ] tR tRt o RtR tR t]! ]]4      t]	! ]
P                  4      tRtV tR# )
ValueProxyi  c                $    V P                  R 4      # )r   r  r*   s   &r   r   ValueProxy.get  r%  r   c                (    V P                  R V34      # r#  r  r  s   &&r   r   ValueProxy.set  s    x00r   r]   N)r   r   )r5   r8   r9   r:   r_  r   r   rr  r   rp  typesGenericAlias__class_getitem__r=   r>   r?   s   @r   rO  rO    s1     I'1S#E#E$6$67r   rO  BaseListProxyc                   P   a  ] tR tRt o R tR t]! ]P                  4      t	Rt
V tR# )	ListProxyi  c                ,    V P                  R V34       V # )extendr  r  s   &&r   __iadd__ListProxy.__iadd__  s    E8,r   c                ,    V P                  R V34       V # )__imul__r  r  s   &&r   r_  ListProxy.__imul__      eX.r   r]   N)r5   r8   r9   r:   r\  r_  rp  rT  rU  rV  r=   r>   r?   s   @r   rY  rY    s"      $E$6$67r   rY  _BaseDictProxyr  Iteratorc                   J   a  ] tR tRt o R t]! ]P                  4      tRt	V t
R# )	DictProxyi  c                ,    V P                  R V34       V # __ior__r  r  s   &&r   rh  DictProxy.__ior__      UH-r   r]   N)r5   r8   r9   r:   rh  rp  rT  rU  rV  r=   r>   r?   s   @r   re  re    s      $E$6$67r   re  _BaseSetProxyc                   \   a  ] tR tRt o R tR tR tR t]! ]	P                  4      tRtV tR# )SetProxyi  c                ,    V P                  R V34       V # rg  r  r  s   &&r   rh  SetProxy.__ior__  rj  r   c                ,    V P                  R V34       V # )__iand__r  r  s   &&r   rq  SetProxy.__iand__  ra  r   c                ,    V P                  R V34       V # )__ixor__r  r  s   &&r   rt  SetProxy.__ixor__  ra  r   c                ,    V P                  R V34       V # )__isub__r  r  s   &&r   rw  SetProxy.__isub__  ra  r   r]   N)r5   r8   r9   r:   rh  rq  rt  rw  rp  rT  rU  rV  r=   r>   r?   s   @r   rm  rm    s,      $E$6$67r   rm  
ArrayProxy	PoolProxyapply_asyncimapimap_unordered	map_asyncstarmap_asyncAsyncResultc                   ,   a  ] tR tRt o R tR tRtV tR# )rz  i  c                    V # r   r]   r*   s   &r   rM  PoolProxy.__enter__  r  r   c                &    V P                  4        R # r   )rW  rP  s   &&&&r   rT  PoolProxy.__exit__  s    r   r]   N)r5   r8   r9   r:   rM  rT  r=   r>   r?   s   @r   rz  rz    s      r   c                       ] tR tRtRtRtR# )r   i  a  
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.
r]   N)r5   r8   r9   r:   r;   r=   r]   r   r   r   r     s    r   QueueJoinableQueuer   rz   RLock	SemaphoreBoundedSemaphore	ConditionBarrierPoolr   r   r   r  )r   rl  )rl  c                   T   a  ] tR tRt o Rt. 3R ltR tR tR tR t	R t
R	 tR
tV tR# )_SharedMemoryTrackeri  z+Manages one or more shared memory segments.c                    Wn         W n        R # r   shared_memory_context_namesegment_names)r&   rd   r  s   &&&r   r'   _SharedMemoryTracker.__init__  s    .2+!.r   c                    \         P                  ! RV: R\        4        24       V P                  P	                  V4       R# )z6Adds the supplied shared memory block name to tracker.zRegister segment  in pid N)r   r   r   r  rb   r&   segment_names   &&r   register_segment%_SharedMemoryTracker.register_segment  s3    JJ*<*:(68*MN%%l3r   c                    \         P                  ! RV: R\        4        24       V P                  P	                  V4       \
        P                  ! V4      pVP                  4        VP                  4        R# )zvCalls unlink() on the shared memory block with the supplied name
and removes it from the list of blocks being tracked.zDestroy segment r  N)	r   r   r   r  remover   SharedMemoryr   unlink)r&   r  segments   && r   destroy_segment$_SharedMemoryTracker.destroy_segment  sX     JJ),)9&(LM%%l3#00>GMMONNr   c                \    V P                   R,           F  pV P                  V4       K  	  R# )z<Calls destroy_segment() on all tracked shared memory blocks.:NNNN)r  r  r  s   & r   r  _SharedMemoryTracker.unlink#  s(     $ 2 21 5 5$$\2 !6r   c                    \         P                  ! R V P                  P                   R\	        4        24       V P                  4        R# )zCall z.__del__ in N)r   r   r4   r5   r   r  r*   s   &r   __del___SharedMemoryTracker.__del__(  s1    JJt~~667|FH:NOKKMr   c                2    V P                   V P                  3# r   r  r*   s   &r   r+   !_SharedMemoryTracker.__getstate__,  s    33T5G5GHHr   c                &    V P                   ! V!   R # r   )r'   r.   s   &&r   r0   !_SharedMemoryTracker.__setstate__/  s    MM5!r   )r  r  N)r5   r8   r9   r:   r;   r'   r  r  r  r  r+   r0   r=   r>   r?   s   @r   r  r    s4     5/1 	/	4
		3
		I	" 	"r   r  c                   n   a  ] tR tRt o ]P
                  . R
O,           tR tR tR tR t	R t
R tRtV tR	# )SharedMemoryServeri3  c                (   \         P                  ! V .VO5/ VB  V P                  p\        V\        4      '       d   \
        P                  ! V4      p\        R V R\        4        24      V n	        \        P                  ! R\        4        24       R# )shm_rh   z"SharedMemoryServer started by pid N)rk   r'   r$   rQ   rp   osfsdecoder  r   shared_memory_contextr   r   )r&   rH   kwargsr$   s   &*, r   r'   SharedMemoryServer.__init__8  sq    OOD24262llG'5))++g.$tG9AfhZ%@A &JJ;FH:FGr   c                   \        V P                  V,          R,          R4      '       d   V P                  VR&   \        P                  ! WV.VO5/ VB # )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._shared_memory_proxyr  r  )rX  rq   r  rk   r   )r&   rF   r#   rH   r  s   """*,r   r   SharedMemoryServer.createB  sL     t}}V,R02HII262L2L./==&B4B6BBr   c                `    V P                   P                  4        \        P                  W4      # )zACall unlink() on all tracked shared memory, terminate the Server.)r  r  rk   r   r   s   &&r   r   SharedMemoryServer.shutdownL  s#    &&--/??4++r   c                <    V P                   P                  V4       R# )z?Adds the supplied shared memory block name to Server's tracker.N)r  r  r&   rF   r  s   &&&r   track_segment SharedMemoryServer.track_segmentQ  s    &&77Er   c                <    V P                   P                  V4       R# )z|Calls unlink() on the shared memory block with the supplied name
and removes it from the tracker instance inside the Server.N)r  r  r  s   &&&r   release_segment"SharedMemoryServer.release_segmentU  s     &&66|Dr   c                .    V P                   P                  # )zVReturns a list of names of shared memory blocks that the Server
is currently tracking.)r  r  r   s   &&r   list_segments SharedMemoryServer.list_segmentsZ  s     --;;;r   )r  N)r  r  r  )r5   r8   r9   r:   rk   r   r'   r   r   r  r  r  r=   r>   r?   s   @r   r  r  3  s>     FG	H	C	,
	F	E
	< 	<r   r  c                   F   a  ] tR tRt o Rt]tR tR tR t	R t
R tRtV tR	# )
r   i`  aq  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                    \         P                  R 8X  d   ^RIHp VP	                  4        \
        P                  ! V .VO5/ VB  \        P                  ! V P                  P                   R\        4        24       R# )posix)resource_trackerz created by pid N)r  rd    r  ensure_runningr   r'   r   r   r4   r5   r   )r&   rH   r  r  s   &*, r   r'   SharedMemoryManager.__init__l  s\    ww'! / //1  777JJ$..1122B68*MNr   c                t    \         P                  ! V P                  P                   R \	        4        24       R# )z.__del__ by pid N)r   r   r4   r5   r   r*   s   &r   r  SharedMemoryManager.__del__x  s'    JJ$..1122B68*MNr   c                   V P                   P                  \        P                  8w  d   V P                   P                  \        P                  8X  d   \        R4      hV P                   P                  \        P                  8X  d   \        R4      h\        RP                  V P                   P                  4      4      hV P                  V P                  V P                  V P                  V P                  4      # )z@Better than monkeypatching for now; merge into Server ultimatelyz"Already started SharedMemoryServerz!SharedMemoryManager has shut downr  )r
  r   r   r   r  r   r  rT   r8  r  r  r	  r  r*   s   &r   r  SharedMemoryManager.get_server{  s    {{  EMM1;;$$5&'KLL[[&&%..8&'JKK&,33DKK4E4EFH H<< $t/?/?A Ar   c                P   V P                  V P                  V P                  R7      ;_uu_ 4       p\        P                  ! RRVR7      p \        VRRVP                  34        RRR4       T#   \         d   pTP                  4        ThRp?ii ; i  + '       g   i     X# ; i)zcReturns a new SharedMemory instance with the specified size in
bytes, to be tracked by the manager.r  NT)r   sizer  )	r  r  r	  r   r  rL   rd   BaseExceptionr  )r&   r  r   smsr   s   &&   r   r   SharedMemoryManager.SharedMemory  s     dmmT]]CCt#00dNT4388+F D J % JJLG	 DC Js)   BA//B:BBBB%	c                r   V P                  V P                  V P                  R7      ;_uu_ 4       p\        P                  ! V4      p \        VRRVP                  P                  34        RRR4       T#   \         d"   pTP                  P                  4        ThRp?ii ; i  + '       g   i     X# ; i)zuReturns a new ShareableList instance populated with the values
from the input sequence, to be tracked by the manager.r  Nr  )
r  r  r	  r   ShareableListrL   shmrd   r  r  )r&   r  r   slr   s   &&   r   r  !SharedMemoryManager.ShareableList  s     dmmT]]CCt"00:T4266;;.I D I % FFMMOG	 DC Is)   B%#A66B"BB""B%%B6	r]   N)r5   r8   r9   r:   r;   r  r8  r'   r  r  r  r  r=   r>   r?   s   @r   r   r   `  s2     	 %
	O	O	A
	
	 
	r   )r   r   r   r   )rj  r   valuesr]   r  r  )__add____contains____delitem____getitem__r_  __len____mul____reversed____rmul____setitem__rb   rx  rh  countr[  indexinsertr  r  reverser   )r  r  r  rh  r  r  __or__r  __ror__r  rx  rh  fromkeysr   rj  r   r  popitem
setdefaultr  r  )%__and__rV  r  rq  rh  rw  r  rt  r  r  __rand__r  __rsub____rxor____sub____xor____ge____gt____le____lt__r  rx  rh  
differencedifference_updater  intersectionintersection_update
isdisjointissubset
issupersetr  r  symmetric_differencesymmetric_difference_updateunionr  )r  r  r  )applyr{  r   r|  r}  r   mapr~  starmapr  rW  )___all__r   ry   r5  r   collections.abccollectionsqueuer  rT  r  r   r   r   r  r   contextr	   r
   r   r   r   r   r   r   	HAS_SHMEMrb   ImportErrorr   rn  rU   r`   
view_typesr   	view_typerC  r   rL   rE   r   rV   rf   ri   rk   r   r}   r~   XmlListener	XmlClientrt   r   r   rt  r   r  r  ri  r  r  r  r  r  r
  r  r,  r@  rO  rW  rY  abcMutableSequencerb  r`  re  MutableMappingrk  rm  ry  BasePoolProxyrz  r   r  r   rz   r  r  r  r  r  r  r   r   r  r  r   )rd   s   0r   <module>r     s   A         	     @ @    * INN()2 	  5;; -4MN4MDd72t$&'4MN
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 w= w=z:* )+ ,:
E 
E
F 
+/I /+I +] 6	4 	4A9 A&1Y 1&8 8 o 0 8 8    ( ( 7/ 2  
% !8 8    ' ' 7o 	0 	8} 8     ' ' 6 < * 

 k , 
 =]
Jj$   	+ 	   Wekk *   _ekk 2   Wiooz :   VY^^] ;   Wioo} =   [)"5"5} E   ')C)C"$   [)"5"5~ F   Y	 1 1< @   VTYY	 2   VT9 -   VT9 -   UC *   WeZ 0   WeZ 0   [)^ <   Z=  N   ]%  8 "" ""J*<V *<Z>k >g O'  I Os   R3 S3	S ?S 