o
    `i                     @  s`  d 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	 ddl
Z
ddlZddlmZ e ZG dd deZG dd	 d	eZee Zd
d ZG dd deZdd Zdd Zdd Zeg df ZejZee	e ef gdf Z!ee edge	e df f Z"eddd(dd Z#d!Z$ej%d"krdd#l&m'Z' dd$l&m(Z( dd%l&m)Z) dd&l&m*Z* e$d'7 Z$dS dS ))zbgRPC's experimental APIs.

These APIs are subject to be removed during any minor version release.
    )annotationsN)CallableOptionalUnion)cygrpcc                   @  s   e Zd ZdZdZdS )ChannelOptionszIndicates a channel option unique to gRPC Python.

    This enumeration is part of an EXPERIMENTAL API.

    Attributes:
      SingleThreadedUnaryStream: Perform unary-stream RPCs on a single thread.
    SingleThreadedUnaryStreamN)__name__
__module____qualname____doc__r    r   r   X/home/ubuntu/SoloSpeech/.venv/lib/python3.10/site-packages/grpc/experimental/__init__.pyr       s    r   c                   @     e Zd ZdZdS )
UsageErrorzDRaised by the gRPC library to indicate usage not allowed by the API.Nr	   r
   r   r   r   r   r   r   r   ,       r   c                   C  s   t S )zeCreates a ChannelCredentials for use with an insecure channel.

    THIS IS AN EXPERIMENTAL API.
    )_insecure_channel_credentialsr   r   r   r   insecure_channel_credentials7   s   r   c                   @  r   )ExperimentalApiWarningz&A warning that an API is experimental.Nr   r   r   r   r   r   ?   r   r   c                 C  s<   | t vrt |  d| d }tj|td| d d S d S )Nz8'{}' is an experimental API. It is subject to change or z5removal between minor releases. Proceed with caution.   )
stacklevel)_EXPERIMENTAL_APIS_USEDaddformatwarningswarnr   )api_namestack_offsetmsgr   r   r   _warn_experimentalC   s   
r    c                   s   t   fdd}|S )Nc                    s   t  jd  | i |S )N   )r    r	   )argskwargsfr   r   _wrapperP   s   z"experimental_api.<locals>._wrapper)	functoolswraps)r%   r&   r   r$   r   experimental_apiO   s   r)   c                 C  sb   |sdS |j s|js|j| |jdS |j| |jdS |js(|j| |jdS |j| |jdS )a  Wraps the server method handler function.

    The server implementation requires all server handlers being wrapped as
    RpcMethodHandler objects. This helper function ease the pain of writing
    server handler wrappers.

    Args:
        wrapper: A wrapper function that takes in a method handler behavior
          (the actual function) and returns a wrapped function.
        handler: A RpcMethodHandler object to be wrapped.

    Returns:
        A newly created RpcMethodHandler.
    Nunary_unaryunary_streamstream_unarystream_stream)request_streamingresponse_streaming_replacer+   r-   r/   r1   )wrapperhandlerr   r   r   wrap_server_method_handlerX   s   r7   PrivateKeySignOnCompletePrivateKeySignCancel)root_certificatesprivate_key_sign_fn'CustomPrivateKeySign'r:   Optional[bytes]certificate_chainbytesreturngrpc.ChannelCredentialsc                 C  s   t t|d|| S )a  Creates a ChannelCredentials for use with an SSL-enabled Channel with a custom signer.

    THIS IS AN EXPERIMENTAL API.
    This API will be removed in a future version and combined with `grpc.ssl_channel_credentials`.

    Args:
      private_key_sign_fn: a function with the signature of
        `CustomPrivateKeySign`. This function can return synchronously or
        asynchronously.  To return synchronously, return the signed bytes.  To
        return asynchronously, return a callable matching the
        `PrivateKeySignCancel` signature.This can be a no-op if no cancellation is
        needed. In the async case, this function must return this callable
        quickly, then call the passed in `PrivateKeySignOnComplete` when the async
        signing operation is complete to trigger gRPC to continue the handshake.
      root_certificates: The PEM-encoded root certificates as a byte string,
        or None to retrieve them from a default location chosen by gRPC
        runtime.
      certificate_chain: The PEM-encoded certificate chain as a byte string
        to use

    Returns:
      A ChannelCredentials for use with an SSL-enabled Channel.
    N)grpcChannelCredentials_cygrpcSSLChannelCredentials)r;   r:   r>   r   r   r   *ssl_channel_credentials_with_custom_signer   s
   rF   )r   r   r   r   rF   r7   )      r0   r.   r,   r*   )r1   r/   r-   r+   )r;   r<   r:   r=   r>   r?   r@   rA   )+r   
__future__r   copyr'   systypingr   r   r   r   rB   grpc._cythonr   rD   setr   objectr   	Exceptionr   rC   channel_credentials_insecurer   r   Warningr   r    r)   r7   r9   PrivateKeySignatureAlgorithmr?   r8   CustomPrivateKeySignrF   __all__version_infogrpc._simple_stubsr1   r/   r-   r+   r   r   r   r   <module>   sT   	

$
	