Ë
    ÒÍ:j�  ã            	       óª  — d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
mZ d dlmZ d dlmZmZmZ  e	d«      Z ee«      Z ee«      Z ee«      Z ee«      Z	 dd
ed	z  deeef   fd„Zdded
ed	z  ded	z  fd„Z	 ddeded
ed	z  defd„Zdded
ed	z  defd„Zdd
ed	z  defd„Zdd
ed	z  deeef   fd„Z dede!fd„Z"dede!fd„Z#dedede!fd„Z$y	)é    )ÚMapping)Ú	getLogger)Úcompile)ÚMappingProxyType)Ú
create_keyÚ	get_valueÚ	set_value)ÚContext)Ú_BAGGAGE_PROPERTY_FORMATÚ_KEY_FORMATÚ_VALUE_FORMATÚbaggageNÚcontextÚreturnc                 ó,   — t        t        | ¬«      «      S )z»Returns 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    ús/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/opentelemetry/baggage/__init__.pyÚget_allr      s   € ô Ô.°wÔ?Ó@Ð@ó    Únamec                 ó8   — t        |¬«      j                  | «      S )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   '   s   € ô  gÔ.×2Ñ2°4Ó8Ð8r   Úvaluec                 ód   — t        |¬«      j                  «       }||| <   t        t        ||¬«      S )zóSets 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   6   s/   € ô !¨Ô1×6Ñ6Ó8€GØ€GˆD�MÜ”\ 7°GÔ<Ð<r   c                 ó~   — t        |¬«      j                  «       }|j                  | d«       t        t        ||¬«      S )zàRemoves 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"   H   s4   € ô !¨Ô1×6Ñ6Ó8€GØ‡K�K��dÔä”\ 7°GÔ<Ð<r   c                 ó&   — t        t        i | ¬«      S )zºRemoves 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$   X   s   € ô ”\ 2¨wÔ7Ð7r   c                 óL   — t        t        | ¬«      }t        |t        «      r|S i S )Nr   )r   r   Ú
isinstanceÚdict)r   r   s     r   r   r   d   s"   € Üœ¨gÔ6€GÜ�'œ4Ô ØˆØ€Ir   c                 óB   — t         j                  t        | «      «      d uS ©N)Ú_KEY_PATTERNÚ	fullmatchÚstr)r   s    r   Ú_is_valid_keyr-   k   s   € Ü×!Ñ!¤# d£)Ó,°DÐ8Ð8r   c                 óÒ   — t        | «      j                  d«      }t        j                  |d   «      d u}t	        |«      dkD  r$|dd  D ]  }t
        j                  |«      �Œd} |S  |S )Nú;r   é   F)r,   ÚsplitÚ_VALUE_PATTERNr+   ÚlenÚ_PROPERT_PATTERN)r   ÚpartsÚis_valid_valueÚpropertys       r   Ú_is_valid_valuer8   o   sv   € Ü�‹J×Ñ˜SÓ!€EÜ#×-Ñ-¨e°A©hÓ7¸tÐC€NÜ
ˆ5ƒz�A‚~Ø˜a˜b˜	ò 	ˆHÜ×)Ñ)¨(Ó3Ñ;Ø!&�ØØÐð		ð Ðr   Úkeyc                 ó2   — t        | «      xr t        |«      S r)   )r-   r8   )r9   r   s     r   Ú_is_valid_pairr;   z   s   € Ü˜ÓÒ8¤/°%Ó"8Ð8r   r)   )%Úcollections.abcr   Úloggingr   Úrer   Útypesr   Úopentelemetry.contextr   r   r	   Úopentelemetry.context.contextr
   Úopentelemetry.util.rer   r   r   r   Ú__name__Ú_loggerr*   r2   r4   r,   Úobjectr   r   r   r"   r$   r'   r   Úboolr-   r8   r;   © r   r   ú<module>rH      sk  ðõ $Ý Ý Ý "ç BÑ BÝ 1÷ñ ñ ˜)Ó$€Ù
�HÓ
€á�{Ó#€Ù˜Ó'€ÙÐ3Ó4Ð ð #ñAØ�t‰^ðAàˆS�&ˆ[ÑóAñ9�cð 9 G¨d¡Nð 9¸fÀt¹mó 9ð  9=ñ=Ø
ð=Øð=Ø'.°¡~ð=àó=ñ$=˜ð = w°¡~ð =Àó =ñ 	8�7˜T‘>ð 	8¨Wó 	8ñ ¨$¡ð ¸$¸sÀF¸{Ñ:Kó ð9˜ð 9 ó 9ð˜6ð  dó ð9˜ð 9 Cð 9¨Dô 9r   