
    Ki              	          S SK Jr  S SKJr  S SKJr  S SKJrJrJ	r	  S SK
JrJrJr  S SKJr  S SKJrJrJr  \" S5      r\" \5      r\" \5      r\" \5      r\" \5      r SS
\	\   S\\\4   4S jjr SS\S
\	\   S\	\   4S jjr SS\S\S
\	\   S\4S jjrSS\S
\	\   S\4S jjrSS
\	\   S\4S jjr SS
\	\   S\\\4   4S jjr!S\S\"4S jr#S\S\"4S jr$S\S\S\"4S jr%g	)    )	getLogger)compile)MappingProxyType)DictMappingOptional)
create_key	get_value	set_value)Context)_BAGGAGE_PROPERTY_FORMAT_KEY_FORMAT_VALUE_FORMATbaggageNcontextreturnc                 &    [        [        U S95      $ )zReturns the name/value pairs in the Baggage

Args:
    context: The Context to use. If not set, uses current Context

Returns:
    The name/value pairs in the Baggage
r   )r   _get_baggage_valuer   s    `/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/opentelemetry/baggage/__init__.pyget_allr   $   s     .w?@@    namec                 2    [        US9R                  U 5      $ )a  Provides access to the value for a name/value pair in the
Baggage

Args:
    name: The name of the value to retrieve
    context: The Context to use. If not set, uses current Context

Returns:
    The value associated with the given name, or null if the given name is
    not present.
r   )r   get)r   r   s     r   get_baggager   2   s     g.22488r   valuec                 T    [        US9R                  5       nXU '   [        [        X2S9$ )zSets a value in the Baggage

Args:
    name: The name of the value to set
    value: The value to set
    context: The Context to use. If not set, uses current Context

Returns:
    A Context with the value updated
r   )r   copyr   _BAGGAGE_KEY)r   r   r   r   s       r   set_baggager!   C   s+     !1668GDM\7<<r   c                 p    [        US9R                  5       nUR                  U S5        [        [        X!S9$ )zRemoves a value from the Baggage

Args:
    name: The name of the value to remove
    context: The Context to use. If not set, uses current Context

Returns:
    A Context with the name/value removed
r   N)r   r   popr   r    )r   r   r   s      r   remove_baggager$   U   s2     !1668GKKd\7<<r   c                      [        [        0 U S9$ )zRemoves all values from the Baggage

Args:
    context: The Context to use. If not set, uses current Context

Returns:
    A Context with all baggage entries removed
r   )r   r    r   s    r   clearr&   e   s     \2w77r   c                 P    [        [        U S9n[        U[        5      (       a  U$ 0 $ )Nr   )r
   r    
isinstancedict)r   r   s     r   r   r   q   s%    g6G'4  Ir   c                 B    [         R                  [        U 5      5      S L$ N)_KEY_PATTERN	fullmatchstr)r   s    r   _is_valid_keyr/   x   s    !!#d),D88r   c                     [        U 5      R                  S5      n[        R                  US   5      S Ln[	        U5      S:  a'  USS   H  n[
        R                  U5      b  M  Sn  U$    U$ )N;r      F)r.   split_VALUE_PATTERNr-   len_PROPERT_PATTERN)r   partsis_valid_valuepropertys       r   _is_valid_valuer:   |   sq    JS!E#--eAh7tCN
5zA~ab	H))(3;!&	 " r   keyc                 <    [        U 5      =(       a    [        U5      $ r+   )r/   r:   )r;   r   s     r   _is_valid_pairr=      s    8/%"88r   r+   )&loggingr   rer   typesr   typingr   r   r   opentelemetry.contextr	   r
   r   opentelemetry.context.contextr   opentelemetry.util.rer   r   r   r    __name___loggerr,   r4   r6   r.   objectr   r   r!   r$   r&   r   boolr/   r:   r=    r   r   <module>rJ      s~     " * * B B 1  )$
H
{#'34  "&AgAS&[A -19
9 )9f9$ <@=
=='/'8==$= =x'8 =G = 	88G$ 	8 	8 1 T#v+=N 9 9 96 d 9 9C 9D 9r   