
    h                    
   d Z ddlmZ ddlZddlZddlmZ ddlZddlZddl	Z	ddl
Z
ddlZddlZddlmZmZmZmZmZmZmZmZmZmZmZmZ ddlZddlmZ ddlmZ ddlmZ dd	lmZ dd
lm Z  ddl!m"Z" ddl!m#Z# ddl!m$Z$ ddl!m%Z% ddl!m&Z& ddl!m'Z' ddl!m(Z( ddl!m)Z) ddl!m*Z* ddl+m,Z,  e	jZ                  e.      Z/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8dZ9dZ:d Z;dZ<d!Z=d"Z>dld#Z?dmd$Z@dnd&ZA	 	 	 	 	 	 dod'ZBdpd(ZC G d) d* ej                  d*d+      ej                        ZF G d, d-ej                        ZH G d. d/eH      ZI G d0 d1eH      ZJ G d2 d%eK      ZLdqd3ZM	 	 	 	 	 	 drd4ZNdsd5ZO	 	 	 	 	 	 dtd6ZP	 	 	 	 	 	 dud7ZQ	 	 	 	 	 	 	 	 	 	 dvd8ZRdwd9ZS	 	 	 	 	 	 	 	 dxd:ZTdwd;ZUdsd<ZV G d= d>ej                        ZX G d? d@eK      ZY	 	 	 	 	 	 	 	 dydAZZ	 dz	 	 	 	 	 	 	 	 	 	 	 	 	 d{dBZ[	 	 	 	 	 	 	 	 d|dCZ\	 	 	 	 	 	 	 	 	 	 d}dDZ]	 	 	 	 d~dEZ^dqdFZ_	 	 	 	 	 	 	 	 ddGZ`	 	 	 	 	 	 	 	 ddHZa	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddIZb	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddJZcddKZd	 	 	 	 	 	 	 	 	 	 ddLZe	 	 	 	 	 	 ddMZf	 	 	 	 	 	 	 	 	 	 ddNZg	 	 	 	 	 	 	 	 	 	 ddOZh	 	 	 	 	 	 	 	 	 	 ddPZi	 	 	 	 	 	 	 	 	 	 ddQZj	 	 	 	 	 	 	 	 	 	 ddRZk	 	 	 	 	 	 	 	 ddSZl	 	 	 	 	 	 	 	 	 	 ddTZm	 	 	 	 	 	 	 	 	 	 	 	 ddUZnej                   G dV dWej                               Zq G dX dYeK      Zr	 	 	 	 	 	 ddZZs	 	 	 	 	 	 dd[Ztdd\Zu	 	 	 	 	 	 	 	 dd]Zvdd^Zwdd_Zxdd`ZyddaZz	 	 	 	 	 	 ddbZ{ddcZ|dddZ}ddeZ~ddfZ	 	 	 	 ddgZ	 	 	 	 	 	 	 	 ddhZ G di djej                        Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddkZy)z+Service-side implementation of gRPC Python.    )annotationsN)futures)AnyCallableDictIterableIteratorListMappingOptionalSequenceSetTupleUnion)_common)_compression)_interceptor)_observability)cygrpc)ArityAgnosticMethodHandler)ChannelArgumentType)DeserializingFunction)MetadataType)NullaryCallbackType)ResponseType)SerializingFunction)ServerCallbackTag)ServerTagCallbackType)overrideshutdownrequest_callreceive_close_on_serversend_initial_metadatareceive_messagesend_messagez$send_initial_metadata * send_messagesend_status_from_serverz/send_initial_metadata * send_status_from_serveropenclosed	cancelledg      ?g    eAc                <    | j                   d   j                         S Nr   )batch_operationsmessage)request_events    J/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/grpc/_server.py_serialized_requestr0   V   s    ))!,4466    c                |    t         j                  j                  |       }|t        j                  j
                  S |S N)r   !STATUS_CODE_TO_CYGRPC_STATUS_CODEgetr   
StatusCodeunknown)codecygrpc_codes     r/   _application_coder:   Z   s4    ;;??EK(3(;6$$LLr1   	_RPCStatec                x    | j                   t        j                  j                  S t	        | j                         S r3   )r8   r   r6   okr:   states    r/   _completion_coder@   _   s-    zz  ### ,,r1   c                H    | j                   |S t        | j                         S r3   )r8   r:   )r?   r8   s     r/   _abortion_coderB   f   s"     zz ,,r1   c                6    | j                   dS | j                   S )Nr1   )detailsr>   s    r/   _detailsrE   o   s    --'3:U]]:r1   c                      e Zd Zy)_HandlerCallDetailsN)__name__
__module____qualname__ r1   r/   rG   rG   s   s     	r1   rG   )methodinvocation_metadatac                  `    e Zd Zej                  dd       Zej                  	 	 	 	 dd       Zy)_Methodc                    t               r3   NotImplementedErrorselfs    r/   namez_Method.name   s    !##r1   c                    t               r3   rQ   rT   handler_call_detailss     r/   handlerz_Method.handler   s     "##r1   NreturnzOptional[str]rX   rG   r[   Optional[grpc.RpcMethodHandler])rH   rI   rJ   abcabstractmethodrU   rY   rK   r1   r/   rO   rO      sD    $ $ 	$$7$	($ $r1   rO   c                  H    e Zd Z	 	 	 	 ddZedd       Ze	 	 	 	 dd       Zy)_RegisteredMethodc                     || _         || _        y r3   )_name_registered_handler)rT   rU   registered_handlers      r/   __init__z_RegisteredMethod.__init__   s    
 
#5 r1   c                    | j                   S r3   )rc   rS   s    r/   rU   z_RegisteredMethod.name   s    zzr1   c                    | j                   S r3   )rd   rW   s     r/   rY   z_RegisteredMethod.handler   s     '''r1   N)rU   strre   r]   rZ   r\   rH   rI   rJ   rf   r   rU   rY   rK   r1   r/   ra   ra      sQ    66 <6   ($7(	(( (r1   ra   c                  D    e Zd Z	 	 ddZedd       Ze	 	 	 	 dd       Zy)_GenericMethodc                    || _         y r3   )_generic_handlers)rT   generic_handlerss     r/   rf   z_GenericMethod.__init__   s     "2r1   c                     y r3   rK   rS   s    r/   rU   z_GenericMethod.name   s    r1   c                T    | j                   D ]  }|j                  |      }||c S  y r3   )rn   service)rT   rX   generic_handlermethod_handlers       r/   rY   z_GenericMethod.handler   s;      $55 	&O,445IJN)%%	& r1   N)ro   List[grpc.GenericRpcHandler]rZ   r\   rj   rK   r1   r/   rl   rl      sG    262   	$7		(	 	r1   rl   c                      e Zd ZU ded<   ded<   ee   Zded<   ded<   d	ed
<   ded<   d	ed<   ded<   ded<   ded<   d	ed<   ded<   ded<   d	ed<   d Zy)r;   zcontextvars.Contextcontextzthreading.Condition	conditionr   requestri   clientboolinitial_metadata_allowedOptional[grpc.Compression]compression_algorithmdisable_next_compressionOptional[MetadataType]trailing_metadatazOptional[grpc.StatusCode]r8   Optional[bytes]rD   statusedzList[Exception]
rpc_errorsz#Optional[List[NullaryCallbackType]]	callbacksabortedc                6   t        j                         | _        t        j                         | _        t               | _        d | _        t        | _
        d| _        d | _        d| _        d | _        d | _        d | _        d| _        g | _        g | _        d| _        y NTF)contextvarsContextrw   	threading	Conditionrx   setduery   _OPENrz   r|   r~   r   r   r8   rD   r   r   r   r   rS   s    r/   rf   z_RPCState.__init__   s    "**,",,.5(,%%)"(-%!%	r1   N)rH   rI   rJ   __annotations__r   ri   r   rf   rK   r1   r/   r;   r;      s`      ""
c(CLK""55""--
##N22Mr1   c                d    t        j                         }| j                  j                  |       |r3   )grpcRpcErrorr   append)r?   	rpc_errors     r/   _raise_rpc_errorr      s&    I	I&
Or1   c                    | j                   j                  |       t        |       s#| j                   s| j                  }d | _        | |fS y)NNrK   )r   remove_is_rpc_state_activer   )r?   tokenr   s      r/   _possibly_finish_callr      sB     
IIU&uyyOO	ir1   c                      fd}|S )Nc                `    j                   5  t              cd d d        S # 1 sw Y   y xY wr3   )rx   r   )$unused_send_status_from_server_eventr?   r   s    r/   r&   z9_send_status_from_server.<locals>.send_status_from_server   s)    __ 	7(6	7 	7 	7s   $-rK   )r?   r   r&   s   `` r/   _send_status_from_serverr      s    7 #"r1   c                    | j                   5  | j                  rDt        j                  | j                        f}||cd d d        S |t	        |      z   cd d d        S |cd d d        S # 1 sw Y   y xY wr3   )rx   r~   r   !compression_algorithm_to_metadatatuple)r?   metadatacompression_metadatas      r/   _get_initial_metadatar      sz     
 &&>>//$ 
 +  ,eHo=    s   0A)A)A))A2c                N    t        j                  t        | |      t              }|S r3   )r   SendInitialMetadataOperationr   _EMPTY_FLAGS)r?   r   	operations      r/   _get_initial_metadata_operationr     s(     33eX.I r1   c                   | j                   t        urt        | |      }| j                  |n| j                  }| j                  r9t        | d       t        j                  | j                  ||t              f}t        }n-t        j                  | j                  ||t              f}t        }|j                  |t        | |             d| _        | j                  j!                  |       y y NT)rz   
_CANCELLEDrB   rD   r|   r   r   SendStatusFromServerOperationr   r   8_SEND_INITIAL_METADATA_AND_SEND_STATUS_FROM_SERVER_TOKEN_SEND_STATUS_FROM_SERVER_TOKENstart_server_batchr   r   r   add)r?   callr8   rD   effective_codeeffective_details
operationsr   s           r/   _abortr     s     ||:%'t4',}}'<G%--))/t<44++"% 	J ME 44++"% 	J 3E0>	
 		e9 &r1   c                      fd}|S )Nc                (   j                   5  | j                  d   j                         rt        _        nj                  t
        u rt        _        j                   j                          t        t              cd d d        S # 1 sw Y   y xY wr+   )
rx   r,   r)   r   rz   r   _CLOSED
notify_allr   _RECEIVE_CLOSE_ON_SERVER_TOKEN)receive_close_on_server_eventr?   s    r/   r"   z9_receive_close_on_server.<locals>.receive_close_on_server3  so    __ 	P,==a@JJL)&&OO&&((0NO	P 	P 	Ps   A0BBrK   )r?   r"   s   ` r/   _receive_close_on_serverr   2  s    P #"r1   c                      fd}|S )Nc                   t        |       }|]j                  5  j                  t        u rt        _        j                  j                          t        t              cd d d        S t        j                  |      }j                  5  |'t        t        j                  j                  d       n|_        j                  j                          t        t              cd d d        S # 1 sw Y   y xY w# 1 sw Y   y xY w)Ns    Exception deserializing request!)r0   rx   rz   r   r   r   r   _RECEIVE_MESSAGE_TOKENr   deserializer   r   r6   internalry   )receive_message_eventserialized_requestry   r   request_deserializerr?   s      r/   r$   z)_receive_message.<locals>.receive_messageD  s    01FG% L<<5(#*EL**,,U4JK	L L ))"$8G  L?))22;	 %,EM**,,U4JKL LL LL Ls   AC2AC>2C;>DrK   )r?   r   r   r$   s   ``` r/   _receive_messager   ?  s    
L2 r1   c                      fd}|S )Nc                h    j                   5  t        t              cd d d        S # 1 sw Y   y xY wr3   )rx   r   _SEND_INITIAL_METADATA_TOKEN)"unused_send_initial_metadata_eventr?   s    r/   r#   z5_send_initial_metadata.<locals>.send_initial_metadataa  s.    __ 	N(0LM	N 	N 	Ns   (1rK   )r?   r#   s   ` r/   _send_initial_metadatar   `  s    N ! r1   c                      fd}|S )Nc                    j                   5  j                   j                          t              cd d d        S # 1 sw Y   y xY wr3   )rx   r   r   )unused_send_message_eventr?   r   s    r/   r%   z#_send_message.<locals>.send_messagei  s9    __ 	7OO&&((6	7 	7 	7s	   &>ArK   )r?   r   r%   s   `` r/   _send_messager   h  s    7
 r1   c                      e Zd ZU ded<   ded<   ded<   	 	 	 	 	 	 ddZddZd d	Zd!d
Zd"dZd!dZ	d#dZ
d$dZd%dZd&dZd'dZd(dZd)dZd*dZd#dZd+dZd,dZd-dZd.dZd/dZd0dZd!dZy)1_Contextcygrpc.BaseEvent
_rpc_eventr;   _stateOptional[DeserializingFunction]r   c                .    || _         || _        || _        y r3   )r   r   _request_deserializer)rT   	rpc_eventr?   r   s       r/   rf   z_Context.__init__v  s     $%9"r1   c                    | j                   j                  5  t        | j                         cd d d        S # 1 sw Y   y xY wr3   )r   rx   r   rS   s    r/   	is_activez_Context.is_active  s0    [["" 	5'4	5 	5 	5s   6?c                    t        | j                  j                  j                  t	        j                         z
  d      S r+   )maxr   call_detailsdeadlinetimerS   s    r/   time_remainingz_Context.time_remaining  s*    4??//88499;FJJr1   c                L    | j                   j                  j                          y r3   )r   r   cancelrS   s    r/   r   z_Context.cancel  s    ##%r1   c                    | j                   j                  5  | j                   j                  
	 d d d        y| j                   j                  j                  |       	 d d d        y# 1 sw Y   y xY w)NFT)r   rx   r   r   )rT   callbacks     r/   add_callbackz_Context.add_callback  s^    [["" 	{{$$,	 	 %%,,X6	 	 	s   A'&A''A0c                |    | j                   j                  5  d| j                   _        d d d        y # 1 sw Y   y xY wr   )r   rx   r   rS   s    r/    disable_next_message_compressionz)_Context.disable_next_message_compression  s0    [["" 	837DKK0	8 	8 	8   2;c                .    | j                   j                  S r3   )r   rM   rS   s    r/   rM   z_Context.invocation_metadata  s    222r1   c                p    t        j                  | j                  j                  j	                               S r3   )r   decoder   r   peerrS   s    r/   r   z_Context.peer  s$    ~~doo22779::r1   c                T    t        j                  | j                  j                        S r3   )r   peer_identitiesr   r   rS   s    r/   r   z_Context.peer_identities  s    %%doo&:&:;;r1   c                    t        j                  | j                  j                        }||S t	        j
                  |      S r3   )r   peer_identity_keyr   r   r   r   )rT   id_keys     r/   r   z_Context.peer_identity_key  s4    ))$//*>*>?vCW^^F-CCr1   c                    t        j                  | j                  j                        }|i n|}|j	                         D ci c]  \  }}t        j                  |      | c}}S c c}}w r3   )r   auth_contextr   r   itemsr   r   )rT   r   auth_context_dictkeyvalues        r/   r   z_Context.auth_context  sf    **4??+?+?@"."6BL 0557
U NN3&
 	
 
s    A'c                |    | j                   j                  5  || j                   _        d d d        y # 1 sw Y   y xY wr3   )r   rx   r~   )rT   compressions     r/   set_compressionz_Context.set_compression  s0    [["" 	<0;DKK-	< 	< 	<r   c                   | j                   j                  5  | j                   j                  t        u rt	        | j                          n| j                   j
                  rt        | j                   |      }| j                  j                  j                  |ft        | j                                d| j                   _        | j                   j                  j                  t               nd}t        |      d d d        y # 1 sw Y   y xY w)NFz#Initial metadata no longer allowed!)r   rx   rz   r   r   r|   r   r   r   r   r   r   r   r   
ValueError)rT   initial_metadatar   	error_msgs       r/   r#   z_Context.send_initial_metadata  s    [["" 	0{{!!Z/ -;;77 ?%5!I OO((;;"&<T[[&I <ADKK8KKOO''(DE EI$Y//	0 	0 	0s   C!DD
c                |    | j                   j                  5  || j                   _        d d d        y # 1 sw Y   y xY wr3   )r   rx   r   )rT   r   s     r/   set_trailing_metadataz_Context.set_trailing_metadata  s0    [["" 	>,=DKK)	> 	> 	>r   c                .    | j                   j                  S r3   )r   r   rS   s    r/   r   z_Context.trailing_metadata  s    {{,,,r1   c                   |t         j                  j                  k(  r1t        j	                  d       t         j                  j
                  }d}| j                  j                  5  || j                  _        t        j                  |      | j                  _        d| j                  _        t               # 1 sw Y   y xY w)Nz4abort() called with StatusCode.OK; returning UNKNOWN T)r   r6   OK_LOGGERerrorUNKNOWNr   rx   r8   r   encoderD   r   	Exception)rT   r8   rD   s      r/   abortz_Context.abort  s    4??%%%MMF ??**DG[["" 	#DKK").."9DKK"&DKK+		 	s   %AB66B?c                    |j                   | j                  _         | j                  |j                  |j                         y r3   )r   r   r  r8   rD   )rT   statuss     r/   abort_with_statusz_Context.abort_with_status  s*    (.(@(@%

6;;/r1   c                |    | j                   j                  5  || j                   _        d d d        y # 1 sw Y   y xY wr3   )r   rx   r8   )rT   r8   s     r/   set_codez_Context.set_code  s0    [["" 	$#DKK	$ 	$ 	$r   c                .    | j                   j                  S r3   )r   r8   rS   s    r/   r8   z_Context.code  s    {{r1   c                    | j                   j                  5  t        j                  |      | j                   _        d d d        y # 1 sw Y   y xY wr3   )r   rx   r   r
  rD   )rT   rD   s     r/   set_detailsz_Context.set_details  s9    [["" 	:").."9DKK	: 	: 	:s   %AAc                .    | j                   j                  S r3   )r   rD   rS   s    r/   rD   z_Context.details  s    {{"""r1   c                     y r3   rK   rS   s    r/   _finalize_statez_Context._finalize_state  s    r1   N)r   r   r?   r;   r   r   )r[   r{   )r[   floatr[   None)r   r   r[   r{   )r[   r   )r[   ri   )r[   zOptional[Sequence[bytes]]rZ   )r[   zMapping[str, Sequence[bytes]])r   zgrpc.Compressionr[   r  )r   r   r[   r  )r   r   r[   r  )r8   grpc.StatusCoderD   ri   r[   r  )r  zgrpc.Statusr[   r  )r8   r  r[   r  )r[   r  )rD   ri   r[   r  )r[   bytes)rH   rI   rJ   r   rf   r   r   r   r   r   rM   r   r   r   r   r   r#   r  r   r  r  r  r8   r  rD   r  rK   r1   r/   r   r   q  s      99:#: : >	:5K&83;<D
<0$>-0$ :#r1   r   c                  p    e Zd ZU ded<   ded<   ded<   	 	 	 	 	 	 ddZddZdd	Zdd
ZddZddZ	ddZ
y)_RequestIteratorr;   r   cygrpc.Call_callr   r   c                .    || _         || _        || _        y r3   )r   r   r   )rT   r?   r   r   s       r/   rf   z_RequestIterator.__init__  s     
%9"r1   c                   | j                   j                  t        u rt        | j                          y t	        | j                         s
t               | j                  j                  t        j                  t              ft        | j                   | j                  | j                               | j                   j                  j                  t               y r3   )r   rz   r   r   r   StopIterationr   r   r   ReceiveMessageOperationr   r   r   r   r   r   rS   s    r/   _raise_or_start_receive_messagez0_RequestIterator._raise_or_start_receive_message  s    ;;+T[[)%dkk2/!JJ))//=? KKT-G-G KKOO 67r1   c                B   | j                   j                  t        u rt        | j                          t               | j                   j                  &t
        | j                   j                  vr
t               | j                   j                  }d | j                   _        |S r3   )	r   rz   r   r   ry   r   r   r#  AssertionErrorrT   ry   s     r/   _look_for_requestz"_RequestIterator._look_for_request	  su    ;;+T[[)  KK'&dkkoo=/!kk))G"&DKKNr1   c                    | j                   j                  5  | j                          	 | j                   j                  j                          | j	                         }||cd d d        S B# 1 sw Y   y xY wr3   )r   rx   r%  waitr)  r(  s     r/   _nextz_RequestIterator._next  sh    [["" 	#002%%**,002&"	# 	#	# 	#s   A	A+*A++A4c                    | S r3   rK   rS   s    r/   __iter__z_RequestIterator.__iter__!  s    r1   c                "    | j                         S r3   r,  rS   s    r/   __next__z_RequestIterator.__next__$      zz|r1   c                "    | j                         S r3   r0  rS   s    r/   nextz_RequestIterator.next'  r2  r1   N)r?   r;   r   r  r   r   r  )r[   r   )r[   r  )rH   rI   rJ   r   rf   r%  r)  r,  r.  r1  r4  rK   r1   r/   r  r    sS    :::: : >	:8#r1   r  c                      fd}|S )Nc            	        j                   5  t              s
	 d d d        y j                  j                  t	        j
                  t              ft        j                               j                  j                  t               	 j                   j                          j                  j                  t        u rrdj                  j                   j"                        } t%        j                  t        j&                  j(                  t+        j,                  |              	 d d d        y j                  t.        u r(	 d d d        y j                  }d _        |cd d d        S # 1 sw Y   y xY w)Nz*"{}" requires exactly one request message.)rx   r   r   r   r   r$  r   r   r   r   r   r+  ry   rz   r   formatr   rL   r   r6   unimplementedr   r
  r   )rD   ry   r   r   r?   s     r/   unary_requestz%_unary_request.<locals>.unary_request0  s@   __ 	''.	' 	' 1133LAC$y~~/C 		45OO((*}}, <<72&R&Y&Y ) 6 6 = ='G # % ) & 1 1 ? ? 'w 7	 $(1	' 	'2 #\\Z7#'5	' 	'8 #(--(,&=	' 	' 	' 	's#   E2D
E27E2E21E22E;rK   )r   r?   r   r9  s   ``` r/   _unary_requestr:  +  s    
'B r1   c                :   ddl m}  || ||      5 }	 d }| ||||      }n	 |||      }|dfcd d d        S # t        $ rL}	|j                  5  |j                  r1t        || j                  t        j                  j                  d       n|	|j                  vr	 dj                  |	      }
nb# t        $ rV d}
t        j                  t        j                  t!        |	      |	|	j"                               t        j$                          Y nw xY wt        j                  |
       t        || j                  t        j                  j                  t'        j(                  |
             d d d        n# 1 sw Y   nxY wY d }	~	d d d        yd }	~	ww xY w# 1 sw Y   y xY w)Nr   )_create_servicer_contextT   RPC Abortedz!Exception calling application: {}z1Calling application raised unprintable Exception!NF)r   r<  r  rx   r   r   r   r   r6   r7   r   r7  r  	exception	tracebackformat_exceptiontype__traceback__	print_excr   r
  )r   r?   behaviorargumentr   send_response_callbackr<  rw   response_or_iteratorr?  rD   s              r/   _call_behaviorrI  T  s    .	!5.
 -	*	#' %1'/g'=($ (0''B$'-- -  !	 ==!))11&	 e&6&66."E"L"L%# % .O    ))%66 $Y ) ) 7 7 "++-. %%g.!))11w/	5  @ [- -!	- -sk   F8
FF	AE0B-,E0-AD		E0D	AE0'	F	0E95F	<F	FFFc           
     
   	 t        |      dfS # t        $ r Y yt        $ r}|j                  5  |j                  r1t        || j                  t        j                  j                  d       nw||j                  vridj                  |      }t        j                  |       t        || j                  t        j                  j                  t        j                  |             d d d        n# 1 sw Y   nxY wY d }~yd }~ww xY w)NTr   r=  z!Exception iterating responses: {}r>  )r4  r#  r  rx   r   r   r   r   r6   r7   r   r7  r  r?  r   r
  )r   r?   response_iteratorr?  rD   s        r/   %_take_response_from_response_iteratorrL    s    
%&,,  __ 	}}NN%%--"	 %"2"22=DDYO!!'*NN%%--NN7+		 	 	" %s1    	DDC=B5C,#	C=,C5	1C==Dc                    t        j                  ||      }|F|j                  5  t        || j                  t
        j                  j                  d       d d d        y |S # 1 sw Y   y xY w)Ns   Failed to serialize response!)r   	serializerx   r   r   r   r6   r   )r   r?   responseresponse_serializerserialized_responses        r/   _serialize_responserR    si     "++H6IJ"__ 	!!**0		 ""	 s   1A!!A*c                Z    | j                   rt        j                  j                  S t        S r3   )r   r   	WriteFlagno_compressr   r>   s    r/   %_get_send_message_op_flags_from_staterV    s%     %%+++r1   c                T    | j                   5  d| _        d d d        y # 1 sw Y   y xY wr>  )rx   r   r>   s    r/   _reset_per_message_staterX    s&    	 /).&/ / /s   'c                H   |j                   5  t        |      s
	 d d d        y|j                  r9t        |d       t	        j
                  |t        |            f}d|_        t        }n&t	        j
                  |t        |            f}t        }| j                  j                  |t        ||             |j                  j                  |       t        |       	 |j                   j                          ||j                  vrt        |      cd d d        S =# 1 sw Y   y xY wr>  )rx   r   r|   r   r   SendMessageOperationrV  -_SEND_INITIAL_METADATA_AND_SEND_MESSAGE_TOKEN_SEND_MESSAGE_TOKENr   r   r   r   r   rX  r+  )r   r?   rQ  r   r   s        r/   _send_responser]    s    
 7#E*7 7 --3E4@//+=eD
 27.E //+=eD
 ,NN--M%7 IIMM% $U+$$&		)/6=7 76 77 7s   DC*DDD!c           	     H   |j                   5  |j                  t        urt        |      }t	        |      }t        j                  |j                  ||t              g}|j                  r|j                  t        |d              |.|j                  t        j                  |t        |                   | j                  j                  |t!        |t"                     d|_        t'        |       |j(                  j+                  t"               d d d        y # 1 sw Y   y xY wr   )rx   rz   r   r@   rE   r   r   r   r   r|   r   r   rZ  rV  r   r   r   r   r   rX  r   r   )r   r?   rQ  r8   rD   r   s         r/   _statusr_    s    
 
 :<<z)#E*DuoG44++T7LJ
 --!!"A%"NO".!!//+=eD NN--(0NO "EN$U+IIMM891: : :s   DDD!c                D   t        j                  |        	  |       }|1t        | ||||      \  }}|rt        | |||      }	|	t	        | ||	       t        j                          y # t
        $ r t        j                          Y 4w xY w# t        j                          w xY wr3   )	r   'install_context_from_request_call_eventrI  rR  r_  r  r@  rD  uninstall_context)
r   r?   rE  argument_thunkr   rP  rF  rO  proceedrQ  s
             r/   _unary_response_in_poolre    s     229=#!# .5(H6J!Hg &9uh0C'# '2Iu.AB 	  "   	  "s#   :A& &BB	 BB	 	Bc                    t        j                          d fd}	  |       }|Lt        |d      r|j                  rt	         ||||       n"t	         |||      \  }}	|	rt         ||       t        j                          y # t        $ r t        j                          Y 4w xY w# t        j                          w xY w)Nc                b    | t        d        y t        |       }|t        |       y y r3   )r_  rR  r]  )rO  rQ  rP  r   r?   s     r/   send_responsez/_stream_response_in_pool.<locals>.send_response8  sD    Iud+"55(,?# #.y%1DE /r1   experimental_non_blocking)rG  )rO  r   r[   r  )
r   ra  hasattrri  rI  3_send_message_callback_to_blocking_iterator_adapterr  r@  rD  rb  )
r   r?   rE  rc  r   rP  rh  rF  rK  rd  s
   ``   `    r/   _stream_response_in_poolrl  .  s     229=F#!#"=>66(+8 .<uh:N.*!7 G!5-9J 	  "   	  "s$   AB B,)B/ +B,,B/ /Cc                D    | j                   t        uxr | j                   S r3   )rz   r   r   r>   s    r/   r   r   _  s    <<z)@%...@@r1   c                T    	 t        | ||      \  }}|r ||       t        |      sy y (r3   )rL  r   )r   r?   rG  rK  rO  rd  s         r/   rk  rk  c  s>     Au/
' "8,'. r1   c                ~    t        | d      r0t        | j                  t        j                        r| j                  S |S )Nexperimental_thread_pool)rj  
isinstancerp  r   ThreadPoolExecutor)rE  default_thread_pools     r/    _select_thread_pool_for_behaviorrt  u  s;     x34))7+E+E: 000""r1   c           
         t        | ||j                        }t        |j                  |      }|j	                  |j
                  j                  t        | ||j                  ||j                  |j                        S r3   )	r:  r   rt  unary_unarysubmitrw   runre  rP  r   r?   rt   rs  r9  thread_pools         r/   _handle_unary_unaryr{    s|     #5.==M 3""$7K ""++**	 	r1   c           
         t        | ||j                        }t        |j                  |      }|j	                  |j
                  j                  t        | ||j                  ||j                  |j                        S r3   )	r:  r   rt  unary_streamrw  rw   rx  rl  rP  ry  s         r/   _handle_unary_streamr~    s|     #5.==M 3##%8K  ##++**	 	r1   c           
        t        || j                  |j                        t        |j                  |      }|j                  |j                  j                  t        | ||j                  fd|j                  |j                        S )Nc                      S r3   rK   request_iterators   r/   <lambda>z&_handle_stream_unary.<locals>.<lambda>        r1   )
r  r   r   rt  stream_unaryrw  rw   rx  re  rP  r   r?   rt   rs  rz  r  s        @r/   _handle_stream_unaryr    s     (y~~~BB 3##%8K ## ++**	 	r1   c           
        t        || j                  |j                        t        |j                  |      }|j                  |j                  j                  t        | ||j                  fd|j                  |j                        S )Nc                      S r3   rK   r  s   r/   r  z'_handle_stream_stream.<locals>.<lambda>  r  r1   )
r  r   r   rt  stream_streamrw  rw   rx  rl  rP  r  s        @r/   _handle_stream_streamr    s     (y~~~BB 3$$&9K  $$ ++**	 	r1   c                D   	 	 	 	 dfd}j                         }|s)t        j                  | j                  j                        }t        || j                        }|'|j                  j                  |j                  ||      S |j                  j                  ||      S )Nc                &    j                  |       S r3   )rY   )rX   method_with_handlers    r/   query_handlersz,_find_method_handler.<locals>.query_handlers  s     #**+?@@r1   r\   )
rU   r   r   r   rL   rG   rM   rw   rx  execute)r   r?   r  interceptor_pipeliner  method_namerX   s     `    r/   _find_method_handlerr    s    A1A	(A
 &**,KnnY%;%;%B%BC.%%
 '}}   ((.:N
 	
 }}  1EFFr1   c                    t        d       t        j                  t              t        j                  d ||t              f}| j
                  j                  |fd       y )Nc                    dfS r   rK   )_ignored_event	rpc_states    r/   r  z_reject_rpc.<locals>.<lambda>  s     
 r1   )r   r   ReceiveCloseOnServerOperationr   r   r   r   )r   r  r  rD   r   s    `   r/   _reject_rpcr    sW     	(	48,,\:,,&'<	
J NN%%	
r1   c                   |j                   5  | j                  j                  t        j                  t
              ft        |             |j                  j                  t               |j                  r:|j                  rt        | |||      cd d d        S t        | |||      cd d d        S |j                  rt        | |||      cd d d        S t        | |||      cd d d        S # 1 sw Y   y xY wr3   )rx   r   r   r   r  r   r   r   r   r   request_streamingresponse_streamingr  r  r~  r{  )r   r?   rt   rz  s       r/   _handle_with_method_handlerr    s     
 ))11,?A$U+	
 			45++00,unk  ,unk   00+unk# * +unk+  s   BC*C*0C*C**C3c                8   | j                   sy| j                  j                  s|j                         rt	               }	 t        | |||      }|*t        | |t        j                  j                  d       |dfS |r*t        | |t        j                  j                  d       |dfS |t!        | |||      fS y# t        $ rZ}dj                  |      }t        j                  |       t        | |t        j                  j                  d       |dfcY d}~S d}~ww xY w)a  Handles RPC based on provided handlers.

      When receiving a call event from Core, registered method will have its
    name as tag, we pass the tag as registered_method_name to this method,
    then we can find the handler in registered_method_handlers based on
    the method name.

      For call event with unregistered method, the method name will be included
    in rpc_event.call_details.method and we need to query the generics handlers
    to find the actual handler.
    )NNzException servicing handler: {}s   Error in service handler!Ns   Method not found!s   Concurrent RPC limit exceeded!)successr   rL   rU   r;   r  r  r7  r  r?  r  r   r6   r7   r8  resource_exhaustedr  )	r   r  r  rz  concurrency_exceededr  rt   r?  rD   s	            r/   _handle_callr  3  s2   $ $$(;(@(@(BK		#1#$	N  !!!//$	 d?"!!!441	 d?" +y.+  E  		#7>>yIGg&!!)),	 d?"		#s   B6 6	D?ADDDc                      e Zd ZdZdZdZy)_ServerStagestoppedstartedgraceN)rH   rI   rJ   STOPPEDSTARTEDGRACErK   r1   r/   r  r  u  s    GGEr1   r  c                      e Zd ZU ded<   ded<   ded<   ded<   d	ed
<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   	 	 	 	 	 	 	 	 	 	 	 	 d!dZy )"_ServerStatezthreading.RLocklockcygrpc.CompletionQueuecompletion_queuecygrpc.Serverserverru   ro    Dict[str, grpc.RpcMethodHandler]registered_method_handlers'Optional[_interceptor._ServicePipeline]r  futures.ThreadPoolExecutorrz  r  stagethreading.Eventtermination_eventzList[threading.Event]shutdown_eventsOptional[int]maximum_concurrent_rpcsintactive_rpc_countzSet[_RPCState]
rpc_stateszSet[str]r   r{   server_deallocatedc                   t        j                         | _        || _        || _        t        |      | _        || _        || _        t        j                  | _        t        j                         | _        | j                  g| _        || _        d| _        i | _        t%               | _        t%               | _        d| _        y )Nr   F)r   RLockr  r  r  listro   r  rz  r  r  r  Eventr  r  r  r  r  r   r  r   r  )rT   r  r  ro   r  rz  r  s          r/   rf   z_ServerState.__init__  s     OO%	 0 $%5 6$8!&!))
!*!2 $ 6 67'>$ !*,' %5 #(r1   N)r  r  r  r  ro    Sequence[grpc.GenericRpcHandler]r  r  rz  r  r  r  )rH   rI   rJ   r   rf   rK   r1   r/   r  r  |  s    
,,22 @@AA++&&****	M(0( ( ;	(
 F( 0( "/(r1   r  c                |    | j                   5  | j                  j                  |       d d d        y # 1 sw Y   y xY wr3   )r  ro   extend)r?   ro   s     r/   _add_generic_handlersr    s5     
 8%%&678 8 8   2;c                |    | j                   5  | j                  j                  |       d d d        y # 1 sw Y   y xY wr3   )r  r  update)r?   method_handlerss     r/   _add_registered_method_handlersr    s8     
 A((//@A A Ar  c                |    | j                   5  | j                  j                  |      cd d d        S # 1 sw Y   y xY wr3   )r  r  add_http2_port)r?   addresss     r/   _add_insecure_portr    s0    	 4||**734 4 4s   2;c                    | j                   5  | j                  j                  ||j                        cd d d        S # 1 sw Y   y xY wr3   )r  r  r  _credentials)r?   r  server_credentialss      r/   _add_secure_portr    s>    
 
 
||**'44

 
 
s	   &=Ac                    | j                   j                  | j                  | j                  t               | j                  j                  t               y r3   )r  r!   r  _REQUEST_CALL_TAGr   r   r>   s    r/   _request_callr    s;    	LL 6 68I 
IIMM#$r1   c                    |}| j                   j                  | j                  | j                  ||       | j                  j	                  |       y r3   )r  request_registered_callr  r   r   )r?   rL   registered_call_tags      r/   _request_registered_callr    sE     	LL((	 
IIMM%&r1   c                    | j                   s]| j                  sQ| j                  j                          | j                  D ]  }|j                           t        j                  | _        yyr   )	r  r   r  destroyr  r   r  r  r  )r?   shutdown_events     r/   _stop_servingr    sU    EII#33 	!N 	!"**r1   c                p    | j                   5  | xj                  dz  c_        d d d        y # 1 sw Y   y xY w)N   )r  r  r>   s    r/   _on_call_completedr    s/    	 $!#$ $ $s   ,5c                    d}|j                   t        u rC j                  5   j                  j	                  t               t               rd}d d d        |S |j                   t        u s'|j                    j                  j                         v rd }|j                    j                  j                         v r3|j                   }t        | j                  j                  |d             }nt         j                        } j                  5   j                  j	                  |j                           j                  d uxr  j                   j                  k\  }t        || j                    j"                  |      \  }}| j$                  j'                  |       |) xj                  dz  c_        |j)                   fd        j*                  t,        j.                  u r5| j                  j                         v rt1         |       nt3                nt               rd}d d d        |S |j                  |      \  }}|D ]
  }		  |	         |? j                  5   j$                  j	                  |       t               rd}d d d        |S |S # 1 sw Y   |S xY w# 1 sw Y   |S xY w# t4        $ r t6        j9                  d       Y w xY w# 1 sw Y   |S xY w)NTFr  c                    t              S r3   )r  )_unused_futurer?   s    r/   r  z-_process_event_and_continue.<locals>.<lambda>  s    +=e+D r1   zException calling callback!)tag_SHUTDOWN_TAGr  r   r   r  r  r  keysra   r5   rl   ro   r  r  r  r  rz  r  r   add_done_callbackr  r  r  r  r  r  r  r?  )
r?   eventshould_continueregistered_method_namer  r  r  
rpc_futurer   r   s
   `         r/   _process_event_and_continuer    s    OyyM!ZZ 	(II]+U#"'	(~ u 			&&9988==??!%9988==??%*YY""3&0044*D# #1&&# ZZ 	(IIUYY'--T9 L**e.K.KK ! %1#**!!$%!Iz $  $$Y/%&&!+&,,D {{l222*77<<>? -U4JK!%(u%"';	(T   %yy/	9! 	AHA
	A
   ,  ''	2 '&+O, ?	(~ U	(T   A!!"?@A, s6   -JDJ&J3$)KJ#&J03KKK!c                   	 t        j                          t        z   }| j                  j                  |      }| j                  rt        |        |j                  t        j                  j                  k7  rt        | |      sy d }r3   )r   "_DEALLOCATED_SERVER_CHECK_PERIOD_Sr  pollr  _begin_shutdown_oncecompletion_typer   CompletionTypequeue_timeoutr  )r?   timeoutr  s      r/   _server  5  sp    
))+ BB&&++G4## '  F$9$9$G$GG.ue<  r1   c                :   | j                   5  | j                  t        j                  u r^| j                  j                  | j                  t               t        j                  | _        | j                  j                  t               d d d        y # 1 sw Y   y xY wr3   )r  r  r  r  r  r    r  r  r  r   r   r>   s    r/   r  r  D  sg    	 );;,...LL!!%"8"8-H&,,EKIIMM-(	) ) )s   A;BBc                $     j                   5   j                  t        j                  u r/t	        j
                         j                          cd d d        S t                t	        j
                          j                  j                          j                  j                          n8 fd}t	        j                  |      }|j                          cd d d        S 	 d d d        j                          S # 1 sw Y   xY w)Nc                     j                          j                  5  j                  j                          d d d        y # 1 sw Y   y xY wN)r  )r+  r  r  cancel_all_calls)r  r  r?   s   r/   cancel_all_calls_after_gracez+_stop.<locals>.cancel_all_calls_after_graceZ  s@    "'''6 85578 8 8s   AA)target)r  r  r  r  r   r  r   r  r  r   r  r  Threadstartr+  )r?   r  r  threadr  s   ``  @r/   _stopr  L  s    	 &;;,...&__.N !	& & !'&__.N!!((8}--/8
 #))1MN%)& & 0&* -& &s   ADBDDc                   | j                   5  | j                  t        j                  urd}t	        |      | j
                  j                          t        j                  | _        | j                  j                         D ]  }t        | |        t        |        t        j                  t        | f      }d|_        |j                          d d d        y # 1 sw Y   y xY w)Nz$Cannot start already-started server!)r  argsT)r  r  r  r  r   r  r   r  r  r  r  r  r   r  r  daemon)r?   r   rL   r  s       r/   _startr  f  s    	 ;;l222>IY''"**66;;= 	4F$UF3	4 	e!!uh?  s   CCC!c                R    | D ]"  }t        |dd       }|d| d}t        |       y )Nrr   "zP" must conform togrpc.GenericRpcHandler type but does not have "service" method!)getattrAttributeError)generic_rpc_handlersgeneric_rpc_handlerservice_attributer   s       r/   _validate_generic_rpc_handlersr  w  sQ      4 ,#$7DI$'( )R R  !++,r1   c                x    t        j                  |      }t        j                  |      }t	        |       |z   |z   S r3   )r   create_channel_optionr   (create_server_call_tracer_factory_optionr   )base_optionsr   xdscompression_option'maybe_server_call_tracer_factory_options        r/   _augment_optionsr    sG    
 &;;KH??D , 	l
	
1	2r1   c                      e Zd ZU ded<   	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	 	 	 	 ddZ	 	 	 	 	 	 ddZddZ	 	 	 	 	 	 ddZddZ	ddd
Z
ddZd Zy	)_Serverr  r   c                    t        j                         }t        j                  t        |||      |      }	|	j	                  |       t        ||	|t        j                  |      ||      | _        |	| _	        y r3   )
r   CompletionQueueServerr  register_completion_queuer  r   service_pipeliner   
_cy_server)
rT   rz  ro   interceptorsoptionsr  r   r  r  r  s
             r/   rf   z_Server.__init__  sn     "113/cJCP(()9:")),7#
 !r1   c                F    t        |       t        | j                  |       y r3   )r  r  r   )rT   r  s     r/   add_generic_rpc_handlersz _Server.add_generic_rpc_handlers  s     	'';<dkk+?@r1   c                   | j                   j                  5  | j                   j                  t        j                  u r
	 d d d        y 	 d d d        |j                         D ci c]  \  }}t        j                  ||      | }}}|j                         D ]  }| j                  j                  |        t        | j                   |       y # 1 sw Y   xY wc c}}w r3   )r   r  r  r  r  r   r   fully_qualified_methodr  r  register_methodr  )rT   service_namer  rL   rt   method_to_handlersr$  s          r/   add_registered_method_handlersz&_Server.add_registered_method_handlers  s     [[ 	{{  L$8$88	 	8	 +:*?*?*A
& **<@.P
 
 '9&=&=&? 	D"OO++,BC	D'5GH	 	

s   (C$!CCc           	     |    t        j                  |t        | j                  t        j                  |                  S r3   )r   validate_port_binding_resultr  r   r
  )rT   r  s     r/   add_insecure_portz_Server.add_insecure_port  s/    33'W^^G5LM
 	
r1   c           	     ~    t        j                  |t        | j                  t        j                  |      |            S r3   )r   r*  r  r   r
  )rT   r  r  s      r/   add_secure_portz_Server.add_secure_port  s7     33W^^G46H
 	
r1   c                .    t        | j                         y r3   )r  r   rS   s    r/   r   z_Server.start  s    t{{r1   Nc                    t        j                  | j                  j                  j                  | j                  j                  j                  |      S r  )r   r+  r   r  is_set)rT   r  s     r/   wait_for_terminationz_Server.wait_for_termination  s>     ||KK))..KK))00
 	
r1   c                .    t        | j                  |      S r3   )r  r   )rT   r  s     r/   stopz_Server.stop  s    T[[%((r1   c                @    t        | d      rd| j                  _        y y )Nr   T)rj  r   r  rS   s    r/   __del__z_Server.__del__  s    4" .2DKK* #r1   )rz  r  ro   r  r   Sequence[grpc.ServerInterceptor]r   Sequence[ChannelArgumentType]r  r  r   r}   r  r{   r   Iterable[grpc.GenericRpcHandler]r[   r  )r&  ri   r  r  r[   r  )r  ri   r[   r  )r  ri   r  grpc.ServerCredentialsr[   r  r  r3   )r  Optional[float]r[   r{   )r  r;  r[   r  )rH   rI   rJ   r   rf   r"  r(  r+  r-  r   r1  r3  r5  rK   r1   r/   r  r    s    !/! ;! 7	!
 /! "/! 0! !.A$DA	AII :I 
	I&



0F
	

)2r1   r  c           	     :    t        |       t        | ||||||      S r3   )r  r  )rz  r  r  r   r  r   r  s          r/   create_serverr=    s/     ##78 r1   )r.   r   r[   r  )r8   r  r[   cygrpc.StatusCode)r?   r;   r[   r>  )r?   r;   r8   r>  r[   r>  )r?   r;   r[   r  )r?   r;   r[   r  )r?   r;   r   ri   r[   r   )r?   r;   r   ri   r[   r   )r?   r;   r   r   r[   r   )r?   r;   r   r   r[   zcygrpc.Operation)
r?   r;   r   r  r8   r>  rD   r  r[   r  )r?   r;   r[   r   )r?   r;   r   r  r   r   r[   r   )r   r   r?   r;   r   r   r[   Callable[[], Any]r3   )r   r   r?   r;   rE  r   rF  r   r   r   rG  z(Optional[Callable[[ResponseType], None]]r[   z8Tuple[Union[ResponseType, Iterator[ResponseType]], bool])r   r   r?   r;   rK  Iterator[ResponseType]r[   zTuple[ResponseType, bool])
r   r   r?   r;   rO  r   rP  Optional[SerializingFunction]r[   r   )r?   r;   r[   zUnion[int, cygrpc.WriteFlag])r   r   r?   r;   rQ  r  r[   r{   )r   r   r?   r;   rQ  r   r[   r  )r   r   r?   r;   rE  r   rc  r?  r   rA  rP  rA  r[   r  )r   r   r?   r;   rE  r   rc  r?  r   r   rP  rA  r[   r  )r?   r;   r[   r{   )
r   r   r?   r;   rG  zCallable[[ResponseType], None]rK  r@  r[   r  )rE  r   rs  r  r[   r  )
r   r   r?   r;   rt   grpc.RpcMethodHandlerrs  r  r[   futures.Future)
r   r   r?   r;   r  rO   r  r  r[   r]   )r   r   r  r;   r  r>  rD   r  )
r   r   r?   r;   rt   rB  rz  r  r[   rC  )r   r   r  rO   r  r  rz  r  r  r{   r[   z4Tuple[Optional[_RPCState], Optional[futures.Future]])r?   r  ro   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[   r  )r?   r  rL   ri   r[   r  )r?   r  r[   r{   )r?   r  r  r   r[   r{   )r?   r  r  r;  r[   r  r8  )r  r7  r   r}   r  r{   r[   r7  )rz  r  r  r  r  r6  r   r7  r  r  r   r}   r  r{   r[   r  )__doc__
__future__r   r^   collections
concurrentr   r   enumloggingr   r   r@  typingr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   grpc._cythonr   grpc._typingr   r   r   r   r   r   r   r   r   typing_extensionsr   	getLoggerrH   r  r  r  r   r   r   r\  r[  r   r   r   r   r   r   r  _INF_TIMEOUTr0   r:   r@   rB   rE   
namedtupleHandlerCallDetailsrG   ABCrO   ra   rl   objectr;   r   r   r   r   r   r   r   r   r   r   ServicerContextr   r  r:  rI  rL  rR  rV  rX  r]  r_  re  rl  r   rk  rt  r{  r~  r  r  r  r  r  r  uniqueEnumr  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r=  rK   r1   r/   <module>rW     s   2 " 
                  3 , . % , % , * . &
'

H
%" !: 6 * $ * . "; 5 9 	

%( "7M
------;
	K	
 	
		$cgg 	$( ((W 0   F		 		# 6$ 6'/@KP	D
#
 : 	B!xt## xv<v <~&&& :& 	&^ HL777 )7 	7
 :7 E7 >7t . 	<### # 7	#
 #(!/
!7!7(1!7HM!7	!7H::: ): 
	:@### )# &	#
 8# 7# 
#8.#.#.# ).# &	.#
 :.# 7.# 
.#bA ; .	
 
$	#(	#3	#  	# * 4	
 0 * 4	
 0 * 4	
 0 * 4	
 0GGG !G B	G
 %G8  	, * ,	
 @?? ? B? ,	?
 ? :?D 499  -(6 -(`88+K8	8AA*JA	A4



 /
 		
%'$DD 0D	DN)4"
,:
,	
,/+ 
 #	 W2dkk W2t+: 3 +	
 + , 
 r1   