§
    ZŠtjÔ  ã                  ó  — d dl 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	m
Z
 d dlmZ d dlmZ  ej        e¦  «        Zd d
„Z e¦   «         Zd!d„Zd"d#d„Z	 d"d$d„Zd%d„Zd&d„Zd'd„Z ed¦  «        Z ed¦  «        Z ed¦  «        Zg d¢ZdS )(é    )ÚannotationsN)ÚToken)Úuuid4)ÚContextÚ_RuntimeContext)ÚContextVarsRuntimeContext)ÚOTEL_PYTHON_CONTEXTÚreturnr   c            	     ól  — t           j                             t          ¦  «        } | st	          ¦   «         S ddlm} 	  t          t           |d| ¬¦  «        ¦  «        ¦  «         	                    ¦   «         ¦   «         S # t          $ r, t                               d| ¦  «         t	          ¦   «         cY S w xY w)zWInitialize the RuntimeContext

    Returns:
        An instance of RuntimeContext.
    r   )Úentry_pointsÚopentelemetry_context)ÚgroupÚnamez?Failed to load context: %s, falling back to contextvars_context)ÚosÚenvironÚgetr	   r   Ú&opentelemetry.util._importlib_metadatar   ÚnextÚiterÚloadÚ	ExceptionÚloggerÚ	exception)Úconfigured_contextr   s     ú\/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/opentelemetry/context/__init__.pyÚ_load_runtime_contextr      sñ   € õ œŸšÕ(;Ñ<Ô<ÐØð +Ý(Ñ*Ô*Ð*ðð ð ð ð ð ð+ð�tÝØ�Ø1Ð8Jðñ ô ñô ñ
ô 
÷ Š$‰&Œ&ñô ð 	øõ ð +ð +ð +Ý×ÒØMØñ	
ô 	
ð 	
õ )Ñ*Ô*Ð*Ð*Ð*ð+øøøs   ¼A A= Á=3B3Â2B3ÚkeynameÚstrc                óD   — | dz   t          t          ¦   «         ¦  «        z   S )ae  To allow cross-cutting concern to control access to their local state,
    the RuntimeContext API provides a function which takes a keyname as input,
    and returns a unique key.
    Args:
        keyname: The key name is for debugging purposes and is not required to be unique.
    Returns:
        A unique string representing the newly created key.
    ú-)r   r   )r   s    r   Ú
create_keyr!   5   s   € ð �S‰=�3�u™wœw™<œ<Ñ'Ð'ó    ÚkeyÚcontextúContext | NoneÚobjectc                ór   — |�|                      | ¦  «        n t          ¦   «                               | ¦  «        S )av  To access the local state of a concern, the RuntimeContext API
    provides a function which takes a context and a key as input,
    and returns a value.

    Args:
        key: The key of the value to retrieve.
        context: The context from which to retrieve the value, if None, the current context is used.

    Returns:
        The value associated with the key.
    )r   Úget_current)r#   r$   s     r   Ú	get_valuer)   A   s2   € ð  'Ð2ˆ7�;Š;�sÑÔÐ½¹¼×8IÒ8IÈ#Ñ8NÔ8NÐNr"   Úvaluer   c                ór   — |€t          ¦   «         }|                     ¦   «         }||| <   t          |¦  «        S )aÑ  To record the local state of a cross-cutting concern, the
    RuntimeContext API provides a function which takes a context, a
    key, and a value as input, and returns an updated context
    which contains the new value.

    Args:
        key: The key of the entry to set.
        value: The value of the entry to set.
        context: The context to copy, if None, the current context is used.

    Returns:
        A new `Context` containing the value set.
    )r(   Úcopyr   )r#   r*   r$   Ú
new_valuess       r   Ú	set_valuer.   P   s6   € ð  €Ý‘-”-ˆØ—’‘”€JØ€Jˆs�OÝ�:ÑÔÐr"   c                 ó4   — t                                ¦   «         S )zÍTo access the context associated with program execution,
    the Context API provides a function which takes no arguments
    and returns a Context.

    Returns:
        The current `Context` object.
    )Ú_RUNTIME_CONTEXTr(   © r"   r   r(   r(   g   s   € õ ×'Ò'Ñ)Ô)Ð)r"   úToken[Context]c                ó6   — t                                | ¦  «        S )a  Associates a Context with the caller's current execution unit. Returns
    a token that can be used to restore the previous Context.

    Args:
        context: The Context to set as current.

    Returns:
        A token that can be used with `detach` to reset the context.
    )r0   Úattach)r$   s    r   r4   r4   r   s   € õ ×"Ò" 7Ñ+Ô+Ð+r"   ÚtokenÚNonec                ó’   — 	 t                                | ¦  «         dS # t          $ r t                               d¦  «         Y dS w xY w)zçResets the Context associated with the caller's current execution unit
    to the value it had before attaching a specified Context.

    Args:
        token: The Token that was returned by a previous call to attach a Context.
    zFailed to detach contextN)r0   Údetachr   r   r   )r5   s    r   r8   r8      sZ   € ð5Ý×Ò Ñ&Ô&Ð&Ð&Ð&øÝð 5ð 5ð 5Ý×ÒÐ3Ñ4Ô4Ð4Ð4Ð4Ð4ð5øøøs   ‚ ž$AÁAÚon_emit_recursion_countÚsuppress_instrumentationÚsuppress_http_instrumentation)r   r4   r!   r8   r(   r)   r.   )r
   r   )r   r   r
   r   )N)r#   r   r$   r%   r
   r&   )r#   r   r*   r&   r$   r%   r
   r   )r
   r   )r$   r   r
   r2   )r5   r2   r
   r6   )Ú
__future__r   Úloggingr   Úcontextvarsr   Úuuidr   Úopentelemetry.context.contextr   r   Ú)opentelemetry.context.contextvars_contextr   Ú#opentelemetry.environment_variablesr	   Ú	getLoggerÚ__name__r   r   r0   r!   r)   r.   r(   r4   r8   Ú_ON_EMIT_RECURSION_COUNT_KEYÚ_SUPPRESS_INSTRUMENTATION_KEYÚ"_SUPPRESS_HTTP_INSTRUMENTATION_KEYÚ__all__r1   r"   r   ú<module>rI      sŸ  ðð #Ð "Ð "Ð "Ð "Ð "à €€€Ø 	€	€	€	Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð ð CÐ BÐ BÐ BÐ BÐ BÐ BÐ BØ OÐ OÐ OÐ OÐ OÐ OØ CÐ CÐ CÐ CÐ CÐ Cà	ˆÔ	˜8Ñ	$Ô	$€ð+ð +ð +ð +ð> )Ð(Ñ*Ô*Ð ð	(ð 	(ð 	(ð 	(ðOð Oð Oð Oð Oð  8<ðð ð ð ð ð.*ð *ð *ð *ð
,ð 
,ð 
,ð 
,ð
5ð 
5ð 
5ð 
5ð   *˜zÐ*CÑDÔDÐ Ø * 
Ð+EÑ FÔ FÐ Ø%/ ZØ#ñ&ô &Ð "ðð ð €€€r"   