Ë
    ÿÿæi:0  ã                   ó  — d dl 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	m
Z
mZmZ d dlmZ eeeeefZ ed«      eeeeee
efZd„ Z ej0                  e«      Zdedej6                  d	e	e   d
e	eej6                  eeeeef   df   f      fd„Zdej:                  d	e	e   d
ej:                  fd„Zdedej:                  d	e	e   d
ej:                  fd„Zdej6                  de	e   d
e	ej6                     fd„Z  G d„ de«      Z!y)é    N)ÚOrderedDict)ÚMutableMapping)ÚMappingÚOptionalÚSequenceÚTupleÚUnion)Útypesc                 óD   — t        | dt        | dt        | «      «      «      S )NÚ__name__Ú_name)ÚgetattrÚrepr)Úts    úv/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/opentelemetry/attributes/__init__.pyÚ
_type_namer   +   s   € Ü�1�j¤'¨!¨W´d¸1³gÓ">Ó?Ð?ó    ÚkeyÚvalueÚmax_lenÚreturn.c           
      ó  — | rt        | t        «      st        j                  d| «       yt        |t        «      rt        ||«      S t        |t        «      rÛd}g }|D ]Ç  }t        ||«      }|€|j                  |«       Œ#t        |«      }|t        vr@t        j                  d|j                  | t        D �cg c]  }|j                  ‘Œ c}«        y|€|}n<||k7  r7t        j                  d| |j                  t        |«      j                  «        y|j                  |«       ŒÉ t        |«      S t        j                  dt        |«      j                  | t        D �cg c]  }|j                  ‘Œ c}«       yc c}w c c}w )ak  Checks if attribute value is valid and cleans it if required.

    The function returns the cleaned value or None if the value is not valid.

    An attribute value is valid if it is either:
        - A primitive type: string, boolean, double precision floating
            point (IEEE 754-1985) or integer.
        - An array of primitive type values. The array MUST be homogeneous,
            i.e. it MUST NOT contain values of different types.

    An attribute needs cleansing if:
        - Its length is greater than the maximum allowed length.
        - It needs to be encoded/decoded e.g, bytes to strings.
    ú+invalid key `%s`. must be non-empty string.NzLInvalid type %s in attribute '%s' value sequence. Expected one of %s or Nonez>Attribute %r mixes types %s and %s in attribute value sequencezYInvalid type %s for attribute '%s' value. Expected one of %s or a sequence of those types)Ú
isinstanceÚstrÚ_loggerÚwarningÚ_VALID_ATTR_VALUE_TYPESÚ_clean_attribute_valuer   ÚappendÚtyper   Útuple)r   r   r   Úsequence_first_valid_typeÚcleaned_seqÚelementÚelement_typeÚ
valid_types           r   Ú_clean_attributer(   2   s€  € ñ$ ”J˜s¤CÔ(Ü�‰ÐEÀsÔKØä�%Ô0Ô1Ü% e¨WÓ5Ð5ä�%œÔ"Ø$(Ð!ØˆãˆGÜ,¨W°gÓ>ˆGØˆØ×"Ñ" 7Ô+Øä ›=ˆLàÔ#:Ñ:Ü—‘ð!à ×)Ñ)Øõ +Bóá*A˜Jð #×+Ó+Ø*Añô	ñ ð )Ð0Ø,8Ñ)àÐ!:Ò:Ü—‘ØTØØ-×6Ñ6Ü˜“M×*Ñ*ô	ñ à×Ñ˜wÕ'ðG ôL �[Ó!Ð!ä‡O�Oð	"äˆU‹×ÑØÝ/FÓGÑ/F ˆ×	Ó	Ð/FÑGôð ùòCùò> 	Hs   Â6E9ÅE>c                 ó|  — | �t        | t        «      r|�t        | t        «      r| d | } | S t        | t        «      rVi }| j	                  «       D ]?  \  }}|rt        |t        «      st
        j                  d|«       Œ/t        |||¬«      ||<   ŒA |S t        | t        «      r½d }g }| D ]©  }|€|j                  |«       Œ|�t        |t        «      r|d | }t        |«      }|t        vrt        ||¬«      }t        |«      }|€|}n;||k7  r6t
        j                  d|j                  t        |«      j                  «        y |j                  |«       Œ« t        |«      S 	 t        | «      S # t        $ rG t        dt        | «      j                  › dt         D �cg c]  }t#        |«      ‘Œ nc c}w c}› d�«      ‚w xY w)Nr   )r   r   r   ©r   z1Mixed types %s and %s in attribute value sequencezInvalid type z& for attribute value. Expected one of z or a sequence of those types)r   r   r   r   Úitemsr   r   Ú_clean_extended_attributer   r    r!   Ú_clean_extended_attribute_valuer   r"   Ú	ExceptionÚ	TypeErrorÚ_VALID_ANY_VALUE_TYPESr   )	r   r   Úcleaned_dictr   r%   r#   r$   r&   r'   s	            r   r-   r-   �   sÖ  € ð €}œ
 5Ô*AÔBØÐ¤:¨e´SÔ#9Ø˜(˜7�OˆEØˆä�%œÔ!Ø24ˆØ!ŸK™KžM‰LˆC�áœJ s¬CÔ0Ü—‘ØAÀ3ôð ä 9Ø˜w°ô!ˆL˜Òð *ð Ðä�%œÔ"Ø$(Ð!Ø,.ˆãˆGØˆØ×"Ñ" 7Ô+ØàÐ"¤z°'¼3Ô'?Ø! ( 7Ð+�ä ›=ˆLØÔ#:Ñ:Ü9Ø Wô�ô  $ G›}�ð )Ð0Ø,8Ñ)àÐ!:Ò:Ü—‘ØGØ-×6Ñ6Ü˜“M×*Ñ*ôñ
 à×Ñ˜wÕ'ð9 ô> �[Ó!Ð!ð
Ü�5‹zÐøÜò 
ÜØœD ›K×0Ñ0Ð1ð 2ÝI_Ó`ÑI_¸:¤
¨:Õ 6ÑI_ùÔ`Ðað b&ð&ó
ð 	
ð
ús   Å 
E+ Å+-F;ÆF+Æ*F;c                 óÊ   — | rt        | t        «      st        j                  d| «       y	 t	        ||¬«      S # t
        $ r!}t        j                  d| |«       Y d}~yd}~ww xY w)a.  Checks if attribute value is valid and cleans it if required.

    The function returns the cleaned value or None if the value is not valid.

    An attribute value is valid if it is an AnyValue.
    An attribute needs cleansing if:
        - Its length is greater than the maximum allowed length.
    r   Nr*   zAttribute %s: %s)r   r   r   r   r-   r/   )r   r   r   Ú	exceptions       r   r,   r,   Î   sX   € ñ ”J˜s¤CÔ(Ü�‰ÐEÀsÔKØðÜ.¨u¸gÔFÐFøÜò Ü�‰Ð*¨C°Ô;Üûðús   «8 ¸	A"ÁAÁA"Úlimitc                 óÄ   — | €y t        | t        «      r	 | j                  «       } |�t        | t        «      r| d | } | S # t        $ r t        j                  d«       Y y w xY w)Nz$Byte attribute could not be decoded.)r   ÚbytesÚdecodeÚUnicodeDecodeErrorr   r   r   )r   r4   s     r   r   r   å   sh   € ð €}Øä�%œÔð	Ø—L‘L“NˆEð
 ÐœZ¨¬sÔ3Ø�f�u�ˆØ€Løô "ò 	Ü�O‰OÐBÔCÙð	ús   •> ¾AÁAc                   óî   — e Zd ZdZ	 	 	 	 	 ddee   deej                     dedee   def
d„Z	d	e
fd
„Zde
d	ej                  fd„Zde
dej                  d	dfd„Zde
d	dfd„Zd„ Zd	efd„Zded	d fd„Zd„ Zy)ÚBoundedAttributesz†An ordered dict with a fixed max capacity.

    Oldest elements are dropped when the dict is full and a new element is
    added.
    NÚmaxlenÚ
attributesÚ	immutableÚmax_value_lenÚextended_attributesc                 ó  — |� t        |t        «      r|dk  rt        d«      ‚|| _        d| _        || _        || _        i | _        t        j                  «       | _
        |r|j                  «       D ]
  \  }}|| |<   Œ || _        y )Nr   z.maxlen must be valid int greater or equal to 0)r   ÚintÚ
ValueErrorr;   Údroppedr>   Ú_extended_attributesÚ_dictÚ	threadingÚRLockÚ_lockr+   Ú
_immutable)Úselfr;   r<   r=   r>   r?   r   r   s           r   Ú__init__zBoundedAttributes.__init__þ   s�   € ð ÐÜ˜f¤cÔ*¨f°qªjÜ ØDóð ð ˆŒØˆŒØ*ˆÔØ$7ˆÔ!ð ð 	Œ
ô —_‘_Ó&ˆŒ
ÙØ(×.Ñ.Ö0‘
��UØ!��S’	ð 1à#ˆ�r   r   c                 ó.   — t        | j                  «      › S ©N)ÚdictrE   ©rJ   s    r   Ú__repr__zBoundedAttributes.__repr__  s   € Ü�t—z‘zÓ"Ð#Ð$r   r   c                 ó    — | j                   |   S rM   )rE   ©rJ   r   s     r   Ú__getitem__zBoundedAttributes.__getitem__  s   € Ø�z‰z˜#‰Ðr   r   c                 óê  — t        | dd«      rt        ‚| j                  5  | j                  �.| j                  dk(  r| xj                  dz  c_        	 d d d «       y | j
                  rt        ||| j                  «      }n#t        ||| j                  «      }|€
	 d d d «       y || j                  v r| j                  |= n“| j                  �‡t        | j                  «      | j                  k(  ret        | j                  t        «      st        | j                  «      | _	        | j                  j                  d¬«       | xj                  dz  c_        || j                  |<   d d d «       y # 1 sw Y   y xY w)NrI   Fr   é   )Úlast)r   r/   rH   r;   rC   rD   r,   r>   r(   rE   Úlenr   r   Úpopitem)rJ   r   r   s      r   Ú__setitem__zBoundedAttributes.__setitem__!  s  € Ü�4˜ uÔ-ÜˆOØ�Z‹ZØ�{‰{Ð&¨4¯;©;¸!Ò+;Ø—’ Ñ!•Ø÷ ˆZð
 ×(Ò(Ü1Ø˜ × 2Ñ 2ó‘ô )¨¨e°T×5GÑ5GÓH�Ø�=Ø÷ ˆZð �d—j‘jÑ Ø—J‘J˜s‘OØ—‘Ð(¬S°·±«_ÀÇÁÒ-KÜ! $§*¡*¬kÔ:Ü!,¨T¯Z©ZÓ!8�D”JØ—
‘
×"Ñ"¨Ð"Ô.Ø—’ Ñ!•à#ˆD�J‰J�s‰O÷- �Z‰Zús    2E)Á>E)Â"B>E)Å)E2c                 ó†   — t        | dd«      rt        ‚| j                  5  | j                  |= d d d «       y # 1 sw Y   y xY w)NrI   F)r   r/   rH   rE   rR   s     r   Ú__delitem__zBoundedAttributes.__delitem__<  s/   € Ü�4˜ uÔ-ÜˆOØ�Z‹ZØ—
‘
˜3�÷ �Z‰Zús	    7·A c                 óŒ   — | j                   5  t        | j                  j                  «       «      cd d d «       S # 1 sw Y   y xY wrM   )rH   ÚiterrE   ÚcopyrO   s    r   Ú__iter__zBoundedAttributes.__iter__B  s&   € Ø�Z‹ZÜ˜Ÿ
™
Ÿ™Ó)Ó*÷ �ZŠZús	   �#:ºAc                 ó,   — t        | j                  «      S rM   )rW   rE   rO   s    r   Ú__len__zBoundedAttributes.__len__F  s   € Ü�4—:‘:‹Ðr   Úmemoc                 ó@  — t        | j                  | j                  | j                  | j                  ¬«      }||t        | «      <   | j                  5  t        j                  | j                  |«      |_	        | j                  |_
        d d d «       |S # 1 sw Y   |S xY w)N)r;   r=   r>   r?   )r:   r;   rI   r>   rD   ÚidrH   r^   ÚdeepcopyrE   rC   )rJ   rb   Úcopy_s      r   Ú__deepcopy__zBoundedAttributes.__deepcopy__I  s~   € Ü!Ø—;‘;Ø—o‘oØ×,Ñ,Ø $× 9Ñ 9ô	
ˆð ˆŒR�‹X‰Ø�Z‹Zô Ÿ-™-¨¯
©
°DÓ9ˆEŒKØ ŸL™LˆEŒM÷	 ð
 ˆ÷ ð
 ˆús   Á7BÂBc                 ó6   — | j                   j                  «       S rM   )rE   r^   rO   s    r   r^   zBoundedAttributes.copyX  s   € Ø�z‰z�‰Ó Ð r   )NNTNF)r   Ú
__module__Ú__qualname__Ú__doc__r   rA   r
   Ú_ExtendedAttributesÚboolrK   r   rP   ÚAnyValuerS   rY   r[   r_   ra   rN   rg   r^   © r   r   r:   r:   ÷   sÞ   „ ñð !%Ø:>ØØ'+Ø$)ñ$à˜‘ð$ð ˜U×6Ñ6Ñ7ð$ð ð	$ð
   ‘}ð$ð "ó$ð:%˜#ó %ð˜sð  u§~¡~ó ð$˜sð $¨5¯>©>ð $¸dó $ð6 ˜sð   tó  ò+ð˜ó ð ð Ð*=ó ó!r   r:   )"r^   ÚloggingrF   Úcollectionsr   Úcollections.abcr   Útypingr   r   r   r   r	   Úopentelemetry.utilr
   rm   r   r6   rA   Úfloatr   r!   r0   r   Ú	getLoggerr   r   ÚAttributeValuer(   rn   r-   r,   r   r:   ro   r   r   Ú<module>rx      sp  ðó Û Û Ý #Ý *ß <Õ <å $ð    e¨S°%Ð8Ð ñ 	ˆƒJØØ	ØØ	ØØØð	Ð ò@ð ˆ'×
Ñ
˜HÓ
%€ðLØ	ðLØ×)Ñ)ðLØ4<¸S±MðLàˆe�E×(Ñ(¨%°°c¸3À°oÑ0FÈÐ0KÑ*LÐLÑMÑNóLð^J
Ø�>‰>ðJ
Ø$,¨S¡MðJ
à
‡^�^óJ
ðZØ	ðØ—^‘^ðØ.6°s©mðà
‡^�^óð.Ø×ÑðØ(0°©ðàˆe×"Ñ"Ñ#óô$b!˜õ b!r   