§
    dŠtjU  ã            	       óÄ   — d Z ddlmZ ddlZddlZddlZddlZ ej        e¦  «        Z	 G d„ de¦  «        Z
 G d„ d ej        dg d¢¦  «        e
¦  «        Zd	„ Zd
„ Zd„ ZdS )z%Utilities for working with callables.é    )ÚABCNc                   óR   — e Zd ZdZej         G d„ dej        ¦  «        ¦   «         ZdS )ÚOutcomea•  A sum type describing the outcome of some call.

    Attributes:
      kind: One of Kind.RETURNED or Kind.RAISED respectively indicating that the
        call returned a value or raised an exception.
      return_value: The value returned by the call. Must be present if kind is
        Kind.RETURNED.
      exception: The exception raised by the call. Must be present if kind is
        Kind.RAISED.
    c                   óN   — e Zd ZdZ ej        ¦   «         Z ej        ¦   «         ZdS )úOutcome.Kindz8Identifies the general kind of the outcome of some call.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚenumÚautoÚRETURNEDÚRAISED© ó    úe/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/grpc/framework/foundation/callable_util.pyÚKindr   %   s.   € € € € € àFÐFà�4”9‘;”;ˆØ�”‘”ˆˆˆr   r   N)r   r	   r
   r   r   ÚuniqueÚEnumr   r   r   r   r   r      sX   € € € € € ð	ð 	ð 
„[ðð ð ð ð ˆtŒyñ ô ñ „[ðð ð r   r   c                   ó   — e Zd ZdZdS )Ú_EasyOutcomez$A trivial implementation of Outcome.N)r   r	   r
   r   r   r   r   r   r   -   s   € € € € € ð /Ð.Ð.Ð.r   r   )ÚkindÚreturn_valueÚ	exceptionc                 óò   — 	 t          t          j        j         | |i |¤Žd ¦  «        S # t          $ rD}t
                               |¦  «         t          t          j        j        d |¦  «        cY d }~S d }~ww xY w©N)r   r   r   r   Ú	ExceptionÚ_LOGGERr   r   )ÚbehaviorÚmessageÚargsÚkwargsÚes        r   Ú_call_logging_exceptionsr$   6   s�   € ð:ÝÝŒLÔ! 8 8¨TÐ#<°VÐ#<Ð#<¸dñ
ô 
ð 	
øõ ð :ð :ð :Ý×Ò˜'Ñ"Ô"Ð"Ý�GœLÔ/°°qÑ9Ô9Ð9Ð9Ð9Ð9Ð9Ð9øøøøð:øøøs   ‚%( ¨
A6²9A1Á+A6Á1A6c                 óJ   ‡ ‡— t          j        ‰ ¦  «        ˆ ˆfd„¦   «         }|S )aÍ  Wraps a callable in a try-except that logs any exceptions it raises.

    Args:
      behavior: Any callable.
      message: A string to log if the behavior raises an exception.

    Returns:
      A callable that when executed invokes the given behavior. The returned
        callable takes the same arguments as the given behavior but returns a
        future.Outcome describing whether the given behavior returned a value or
        raised an exception.
    c                  ó&   •— t          ‰‰g| ¢R i |¤ŽS r   ©r$   )r!   r"   r   r    s     €€r   Úwrapped_behaviorz0with_exceptions_logged.<locals>.wrapped_behaviorN   s#   ø€ å'¨°'ÐK¸DÐKÐKÐKÀFÐKÐKÐKr   )Ú	functoolsÚwraps)r   r    r(   s   `` r   Úwith_exceptions_loggedr+   @   sG   øø€ õ „_�XÑÔðLð Lð Lð Lð Lñ ÔðLð Ðr   c                 ó$   — t          | |g|¢R i |¤ŽS )a®  Calls a behavior in a try-except that logs any exceptions it raises.

    Args:
      behavior: Any callable.
      message: A string to log if the behavior raises an exception.
      *args: Positional arguments to pass to the given behavior.
      **kwargs: Keyword arguments to pass to the given behavior.

    Returns:
      An Outcome describing whether the given behavior returned a value or raised
        an exception.
    r'   )r   r    r!   r"   s       r   Úcall_logging_exceptionsr-   U   s$   € õ $ H¨gÐG¸ÐGÐGÐGÀÐGÐGÐGr   )r   Úabcr   Úcollectionsr   r)   ÚloggingÚ	getLoggerr   r   r   Ú
namedtupler   r$   r+   r-   r   r   r   ú<module>r3      s  ðð ,Ð +à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ø €€€Ø Ð Ð Ð Ø €€€à
ˆ'Ô
˜HÑ
%Ô
%€ðð ð ð ð ˆcñ ô ð ð(/ð /ð /ð /ð /Ø€KÔØÐ=Ð=Ð=ñô ð ñ	/ô /ð /ð:ð :ð :ðð ð ð*Hð Hð Hð Hð Hr   