ó
    Ð]j3  ã                  óü  • % S SK Jr  S SKrS SKJs  Jr  S SKrS SK	r	S SK
r
S SKJr  S SKJr  S SKJrJr  S SKJr  S SKrS SKr\" S5      R/                  5       r\" S\\\S	.S
S9r\" \R:                  R=                  5       5      r1 Skr \\ :H  r!\!(       d‹  \RD                  " S\!4S\\ 45      S\RF                  " 5       ;   d  \RH                  " \5      (       a  \RJ                  " \5      OS\RJ                  " \ 5      S.-  r&SS\&0-  r'\(" \RR                  " \'5      5      eS=r!r Sq*S\S'   S!S jr+\+" \" \RX                  RZ                  R\                  5      R^                  R^                  R^                  R^                  5        \+" \" \R\                  5      R^                  5        \+" \" \R\                  5      R^                  5        S"S jr0\" SS9S#S j5       r1S$S jr2S%S jr3S&S jr4\" SS9S'S j5       r5S(S  jr6g))é    )ÚannotationsN)Ú	lru_cache)ÚPath)ÚCodeTypeÚ	FrameType)Ú	TypedDictÚ.Ú	StackInfo)úcode.filepathúcode.linenoúcode.functionF)Útotal>   r   r   r   )ú==)z%(py0)s == %(py3)sÚSTACK_INFO_KEYS)Úpy0Úpy3zassert %(py5)sÚpy5© ztuple[str, ...]ÚNON_USER_CODE_PREFIXESc                ó\   • [        [        U 5      R                  5       5      n [        U 4-  qg)aª  Add a path to the list of prefixes that are considered non-user code.

This prevents the stack info from including frames from the given path.

This is for advanced users and shouldn't often be needed.
By default, the following prefixes are already included:

- The standard library
- site-packages (specifically wherever opentelemetry is installed)
- The logfire package

This function is useful if you're writing a library that uses logfire and you want to exclude your library's frames.
Since site-packages is already included, this is already the case by default for users of your library.
But this is useful when testing your library since it's not installed in site-packages.
N)Ústrr   Úabsoluter   )Úpaths    ÚY/home/mande/repo/quber/.venv/lib/python3.13/site-packages/logfire/_internal/stack_info.pyÚadd_non_user_code_prefixr      s(   € ô" Œt�D‹z×"Ñ"Ó$Ó%€DÜ˜t˜gÑ%Ñó    c                ó¨   • [        U 5      nUR                  5       (       a   UR                  [        5      nS[        U5      0$ ! [         a     Nf = f)Nr   )r   Úis_absoluteÚrelative_toÚ_CWDÚ
ValueErrorr   )Úfiler   s     r   Úget_filepath_attributer#   3   sT   € Ü�‹:€DØ×Ñ×Ñð	Ø×#Ñ#¤DÓ)ˆDð œS ›YÐ'Ð'øô ó 	áð	ús   ¢A Á
AÁAi   )Úmaxsizec                óÌ   • [        U R                  5      nU R                  S:w  a/  [        R                  S:¼  a  U R
                  OU R                  US'   U R                  US'   U$ )Nz<module>)é   é   r   r   )r#   Úco_filenameÚco_nameÚsysÚversion_infoÚco_qualnameÚco_firstlineno)ÚcodeÚresults     r   Úget_code_object_infor0   >   sY   € ä# D×$4Ñ$4Ó5€FØ‡|�|�zÓ!Ü69×6FÑ6FÈ'Ó6Q $×"2Ò"2ÐW[×WcÑWcˆˆÑØ ×/Ñ/€Fˆ=ÑØ€Mr   c                óL   • 0 [        U R                  5      ESU R                  0E$ )Nr   )r0   Úf_codeÚf_lineno)Úframes    r   Úget_stack_info_from_framer5   G   s+   € ðÜ
˜uŸ|™|Ó
,ðà�u—~‘~ñð r   c                 óB   • [        5       u  pU (       a  [        U 5      $ 0 $ )z�Get the stack info for the first calling frame in user code.

See is_user_code for details.
Returns an empty dict if no such frame is found.
)Úget_user_frame_and_stacklevelr5   )r4   Ú_stacklevels     r   Úget_user_stack_infor9   N   s"   € ô 7Ó8Ñ€EÞÜ(¨Ó/Ð/Ø€Ir   c                 ó¾   • [         R                  " 5       n SnU (       a?  [        U R                  5      (       a  X4$ U R                  n US-  nUS:”  a   gU (       a  M?  g)z½Get the first calling frame in user code and a corresponding stacklevel that can be passed to `warnings.warn`.

See is_user_code for details.
Returns `(None, 0)` if no such frame is found.
r   é   i'  )Nr   )ÚinspectÚcurrentframeÚis_user_coder2   Úf_back)r4   Ú
stacklevels     r   r7   r7   Z   s`   € ô × Ò Ó"€EØ€JÞ
Ü˜Ÿ™×%Ñ%ØÐ$Ð$Ø—‘ˆØ�a‰ˆ
Ø˜Óð Ø÷ ˆ%ð r   i    c                óú   • [        [        U R                  5      R                  5       5      R	                  [
        5      =(       d1    U R                  R	                  S5      =(       d    U R                  S;   (       + $ )a�  Check if the code object is from user code.

A code object is not user code if:
- It is from a file in
    - the standard library
    - site-packages (specifically wherever opentelemetry is installed)
    - the logfire package
    - an unknown location (e.g. a dynamically generated code object) indicated by a filename starting with '<'
- It is a list/dict/set comprehension.
    These are artificial frames only created before Python 3.12,
    and they are always called directly from the enclosing function so it makes sense to skip them.
    On the other hand, generator expressions and lambdas might be called far away from where they are defined.
Ú<)z
<listcomp>z
<dictcomp>z	<setcomp>)r   r   r(   r   Ú
startswithr   r)   )r.   s    r   r>   r>   o   sc   € ô  	ŒD�×!Ñ!Ó"×+Ñ+Ó-Ó.×9Ñ9Ô:PÓQ÷ 	EØ×Ñ×&Ñ& sÓ+÷	Eà�<‰<ÐDÑDôð r   c                óF   • [        5       u  p#[        R                  " XUS9  g )N)r@   Úcategory)r7   ÚwarningsÚwarn)ÚmsgrE   Ú_framer@   s       r   Úwarn_at_user_stacklevelrJ   …   s   € Ü6Ó8Ñ€FÜ‡M‚M�#°xÓ@r   )r   z
str | PathÚreturnÚNone)r"   r   rK   r
   )r.   r   rK   r
   )r4   r   rK   r
   )rK   r
   )rK   ztuple[FrameType | None, int])r.   r   rK   Úbool)rH   r   rE   ztype[Warning])7Ú
__future__r   ÚbuiltinsÚ@py_builtinsÚ_pytest.assertion.rewriteÚ	assertionÚrewriteÚ
@pytest_arr<   r*   rF   Ú	functoolsr   Úpathlibr   Útypesr   r   Útypingr   Úopentelemetry.sdk.traceÚopentelemetryÚlogfireÚresolver    r   Úintr
   ÚsetÚ__annotations__Úkeysr   Ú@py_assert2Ú@py_assert1Ú_call_reprcompareÚlocalsÚ_should_repr_global_nameÚ	_safereprÚ@py_format4Ú@py_format6ÚAssertionErrorÚ_format_explanationr   r   ÚsdkÚtraceÚ__file__Úparentr#   r0   r5   r9   r7   r>   rJ   r   r   r   Ú<module>ro      s†  ðÞ "ç  „ ƒÛ 
Û Ý Ý ß %Ý ã ã áˆCƒy×ÑÓ€á�k°SÈÐ_bÑ#cÐkpÑq€	á�i×/Ñ/×4Ñ4Ó6Ó7€ÚKÐ K€ÐKÑK× K× K× K€ÐK× K× K× K× KÕ K€× K× KÕ K€× K× KÑ KÐK× K× K× K× K× KÓ Kà*,Ð ˜Ó ,ô&ñ* ™˜m×/Ñ/×5Ñ5×>Ñ>Ó?×FÑF×MÑM×TÑT×[Ñ[Ô \Ù ™˜g×.Ñ.Ó/×6Ñ6Ô 7Ù ™˜g×.Ñ.Ó/×6Ñ6Ô 7ô(ñ �4Ñóó ðôô	ôñ* �4Ñóó ðõ*Ar   