403Webshell
Server IP : 162.144.4.212  /  Your IP : 216.73.216.108
Web Server : Apache
System : Linux gator2125.hostgator.com 5.14.0-162.23.1.9991722448259.nf.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 31 18:11:45 UTC 2024 x86_64
User : cozeellc ( 2980)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /usr/libexec/oracle-cloud-agent/plugins/osms/grpc/aio/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/libexec/oracle-cloud-agent/plugins/osms/grpc/aio/_call.pyc
a

K��fc�@s�dZddlZddlZddlmZddlZddlZddlZddlm	Z	m
Z
mZmZm
Z
mZmZddlZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlm Z dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(e�)e*�Z+Gdd�dej,�Z-eej.e-d�dd�Z/Gdd �d �Z0Gd!d"�d"ej1�Z2Gd#d$�d$e0ee�Z3Gd%d&�d&e0�Z4Gd'd(�d(e0�Z5Gd)d*�d*e3e0ej6�Z6Gd+d,�d,e4e0ej7�Z7Gd-d.�d.e5e3e0ej8�Z8Gd/d0�d0e5e4e0ej9�Z9dS)1z6Invocation-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!zRPC 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 = "{}"
>cs�eZdZUdZejed<eeed<ee	ed<ee	ed<eeed<deje	e	eeeedd��fd	d
�
Z
ejd�dd
�Zeed�dd�Ze	d�dd�Z
e	d�dd�Zed�dd�Zed�dd�Zed�dd�Zed�dd�Zdd�Z�ZS)rz�An 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�returncs,t���||_||_||_||_||_dS)ahConstructor.

        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__rrrrr)�selfr r!r"r#r$��	__class__��r/sparta/input/_build_configuration/image_build+validate/lib/bmcenv/lib64/python3.9/site-packages/grpc/aio/_call.pyr'Us
zAioRpcError.__init__�r%cCs|jS)ztAccesses the status code sent by the server.

        Returns:
          The `grpc.StatusCode` status code.
        )r�r(r+r+r,r nszAioRpcError.codecCs|jS)zkAccesses the details sent by the server.

        Returns:
          The description of the error.
        )rr.r+r+r,r#vszAioRpcError.detailscCs|jS)zuAccesses the initial metadata sent by the server.

        Returns:
          The initial metadata received.
        )rr.r+r+r,r!~szAioRpcError.initial_metadatacCs|jS)zwAccesses the trailing metadata sent by the server.

        Returns:
          The trailing metadata received.
        )rr.r+r+r,r"�szAioRpcError.trailing_metadatacCs|jS)zyAccesses the debug error string sent by the server.

        Returns:
          The debug error string received.
        )rr.r+r+r,r$�szAioRpcError.debug_error_stringcCst�|jj|j|j|j�S)z-Assembles the error string for the RPC error.)�_NON_OK_CALL_REPRESENTATION�formatr*�__name__rrrr.r+r+r,�_repr�s�zAioRpcError._reprcCs|��S�N�r2r.r+r+r,�__repr__�szAioRpcError.__repr__cCs|��Sr3r4r.r+r+r,�__str__�szAioRpcError.__str__cCs t|�|j|j|j|j|jffSr3)�typerrrrrr.r+r+r,�
__reduce__�s��zAioRpcError.__reduce__)NN)r1�
__module__�__qualname__�__doc__�grpc�
StatusCode�__annotations__r�strrr'r r#r!r"r$r2r5r6r8�
__classcell__r+r+r)r,rHs2

��	r)r!�statusr%cCs4ttj|��t�|�t�|���|��|��d�S)N)r#r$)	rr
�!CYGRPC_STATUS_CODE_TO_STATUS_CODEr r�
from_tupler"r#r$)r!rAr+r+r,�_create_rpc_error�s�rDc@sVeZdZUdZejed<ejed<e	j
ed<eedfed<e
ed<eed<e	j
ee
eejd	d
�dd�Zd	d
�dd�Zed
�dd�Zeed�dd�Zed
�dd�Zed
�dd�Zed	d�dd�Zeed
�dd�Zed
�dd�Zed
�d d!�Zejd
�d"d#�Zed
�d$d%�Z ed
�d&d'�Z!d	d
�d(d)�Z"ed
�d*d+�Z#ed
�d,d-�Z$ed
�d.d/�Z%d	S)0rzyBase implementation of client RPC Call object.

    Implements logic around final status, metadata and cancellation.
    �_loopr�_cython_call.�	_metadata�_request_serializer�_response_deserializerN)�cython_call�metadata�request_serializer�response_deserializer�loopr%cCs&||_||_t|�|_||_||_dSr3)rErF�tuplerGrHrI)r(rJrKrLrMrNr+r+r,r'�s

z
Call.__init__r-cCs"t|d�r|j��s|�t�dS)NrF)�hasattrrF�done�_cancel�_GC_CANCELLATION_DETAILSr.r+r+r,�__del__�s

zCall.__del__cCs
|j��Sr3)rF�	cancelledr.r+r+r,rU�szCall.cancelled)r#r%cCs"|j��s|j�|�dSdSdS)z0Forwards the application cancellation reasoning.TFN)rFrQ�cancel)r(r#r+r+r,rR�s
zCall._cancelcCs
|�t�Sr3)rR�_LOCAL_CANCELLATION_DETAILSr.r+r+r,rV�szCall.cancelcCs
|j��Sr3)rFrQr.r+r+r,rQ�sz	Call.done)�callbackr%cCst||�}|j�|�dSr3)rrF�add_done_callback)r(rX�cbr+r+r,rY�s
zCall.add_done_callbackcCs
|j��Sr3)rF�time_remainingr.r+r+r,r[�szCall.time_remainingc�s|j��IdH}t�|�Sr3)rFr!rrC�r(�raw_metadata_tupler+r+r,r!�szCall.initial_metadatac�s|j��IdH��}t�|�Sr3)rFrAr"rrCr\r+r+r,r"�s�zCall.trailing_metadatac�s|j��IdH��}tj|Sr3)rFrAr r
rB)r(�cygrpc_coder+r+r,r sz	Call.codec�s|j��IdH��Sr3)rFrAr#r.r+r+r,r#szCall.detailsc�s|j��IdH��Sr3)rFrAr$r.r+r+r,r$szCall.debug_error_stringc�sP|j��rt���|��IdH}|tjjkrLt|�	�IdH|j�
�IdH��dSr3)rF�is_locally_cancelled�asyncio�CancelledErrorr r<r=�OKrDr!rA)r(r r+r+r,�_raise_for_statuss
�zCall._raise_for_statuscCs
t|j�Sr3)�reprrFr.r+r+r,r2sz
Call._reprcCs|��Sr3r4r.r+r+r,r5sz
Call.__repr__cCs|��Sr3r4r.r+r+r,r6szCall.__str__)&r1r9r:r;r`�AbstractEventLoopr>r<r=r�_AioCallrrrrrr'rT�boolrUr?rRrVrQrrYr�floatr[r!r"r r#r$rcr2r5r6r+r+r+r,r�s<



�	rc@seZdZdZdZdZdS)�	_APIStylerr�N)r1r9r:�UNKNOWN�ASYNC_GENERATOR�
READER_WRITERr+r+r+r,risricsVeZdZUejed<ejd�dd�Zed��fdd�Ze	e
defd�d	d
�Z�Z
S)�_UnaryResponseMixin�_call_response)�
response_taskcCs
||_dSr3)ro)r(rpr+r+r,�_init_unary_response_mixin'sz._UnaryResponseMixin._init_unary_response_mixinr-cs t���r|j��dSdSdS�NTF)r&rVror.r)r+r,rV*s

z_UnaryResponseMixin.cancelNccsrz|jEdH}Wn&tjy6|��s0|���Yn0|tjurj|j��rVt���qnt	|jj
|jj��n|SdS)z+Wait till the ongoing RPC request finishes.N)ror`rarUrVr�EOFrFr_rDr�_status)r(�responser+r+r,�	__await__1s


�z_UnaryResponseMixin.__await__)r1r9r:r`�Taskr>rqrgrVrrrrvr@r+r+r)r,rn$s

rncs�eZdZUeeed<ejed<eed<ejd�dd�Z	ed�dd	�Z
ed
��fdd�Zed
�d
d�Z
eed
�dd�Zed
�dd�Zeeefd
�dd�Z�ZS)�_StreamResponseMixin�_message_aiter�_preparation�_response_style)�preparationcCsd|_||_tj|_dSr3)ryrzrirkr{)r(r|r+r+r,�_init_stream_response_mixinTsz0_StreamResponseMixin._init_stream_response_mixin��stylecCs,|jtjur||_n|j|ur(t�t��dSr3)r{rirkr�
UsageError�_API_STYLE_ERROR�r(rr+r+r,�_update_response_styleYs
z+_StreamResponseMixin._update_response_styler-cs t���r|j��dSdSdSrr)r&rVrzr.r)r+r,rV_s

z_StreamResponseMixin.cancelcCs@|��IdH}|tjur.|V|��IdH}q|��IdHdSr3)�_readrrsrc)r(�messager+r+r,�_fetch_stream_responsesfs

z,_StreamResponseMixin._fetch_stream_responsescCs&|�tj�|jdur |��|_|jSr3)r�rirlryr�r.r+r+r,�	__aiter__os

z_StreamResponseMixin.__aiter__c�sj|jIdHz|j��IdH}Wn&tjyF|��s@|���Yn0|tjurXtjSt	�
||j�SdSr3)rzrF�receive_serialized_messager`rarUrVrrsr
�deserializerI)r(�raw_responser+r+r,r�us
�z_StreamResponseMixin._readc�sR|��r|��IdHtjS|�tj�|��IdH}|tjurN|��IdH|Sr3)rQrcrrsr�rirmr�)r(�response_messager+r+r,�read�s
z_StreamResponseMixin.read)r1r9r:rrr>r`rwrir}r�rgrVr�r�r�r	rr�r@r+r+r)r,rxOs

	rxcs�eZdZUejed<eed<eejed<e	ed<ee
d�dd�Ze	d�d	d
�Zed��fdd
�Z
dd�Ze
dd�dd�Zedd�dd�Zdd�dd�Zedd�dd�Zdd�dd�Zdd�dd�Z�ZS)�_StreamRequestMixin�_metadata_sent�_done_writing_flag�_async_request_poller�_request_style)�request_iteratorcCsHt��|_d|_|dur6|j�|�|��|_tj	|_
nd|_tj|_
dS)NF)r`�Eventr�r�rE�create_task�_consume_request_iteratorr�rirlr�rm)r(r�r+r+r,�_init_stream_request_mixin�s
�
z._StreamRequestMixin._init_stream_request_mixinr~cCs|j|urt�t��dSr3)r�rr�r�r�r+r+r,�_raise_for_different_style�s
z._StreamRequestMixin._raise_for_different_styler-cs*t���r"|jdur|j��dSdSdSrr)r&rVr�r.r)r+r,rV�s



z_StreamRequestMixin.cancelcCs|j��dSr3)r��setr.r+r+r,�_metadata_sent_observer�sz+_StreamRequestMixin._metadata_sent_observerN)r�r%c�sz�t�|�st|d�rx|2zX3dHW}z|�|�IdHWqtyp}zt�d|�WYd}~WdSd}~00q6nV|D]P}z|�|�IdHWq|ty�}zt�d|�WYd}~WdSd}~00q||��IdHWn$t�dt�	��|�
�Yn0dS)Nr�z2Exception while consuming the request_iterator: %sz,Client request_iterator raised exception:
%s)�inspect�
isasyncgenrP�_writer�_LOGGER�debug�
_done_writing�	traceback�
format_excrV)r(r��request�	rpc_errorr+r+r,r��s:��"��z-_StreamRequestMixin._consume_request_iterator)r�r%c
�s�|��rt�t��|jr"t�t��|j��sR|j��IdH|��rR|�	�IdHt
�||j�}z|j
�|�IdHWnhtjy�}z*|j
�t|��|�	�IdHWYd}~n.d}~0tjy�|��s�|���Yn0dSr3)rQr`�InvalidStateError�_RPC_ALREADY_FINISHED_DETAILSr��_RPC_HALF_CLOSED_DETAILSr��is_set�waitrcr
�	serializerHrF�send_serialized_messager�
InternalError�set_internal_errorr?rarUrV)r(r��serialized_request�errr+r+r,r��s(


�"z_StreamRequestMixin._writec�sX|��rdS|jsTd|_z|j��IdHWn&tjyR|��sL|���Yn0dS)NT)rQr�rF�send_receive_closer`rarUrVr.r+r+r,r��sz!_StreamRequestMixin._done_writingc�s |�tj�|�|�IdHdSr3)r�rirmr�)r(r�r+r+r,�writesz_StreamRequestMixin.writec�s|�tj�|��IdHdS)zUSignal peer that client is done writing.

        This method is idempotent.
        N)r�rirmr�r.r+r+r,�done_writingsz _StreamRequestMixin.done_writingc�s*|j��IdH|��r&|��IdHdSr3)r�r�rQrcr.r+r+r,�wait_for_connectionsz'_StreamRequestMixin.wait_for_connection)r1r9r:r`r�r>rgrrwrirr�r�rVr�r�rr�r�r�r�r�r@r+r+r)r,r��s"

��,r�cs|eZdZUdZeed<ejed<eee	e
eejee
ejeeeejdd��fdd�Zed�d	d
�Zdd�dd�Z�ZS)
rz}Object for managing unary-unary RPC calls.

    Returned when an instance of `UnaryUnaryMultiCallable` object is called.
    �_request�_invocation_taskN�r��deadlinerK�credentials�wait_for_ready�channel�methodrLrMrNr%csPt��|�||||�|||	|
�||_t��|_|
�|���|_	|�
|j	�dSr3)r&r'�callr�r�build_census_context�_contextr��_invoker�rq�r(r�r�rKr�r�r�r�rLrMrNr)r+r,r'(s
�
zUnaryUnaryCall.__init__r-c�svt�|j|j�}z|j�||j|j�IdH}Wn$tj	yR|�
�sN|��Yn0|j��rlt�
||j�StjSdSr3)r
r�r�rHrF�unary_unaryrGr�r`rarUrV�is_okr�rIrrs)r(r��serialized_responser+r+r,r�As�
�
�zUnaryUnaryCall._invokec�s&|jIdH|��r"|��IdHdSr3)r�rQrcr.r+r+r,r�Xsz"UnaryUnaryCall.wait_for_connection)r1r9r:r;rr>r`rwrrhrr<�CallCredentialsrgr�
AioChannel�bytesrrrer'rr�r�r@r+r+r)r,rs"

�rcs|eZdZUdZeed<ejed<eee	e
eejee
ejeeeejdd��fdd�Zed�d	d
�Zdd�dd�Z�ZS)
rzObject for managing unary-stream RPC calls.

    Returned when an instance of `UnaryStreamMultiCallable` object is called.
    r��_send_unary_request_taskNr�csPt��|�||||�|||	|
�||_t��|_|
�|���|_	|�
|j	�dSr3)r&r'r�r�rr�r�r��_send_unary_requestr�r}r�r)r+r,r'hs
�
�zUnaryStreamCall.__init__r-c�sZt�|j|j�}z|j�||j|j�IdHWn&tj	yT|�
�sN|���Yn0dSr3)r
r�r�rHrF�initiate_unary_streamrGr�r`rarUrV)r(r�r+r+r,r��s�
�z#UnaryStreamCall._send_unary_requestc�s&|jIdH|��r"|��IdHdSr3)r�rQrcr.r+r+r,r��sz#UnaryStreamCall.wait_for_connection)r1r9r:r;rr>r`rwrrhrr<r�rgrr�r�rrrer'rr�r�r@r+r+r)r,r^s"

�
rcs^eZdZdZeeeeeeej	ee
eje
eeejdd��fdd�Zed�dd�Z�ZS)	�StreamUnaryCallzObject for managing stream-unary RPC calls.

    Returned when an instance of `StreamUnaryMultiCallable` object is called.
    N�r�r�rKr�r�r�r�rLrMrNr%csLt��|�||||�|||	|
�t��|_|�|�|�|
�|�	���dSr3)
r&r'r�rr�r�r�rqr��_conduct_rpc�r(r�r�rKr�r�r�r�rLrMrNr)r+r,r'�s
�

zStreamUnaryCall.__init__r-c�sjz |j�|j|j|j�IdH}Wn&tjyF|��s@|���Yn0|j�	�r`t
�||j�St
jSdSr3)rF�stream_unaryrGr�r�r`rarUrVr�r
r�rIrrs)r(r�r+r+r,r��s�
�zStreamUnaryCall._conduct_rpc)r1r9r:r;rrrhrr<r�rgrr�r�rrr`rer'rr�r@r+r+r)r,r��s�r�csdeZdZUdZejed<eeee	e
eejee
ejeeeejdd��fdd�Zdd�Z�ZS)	�StreamStreamCallz�Object for managing stream-stream RPC calls.

    Returned when an instance of `StreamStreamMultiCallable` object is called.
    �_initializerNr�csVt��|�||||�|||	|
�t��|_|j�|���|_	|�
|�|�|j	�dSr3)r&r'r�rr�r�rEr��_prepare_rpcr�r�r}r�r)r+r,r'�s
�

zStreamStreamCall.__init__c�sJz |j�|j|j|j�IdHWn$tjyD|��s@|��Yn0dS)z�This method prepares the RPC for receiving/sending messages.

        All other operations around the stream should only happen after the
        completion of this method.
        N)	rF�initiate_stream_streamrGr�r�r`rarUrVr.r+r+r,r��s�zStreamStreamCall._prepare_rpc)r1r9r:r;r`rwr>rrrhrr<r�rgrr�r�rrrer'r�r@r+r+r)r,r��s

�r�):r;r`�enum�	functoolsrr��loggingr��typingrrrrrrr	r<r
�grpc._cythonr�r
rGr�_typingrrrrrrrr�__all__rWrSr�r�r��_OK_CALL_REPRESENTATIONr/�	getLoggerr1r��RpcErrorr�AioRpcStatusrDr�IntEnumrirnrxr�rrr�r�r+r+r+r,�<module>sd$
���
k�`+G	@9

�4

�

Youez - 2016 - github.com/yon3zu
LinuXploit