ó
    ÷Þ 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      ÚI/var/www/html/gaurav/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        g )NTFÚ__name__Ú.z	__init__.Ú__init__r&   )ÚcoveragerR   ÚconfigÚrelative_filesr	   ÚsuperrY   rM   rW   r   r,   Úsepr-   ÚbasenameÚ
startswithr
   ÚrelnameÚ_sourceÚ_parser)Ú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    ©rd   s    r#   Ú__repr__ÚPythonFileReporter.__repr__°   s   € Ø% d§m¡mÑ%6°aÐ8Ð8r9   c                ó   • U R                   $ ©N)ra   rl   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    rs   )rZ   rc   r   r    Ú_exclude_regexÚparse_sourcerl   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.)rv   Ú
statementsrl   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.)rv   Úmultiline_maprl   s    r#   r}   Ú PythonFileReporter.multiline_mapÆ   s   € à�{‰{×(Ñ(Ð(r9   c                ó.   • U R                   R                  $ )z;Return the line numbers of excluded statements in the file.)rv   Úexcludedrl   s    r#   Úexcluded_linesÚ!PythonFileReporter.excluded_linesÊ   s   € à�{‰{×#Ñ#Ð#r9   c                ó8   • U R                   R                  U5      $ rp   )rv   Útranslate_lines)rd   rz   s     r#   r„   Ú"PythonFileReporter.translate_linesÎ   s   € Ø�{‰{×*Ñ*¨5Ó1Ð1r9   c                ó8   • U R                   R                  U5      $ rp   )rv   Útranslate_arcs)rd   Ú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$ rp   )rZ   rv   Úlines_matchingr   r[   Úpartial_listÚpartial_always_list)rd   Ú	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       $ rp   )rv   rˆ   rl   s    r#   rˆ   ÚPythonFileReporter.arcsÛ   s   € Ø�{‰{×ÑÓ!Ð!r9   c                ó6   • U R                   R                  5       $ rp   )rv   Úexit_countsrl   s    r#   r”   ÚPythonFileReporter.exit_countsÞ   s   € Ø�{‰{×&Ñ&Ó(Ð(r9   c                ó8   • U R                   R                  X5      $ rp   )rv   Úmissing_arc_description)rd   ÚstartÚendÚexecuted_arcss       r#   r—   Ú*PythonFileReporter.missing_arc_descriptioná   s   € ð �{‰{×2Ñ2°5Ó>Ð>r9   c                ó8   • U R                   R                  X5      $ rp   )rv   Úarc_description)rd   r˜   r™   s      r#   r�   Ú"PythonFileReporter.arc_descriptioné   s   € Ø�{‰{×*Ñ*¨5Ó6Ð6r9   c                óh   • U R                   c  [        U R                  5      U l         U R                   $ rp   )rb   r8   r    rl   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`   )rd   Ú_r4   s      r#   Úshould_be_pythonÚ#PythonFileReporter.should_be_pythonñ   s;   € ô —‘×!Ñ! $§-¡-Ó0‰ˆð �>‰>˜%× Ñ ØæØàr9   c                ó4   • [        U R                  5       5      $ rp   )r   r"   rl   s    r#   r   Ú%PythonFileReporter.source_token_lines  s   € Ü! $§+¡+£-Ó0Ð0r9   c                ó4   • [        U R                  5       5      $ rp   )r   r"   rl   s    r#   r   ÚPythonFileReporter.code_regions  s   € Ü˜DŸK™K›MÓ*Ð*r9   c                ó
   • SS/$ )N)ÚfunctionÚ	functions)ÚclassÚclasses© rl   s    r#   Úcode_region_kindsÚ$PythonFileReporter.code_region_kinds  s   € à%Ø ð
ð 	
r9   )rc   rb   rZ   ra   rp   )rQ   r   rZ   zCoverage | NoneÚreturnÚNone)r±   Ústr)r±   r   )r±   úset[TLineNo])r±   zdict[TLineNo, TLineNo])rz   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   rm   r
   Úpropertyrv   rz   r}   r�   r„   r‡   r�   rˆ   r”   r—   r�   r"   r£   r   r   r¯   Ú__static_attributes__Ú__classcell__)rh   s   @r#   rT   rT   “   s©   ø† Ù+÷1ñ 1ô4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   