
    Agc                        d 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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Z!dZ"dZ#dZ$dZ%dZ&dZ'dZ( ejR                  e*      Z+ G d dejX                        Z-dedej\                  de-fdZ/ G d  d!      Z0 G d" d#ejb                        Z2 G d$ d%e0ee         Z3 G d& d'e0      Z4 G d( d)e0      Z5 G d* d+e3e0ejl                        Z6 G d, d-e4e0ejn                        Z7 G d. d/e5e3e0ejp                        Z8 G d0 d1e5e4e0ejr                        Z9y)2z6Invocation-side implementation of gRPC Asyncio Python.    N)partial)AnyAsyncIterator	GeneratorGenericOptionalTupleUnion)_common)cygrpc   )
_base_call)Metadata)DeserializingFunction)DoneCallbackType)EOFType)MetadatumType)RequestIterableType)RequestType)ResponseType)SerializingFunction)AioRpcErrorCallUnaryUnaryCallUnaryStreamCallz!Locally cancelled by application!z"Cancelled upon garbage collection!zRPC already finished.z0RPC is half closed after calling "done_writing".zBThe iterator and read/write APIs may not be mixed on a single RPC.z?<{} of RPC that terminated with:
	status = {}
	details = "{}"
>zZ<{} of RPC that terminated with:
	status = {}
	details = "{}"
	debug_error_string = "{}"
>c                   B    e Zd ZU dZej
                  ed<   ee   ed<   ee	   ed<   ee	   ed<   ee   ed<   	 	 ddej
                  d	e	d
e	dee   dee   ddf fdZ
dej
                  fdZdee   fdZde	fdZde	fdZdefdZdefdZdefdZdefdZd Z xZS )r   zAn implementation of RpcError to be used by the asynchronous API.

    Raised RpcError is a snapshot of the final status of the RPC, values are
    determined. Hence, its methods no longer needs to be coroutines.
    _code_details_initial_metadata_trailing_metadata_debug_error_stringNcodeinitial_metadatatrailing_metadatadetailsdebug_error_stringreturnc                 h    t         |           || _        || _        || _        || _        || _        y)ah  Constructor.

        Args:
          code: The status code with which the RPC has been finalized.
          details: Optional details explaining the reason of the error.
          initial_metadata: Optional initial metadata that could be sent by the
            Server.
          trailing_metadata: Optional metadata that could be sent by the Server.
        N)super__init__r   r   r   r    r!   )selfr"   r#   r$   r%   r&   	__class__s         C/var/www/openai/venv/lib/python3.12/site-packages/grpc/aio/_call.pyr*   zAioRpcError.__init__U   s6    $ 	
!1"3#5     c                     | j                   S )ztAccesses the status code sent by the server.

        Returns:
          The `grpc.StatusCode` status code.
        )r   r+   s    r-   r"   zAioRpcError.coden   s     zzr.   c                     | j                   S )zkAccesses the details sent by the server.

        Returns:
          The description of the error.
        )r   r0   s    r-   r%   zAioRpcError.detailsv   s     }}r.   c                     | j                   S )zuAccesses the initial metadata sent by the server.

        Returns:
          The initial metadata received.
        )r   r0   s    r-   r#   zAioRpcError.initial_metadata~   s     %%%r.   c                     | j                   S )zwAccesses the trailing metadata sent by the server.

        Returns:
          The trailing metadata received.
        )r    r0   s    r-   r$   zAioRpcError.trailing_metadata   s     &&&r.   c                     | j                   S )zyAccesses the debug error string sent by the server.

        Returns:
          The debug error string received.
        )r!   r0   s    r-   r&   zAioRpcError.debug_error_string   s     '''r.   c                     t         j                  | j                  j                  | j                  | j
                  | j                        S )z-Assembles the error string for the RPC error.)_NON_OK_CALL_REPRESENTATIONformatr,   __name__r   r   r!   r0   s    r-   _reprzAioRpcError._repr   s9    *11NN##JJMM$$	
 	
r.   c                 "    | j                         S Nr9   r0   s    r-   __repr__zAioRpcError.__repr__       zz|r.   c                 "    | j                         S r;   r<   r0   s    r-   __str__zAioRpcError.__str__   r>   r.   c                     t        |       | j                  | j                  | j                  | j                  | j
                  ffS r;   )typer   r   r    r   r!   r0   s    r-   
__reduce__zAioRpcError.__reduce__   sA    J

&&''((	
 		
r.   )NN)r8   
__module____qualname____doc__grpc
StatusCode__annotations__r   strr   r*   r"   r%   r#   r$   r&   r9   r=   r@   rC   __classcell__r,   s   @r-   r   r   H   s     ??sm)) **!#& "&,06oo6 #6 $	6
 #6 %SM6 
62doo # &( &'8 '(C (
s 
#  

r.   r   r#   statusr'   c                     t        t        j                  |j                            t	        j
                  |       t	        j
                  |j                               |j                         |j                               S )N)r%   r&   )	r   r   !CYGRPC_STATUS_CODE_TO_STATUS_CODEr"   r   
from_tupler$   r%   r&   )r#   rM   s     r-   _create_rpc_errorrQ      sa     11&++-@,-F4467 !446 r.   c                      e Zd ZU dZej
                  ed<   ej                  ed<   e	j                  ed<   eedf   ed<   eed<   eed<   d	e	j                  d
edededej
                  ddfdZd#dZdefdZdedefdZdefdZdefdZdeddfdZdee   fdZdefdZdefdZdej                  fdZdefdZ defdZ!d#dZ"defd Z#defd!Z$defd"Z%y)$r   zyBase implementation of client RPC Call object.

    Implements logic around final status, metadata and cancellation.
    _loopr   _cython_call.	_metadata_request_serializer_response_deserializercython_callmetadatarequest_serializerresponse_deserializerloopr'   Nc                 \    || _         || _        t        |      | _        || _        || _        y r;   )rS   rT   tuplerU   rV   rW   )r+   rX   rY   rZ   r[   r\   s         r-   r*   zCall.__init__   s.     
'x#5 &;#r.   c                 ~    t        | d      r1| j                  j                         s| j                  t               y y y )NrT   )hasattrrT   done_cancel_GC_CANCELLATION_DETAILSr0   s    r-   __del__zCall.__del__   s5    4($$))+56 , )r.   c                 6    | j                   j                         S r;   )rT   	cancelledr0   s    r-   rf   zCall.cancelled   s      **,,r.   r%   c                 p    | j                   j                         s| j                   j                  |       yy)z0Forwards the application cancellation reasoning.TF)rT   ra   cancel)r+   r%   s     r-   rb   zCall._cancel   s.      %%'$$W-r.   c                 ,    | j                  t              S r;   )rb   _LOCAL_CANCELLATION_DETAILSr0   s    r-   rh   zCall.cancel   s    ||788r.   c                 6    | j                   j                         S r;   )rT   ra   r0   s    r-   ra   z	Call.done   s      %%''r.   callbackc                 R    t        ||       }| j                  j                  |       y r;   )r   rT   add_done_callback)r+   rl   cbs      r-   rn   zCall.add_done_callback   s"    Xt$++B/r.   c                 6    | j                   j                         S r;   )rT   time_remainingr0   s    r-   rq   zCall.time_remaining   s      //11r.   c                 |   K   | j                   j                          d {   }t        j                  |      S 7 wr;   )rT   r#   r   rP   r+   raw_metadata_tuples     r-   r#   zCall.initial_metadata   s6     #'#4#4#E#E#GG""#566 Hs   <:<c                    K   | j                   j                          d {   j                         }t        j                  |      S 7 'wr;   )rT   rM   r$   r   rP   rs   s     r-   r$   zCall.trailing_metadata   sB     ##**,,


 	 ""#566 -s   A
A(A
c                    K   | j                   j                          d {   j                         }t        j                  |   S 7 %wr;   )rT   rM   r"   r   rO   )r+   cygrpc_codes     r-   r"   z	Call.code  s<     !..5577==?88EE 8s   AA&Ac                 n   K   | j                   j                          d {   j                         S 7 wr;   )rT   rM   r%   r0   s    r-   r%   zCall.details  s*     ''..0099;;0   535c                 n   K   | j                   j                          d {   j                         S 7 wr;   )rT   rM   r&   r0   s    r-   r&   zCall.debug_error_string  s*     ''..00DDFF0ry   c                 b  K   | j                   j                         rt        j                         | j	                          d {   }|t
        j                  j                  k7  rBt        | j                          d {   | j                   j                          d {         y 7 d7 ,7 wr;   )rT   is_locally_cancelledasyncioCancelledErrorr"   rG   rH   OKrQ   r#   rM   )r+   r"   s     r-   _raise_for_statuszCall._raise_for_status  s     113((**YY[ 4??%%%#++--T5F5F5M5M5O/O  & ! ./Os6   AB/B)9B/>B+? B/B-
 
B/+B/-B/c                 ,    t        | j                        S r;   )reprrT   r0   s    r-   r9   z
Call._repr  s    D%%&&r.   c                 "    | j                         S r;   r<   r0   s    r-   r=   zCall.__repr__  r>   r.   c                 "    | j                         S r;   r<   r0   s    r-   r@   zCall.__str__  r>   r.   r'   N)&r8   rD   rE   rF   r}   AbstractEventLooprI   rG   rH   r   _AioCallr	   r   r   r   r   r*   rd   boolrf   rJ   rb   rh   ra   r   rn   r   floatrq   r#   r$   r"   r%   r&   r   r9   r=   r@    r.   r-   r   r      s[   
 $$$??//!]C'((,,11<__< < 0	<
  5< ''< 
<7-4 -s t 9 9(d (0*: 0t 02 27 77 7FDOO F<s <G# G's '#  r.   r   c                       e Zd ZdZdZdZy)	_APIStyler   r      N)r8   rD   rE   UNKNOWNASYNC_GENERATORREADER_WRITERr   r.   r-   r   r     s    GOMr.   r   c                   |     e Zd ZU ej                  ed<   dej                  fdZdef fdZde	e
def   fdZ xZS )_UnaryResponseMixin_call_responseresponse_taskc                     || _         y r;   )r   )r+   r   s     r-   _init_unary_response_mixinz._UnaryResponseMixin._init_unary_response_mixin'  s
    +r.   r'   c                 X    t         |          r| j                  j                          yyNTF)r)   rh   r   r+   r,   s    r-   rh   z_UnaryResponseMixin.cancel*  s%    7>&&(r.   Nc              #     K   	 | j                   E d{   }|t
        j                  u rb| j                  j                         rt        j                         t        | j                  j                  | j                  j                        |S 7 z# t        j                  $ r" | j                         s| j	                           w xY ww)z+Wait till the ongoing RPC request finishes.N)r   r}   r~   rf   rh   r   EOFrT   r|   rQ   r   _status)r+   responses     r-   	__await__z_UnaryResponseMixin.__await__1  s     		"&"5"55H vzz!  557,,..'%%77%%-- 
 O1 6%% 	
 >>#	s,   CB BB A6CB 5CC)r8   rD   rE   r}   TaskrI   r   r   rh   r   r   r   r   rK   rL   s   @r-   r   r   $  sA    LL , , 9S$%<= r.   r   c                        e Zd ZU ee   ed<   ej                  ed<   eed<   dej                  fdZ	defdZ
def fd	Zdefd
Zdee   fdZdefdZdeeef   fdZ xZS )_StreamResponseMixin_message_aiter_preparation_response_stylepreparationc                 J    d | _         || _        t        j                  | _        y r;   )r   r   r   r   r   )r+   r   s     r-   _init_stream_response_mixinz0_StreamResponseMixin._init_stream_response_mixinT  s     "'(00r.   stylec                     | j                   t        j                  u r|| _         y | j                   |urt        j                  t
              y r;   )r   r   r   r   
UsageError_API_STYLE_ERRORr+   r   s     r-   _update_response_stylez+_StreamResponseMixin._update_response_styleY  sC    9#4#44#(D !!.##$455 /r.   r'   c                 X    t         |          r| j                  j                          yyr   )r)   rh   r   r   s    r-   rh   z_StreamResponseMixin.cancel_  s%    7>$$&r.   c                   K   | j                          d {   }|t        j                  ur0| | j                          d {   }|t        j                  ur0| j                          d {    y 7 _7 27 	wr;   )_readr   r   r   )r+   messages     r-   _fetch_stream_responsesz,_StreamResponseMixin._fetch_stream_responsesf  sf     

$VZZ'M JJL(G VZZ'
 $$&&& % ) 	's9   A<A6.A<A8A<A<0A:1A<8A<:A<c                     | j                  t        j                         | j                  | j	                         | _        | j                  S r;   )r   r   r   r   r   r0   s    r-   	__aiter__z_StreamResponseMixin.__aiter__o  s?    ##I$=$=>&"&">">"@D"""r.   c                 t  K   | j                    d {    	 | j                  j                          d {   }|t        j                  u rt        j                  S t        j                  || j                        S 7 i7 H# t        j                  $ r" | j                         s| j                           w xY wwr;   )r   rT   receive_serialized_messager}   r~   rf   rh   r   r   r   deserializerW   )r+   raw_responses     r-   r   z_StreamResponseMixin._readu  s     	!%!2!2!M!M!OOL 6::%::&&d99  	  P%% 	>>#	s6   B8A<B8B  A>B  AB8>B   5B55B8c                 L  K   | j                         r(| j                          d {    t        j                  S | j	                  t
        j                         | j                          d {   }|t        j                  u r| j                          d {    |S 7 w7 27 
wr;   )ra   r   r   r   r   r   r   r   )r+   response_messages     r-   readz_StreamResponseMixin.read  s     99;((***::##I$;$;<!%-vzz)((*** + . +s4   $B$BAB$-B .)B$B"B$ B$"B$)r8   rD   rE   r   r   rI   r}   r   r   r   r   r   rh   r   r   r   r
   r   r   rK   rL   s   @r-   r   r   O  s    !,//,,1w|| 1
6I 6 '| '#=6 #\ & E'<"78  r.   r   c                        e Zd ZU ej                  ed<   eed<   eej                     ed<   e	ed<   dee
   fdZde	fdZd	ef fd
Zd Zde
d	dfdZded	dfdZddZded	dfdZddZddZ xZS )_StreamRequestMixin_metadata_sent_done_writing_flag_async_request_poller_request_stylerequest_iteratorc                 
   t        j                         | _        d| _        |E| j                  j                  | j                  |            | _        t        j                  | _
        y d | _        t        j                  | _
        y )NF)r}   Eventr   r   rS   create_task_consume_request_iteratorr   r   r   r   r   )r+   r   s     r-   _init_stream_request_mixinz._StreamRequestMixin._init_stream_request_mixin  sn     &mmo"' ')-)?)?../?@*D& #,";";D)-D&"+"9"9Dr.   r   c                 R    | j                   |urt        j                  t              y r;   )r   r   r   r   r   s     r-   _raise_for_different_stylez._StreamRequestMixin._raise_for_different_style  s'    e+##$455 ,r.   r'   c                 p    t         |          r'| j                  | j                  j                          yyr   )r)   rh   r   r   s    r-   rh   z_StreamRequestMixin.cancel  s1    7>))5**113r.   c                 8    | j                   j                          y r;   )r   setr0   s    r-   _metadata_sent_observerz+_StreamRequestMixin._metadata_sent_observer  s    !r.   Nc                 T  K   	 t        j                  |      st        |d      r&|2 3 d {   }	 | j                  |       d {    $|D ]  }	 | j                  |       d {     | j                          d {    y 7 Y7 A# t        $ r!}t
        j                  d|       Y d }~ y d }~ww xY w6 L7 R# t        $ r!}t
        j                  d|       Y d }~ y d }~ww xY w7 g#  t
        j                  dt        j                                | j                          Y y xY ww)Nr   z2Exception while consuming the request_iterator: %sz,Client request_iterator raised exception:
%s)inspect
isasyncgenr`   _writer   _LOGGERdebug_done_writing	traceback
format_excrh   )r+   r   request	rpc_errors       r-   r   z-_StreamRequestMixin._consume_request_iterator  s    '	!!"23w +8 &6 '
"kk'222  0G
"kk'222  0 $$&&&52& !8 &  &6 3& !8 &  '	 MM?$$& KKMs   D(#C) B6BB6C) B	BB	
C) B:%B8&B:*C) ?C' C) D(B6B			B3B.(C) -D(.B33C) 8B::	C$CC) D(C$$C) ):D%#D(r   c                 $  K   | j                         rt        j                  t              | j                  rt        j                  t
              | j                  j                         sJ| j                  j                          d {    | j                         r| j                          d {    t        j                  || j                        }	 | j                  j                  |       d {    y 7 q7 K7 	# t        j                   $ rG}| j                  j#                  t%        |             | j                          d {  7   Y d }~y d }~wt        j&                  $ r" | j)                         s| j+                           w xY wwr;   )ra   r}   InvalidStateError_RPC_ALREADY_FINISHED_DETAILSr   _RPC_HALF_CLOSED_DETAILSr   is_setwaitr   r   	serializerV   rT   send_serialized_messager   InternalErrorset_internal_errorrJ   r~   rf   rh   )r+   r   serialized_requesterrs       r-   r   z_StreamRequestMixin._write  s0    99;++,IJJ""++,DEE""))+%%**,,,yy{,,...$..T--
	##;;<NOOO -. P## 	+00S:((***%% 	>>#	sl   BFC:	'F0C<1$FD  4C>5D  9F<F>D   F7E
EEF8FFc                   K   | j                         ry | j                  s+d| _        	 | j                  j                          d {    y y 7 # t        j
                  $ r" | j                         s| j                           w xY ww)NT)ra   r   rT   send_receive_closer}   r~   rf   rh   r0   s    r-   r   z!_StreamRequestMixin._done_writing  st     99;&&&*D#''::<<<	 ' =)) ~~'KKMs.   %BA AA 
BA 5BBc                    K   | j                  t        j                         | j                  |       d {    y 7 wr;   )r   r   r   r   )r+   r   s     r-   writez_StreamRequestMixin.write  s,     ''	(?(?@kk'"""s   4><>c                 ~   K   | j                  t        j                         | j                          d{    y7 w)zUSignal peer that client is done writing.

        This method is idempotent.
        N)r   r   r   r   r0   s    r-   done_writingz _StreamRequestMixin.done_writing  s.     
 	''	(?(?@  """s   3=;=c                    K   | j                   j                          d {    | j                         r| j                          d {    y y 7 .7 wr;   )r   r   ra   r   r0   s    r-   wait_for_connectionz'_StreamRequestMixin.wait_for_connection  sG     !!&&(((99;((***  	)*s!   AA'AA	AAr   )r8   rD   rE   r}   r   rI   r   r   r   r   r   r   r   rh   r   r   r   r   r   r   r   r   rK   rL   s   @r-   r   r     s    MM!#GLL11: ()< =: 6	 6 "* 3*	*XK D .#; #4 ##+r.   r   c                        e Zd ZU dZeed<   ej                  ed<   dedee	   de
deej                     dee   d	ej                  d
edededej&                  ddf fdZdefdZddZ xZS )r   z}Object for managing unary-unary RPC calls.

    Returned when an instance of `UnaryUnaryMultiCallable` object is called.
    _request_invocation_taskr   deadlinerY   credentialswait_for_readychannelmethodrZ   r[   r\   r'   Nc                    t         |   |j                  ||||      |||	|
       || _        t	        j
                         | _        |
j                  | j                               | _	        | j                  | j                         y r;   )r)   r*   callr   r   build_census_context_contextr   _invoker   r   r+   r   r   rY   r   r   r   r   rZ   r[   r\   r,   s              r-   r*   zUnaryUnaryCall.__init__(  sv     	LL;G!	
  335 $ 0 0 @''(=(=>r.   c                   K   t        j                  | j                  | j                        }	 | j                  j                  || j                  | j                         d {   }| j                  j                         r t        j                  | j                        S t        j                   S 7 N# t        j                  $ r# | j                         s| j                          Y w xY wwr;   )r   r   r   rV   rT   unary_unaryrU   r   r}   r~   rf   rh   is_okr   rW   r   r   )r+   r   serialized_responses      r-   r   zUnaryUnaryCall._invokeA  s     $..MM433
	(,(9(9(E(E"DNNDMM) # ""$&&#T%@%@  ::# %% 	>>#	s;   +C,4B3 "B1#B3 'A
C,1B3 33C)&C,(C))C,c                    K   | j                    d {    | j                         r| j                          d {    y y 7 .7 wr;   )r   ra   r   r0   s    r-   r   z"UnaryUnaryCall.wait_for_connectionX  s>     ####99;((***  	$*   AA'AAAAr   )r8   rD   rE   rF   r   rI   r}   r   r   r   r   rG   CallCredentialsr   r   
AioChannelbytesr   r   r   r*   r   r   r   rK   rL   s   @r-   r   r     s    
 ll"?? 5/? 	?
 d223? !? ""? ? 0?  5? ''? 
?2| .+r.   r   c                        e Zd ZU dZeed<   ej                  ed<   dedee	   de
deej                     dee   d	ej                  d
edededej&                  ddf fdZdefdZddZ xZS )r   zObject for managing unary-stream RPC calls.

    Returned when an instance of `UnaryStreamMultiCallable` object is called.
    r   _send_unary_request_taskr   r   rY   r   r   r   r   rZ   r[   r\   r'   Nc                    t         |   |j                  ||||      |||	|
       || _        t	        j
                         | _        |
j                  | j                               | _	        | j                  | j                         y r;   )r)   r*   r   r   r   r   r   r   _send_unary_requestr  r   r   s              r-   r*   zUnaryStreamCall.__init__h  s~     	LL;G!	
  335(,(8(8$$&)
% 	(()F)FGr.   c                 H  K   t        j                  | j                  | j                        }	 | j                  j                  || j                  | j                         d {    y 7 # t        j                  $ r" | j                         s| j                           w xY wwr;   )r   r   r   rV   rT   initiate_unary_streamrU   r   r}   r~   rf   rh   )r+   r   s     r-   r  z#UnaryStreamCall._send_unary_request  s     $..MM433
	##99"DNNDMM   %% 	>>#	s.   +B"4A* "A(#A* 'B"(A* *5BB"c                    K   | j                    d {    | j                         r| j                          d {    y y 7 .7 wr;   )r  ra   r   r0   s    r-   r   z#UnaryStreamCall.wait_for_connection  s>     ++++99;((***  	,*r   r   )r8   rD   rE   rF   r   rI   r}   r   r   r   r   rG   r  r   r   r  r  r   r   r   r*   r   r  r   rK   rL   s   @r-   r   r   ^  s    
 %ll*HH 5/H 	H
 d223H !H ""H H 0H  5H ''H 
H6< +r.   r   c                        e Zd ZdZdee   dee   dedeej                     dee
   dej                  ded	ed
edej"                  ddf fdZdefdZ xZS )StreamUnaryCallzObject for managing stream-unary RPC calls.

    Returned when an instance of `StreamUnaryMultiCallable` object is called.
    r   r   rY   r   r   r   r   rZ   r[   r\   r'   Nc                     t         |   |j                  ||||      |||	|
       t        j                         | _        | j                  |       | j                  |
j                  | j                                      y r;   )
r)   r*   r   r   r   r   r   r   r   _conduct_rpcr+   r   r   rY   r   r   r   r   rZ   r[   r\   r,   s              r-   r*   zStreamUnaryCall.__init__  ss     	LL;G!	
 335''(89''(8(89J9J9L(MNr.   c                   K   	 | j                   j                  | j                  | j                  | j                         d {   }| j                   j                         r t        j                  || j                        S t        j                  S 7 N# t
        j                  $ r" | j                         s| j                           w xY wwr;   )rT   stream_unaryrU   r   r   r}   r~   rf   rh   r   r   r   rW   r   r   )r+   r   s     r-   r  zStreamUnaryCall._conduct_rpc  s     	(,(9(9(F(F < <dmm) # ""$&&#T%@%@  ::# %% 	>>#	s/   C>B BB A
CB 5CC)r8   rD   rE   rF   r   r   r   r   rG   r  r   r   r  r  r   r   r}   r   r*   r   r  rK   rL   s   @r-   r  r    s    O"#67O 5/O 	O
 d223O !O ""O O 0O  5O ''O 
O2L r.   r  c                        e Zd ZU dZej
                  ed<   dee   dee	   de
deej                     dee   dej                  d	ed
ededej&                  ddf fdZd Z xZS )StreamStreamCallzObject for managing stream-stream RPC calls.

    Returned when an instance of `StreamStreamMultiCallable` object is called.
    _initializerr   r   rY   r   r   r   r   rZ   r[   r\   r'   Nc                 6   t         |   |j                  ||||      |||	|
       t        j                         | _        | j                  j                  | j                               | _	        | j                  |       | j                  | j                         y r;   )r)   r*   r   r   r   r   rS   r   _prepare_rpcr  r   r   r  s              r-   r*   zStreamStreamCall.__init__  s     	LL;G!	
 335 JJ2243D3D3FG''(89(():):;r.   c                   K   	 | j                   j                  | j                  | j                  | j                         d{    y7 # t
        j                  $ r% | j                         s| j                          Y yY yw xY ww)zThis method prepares the RPC for receiving/sending messages.

        All other operations around the stream should only happen after the
        completion of this method.
        N)	rT   initiate_stream_streamrU   r   r   r}   r~   rf   rh   r0   s    r-   r  zStreamStreamCall._prepare_rpc  sl     	##:: < <dmm   %% 	>># $	s:   B>A
 AA
 BA
 
3B=BBB)r8   rD   rE   rF   r}   r   rI   r   r   r   r   rG   r  r   r   r  r  r   r   r   r*   r  rK   rL   s   @r-   r  r    s    
 ,,<"#67< 5/< 	<
 d223< !< ""< < 0<  5< ''< 
<2r.   r  ):rF   r}   enum	functoolsr   r   loggingr   typingr   r   r   r   r   r	   r
   rG   r   grpc._cythonr    r   rU   r   _typingr   r   r   r   r   r   r   r   __all__rj   rc   r   r   r   _OK_CALL_REPRESENTATIONr6   	getLoggerr8   r   RpcErrorr   AioRpcStatusrQ   r   IntEnumr   r   r   r   r   r   r  r  r   r.   r-   <module>r&     s   =              * %  " (   ! (
DA ?  7 M H 
 K 
  '

H
%g
$-- g
T		(.(;(;		] ]@ ($ 5 (VD 4 D NE+$ E+P=+($
0I0I =+@5+*D*2L2L 5+r1,dJ4N4N1h0-tZ5P5P0r.   