
    &Vf                       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)  e	j*        e+          Z,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8dZ9dZ:d Z;dd%Z<dd)Z=dd,Z>dd-Z?dd.Z@ G d/ d0 ejA        d0d1          ejB                  ZC G d2 d3ejD                  ZE G d4 d5eE          ZF G d6 d7eE          ZG G d8 d+eH          ZIdd:ZJdd>ZKdd@ZLddCZMddEZNddIZOddJZPddMZQddNZRddOZS G dP dQejT                  ZU G dR dSeH          ZVddVZW	 ddd^ZXddbZYddgZZddiZ[ddjZ\ddmZ]ddnZ^ddpZ_ddqZ`ddrZaddtZbddwZcdd{Zddd|Zedd}Zfdd~ZgddZhddZiddZjddZkejl         G d dejm                              Zn G d deH          ZoddZpddZqddZrddZsddZtddZuddZvddZwddZxddZyddZzddZ{ddZ|ddZ}ddZ~ G d dej                  ZddZdS )z+Service-side implementation of gRPC Python.    )annotationsN)futures)AnyCallableDictIterableIteratorListMappingOptionalSequenceSetTupleUnion)_common)_compression)_interceptor)cygrpc)ArityAgnosticMethodHandler)ChannelArgumentType)DeserializingFunction)MetadataType)NullaryCallbackType)ResponseType)SerializingFunction)ServerCallbackTag)ServerTagCallbackType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    eArequest_eventcygrpc.BaseEventreturnbytesc                @    | j         d                                         S Nr   )batch_operationsmessage)r(   s    I/var/www/html/software/conda/lib/python3.11/site-packages/grpc/_server.py_serialized_requestr1   T   s    )!,44666    codegrpc.StatusCodecygrpc.StatusCodec                j    t           j                            |           }|t          j        j        n|S N)r   !STATUS_CODE_TO_CYGRPC_STATUS_CODEgetr   
StatusCodeunknown)r3   cygrpc_codes     r0   _application_coder=   X   s.    ;??EEK(3(;6$$Lr2   state	_RPCStatec                Z    | j         t          j        j        S t	          | j                   S r7   )r3   r   r:   okr=   r>   s    r0   _completion_coderC   ]   s&    z ## ,,,r2   c                <    | j         |S t          | j                   S r7   )r3   r=   )r>   r3   s     r0   _abortion_coderE   d   s!     z ,,,r2   c                "    | j         dn| j         S )Nr2   )detailsrB   s    r0   _detailsrH   m   s    -'33U]:r2   c                      e Zd ZdS )_HandlerCallDetailsN)__name__
__module____qualname__ r2   r0   rJ   rJ   q   s         	Dr2   rJ   )methodinvocation_metadatac                  R    e Zd Zej        d	d            Zej        d
d            ZdS )_Methodr*   Optional[str]c                    t                      r7   NotImplementedErrorselfs    r0   namez_Method.name   s    !###r2   handler_call_detailsrJ   Optional[grpc.RpcMethodHandler]c                    t                      r7   rU   rX   rZ   s     r0   handlerz_Method.handler   s     "###r2   Nr*   rS   rZ   rJ   r*   r[   )rK   rL   rM   abcabstractmethodrY   r^   rN   r2   r0   rR   rR   ~   sZ        $ $ $ $ 	$ $ $ $ $ $r2   rR   c                  &    e Zd ZddZddZddZdS )_RegisteredMethodrY   strregistered_handlerr[   c                "    || _         || _        d S r7   )_name_registered_handler)rX   rY   rf   s      r0   __init__z_RegisteredMethod.__init__   s    
 
#5   r2   r*   rS   c                    | j         S r7   )rh   rW   s    r0   rY   z_RegisteredMethod.name   s
    zr2   rZ   rJ   c                    | j         S r7   )ri   r]   s     r0   r^   z_RegisteredMethod.handler   s     ''r2   N)rY   re   rf   r[   r_   r`   rK   rL   rM   rj   rY   r^   rN   r2   r0   rd   rd      sP        6 6 6 6   ( ( ( ( ( (r2   rd   c                  &    e Zd ZddZddZdd
ZdS )_GenericMethodgeneric_handlersList[grpc.GenericRpcHandler]c                    || _         d S r7   )_generic_handlers)rX   rp   s     r0   rj   z_GenericMethod.__init__   s     "2r2   r*   rS   c                    d S r7   rN   rW   s    r0   rY   z_GenericMethod.name   s    tr2   rZ   rJ   r[   c                P    | j         D ]}|                    |          }||c S d S r7   )rs   service)rX   rZ   generic_handlermethod_handlers       r0   r^   z_GenericMethod.handler   sF    
  $5 	& 	&O,445IJJN)%%%% *tr2   N)rp   rq   r_   r`   rm   rN   r2   r0   ro   ro      sP        2 2 2 2   	 	 	 	 	 	r2   ro   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dS )r?   zcontextvars.Contextcontextzthreading.Condition	conditionr   requestre   clientboolinitial_metadata_allowedOptional[grpc.Compression]compression_algorithmdisable_next_compressionOptional[MetadataType]trailing_metadatazOptional[grpc.StatusCode]r3   Optional[bytes]rG   statusedzList[Exception]
rpc_errorsz#Optional[List[NullaryCallbackType]]	callbacksabortedc                >   t          j                    | _        t          j                    | _        t                      | _        d | _        t          | _
        d| _        d | _        d| _        d | _        d | _        d | _        d| _        g | _        g | _        d| _        d S NTF)contextvarsContextrz   	threading	Conditionr{   setduer|   _OPENr}   r   r   r   r   r3   rG   r   r   r   r   rW   s    r0   rj   z_RPCState.__init__   s    "*,,",..55(,%%)"(-%!%	r2   N)rK   rL   rM   __annotations__r   re   r   rj   rN   r2   r0   r?   r?      s             """"
c(CLLLKKK""""5555""""----####NNN2222MMM    r2   Nonec                `    t          j                    }| j                            |           |r7   )grpcRpcErrorr   append)r>   	rpc_errors     r0   _raise_rpc_errorr      s)    I	I&&&
Or2   tokenre   r   c                    | j                             |           t          |           s| j         s| j        }d | _        | |fS dS )NNrN   )r   remove_is_rpc_state_activer   )r>   r   r   s      r0   _possibly_finish_callr      sQ     
IU&& uy O	ixr2   r   c                      fd}|S )Nc                f    j         5  t                    cd d d            S # 1 swxY w Y   d S r7   )r{   r   )$unused_send_status_from_server_eventr>   r   s    r0   r$   z9_send_status_from_server.<locals>.send_status_from_server   s|    _ 	7 	7(66	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7s   &**rN   )r>   r   r$   s   `` r0   _send_status_from_serverr      s*    7 7 7 7 7 7 #"r2   metadatar   c                    | j         5  | j        rHt          j        | j                  f}||cd d d            S |t	          |          z   cd d d            S |cd d d            S # 1 swxY w Y   d S r7   )r{   r   r   !compression_algorithm_to_metadatatuple)r>   r   compression_metadatas      r0   _get_initial_metadatar      s	    
  & 	>/ $ 
 +        ,eHoo=                         s   %A&A&A&&A*-A*cygrpc.Operationc                V    t          j        t          | |          t                    }|S r7   )r   SendInitialMetadataOperationr   _EMPTY_FLAGS)r>   r   	operations      r0   _get_initial_metadata_operationr     s-     3eX.. I r2   callcygrpc.CallrG   c                   | j         t          urt          | |          }| j        |n| j        }| j        r9t          | d           t          j        | j        ||t                    f}t          }n)t          j        | j        ||t                    f}t          }|                    |t          | |                     d| _        | j                            |           d S d S NT)r}   
_CANCELLEDrE   rG   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>   r   r3   rG   effective_codeeffective_details
operationsr   s           r0   _abortr   
  s     |:%%'t44',}'<GG%-) 	3/t<<4+"% 	 J MEE 4+"% 	 J 3E0>>	
 	
 	
 	e9 &%r2   c                      fd}|S )Nc                .   j         5  | j        d                                         rt          _        nj        t
          u rt          _        j                                          t          t                    cd d d            S # 1 swxY w Y   d S r-   )
r{   r.   r'   r   r}   r   _CLOSED
notify_allr   _RECEIVE_CLOSE_ON_SERVER_TOKEN)receive_close_on_server_eventr>   s    r0   r    z9_receive_close_on_server.<locals>.receive_close_on_server-  s    _ 	P 	P,=a@JJLL ')&&&O&&((((0NOO	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	Ps   A4B

BBrN   )r>   r    s   ` r0   _receive_close_on_serverr   ,  s)    P P P P P #"r2   request_deserializerOptional[DeserializingFunction]c                      fd}|S )Nc                   t          |           }|ij        5  j        t          u rt          _        j                                         t          t                    cd d d            S # 1 swxY w Y   d S t          j	        |          }j        5  |"t          t          j        j        d           n|_        j                                         t          t                    cd d d            S # 1 swxY w Y   d S )Ns    Exception deserializing request!)r1   r{   r}   r   r   r   r   _RECEIVE_MESSAGE_TOKENr   deserializer   r   r:   internalr|   )receive_message_eventserialized_requestr|   r   r   r>   s      r0   r"   z)_receive_message.<locals>.receive_message>  s   01FGG% L L<5((#*EL**,,,,U4JKK	L L L L L L L L L L L L L L L L L L )"$8 G  L L?)2;	    %,EM**,,,,U4JKKL L L L L L L L L L L L L L L L L Ls%   AA//A36A3AC>>DDrN   )r>   r   r   r"   s   ``` r0   _receive_messager   9  s7    
L L L L L L L2 r2   c                      fd}|S )Nc                p    j         5  t          t                    cd d d            S # 1 swxY w Y   d S r7   )r{   r   _SEND_INITIAL_METADATA_TOKEN)"unused_send_initial_metadata_eventr>   s    r0   r!   z5_send_initial_metadata.<locals>.send_initial_metadata[  s    _ 	N 	N(0LMM	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	Ns   +//rN   )r>   r!   s   ` r0   _send_initial_metadatar   Z  s)    N N N N N ! r2   c                      fd}|S )Nc                    j         5  j                                          t                    cd d d            S # 1 swxY w Y   d S r7   )r{   r   r   )unused_send_message_eventr>   r   s    r0   r#   z#_send_message.<locals>.send_messagec  s    _ 	7 	7O&&((((66	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7s   )?AArN   )r>   r   r#   s   `` r0   _send_messager   b  s*    7 7 7 7 7 7
 r2   c                      e Zd ZU ded<   ded<   ded<   d6d	Zd7dZd8dZd9dZd:dZd9dZ	d;dZ
d<dZd=dZd>dZd?dZd@d!ZdAd$ZdBd&Zd;d'ZdCd+ZdDd.ZdEd/ZdFd0ZdGd1ZdHd3Zd9d4Zd5S )I_Contextr)   
_rpc_eventr?   _stater   r   	rpc_eventr>   c                0    || _         || _        || _        d S r7   )r   r   _request_deserializer)rX   r   r>   r   s       r0   rj   z_Context.__init__p  s      $%9"""r2   r*   r~   c                v    | j         j        5  t          | j                   cd d d            S # 1 swxY w Y   d S r7   )r   r{   r   rW   s    r0   	is_activez_Context.is_activez  s~    [" 	5 	5'44	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5s   .22floatc                h    t          | j        j        j        t	          j                    z
  d          S r-   )maxr   call_detailsdeadlinetimerW   s    r0   time_remainingz_Context.time_remaining~  s%    4?/849;;FJJJr2   r   c                B    | j         j                                         d S r7   )r   r   cancelrW   s    r0   r   z_Context.cancel  s    ##%%%%%r2   callbackr   c                    | j         j        5  | j         j        	 d d d            dS | j         j                            |           	 d d d            dS # 1 swxY w Y   d S )NFT)r   r{   r   r   )rX   r   s     r0   add_callbackz_Context.add_callback  s    [" 	 	{$,	 	 	 	 	 	 	 	 %,,X666	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   A AAAc                h    | j         j        5  d| j         _        d d d            d S # 1 swxY w Y   d S r   )r   r{   r   rW   s    r0    disable_next_message_compressionz)_Context.disable_next_message_compression  s{    [" 	8 	837DK0	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8   '++r   c                    | j         j        S r7   )r   rP   rW   s    r0   rP   z_Context.invocation_metadata  s    22r2   re   c                b    t          j        | j        j                                                  S r7   )r   decoder   r   peerrW   s    r0   r   z_Context.peer  s#    ~do27799:::r2   Optional[Sequence[bytes]]c                >    t          j        | j        j                  S r7   )r   peer_identitiesr   r   rW   s    r0   r   z_Context.peer_identities  s    %do&:;;;r2   rS   c                n    t          j        | j        j                  }||nt	          j        |          S r7   )r   peer_identity_keyr   r   r   r   )rX   id_keys     r0   r   z_Context.peer_identity_key  s/    )$/*>??vvW^F-C-CCr2   Mapping[str, Sequence[bytes]]c                    t          j        | j        j                  }|i n|}d |                                D             S )Nc                >    i | ]\  }}t          j        |          |S rN   )r   r   ).0keyvalues      r0   
<dictcomp>z)_Context.auth_context.<locals>.<dictcomp>  s8     
 
 
U N3
 
 
r2   )r   auth_contextr   r   items)rX   r  auth_context_dicts      r0   r  z_Context.auth_context  sS    *4?+?@@"."6BBL
 
/5577
 
 
 	
r2   compressiongrpc.Compressionc                h    | j         j        5  || j         _        d d d            d S # 1 swxY w Y   d S r7   )r   r{   r   )rX   r  s     r0   set_compressionz_Context.set_compression  s{    [" 	< 	<0;DK-	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	<r   initial_metadatar   c                   | j         j        5  | j         j        t          u rt	          | j                    n| j         j        ryt          | j         |          }| j        j        	                    |ft          | j                              d| j         _        | j         j                            t                     nt          d          d d d            d S # 1 swxY w Y   d S )NFz#Initial metadata no longer allowed!)r   r{   r}   r   r   r   r   r   r   r   r   r   r   r   
ValueError)rX   r	  r   s      r0   r!   z_Context.send_initial_metadata  s6   [" 	L 	L{!Z// ----;7 
L ?%5! !I O(;;"&<T[&I&I   <ADK8KO''(DEEEE$%JKKK	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	Ls   B=CCCr   c                h    | j         j        5  || j         _        d d d            d S # 1 swxY w Y   d S r7   )r   r{   r   )rX   r   s     r0   set_trailing_metadataz_Context.set_trailing_metadata  s{    [" 	> 	>,=DK)	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	>r   c                    | j         j        S r7   )r   r   rW   s    r0   r   z_Context.trailing_metadata  s    {,,r2   r3   r4   rG   c                B   |t           j        j        k    r-t                              d           t           j        j        }d}| j        j        5  || j        _        t          j
        |          | j        _        d| j        _        t                      # 1 swxY w Y   d S )Nz4abort() called with StatusCode.OK; returning UNKNOWN T)r   r:   OK_LOGGERerrorUNKNOWNr   r{   r3   r   encoderG   r   	Exception)rX   r3   rG   s      r0   abortz_Context.abort  s    4?%%%MMF   ?*DG[" 	 	#DK")."9"9DK"&DK++		 	 	 	 	 	 	 	 	 	s   ABBBstatusgrpc.Statusc                h    |j         | j        _         |                     |j        |j                   d S r7   )r   r   r  r3   rG   )rX   r  s     r0   abort_with_statusz_Context.abort_with_status  s-    (.(@%

6;/////r2   c                h    | j         j        5  || j         _        d d d            d S # 1 swxY w Y   d S r7   )r   r{   r3   )rX   r3   s     r0   set_codez_Context.set_code  s{    [" 	$ 	$#DK	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$r   c                    | j         j        S r7   )r   r3   rW   s    r0   r3   z_Context.code  s    {r2   c                    | j         j        5  t          j        |          | j         _        d d d            d S # 1 swxY w Y   d S r7   )r   r{   r   r  rG   )rX   rG   s     r0   set_detailsz_Context.set_details  s    [" 	: 	:")."9"9DK	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	: 	:s   9= =r+   c                    | j         j        S r7   )r   rG   rW   s    r0   rG   z_Context.details  s    {""r2   c                    d S r7   rN   rW   s    r0   _finalize_statez_Context._finalize_state  s    r2   N)r   r)   r>   r?   r   r   )r*   r~   )r*   r   r*   r   )r   r   r*   r~   )r*   r   )r*   re   )r*   r   r_   )r*   r   )r  r  r*   r   )r	  r   r*   r   )r   r   r*   r   )r3   r4   rG   re   r*   r   )r  r  r*   r   )r3   r4   r*   r   )r*   r4   )rG   re   r*   r   )r*   r+   )rK   rL   rM   r   rj   r   r   r   r   r   rP   r   r   r   r  r  r!   r  r   r  r  r  r3   r   rG   r#  rN   r2   r0   r   r   k  s            9999: : : :5 5 5 5K K K K& & & &   8 8 8 83 3 3 3; ; ; ;< < < <D D D D
 
 
 
< < < <L L L L"> > > >- - - -   0 0 0 0$ $ $ $       : : : :# # # #     r2   r   c                  f    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S )_RequestIteratorr?   r   r   _callr   r   r>   r   r   c                0    || _         || _        || _        d S r7   )r   r'  r   )rX   r>   r   r   s       r0   rj   z_RequestIterator.__init__  s      
%9"""r2   r*   r   c                   | j         j        t          u rt          | j                    d S t	          | j                   st                      | j                            t          j	        t                    ft          | j         | j        | j                             | j         j                            t                     d S r7   )r   r}   r   r   r   StopIterationr'  r   r   ReceiveMessageOperationr   r   r   r   r   r   rW   s    r0   _raise_or_start_receive_messagez0_RequestIterator._raise_or_start_receive_message  s    ;++T[)))))%dk22 		8//!J))/==? KT-G    KO 677777r2   r   c                    | j         j        t          u rt          | j                    nG| j         j        !t
          | j         j        vrt                      | j         j        }d | j         _        |S t                      r7   )	r   r}   r   r   r|   r   r   r*  AssertionErrorrX   r|   s     r0   _look_for_requestz"_RequestIterator._look_for_request  sn    ;++T[))))K'&dko==//!k)G"&DKNr2   c                    | j         j        5  |                                  	 | j         j                                         |                                 }||cd d d            S C# 1 swxY w Y   d S r7   )r   r{   r,  waitr0  r/  s     r0   _nextz_RequestIterator._next  s    [" 	# 	#00222#%**,,,0022&"	# 	# 	# 	# 	# 	# 	# 	##	# 	# 	# 	# 	# 	# 	# 	# 	# 	#s   AA&%A&&A*-A*c                    | S r7   rN   rW   s    r0   __iter__z_RequestIterator.__iter__  s    r2   c                *    |                                  S r7   r3  rW   s    r0   __next__z_RequestIterator.__next__      zz||r2   c                *    |                                  S r7   r7  rW   s    r0   nextz_RequestIterator.next   r9  r2   N)r>   r?   r   r   r   r   r$  )r*   r   )r*   r&  )rK   rL   rM   r   rj   r,  r0  r3  r5  r8  r;  rN   r2   r0   r&  r&    s         ::::: : : :8 8 8 8   # # # #           r2   r&  r   Callable[[], Any]c                      fd}|S )Nc            	        j         5  t                    s	 d d d            d S j                            t	          j        t                    ft          j                             j        	                    t                     	 j                                          j        j        t          u red                    j        j                  } t%          j        t          j        j        t+          j        |                      	 d d d            d S j        t.          u r	 d d d            d S nj        }d _        |cd d d            S # 1 swxY w Y   d S )NTz*"{}" requires exactly one request message.)r{   r   r   r   r   r+  r   r   r   r   r   r2  r|   r}   r   formatr   rO   r   r:   unimplementedr   r  r   )rG   r|   r   r   r>   s     r0   unary_requestz%_unary_request.<locals>.unary_request)  s   _ 	' 	''.. '	' 	' 	' 	' 	' 	' 	' 	' 113LAAC$y~/C    	4555'O((***}, <722&R&Y&Y ) 6 =' 'G # % ) & 1 ? 'w 7 7	   $(1	' 	' 	' 	' 	' 	' 	' 	'2 #\Z77#'5	' 	' 	' 	' 	' 	' 	' 	'2 8 #(-(,&=	' 	' 	' 	' 	' 	' 	' 	''	' 	' 	' 	' 	' 	' 	' 	' 	' 	's)   EC-E!E=EEE"ErN   )r   r>   r   rA  s   ``` r0   _unary_requestrB  $  s1    
' ' ' ' ' ' 'B r2   behaviorr   argumentr   send_response_callback(Optional[Callable[[ResponseType], None]]8Tuple[Union[ResponseType, Iterator[ResponseType]], bool]c                2   ddl m}  || ||          5 }	 d }| ||||          }n |||          }|dfcd d d            S # t          $ r:}	|j        5  |j        r't          || j        t          j        j	        d           n|	|j
        vr	 d                    |	          }
ne# t          $ rX d}
t                              t          j        t!          |	          |	|	j                             t          j                     Y nw xY wt                              |
           t          || j        t          j        j	        t'          j        |
                     d d d            n# 1 swxY w Y   Y d }	~	d d d            dS d }	~	ww xY w# 1 swxY w Y   d S )Nr   )_create_servicer_contextT   RPC Abortedz!Exception calling application: {}z1Calling application raised unprintable Exception!NF)r   rI  r  r{   r   r   r   r   r:   r;   r   r?  r  	exception	tracebackformat_exceptiontype__traceback__	print_excr   r  )r   r>   rC  rD  r   rE  rI  rz   response_or_iteratorrL  rG   s              r0   _call_behaviorrS  M  s    .-----	!	!5.
 
 -	*	#' %1'/xg'=( ($$ (0x''B'B$'-- - - - - - - -  !	 !	 !	  = !)1&	    e&666."E"L"L%# # % . . .O    ))%6 $Y ) ) 7    "+-----. %%g...!)1w//	  5              @ ;;;[- - - - - - - -!	- - - - - - - - - -s~   F!AF	F8E(B%$E(%AD	E(D	AE(F(E,,F/E,0F3FF		FFFresponse_iteratorIterator[ResponseType]Tuple[ResponseType, bool]c           
        	 t          |          dfS # t          $ r Y dS t          $ r}|j        5  |j        r't          || j        t          j        j	        d           np||j
        vrgd                    |          }t                              |           t          || j        t          j        j	        t          j        |                     d d d            n# 1 swxY w Y   Y d }~dS d }~ww xY w)NTr   rJ  z!Exception iterating responses: {}rK  )r;  r*  r  r{   r   r   r   r   r:   r;   r   r?  r  rL  r   r  )r   r>   rT  rL  rG   s        r0   %_take_response_from_response_iteratorrX    s[   
%&&,,   zz   _ 	 	} N%-"	    %"222=DDYOO!!'***N%-N7++	  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	" {{{{{%s=    
C1	C1C,BCC,C	C,"C	#C,,C1responseresponse_serializerOptional[SerializingFunction]r   c                    t          j        ||          }|G|j        5  t          || j        t
          j        j        d           d d d            n# 1 swxY w Y   d S |S )Ns   Failed to serialize response!)r   	serializer{   r   r   r   r:   r   )r   r>   rY  rZ  serialized_responses        r0   _serialize_responser_    s     "+H6IJJ"_ 	 	!*0	  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 t""s   'AAAUnion[int, cygrpc.WriteFlag]c                @    | j         rt          j        j        S t          S r7   )r   r   	WriteFlagno_compressr   rB   s    r0   %_get_send_message_op_flags_from_staterd    s!     % ++r2   c                T    | j         5  d| _        d d d            d S # 1 swxY w Y   d S rK  )r{   r   rB   s    r0   _reset_per_message_staterf    sv    	 / /).&/ / / / / / / / / / / / / / / / / /s   !!r^  r~   c                l   |j         5  t          |          s	 d d d            dS |j        rAt          |d           t	          j        |t          |                    f}d|_        t          }n*t	          j        |t          |                    f}t          }| j	        
                    |t          ||                     |j                            |           t          |           	 |j                                          ||j        vrt          |          cd d d            S ># 1 swxY w Y   d S rK  )r{   r   r   r   r   SendMessageOperationrd  -_SEND_INITIAL_METADATA_AND_SEND_MESSAGE_TOKEN_SEND_MESSAGE_TOKENr   r   r   r   r   rf  r2  )r   r>   r^  r   r   s        r0   _send_responserk    s    
 7 7#E** 	77 7 7 7 7 7 7 7 - ,3E4@@/+=eDD 
 27.E /+=eDD 
 ,N--M%77   IMM%   $U+++7$$&&&	))/66=7 7 7 7 7 7 7 76777 7 7 7 7 7 7 7 7 7s   D)C5D)(D))D-0D-c           	     l   |j         5  |j        t          urt          |          }t	          |          }t          j        |j        ||t                    g}|j	        r#|
                    t          |d                      |5|
                    t          j        |t          |                               | j                            |t!          |t"                               d|_        t'          |           |j                            t"                     d d d            d S # 1 swxY w Y   d S r   )r{   r}   r   rC   rH   r   r   r   r   r   r   r   rh  rd  r   r   r   r   r   rf  r   r   )r   r>   r^  r3   rG   r   s         r0   _statusrm    sz   
 
 : :<z))#E**DuooG4+T7L J
 - P!!"A%"N"NOOO".!!/+=eDD    N--(0NOO   "EN$U+++IMM89991: : : : : : : : : : : : : : : : : :s   DD))D-0D-argument_thunkc                `   t          j        |            	  |            }|=t          | ||||          \  }}|r%t          | |||          }	|	t	          | ||	           n## t
          $ r t          j                     Y nw xY wt          j                     d S # t          j                     w xY wr7   )	r   'install_context_from_request_call_eventrS  r_  rm  r  rM  rQ  uninstall_context)
r   r>   rC  rn  r   rZ  rD  rY  proceedr^  s
             r0   _unary_response_in_poolrs    s     29===#!>## .5(H6J! !Hg  C&9uh0C' '# '2Iu.ABBB    	 """"" """"s*   A	A  B  B =B ?B  B B-c                    t          j                    d fd}	  |            }|Wt          |d          r|j        rt	           ||||           n*t	           |||          \  }}	|	rt           ||           n## t          $ r t          j                     Y nw xY wt          j	                     d S # t          j	                     w xY w)	NrY  r   r*   r   c                    | t          d            d S t          |           }|t          |           d S d S r7   )rm  r_  rk  )rY  r^  rZ  r   r>   s     r0   send_responsez/_stream_response_in_pool.<locals>.send_response1  sd    Iud+++++"55(,?# # #.y%1DEEEEE /.r2   experimental_non_blocking)rE  )rY  r   r*   r   )
r   rp  hasattrrw  rS  3_send_message_callback_to_blocking_iterator_adapterr  rM  rQ  rq  )
r   r>   rC  rn  r   rZ  rv  rD  rT  rr  s
   ``   `    r0   _stream_response_in_poolrz  '  sV    29===F F F F F F F F#!>##"=>>6 (+8     .<uh:N. .*!7  G!5-9J       	 """"" """"s*   A#B B= B%"B= $B%%B= =Cc                .    | j         t          uo| j         S r7   )r}   r   r   rB   s    r0   r   r   X  s    <z)@%..@@r2   Callable[[ResponseType], None]c                p    	 t          | ||          \  }}|r ||           t          |          sd S nd S 6r7   )rX  r   )r   r>   rE  rT  rY  rr  s         r0   ry  ry  \  sd    	Au/
 
'  	""8,,,'..  E	r2   default_thread_poolfutures.ThreadPoolExecutorc                r    t          | d          r&t          | j        t          j                  r| j        S |S )Nexperimental_thread_pool)rx  
isinstancer  r   ThreadPoolExecutor)rC  r~  s     r0    _select_thread_pool_for_behaviorr  n  sD     x344 #)7+E: : # 00""r2   rx   grpc.RpcMethodHandlerfutures.Futurec           
         t          | ||j                  }t          |j        |          }|                    |j        j        t          | ||j        ||j        |j                  S r7   )	rB  r   r  unary_unarysubmitrz   runrs  rZ  r   r>   rx   r~  rA  thread_pools         r0   _handle_unary_unaryr  z  sw     #5.= M 3"$7 K "+*	 	 	r2   c           
         t          | ||j                  }t          |j        |          }|                    |j        j        t          | ||j        ||j        |j                  S r7   )	rB  r   r  unary_streamr  rz   r  rz  rZ  r  s         r0   _handle_unary_streamr    sw     #5.= M 3#%8 K  #+*	 	 	r2   c           
         t          || j        |j                  t          |j        |          }|                    |j        j        t          | ||j        fd|j        |j	                  S )Nc                      S r7   rN   request_iterators   r0   <lambda>z&_handle_stream_unary.<locals>.<lambda>        r2   )
r&  r   r   r  stream_unaryr  rz   r  rs  rZ  r   r>   rx   r~  r  r  s        @r0   _handle_stream_unaryr    s     (y~~B  3#%8 K #    +*	 	 	r2   c           
         t          || j        |j                  t          |j        |          }|                    |j        j        t          | ||j        fd|j        |j	                  S )Nc                      S r7   rN   r  s   r0   r  z'_handle_stream_stream.<locals>.<lambda>  r  r2   )
r&  r   r   r  stream_streamr  rz   r  rz  rZ  r  s        @r0   _handle_stream_streamr    s     (y~~B  3$&9 K  $    +*	 	 	r2   method_with_handlerinterceptor_pipeline'Optional[_interceptor._ServicePipeline]r[   c                   dfd}                                 }|st          j        | j        j                  }t          || j                  }|!|j                            |j	        ||          S |j                            ||          S )NrZ   rJ   r*   r[   c                .                         |           S r7   )r^   )rZ   r  s    r0   query_handlersz,_find_method_handler.<locals>.query_handlers  s     #**+?@@@r2   r`   )
rY   r   r   r   rO   rJ   rP   rz   r  execute)r   r>   r  r  r  method_namerZ   s     `    r0   _find_method_handlerr    s    A A A A A A
 &**,,K DnY%;%BCC.% 
 '}   (.:N
 
 	
 }  1EFFFr2   	rpc_stater  c                    t          d           t          j        t                    t          j        d ||t                    f}| j                            |fd           d S )Nc                    dfS r   rN   )ignored_eventr  s    r0   r  z_reject_rpc.<locals>.<lambda>  s    
 r2   )r   r   ReceiveCloseOnServerOperationr   r   r   r   )r   r  r  rG   r   s    `   r0   _reject_rpcr    s}     	(	488,\::,&'<	
 	
J N%%	
 	
 	
 	
    r2   r  c                   |j         5  | j                            t          j        t
                    ft          |                     |j                            t                     |j
        rC|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xY w Y   d S r7   )r{   r   r   r   r  r   r   r   r   r   request_streamingresponse_streamingr  r  r  r  )r   r>   rx   r  s       r0   _handle_with_method_handlerr    s    
  ))1,??A$U++	
 	
 	
 		4555+ 	0 ,unk         ,unk          0 +unk #       * +unk +                 s$   A?C5C52C5C55C9<C9concurrency_exceeded4Tuple[Optional[_RPCState], Optional[futures.Future]]c                6   | j         sdS | j        j        s|                                rt	                      }	 t          | |||          }nk# t          $ r^}d                    |          }t          	                    |           t          | |t          j        j        d           |dfcY d}~S d}~ww xY w|%t          | |t          j        j        d           |dfS |r%t          | |t          j        j        d           |dfS |t!          | |||          fS dS )a  Handles RPC based on provided handlers.

      When receiving a call event from Core, registered method will have it's
    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   rO   rY   r?   r  r  r?  r  rL  r  r   r:   r;   r@  resource_exhaustedr  )	r   r  r  r  r  r  rx   rL  rG   s	            r0   _handle_callr  ,  s   $  z$ +(;(@(@(B(B +KK		#1#$	 NN  		# 		# 		#7>>yIIGg&&&!),	   d?""""""		# !!/$	   d?"! 	!41	   d?" +y.+   zs   A 
B4AB/)B4/B4c                      e Zd ZdZdZdZdS )_ServerStagestoppedstartedgraceN)rK   rL   rM   STOPPEDSTARTEDGRACErN   r2   r0   r  r  n  s        GGEEEr2   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d!S )#_ServerStatezthreading.RLocklockcygrpc.CompletionQueuecompletion_queuecygrpc.Serverserverrq   rp    Dict[str, grpc.RpcMethodHandler]registered_method_handlersr  r  r  r  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_deallocated Sequence[grpc.GenericRpcHandler]c                   t          j                    | _        || _        || _        t          |          | _        || _        || _        t          j
        | _        t          j                    | _        | j        g| _        || _        d| _        i | _        t%                      | _        t%                      | _        d| _        d S )Nr   F)r   RLockr  r  r  listrp   r  r  r  r  r  Eventr  r  r  r  r  r   r  r   r  )rX   r  r  rp   r  r  r  s          r0   rj   z_ServerState.__init__  s     O%%	 0 $%5 6 6$8!&!)
!*!2!2 $ 67'>$ !*,' %%55 #(r2   N)r  r  r  r  rp   r  r  r  r  r  r  r  )rK   rL   rM   r   rj   rN   r2   r0   r  r  u  s         ,,,,2222@@@@AAAA++++&&&&********MMM( ( ( ( ( (r2   r  rp    Iterable[grpc.GenericRpcHandler]c                z    | j         5  | j                            |           d d d            d S # 1 swxY w Y   d S r7   )r  rp   extend)r>   rp   s     r0   _add_generic_handlersr    s     
 8 8%%&67778 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8   044method_handlersr  c                z    | j         5  | j                            |           d d d            d S # 1 swxY w Y   d S r7   )r  r  update)r>   r  s     r0   _add_registered_method_handlersr    s     
 A A(//@@@A A A A A A A A A A A A A A A A A Ar  addressr  c                x    | j         5  | j                            |          cd d d            S # 1 swxY w Y   d S r7   )r  r  add_http2_port)r>   r  s     r0   _add_insecure_portr    s    	 4 4|**7334 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4s   /33server_credentialsgrpc.ServerCredentialsc                    | j         5  | j                            ||j                  cd d d            S # 1 swxY w Y   d S r7   )r  r  r  _credentials)r>   r  r  s      r0   _add_secure_portr    s    
 
 
 
|**'4
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
s    599c                    | j                             | j        | j        t                     | j                            t                     d S r7   )r  r   r  _REQUEST_CALL_TAGr   r   rB   s    r0   _request_callr    sG    	L 68I   
IMM#$$$$$r2   rO   c                    |}| j                             | j        | j        ||           | j                            |           d S r7   )r  request_registered_callr  r   r   )r>   rO   registered_call_tags      r0   _request_registered_callr    sQ     	L((	   
IMM%&&&&&r2   c                    | j         sQ| j        sJ| j                                         | j        D ]}|                                 t          j        | _        dS dS r   )	r  r   r  destroyr  r   r  r  r  )r>   shutdown_events     r0   _stop_servingr    se     EI #3 	! 	!N    "*tur2   c                f    | j         5  | xj        dz  c_        d d d            d S # 1 swxY w Y   d S )N   )r  r  rB   s    r0   _on_call_completedr    s    	 $ $!#$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $s   &**eventc                n    d}|j         t          u rQ j        5   j                            t                     t                     rd}d d d            n# 1 swxY w Y   nR|j         t          u s!|j          j                                        v rd }|j          j                                        v r1|j         }t          | j        
                    |d                     }nt           j                  } j        5   j                            |j                     j        d uo j         j        k    }t          || j         j        |          \  }}| j                            |           |( xj        dz  c_        |                     fd            j        t,          j        u r<| j                                        v rt1           |           n!t3                      nt                     rd}d d d            n# 1 swxY w Y   n|                     |          \  }}|D ]7}		  |	             # t4          $ r t6                              d           Y 4w xY w|J j        5   j                            |           t                     rd}d d d            n# 1 swxY w Y   |S )NTFr  c                "    t                    S r7   )r  )unused_futurer>   s    r0   r  z-_process_event_and_continue.<locals>.<lambda>  s    *<U*C*C r2   zException calling callback!)tag_SHUTDOWN_TAGr  r   r   r  r  r  keysrd   r9   ro   rp   r  r  r  r  r  r  r   add_done_callbackr  r  r  r  r  r  r  rL  )
r>   r  should_continueregistered_method_namer  r  r  
rpc_futurer   r   s
   `         r0   _process_event_and_continuer    s    OyM!!Z 	( 	(I]+++U## ("'	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(
 		&&&98==????!%98==????%*Y""3&044*D # # #1&# # Z 	( 	(IUY'''-T9 L*e.KK ! %1#*!$% %!Iz $ $$Y///%&&!+&&,,CCCC   {l222*7<<>>? ? -U4JKKKK!%((((u%% ("';	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(>  %yy//	9! 	A 	AHA



 A A A!!"?@@@@@A  , , ''	222 '' ,&+O, , , , , , , , , , , , , , , sH   1AAA C?HHH4
H??$I&%I&2,J**J.1J.c                    	 t          j                     t          z   }| j                            |          }| j        rt          |            |j        t          j        j	        k    rt          | |          sd S d }zr7   )r   "_DEALLOCATED_SERVER_CHECK_PERIOD_Sr  pollr  _begin_shutdown_oncecompletion_typer   CompletionTypequeue_timeoutr  )r>   timeoutr  s      r0   _server  .  s~    )++ BB&++G44# 	( ''' F$9$GGG.ue<<  r2   c                   | j         5  | j        t          j        u rU| j                            | j        t                     t          j        | _        | j	        
                    t                     d d d            d S # 1 swxY w Y   d S r7   )r  r  r  r  r  r   r  r  r  r   r   rB   s    r0   r  r  =  s    	 ) );,...L!!%"8-HHH&,EKIMM-(((	) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )s   A)A>>BBr  Optional[float]r  c                0     j         5   j        t          j        u r5t	          j                                                     cd d d            S t                      t	          j                     j        	                                j
                                         n> fd}t	          j        |          }|                                 cd d d            S 	 d d d            n# 1 swxY w Y                                    S )Nc                                                      j        5  j                                         d d d            d S # 1 swxY w Y   d S N)r
  )r2  r  r  cancel_all_calls)r  r  r>   s   r0   cancel_all_calls_after_gracez+_stop.<locals>.cancel_all_calls_after_graceS  s    "'''666 8 8557778 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8s   AA
A
)target)r  r  r  r  r   r  r   r  r  r   r  r  Threadstartr2  )r>   r  r  threadr  s   ``  @r0   _stopr  E  s   	 & &;,...&_..N   !	& & & & & & & & !'''&_..N!((888}--////8 8 8 8 8 8 8
 #)1MNNN%)& & & & & & & & 0& & & & & & & & & & & & & & &* s   <C7B	C77C;>C;c                   | j         5  | j        t          j        urt	          d          | j                                         t          j        | _        | j        	                                D ]}t          | |           t          |            t          j        t          | f          }d|_        |                                 d d d            d S # 1 swxY w Y   d S )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>   rO   r  s      r0   _startr  _  s   	  ;l222CDDD"*6;;== 	4 	4F$UF3333e!uh???                 s   B?CCCgeneric_rpc_handlersc                z    | D ]7}t          |dd           }|"t          d                    |                    8d S )Nrv   zT"{}" must conform to grpc.GenericRpcHandler type but does not have "service" method!)getattrAttributeErrorr?  )r  generic_rpc_handlerservice_attributes      r0   _validate_generic_rpc_handlersr"  o  sa      4  #$7DII$ --3V4G-H-H   % r2   base_optionsSequence[ChannelArgumentType]r  r   c                N    t          j        |          }t          |           |z   S r7   )r   create_channel_optionr   )r#  r  compression_options      r0   _augment_optionsr(  {  s)     &;KHH!333r2   c                  b    e Zd ZU ded<   d+dZd,dZd-dZd.dZd/d!Zd0d"Z	d1d2d&Z
d3d)Zd* Zd#S )4_Serverr  r   r  r  rp   r  interceptors Sequence[grpc.ServerInterceptor]optionsr$  r  r  r  r   xdsr~   c                    t          j                    }t          j        t          ||          |          }	|	                    |           t          ||	|t          j        |          ||          | _        |	| _	        d S r7   )
r   CompletionQueueServerr(  register_completion_queuer  r   service_pipeliner   
_cy_server)
rX   r  rp   r+  r-  r  r  r.  r  r  s
             r0   rj   z_Server.__init__  s     "133/EEsKK(()9:::"),77#
 
 !r2   r  r  r*   r   c                N    t          |           t          | j        |           d S r7   )r"  r  r   )rX   r  s     r0   add_generic_rpc_handlersz _Server.add_generic_rpc_handlers  s,     	'';<<<dk+?@@@@@r2   service_namere   r  r  c                j   | j         j        5  | j         j        t          j        u r	 d d d            d S 	 d d d            n# 1 swxY w Y   fd|                                D             }|                                D ]}| j                            |           t          | j         |           d S )Nc                B    i | ]\  }}t          j        |          |S rN   )r   fully_qualified_method)r   rO   rx   r7  s      r0   r  z:_Server.add_registered_method_handlers.<locals>.<dictcomp>  s<     
 
 
& *<@@.
 
 
r2   )
r   r  r  r  r  r  r  r4  register_methodr  )rX   r7  r  method_to_handlersr:  s    `   r0   add_registered_method_handlersz&_Server.add_registered_method_handlers  s.    [ 	 	{ L$888	 	 	 	 	 	 	 	8	 	 	 	 	 	 	 	 	 	 	 	 	 	 	

 
 
 
*9*?*?*A*A
 
 
 '9&=&=&?&? 	D 	D"O++,BCCCC'5GHHHHHs   AA	Ar  r  c           	     v    t          j        |t          | j        t          j        |                              S r7   )r   validate_port_binding_resultr  r   r  )rX   r  s     r0   add_insecure_portz_Server.add_insecure_port  s3    3'W^G5L5LMM
 
 	
r2   r  r  c           	     x    t          j        |t          | j        t          j        |          |                    S r7   )r   r?  r  r   r  )rX   r  r  s      r0   add_secure_portz_Server.add_secure_port  s=     3W^G446H 
 
 	
r2   c                .    t          | j                   d S r7   )r  r   rW   s    r0   r  z_Server.start  s    t{r2   Nr
  r  c                l    t          j        | j        j        j        | j        j        j        |          S r  )r   r2  r   r  is_set)rX   r
  s     r0   wait_for_terminationz_Server.wait_for_termination  s6     |K).K)0
 
 
 	
r2   r  r  c                ,    t          | j        |          S r7   )r  r   )rX   r  s     r0   stopz_Server.stop  s    T[%(((r2   c                B    t          | d          rd| j        _        d S d S )Nr   T)rx  r   r  rW   s    r0   __del__z_Server.__del__  s0    4"" 	2 .2DK***	2 	2r2   )r  r  rp   r  r+  r,  r-  r$  r  r  r  r   r.  r~   r  r  r*   r   )r7  re   r  r  r*   r   )r  re   r*   r  )r  re   r  r  r*   r  r$  r7   )r
  r  r*   r~   )r  r  r*   r  )rK   rL   rM   r   rj   r6  r=  r@  rB  r  rF  rH  rJ  rN   r2   r0   r*  r*    s         ! ! ! !.A A A AI I I I&
 
 
 


 
 
 
   
 
 
 
 
) ) ) )2 2 2 2 2r2   r*  r  r+  r,  r-  r  r  r.  c           	     J    t          |           t          | ||||||          S r7   )r"  r*  )r  r  r+  r-  r  r  r.  s          r0   create_serverrM    s:     ##7888  r2   )r(   r)   r*   r+   )r3   r4   r*   r5   )r>   r?   r*   r5   )r>   r?   r3   r5   r*   r5   )r>   r?   r*   r+   )r>   r?   r*   r   )r>   r?   r   re   r*   r   )r>   r?   r   re   r*   r   )r>   r?   r   r   r*   r   )r>   r?   r   r   r*   r   )
r>   r?   r   r   r3   r5   rG   r+   r*   r   )r>   r?   r*   r   )r>   r?   r   r   r   r   r*   r   )r   r)   r>   r?   r   r   r*   r<  r7   )r   r)   r>   r?   rC  r   rD  r   r   r   rE  rF  r*   rG  )r   r)   r>   r?   rT  rU  r*   rV  )
r   r)   r>   r?   rY  r   rZ  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?   rC  r   rn  r<  r   r[  rZ  r[  r*   r   )r   r)   r>   r?   rC  r   rn  r<  r   r   rZ  r[  r*   r   )r>   r?   r*   r~   )
r   r)   r>   r?   rE  r|  rT  rU  r*   r   )rC  r   r~  r  r*   r  )
r   r)   r>   r?   rx   r  r~  r  r*   r  )
r   r)   r>   r?   r  rR   r  r  r*   r[   )r   r)   r  r?   r  r5   rG   r+   )
r   r)   r>   r?   rx   r  r  r  r*   r  )r   r)   r  rR   r  r  r  r  r  r~   r*   r  )r>   r  rp   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>   r  rO   re   r*   r   )r>   r  r*   r~   )r>   r  r  r)   r*   r~   )r>   r  r  r  r*   r  rK  )r#  r$  r  r   r*   r$  )r  r  r  r  r+  r,  r-  r$  r  r  r  r   r.  r~   r*   r*  )__doc__
__future__r   ra   collections
concurrentr   r   enumloggingr   r   rM  typingr   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   	getLoggerrK   r  r  r  r   r   r   rj  ri  r   r   r   r   r   r   r  _INF_TIMEOUTr1   r=   rC   rE   rH   
namedtupleHandlerCallDetailsrJ   ABCrR   rd   ro   objectr?   r   r   r   r   r   r   r   r   r   r   ServicerContextr   r&  rB  rS  rX  r_  rd  rf  rk  rm  rs  rz  r   ry  r  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(  r1  r*  rM  rN   r2   r0   <module>r`     s   2 1 " " " " " " 



                                                                              3 3 3 3 3 3 , , , , , , . . . . . . % % % % % % , , , , , , % % % % % % , , , , , , * * * * * * . . . . . .
'
H
%
%" !: 6 * $ * . "; 5 9 	

%( "7 7 7 7M M M M
- - - -- - - -; ; ; ;
	 
	 
	 
	 
	K	
  	
	 
	 
		$ 	$ 	$ 	$ 	$cg 	$ 	$ 	$( ( ( ( ( ( ( ($    W   ,               F   	 	 	 	# # # #   $      D
# 
# 
# 
#   B! ! ! !   w w w w wt# w w wt< < < < <v < < <~& & & &^ HL7 7 7 7 7t   <# # # #(   / / / /
!7 !7 !7 !7H: : : :@# # # #8.# .# .# .#bA A A A   $	# 	# 	# 	#   0   0   0   0G G G G8   ,   @? ? ? ?D     49   -( -( -( -( -(6 -( -( -(`8 8 8 8A A A A4 4 4 4

 
 
 
% % % %' ' ' '   $ $ $ $D D D DN   ) ) ) )   4    	 	 	 	4 4 4 4W2 W2 W2 W2 W2dk W2 W2 W2t     r2   