
     <i              	       
   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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	e         deeef         fdZ	 dded
e	e         de	e         fdZ	 ddeded
e	e         defdZdded
e	e         defdZdd
e	e         defdZ dd
e	e         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%d	S )    )	getLogger)compile)MappingProxyType)DictMappingOptional)
create_key	get_value	set_value)Context)_BAGGAGE_PROPERTY_FORMAT_KEY_FORMAT_VALUE_FORMATbaggageNcontextreturnc                 <    t          t          |                     S )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    /Users/kimhansen/Desktop/03 Workspace/ceo-agents/chl-effectiveness/mcp-servers/whoop/.venv/lib/python3.11/site-packages/opentelemetry/baggage/__init__.pyget_allr   $   s     .w???@@@    namec                 H    t          |                              |           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   2   s#     g...224888r   valuec                 ~    t          |                                          }||| <   t          t          ||          S )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116688GGDM\7G<<<<r   c                     t          |                                          }|                    | d           t          t          ||          S )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   sI     !1116688GKKd\7G<<<<r   c                 0    t          t          i |           S )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777r   c                 `    t          t          |           }t          |t                    r|S i S )Nr   )r
   r    
isinstancedict)r   r   s     r   r   r   q   s0    g666G'4   Ir   c                 T    t                               t          |                     d uS N)_KEY_PATTERN	fullmatchstr)r   s    r   _is_valid_keyr/   x   s!    !!#d)),,D88r   c                 
   t          |                               d          }t                              |d                   d u}t	          |          dk    r+|dd          D ] }t
                              |          d} n!|S )N;r      F)r.   split_VALUE_PATTERNr-   len_PROPERT_PATTERN)r   partsis_valid_valuepropertys       r   _is_valid_valuer:   |   s    JJS!!E#--eAh77tCN
5zzA~~abb	 	 	H))(33;!& < r   keyc                 >    t          |           ot          |          S r+   )r/   r:   )r;   r   s     r   _is_valid_pairr=      s    8/%"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 B B B B B B B B 1 1 1 1 1 1          z)$$
)H

w{##''7344  "&A AgAS&[A A A A -19 9
9 )9f9 9 9 9$ <@= =
=='/'8== = = =$= = =x'8 =G = = = = 	8 	88G$ 	8 	8 	8 	8 	8  1 T#v+=N    9 9 9 9 9 96 d    9 9C 9D 9 9 9 9 9 9r   