
    ijU                        d Z ddlZddlmZmZmZmZ ddl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 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!jY                  ejZ                        Z.d"e#d#eej^                     fd$Z0 G d% d&      Z1 G d' d(e1ejd                        Z2 G d) d*e1ejf                        Z3 G d+ d,e1ejh                        Z4 G d- d.e1ejj                        Z5 G d/ d0ejl                        Z6	 	 	 d7d1e7d2ee#   d#eej^                     d3eee      fd4Z8	 	 	 d7d1e7d5ejr                  d2ee#   d#eej^                     d3eee      f
d6Z:y)8z6Invocation-side implementation of gRPC Asyncio Python.    N)AnyListOptionalSequence)_common)_compression)_grpcio_metadata)cygrpc   )
_base_call)_base_channel)StreamStreamCall)StreamUnaryCall)UnaryStreamCall)UnaryUnaryCall)ClientInterceptor)InterceptedStreamStreamCall)InterceptedStreamUnaryCall)InterceptedUnaryStreamCall)InterceptedUnaryUnaryCall)StreamStreamClientInterceptor)StreamUnaryClientInterceptor)UnaryStreamClientInterceptor)UnaryUnaryClientInterceptor)Metadata)ChannelArgumentType)DeserializingFunction)MetadataType)RequestIterableType)RequestType)ResponseType)SerializingFunction)_timeout_to_deadlinezgrpc-python-asyncio/{}base_optionscompressionc                     t        j                  |      }t        j                  j                  t
        ff}t        |       |z   |z   S N)r   create_channel_optionr
   ChannelArgKeyprimary_user_agent_string_USER_AGENTtuple)r$   r%   compression_channel_argumentuser_agent_channel_arguments       f/var/www/html/emotional.easysim.app/public_html/venv/lib/python3.12/site-packages/grpc/aio/_channel.py_augment_channel_argumentsr0   6   sX     $0#E#E$ 
   ::	
# 	l
&	'
%	&    c                   n   e Zd ZU dZej
                  ed<   ej                  ed<   e	ed<   e
e   ed<   e
e   ed<   e
ee      ed<   ee   ed<   ej
                  ed<   d	ej                  d
e	de
e   de
e   de
ee      dee   dej
                  ddfdZe	 	 dde
e   de
ej*                     defd       Zy)_BaseMultiCallablezrBase class of all multi callable objects.

    Handles the initialization logic and stores common attributes.
    _loop_channel_method_request_serializer_response_deserializer_interceptors_referenceschannelmethodrequest_serializerresponse_deserializerinterceptors
referencesloopreturnNc                    || _         || _        || _        || _        || _        || _        || _        | j                  sd}t        |      t        | j                  d   t              sd}t        |      | j                  d   | _        y )NzNMultiCallable must be attached to a Channel, unexpectedly found no references.r   zDInvalid reference type. MultiCallable must be attached to a Channel.)r4   r5   r6   r7   r8   r9   r:   
ValueError
isinstanceChannel	TypeError_python_channel)	selfr;   r<   r=   r>   r?   r@   rA   	error_msgs	            r/   __init__z_BaseMultiCallable.__init__Y   s     
#5 &;#)%(  Y''$**1-w7  I&&#//2r1   metadatar%   c                     | xs
 t               } t        | t               s.t        | t              rt        j                  t	        |             } |rt        t        j                  | |       } | S )zBased on the provided values for <metadata> or <compression> initialise the final
        metadata, as it should be used for the current call.
        )r   rE   r   
from_tupler,   r   augment_metadata)rL   r%   s     r/   _init_metadataz!_BaseMultiCallable._init_metadataz   s`     )xz(H-*h3
  **5?;H..xEH r1   )NN)__name__
__module____qualname____doc__asyncioAbstractEventLoop__annotations__r
   
AioChannelbytesr   r"   r   r   r   r   r   rK   staticmethodr   grpcCompressionr   rP    r1   r/   r3   r3   I   s$   
 $$$N!"566$%:;;H%6788c$$$3""3 3 %%89	3
  ((=>3 x(9:;3 I3 ''3 
3B +/26<(d../ 
 r1   r3   c                       e Zd Zdddddddedee   dee   deej                     dee	   deej                     d	ej                  eef   fd
Zy)UnaryUnaryMultiCallableNtimeoutrL   credentialswait_for_readyr%   requestra   rL   rb   rc   r%   rB   c                   | j                  ||      }| j                  sPt        |t        |      |||| j                  | j
                  | j                  | j                  | j                  
      }nQt        | j                  |||||| j                  | j
                  | j                  | j                  | j                        }| j                  j                  |       |S r'   )rP   r9   r   r#   r5   r6   r7   r8   r4   r   rH   _register_callrI   rd   ra   rL   rb   rc   r%   calls           r/   __call__z UnaryUnaryMultiCallable.__call__   s     &&x=!!!$W-((++

D -""((++

D 	++D1r1   )rQ   rR   rS   r    r   floatr   r[   CallCredentialsboolr\   r   r   r!   ri   r]   r1   r/   r_   r_      s     $(+/6:)-26)) %	)
 <() d223) !) d../) 
	"	";#<	=)r1   r_   c                       e Zd Zdddddddedee   dee   deej                     dee	   deej                     d	ej                  eef   fd
Zy)UnaryStreamMultiCallableNr`   rd   ra   rL   rb   rc   r%   rB   c                   | j                  ||      }| j                  sPt        |t        |      |||| j                  | j
                  | j                  | j                  | j                  
      }nQt        | j                  |||||| j                  | j
                  | j                  | j                  | j                        }| j                  j                  |       |S r'   )rP   r9   r   r#   r5   r6   r7   r8   r4   r   rH   rf   rg   s           r/   ri   z!UnaryStreamMultiCallable.__call__   s     &&x=!!"$W-((++

D .""((++

D 	++D1r1   )rQ   rR   rS   r    r   rj   r   r[   rk   rl   r\   r   r   r!   ri   r]   r1   r/   rn   rn      s     $(+/6:)-26** %	*
 <(* d223* !* d../* 
	#	#K$=	>*r1   rn   c                       e Zd Z	 	 	 	 	 	 d
dee   dee   dee   deej                     dee	   deej                     dej                  fd	Zy)StreamUnaryMultiCallableNrequest_iteratorra   rL   rb   rc   r%   rB   c                    | j                  ||      }| j                  sPt        |t        |      |||| j                  | j
                  | j                  | j                  | j                  
      }nQt        | j                  |||||| j                  | j
                  | j                  | j                  | j                        }| j                  j                  |       |S r'   )rP   r9   r   r#   r5   r6   r7   r8   r4   r   rH   rf   rI   rr   ra   rL   rb   rc   r%   rh   s           r/   ri   z!StreamUnaryMultiCallable.__call__   s     &&x=!!" $W-((++

D ."" ((++

D 	++D1r1   NNNNNN)rQ   rR   rS   r   r   rj   r   r[   rk   rl   r\   r   r   ri   r]   r1   r/   rq   rq      s    
 ;?#'+/6:)-26)"#67) %) <(	)
 d223) !) d../) 
	#	#)r1   rq   c                       e Zd Z	 	 	 	 	 	 d
dee   dee   dee   deej                     dee	   deej                     dej                  fd	Zy)StreamStreamMultiCallableNrr   ra   rL   rb   rc   r%   rB   c                    | j                  ||      }| j                  sPt        |t        |      |||| j                  | j
                  | j                  | j                  | j                  
      }nQt        | j                  |||||| j                  | j
                  | j                  | j                  | j                        }| j                  j                  |       |S r'   )rP   r9   r   r#   r5   r6   r7   r8   r4   r   rH   rf   rt   s           r/   ri   z"StreamStreamMultiCallable.__call__  s     &&x=!!# $W-((++

D /"" ((++

D 	++D1r1   ru   )rQ   rR   rS   r   r   rj   r   r[   rk   rl   r\   r   r   ri   r]   r1   r/   rw   rw     s    
 ;?#'+/6:)-26)"#67) %) <(	)
 d223) !) d../) 
	$	$)r1   rw   c                   r   e Zd ZU ej                  ed<   ej                  ed<   ee	   ed<   ee
   ed<   ee   ed<   ee   ed<   deded	eej                      d
eej$                     deee      f
dZdej.                  ddfdZd Zd Zd Zd%dee   fdZd Z	 d&dedej@                  fdZ!dej@                  ddfdZ"d'dZ#dede$fdZ%	 	 	 d(dedee&   dee'   d ee   de(f
d!Z)	 	 	 d(dedee&   dee'   d ee   de*f
d"Z+	 	 	 d(dedee&   dee'   d ee   de,f
d#Z-	 	 	 d(dedee&   dee'   d ee   de.f
d$Z/y))rF   r4   r5   _unary_unary_interceptors_unary_stream_interceptors_stream_unary_interceptors_stream_stream_interceptorstargetoptionsrb   r%   r?   c                    g | _         g | _        g | _        g | _        |Q|D ]K  }t	        |t
              r| j                   j                  |       0t	        |t              r| j                  j                  |       \t	        |t              r| j                  j                  |       t	        |t              r| j                  j                  |       t        dj                  |      dj                  t
        j                        z   dj                  t        j                        z   dj                  t        j                        z   dj                  t        j                        z          t        j                         | _        t        j                   t#        j$                  |      t'        ||      || j                        | _        t+        j,                         | _        y)a  Constructor.

        Args:
          target: The target to which to connect.
          options: Configuration options for the channel.
          credentials: A cygrpc.ChannelCredentials or None.
          compression: An optional value indicating the compression method to be
            used over the lifetime of the channel.
          interceptors: An optional list of interceptors that would be used for
            intercepting any RPC executed with that channel.
        NzInterceptor {} must be z{} or z{}. )rz   r{   r|   r}   rE   r   appendr   r   r   rD   formatrQ   r
   get_working_loopr4   rX   r   encoder0   r5   weakrefWeakSet_active_calls)rI   r~   r   rb   r%   r?   interceptors          r/   rK   zChannel.__init__S  s   & *,&*,'*,'+-(#+ k+FG2299+F-IJ33::;G-IJ33::;G-JK44;;KH$188E"//*E*N*NOP"//*F*O*OPQ #//*F*O*OPQ !--(E(N(NO	P $ ,,.
))NN6"&w<JJ	
 %__.r1   rh   rB   Nc                     | j                   j                  |       |j                  | j                   j                         y)z-Register a call to be tracked by the channel.N)r   addadd_done_callbackdiscard)rI   rh   s     r/   rf   zChannel._register_call  s0    t$t1199:r1   c                    K   | S wr'   r]   rI   s    r/   
__aenter__zChannel.__aenter__  s     s   c                 B   K   | j                  d        d {    y 7 wr'   _close)rI   exc_typeexc_valexc_tbs       r/   	__aexit__zChannel.__aexit__  s     kk$   c                 \  K   | j                   j                         ry |r|dk  rd| d}t        |      | j                   j                          d }t	        | j
                        }|r_|D cg c]3  }|j                         s!| j                  j                   ||            5 }}|rt        j                  ||       d {    |D ]  }|j                           |j                          | j
                  j                          | j                   j                          y c c}w 7 ew)Nr   z grace must be non-negative, got .c                 `   K   	 | j                          d {    y 7 # t        $ r Y y w xY wwr'   )code	Exception)rh   s    r/   _wait_for_call_to_completez2Channel._close.<locals>._wait_for_call_to_complete  s-     iik!!  	s(   .  . 	+.+.)ra   )r5   closedrD   closinglistr   doner4   create_taskrU   waitcancelclearclose)rI   gracerJ   r   callsrh   
call_taskss          r/   r   zChannel._close  s    ==!UQY:5'CIY'' 		 T''( "yy{ 

&&'A$'GHJ 
 ll:u===  	DKKM	 	  " 	! >s   A,D,.8D%&D,D*A&D,r   c                 B   K   | j                  |       d {    y 7 wr'   r   )rI   r   s     r/   r   zChannel.close  s     kk%   r   c                     t        | d      r6| j                  j                         s| j                  j                          y y y )Nr5   )hasattrr5   r   r   r   s    r/   __del__zChannel.__del__  s4    4$T]]-A-A-CMM! .D$r1   try_to_connectc                 ^    | j                   j                  |      }t        j                  |   S r'   )r5   check_connectivity_stater   1CYGRPC_CONNECTIVITY_STATE_TO_CHANNEL_CONNECTIVITY)rI   r   results      r/   	get_statezChannel.get_state  s)     77GHHPPr1   last_observed_statec                    K   | j                   j                  |j                  d   d        d {   }|sd}t        |      y 7 w)Nr   z:gRPC channel connectivity state watch failed unexpectedly.)r5   watch_connectivity_statevalueRuntimeError)rI   r   resolvedrJ   s       r/   wait_for_state_changezChannel.wait_for_state_change  sU      ??%%a($
 
 L  y))	 
s   -AAAc                   K   | j                  d      }|t        j                  j                  k7  rJ| j	                  |       d {    | j                  d      }|t        j                  j                  k7  rIy y 7 6w)NT)r   )r   r[   ChannelConnectivityREADYr   )rI   states     r/   channel_readyzChannel.channel_ready  sg     d3t//555,,U333NN$N7E t//5553s   AA?A=3A?;A?r<   c                      y r'   r]   )rI   r<   s     r/   _get_registered_call_handlez#Channel._get_registered_call_handle  s    r1   r=   r>   _registered_methodc           	          t        | j                  t        j                  |      ||| j                  | g| j
                        S r'   )r_   r5   r   r   rz   r4   rI   r<   r=   r>   r   s        r/   unary_unaryzChannel.unary_unary  s?     'MMNN6"!**FJJ
 	
r1   c           	          t        | j                  t        j                  |      ||| j                  | g| j
                        S r'   )rn   r5   r   r   r{   r4   r   s        r/   unary_streamzChannel.unary_stream  ?     (MMNN6"!++FJJ
 	
r1   c           	          t        | j                  t        j                  |      ||| j                  | g| j
                        S r'   )rq   r5   r   r   r|   r4   r   s        r/   stream_unaryzChannel.stream_unary  r   r1   c           	          t        | j                  t        j                  |      ||| j                  | g| j
                        S r'   )rw   r5   r   r   r}   r4   r   s        r/   stream_streamzChannel.stream_stream*  s?     )MMNN6"!,,FJJ
 	
r1   r'   )F)rB   N)NNF)0rQ   rR   rS   rU   rV   rW   r
   rX   r   r   r   r   r   strr   r   ChannelCredentialsr[   r\   r   r   rK   r   Callrf   r   r   r   rj   r   r   rl   r   r   r   r   intr   r"   r   r_   r   rn   r   rq   r   rw   r   r]   r1   r/   rF   rF   K  sy   $$$#$?@@ $%A BB $%A BB!%&C!DD2/2/ %2/ f778	2/
 d../2/ x(9:;2/h;:?? ;t ;
 'R!% !"
 &+Q"Q		!	!Q*!55* 
*08# #  =AAE-2

 %%89
  ((=>	

 %TN
 
!
. =AAE-2

 %%89
  ((=>	

 %TN
 
"
. =AAE-2

 %%89
  ((=>	

 %TN
 
"
. =AAE-2

 %%89
  ((=>	

 %TN
 
#
r1   rF   r~   r   r?   c                 (    t        | |dn|d||      S )a  Creates an insecure asynchronous Channel to a server.

    Args:
      target: The server address
      options: An optional list of key-value pairs (:term:`channel_arguments`
        in gRPC Core runtime) to configure the channel.
      compression: An optional value indicating the compression method to be
        used over the lifetime of the channel.
      interceptors: An optional sequence of interceptors that will be executed for
        any call executed with this channel.

    Returns:
      A Channel.
    Nr]   )rF   )r~   r   r%   r?   s       r/   insecure_channelr   <  s&    ( o7 r1   rb   c                 <    t        | |dn||j                  ||      S )a<  Creates a secure asynchronous Channel to a server.

    Args:
      target: The server address.
      credentials: A ChannelCredentials instance.
      options: An optional list of key-value pairs (:term:`channel_arguments`
        in gRPC Core runtime) to configure the channel.
      compression: An optional value indicating the compression method to be
        used over the lifetime of the channel.
      interceptors: An optional sequence of interceptors that will be executed for
        any call executed with this channel.

    Returns:
      An aio.Channel.
    r]   )rF   _credentials)r~   rb   r   r%   r?   s        r/   secure_channelr   Y  s,    , o7   r1   )NNN);rT   rU   typingr   r   r   r   r   r[   r   r   r	   grpc._cythonr
    r   r   _callr   r   r   r   _interceptorr   r   r   r   r   r   r   r   r   	_metadatar   _typingr   r   r   r   r    r!   r"   _utilsr#   r   __version__r+   r\   r0   r3   r_   rn   rq   rw   rF   r   r   r   r   r]   r1   r/   <module>r      s   =  0 0     !    # " " ! + 5 4 4 3 7 6 6 5  ( * ! (   ! ( (&--.>.J.JK%4<T=M=M4N&B BJ,==,^->>-`,>>,^,??,^n
m## n
f .2.2:>	)* $**+ 8$567	@ .2.2:>(( )* $**+	
 8$567r1   