ó
    Ð]j:"  ã                  óJ  • S r SSK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  SSKJrJr  SSKJrJrJr  SS	KJrJr  SS
KJr  SSKJrJr  SSKJrJr  SSKJ r   SSK!J"r"J#r#J$r$J%r%  \
(       a  SSKJ&r&  \" \5      r\'r'SS jr(SS jr)SS jr*SS jr+SS jr, " S S\5      r-g)z'Python source expertise for coverage.pyé    )ÚannotationsN)ÚIterable)ÚTYPE_CHECKING)Úenv)ÚCoverageExceptionÚNoSource)Úcanonical_filenameÚrelative_filenameÚzip_location)Úisolate_moduleÚ
join_regex)ÚPythonParser)Úsource_encodingÚsource_token_lines)Ú
CodeRegionÚFileReporter)Úcode_regions)ÚTArcÚTLineNoÚTMorfÚTSourceTokenLines)ÚCoveragec                ó²   • [        U S5       nUR                  5       nSSS5        WR                  SS5      R                  SS5      $ ! , (       d  f       N0= f)z>Read the Python source text from `filename`.

Returns bytes.

ÚrbNs   
ó   
ó   )ÚopenÚreadÚreplace)ÚfilenameÚfÚsources      ÚL/home/mande/repo/quber/.venv/lib/python3.13/site-packages/coverage/python.pyÚread_python_sourcer$   !   sI   € ô 
ˆh˜Ô	 Ø—‘“ˆ÷ 
ð �>‰>˜' 5Ó)×1Ñ1°%¸Ó?Ð?÷ 
Õ	ús   �AÁ
Ac                óÊ  • [         R                  R                  U 5      u  pUS:X  a  [        R                  (       a  SS/nOU/nU HH  nX-   n[         R                  R                  U5      (       a  [        U5      n  O"[        U5      nUc  MH    O   [        SU  S3SS9eUR                  SS5      nUR                  [        U5      S	5      nU(       a  US
   S:w  a  US-  nU$ )z#Return the source code, as unicode.ú.pyz.pywzNo source for code: 'z'.z	no-source)Úslugó   ó    r   éÿÿÿÿÚ
)ÚosÚpathÚsplitextr   ÚWINDOWSÚexistsr$   Úget_zip_bytesr   r   Údecoder   )r    ÚbaseÚextÚextsÚtry_filenameÚsource_bytesr"   s          r#   Úget_python_sourcer8   -   sß   € ä—‘× Ñ  Ó*�I€DØ
ˆeƒ|œŸŸØ�vˆ‰àˆuˆó ˆØ‘zˆÜ�7‰7�>‰>˜,×'Ñ'ä-¨lÓ;ˆLÙô % \Ó2ˆØÓ#Ùñ ô Ð.¨x¨j¸Ð;À+ÑNÐNð  ×'Ñ'¨¨tÓ4€LØ× Ñ ¤°Ó!>À	ÓJ€Fö �&˜‘* Ó$Ø�$‰ˆà€Mó    c                óÒ   • [        U 5      nUb/  Uu  p# [        R                  " U5      n UR	                  U5      nU$ g! [        R                   a     gf = f! [
         a     gf = f)zëGet data from `filename` if it is a zip file path.

Returns the bytestring data read from the zip file, or None if no zip file
could be found or `filename` isn't in it.  The data returned will be
an empty string if the file is empty.

N)r   Ú	zipimportÚzipimporterÚZipImportErrorÚget_dataÚOSError)r    Úzipfile_innerÚzipfileÚinnerÚziÚdatas         r#   r1   r1   P   sz   € ô ! Ó*€MØÑ Ø&‰ˆð	Ü×&Ò& wÓ/ˆBð	Ø—;‘;˜uÓ%ˆDð ˆØøô ×'Ñ'ó 	Ùð	ûô ó 	Ùð	ús    ”? «A ¿AÁAÁ
A&Á%A&c                ó<  • U R                  S5      (       a  U $ U R                  S5      (       am  U SS n[        R                  R                  U5      (       a  U$ [        R
                  (       a+  US-   n[        R                  R                  U5      (       a  U$ U$ U $ )z�Return the source filename for `filename`.

Given a file name being traced, return the best guess as to the source
file to attribute it to.

r&   )z.pycz.pyoNr*   Úw)Úendswithr,   r-   r0   r   r/   )r    Úpy_filenameÚpyw_filenames      r#   Úsource_for_filerJ   g   s‡   € ð ×Ñ˜×Ñàˆà	×	Ñ	Ð+×	,Ñ	,à˜s �mˆÜ�7‰7�>‰>˜+×&Ñ&àÐÜ�;�;à&¨Ñ,ˆLÜ�w‰w�~‰~˜l×+Ñ+Ø#Ð#àÐð €Or9   c                óÚ   • [        U S5      (       a  U R                  (       a  U R                  nO0[        U [        R                  5      (       a  [        SU  S35      eU n[        U5      nU$ )z6Get the source filename for the module-or-file `morf`.Ú__file__zModule z has no file)ÚhasattrrL   Ú
isinstanceÚtypesÚ
ModuleTyper   rJ   )Úmorfr    s     r#   Úsource_for_morfrR   „   s[   € äˆt�Z× Ñ  T§]§]Ø—=‘=‰Ü	�Dœ%×*Ñ*×	+Ñ	+ô   '¨$¨¨|Ð <Ó=Ð=àˆä˜xÓ(€HØ€Or9   c                  ó  ^ • \ rS rSrSrSSU 4S jjjrSS jrSS jr\SS j5       r	SS jr
SS jrSS	 jrSS
 jrSS jrSS jrSS jrS S jr S       S!S jjrS"S jrSS jrS#S jrS$S jrS%S jrS&S jrSrU =r$ )'ÚPythonFileReporteré“   z!Report support for a Python file.c                ó:  >• X l         [        U5      nUnSnU R                   b'  U R                   R                  R                  (       a  SnU(       a  [	        U5      n[
        TU ]  U5        [        US5      (       ay  UR                  R                  S[        R                  5      n[        R                  R                  U5      R                  S5      (       a  U[        R                  S-   -  nUS-  nO[        U5      nX`l        S U l        S U l        S U l        g )NTFÚ__name__Ú.z	__init__.Ú__init__r&   )ÚcoveragerR   ÚconfigÚrelative_filesr	   ÚsuperrY   rM   rW   r   r,   Úsepr-   ÚbasenameÚ
startswithr
   ÚrelnameÚ_sourceÚ_parserÚ	_excluded)ÚselfrQ   rZ   r    ÚfnameÚcanonicalizeÚnameÚ	__class__s          €r#   rY   ÚPythonFileReporter.__init__–   sß   ø€ Ø Œä" 4Ó(ˆàˆØˆØ�=‰=Ñ$Ø�}‰}×#Ñ#×2×2Ø$�ÞÜ& xÓ0ˆEÜ‰Ñ˜Ôä�4˜×$Ñ$Ø—=‘=×(Ñ(¨¬b¯f©fÓ5ˆDÜ�w‰w×Ñ Ó)×4Ñ4°[×AÑAØœŸ™ Ñ+Ñ+�Ø�E‰M‰Dä$ XÓ.ˆDØŒà#'ˆŒØ,0ˆŒØˆ�r9   c                ó$   • SU R                   < S3$ )Nz<PythonFileReporter Ú>)r    ©re   s    r#   Ú__repr__ÚPythonFileReporter.__repr__±   s   € Ø% d§m¡mÑ%6°aÐ8Ð8r9   c                ó   • U R                   $ ©N)ra   rm   s    r#   r
   Ú$PythonFileReporter.relative_filename´   s   € Ø�|‰|Ðr9   c                óê   • U R                   c   eU R                  cL  [        U R                  U R                   R	                  S5      S9U l        U R                  R                  5         U R                  $ )z&Lazily create a :class:`PythonParser`.Úexclude)r    rt   )rZ   rc   r   r    Ú_exclude_regexÚparse_sourcerm   s    r#   ÚparserÚPythonFileReporter.parser·   s_   € ð �}‰}Ñ(Ð(Ð(Ø�<‰<ÑÜ'ØŸ™ØŸ™×4Ñ4°YÓ?ñˆDŒLð �L‰L×%Ñ%Ô'Ø�|‰|Ðr9   c                ó.   • U R                   R                  $ )z2Return the line numbers of statements in the file.)rw   Ú
statementsrm   s    r#   ÚlinesÚPythonFileReporter.linesÃ   s   € à�{‰{×%Ñ%Ð%r9   c                ó.   • U R                   R                  $ )z>A map of line numbers to first-line in a multi-line statement.)rw   Úmultiline_maprm   s    r#   r~   Ú PythonFileReporter.multiline_mapÇ   s   € à�{‰{×(Ñ(Ð(r9   c                ó.   • U R                   R                  $ )z;Return the line numbers of excluded statements in the file.)rw   Úexcludedrm   s    r#   Úexcluded_linesÚ!PythonFileReporter.excluded_linesË   s   € à�{‰{×#Ñ#Ð#r9   c                ó8   • U R                   R                  U5      $ rq   )rw   Útranslate_lines)re   r{   s     r#   r…   Ú"PythonFileReporter.translate_linesÏ   s   € Ø�{‰{×*Ñ*¨5Ó1Ð1r9   c                ó8   • U R                   R                  U5      $ rq   )rw   Útranslate_arcs)re   Úarcss     r#   rˆ   Ú!PythonFileReporter.translate_arcsÒ   s   € Ø�{‰{×)Ñ)¨$Ó/Ð/r9   c                óê   • U R                   c   eU R                  R                  [        U R                   R                  R
                  U R                   R                  R                  -   5      5      nU$ rq   )rZ   rw   Úlines_matchingr   r[   Úpartial_listÚpartial_always_list)re   Ú	no_branchs     r#   Úno_branch_linesÚ"PythonFileReporter.no_branch_linesÕ   s[   € Ø�}‰}Ñ(Ð(Ð(Ø—K‘K×.Ñ.Ü�t—}‘}×+Ñ+×8Ñ8¸4¿=¹=×;OÑ;O×;cÑ;cÑcÓdó
ˆ	ð Ðr9   c                ó6   • U R                   R                  5       $ rq   )rw   r‰   rm   s    r#   r‰   ÚPythonFileReporter.arcsÜ   s   € Ø�{‰{×ÑÓ!Ð!r9   c                ó6   • U R                   R                  5       $ rq   )rw   Úexit_countsrm   s    r#   r•   ÚPythonFileReporter.exit_countsß   s   € Ø�{‰{×&Ñ&Ó(Ð(r9   c                ó8   • U R                   R                  X5      $ rq   )rw   Úmissing_arc_description)re   ÚstartÚendÚexecuted_arcss       r#   r˜   Ú*PythonFileReporter.missing_arc_descriptionâ   s   € ð �{‰{×2Ñ2°5Ó>Ð>r9   c                ó8   • U R                   R                  X5      $ rq   )rw   Úarc_description)re   r™   rš   s      r#   rž   Ú"PythonFileReporter.arc_descriptionê   s   € Ø�{‰{×*Ñ*¨5Ó6Ð6r9   c                óh   • U R                   c  [        U R                  5      U l         U R                   $ rq   )rb   r8   r    rm   s    r#   r"   ÚPythonFileReporter.sourceí   s&   € Ø�<‰<ÑÜ,¨T¯]©]Ó;ˆDŒLØ�|‰|Ðr9   c                ó˜   • [         R                  R                  U R                  5      u  pUR	                  S5      (       a  gU(       d  gg)zÄDoes it seem like this file should contain Python?

This is used to decide if a file reported as part of the execution of
a program was really likely to have contained Python in the first
place.

r&   TF)r,   r-   r.   r    r`   )re   Ú_r4   s      r#   Úshould_be_pythonÚ#PythonFileReporter.should_be_pythonò   s;   € ô —‘×!Ñ! $§-¡-Ó0‰ˆð �>‰>˜%× Ñ ØæØàr9   c                ó4   • [        U R                  5       5      $ rq   )r   r"   rm   s    r#   r   Ú%PythonFileReporter.source_token_lines  s   € Ü! $§+¡+£-Ó0Ð0r9   c                ó4   • [        U R                  5       5      $ rq   )r   r"   rm   s    r#   r   ÚPythonFileReporter.code_regions	  s   € Ü˜DŸK™K›MÓ*Ð*r9   c                ó
   • SS/$ )N)ÚfunctionÚ	functions)ÚclassÚclasses© rm   s    r#   Úcode_region_kindsÚ$PythonFileReporter.code_region_kinds  s   € à%Ø ð
ð 	
r9   )rd   rc   rb   rZ   ra   rq   )rQ   r   rZ   zCoverage | NoneÚreturnÚNone)r²   Ústr)r²   r   )r²   úset[TLineNo])r²   zdict[TLineNo, TLineNo])r{   zIterable[TLineNo]r²   rµ   )r‰   zIterable[TArc]r²   ú	set[TArc])r²   r¶   )r²   zdict[TLineNo, int])r™   r   rš   r   r›   zIterable[TArc] | Noner²   r´   )r™   r   rš   r   r²   r´   )r²   Úbool)r²   r   )r²   zIterable[CodeRegion])r²   zIterable[tuple[str, str]])rW   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rY   rn   r
   Úpropertyrw   r{   r~   r‚   r…   rˆ   r�   r‰   r•   r˜   rž   r"   r¤   r   r   r°   Ú__static_attributes__Ú__classcell__)ri   s   @r#   rT   rT   “   s©   ø† Ù+÷ñ ô69ôð ó	ó ð	ô&ô)ô$ô2ô0ôô"ô)ð 04ð	?àð?ð ð?ð -ð	?ð
 
õ?ô7ôô
ô(1ô+÷
ò 
r9   rT   )r    r´   r²   Úbytes)r    r´   r²   r´   )r    r´   r²   zbytes | None)rQ   r   r²   r´   ).r»   Ú
__future__r   Úos.pathr,   rO   r;   Úcollections.abcr   Útypingr   rZ   r   Úcoverage.exceptionsr   r   Úcoverage.filesr	   r
   r   Úcoverage.miscr   r   Úcoverage.parserr   Úcoverage.phystokensr   r   Úcoverage.pluginr   r   Úcoverage.regionsr   Úcoverage.typesr   r   r   r   r   r   r$   r8   r1   rJ   rR   rT   r¯   r9   r#   Ú<module>rÌ      s}   ðñ .å "ã Û Û Ý $Ý  å ß ;ß NÑ Nß 4Ý (ß Cß 4Ý )ß BÓ BæÝ!ñ �BÓ€à€ô	@ô ôFô.ô:ô}
˜õ }
r9   