HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //var/opt/nydus/ops/mysql/opentelemetry/baggage/__pycache__/__init__.cpython-39.pyc
a

�,�h)�@sHddlmZddlmZddlmZddlmZmZddl	m
Z
mZmZddl
mZddlmZmZmZe
d�Zee�Zee�Zee�Zee�Zd eeeeefd
�dd�Zd!eeeeed
�dd�Zd"eeeeed�dd�Zd#eeeed
�dd�Zd$eeed
�dd�Zee d�dd�Z!ee d�dd�Z"eee d�dd�Z#d	S)%�)�	getLogger)�compile)�MappingProxyType)�Mapping�Optional)�
create_key�	get_value�	set_value)�Context)�_BAGGAGE_PROPERTY_FORMAT�_KEY_FORMAT�
_VALUE_FORMAT�baggageN)�context�returncCs&tt|d�}t|t�rt|�Sti�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�_BAGGAGE_KEY�
isinstance�dictr)rr�r�W/opt/nydus/tmp/pip-target-wkfpz8uv/lib64/python/mysql/opentelemetry/baggage/__init__.py�get_all$s
r)�namerrcCst|d��|�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)rrrrr�get_baggage5sr)r�valuerrcCs$tt|d��}|||<tt||d�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)rrr	r)rrrrrrr�set_baggageDsrcCs(tt|d��}|�|d�tt||d�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
    rN)rr�popr	r)rrrrrr�remove_baggageTs
rcCstti|d�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	rrrrr�cleards	r)rrcCst�t|��duS�N)�_KEY_PATTERN�	fullmatch�str)rrrr�
_is_valid_keypsr$)rrcCsXt|��d�}t�|d�du}t|�dkrT|dd�D]}t�|�dur8d}qTq8|S)N�;r�F)r#�split�_VALUE_PATTERNr"�len�_PROPERT_PATTERN)r�partsZis_valid_value�propertyrrr�_is_valid_valuetsr-)�keyrrcCst|�ot|�Sr )r$r-)r.rrrr�_is_valid_pairsr/)N)N)N)N)N)$�loggingr�rer�typesr�typingrrZmysql.opentelemetry.contextrrr	Z#mysql.opentelemetry.context.contextr
Zmysql.opentelemetry.util.rerrr
r�__name__�_loggerr!r(r*r#�objectrrrrr�boolr$r-r/rrrr�<module>s.�
�