§
    0›j^C  ã                  ó0  — d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ dd	lmZmZ e	rdd
lmZ ddlmZ d+d„Ze G d„ d¦  «        ¦   «         Zee         Z G d„ d¦  «        Ze G d„ d¦  «        ¦   «         Zd,d„Zd-d#„Z	 d.d/d&„Zd0d*„ZdS )1z Results of coverage measurement.é    )ÚannotationsN)ÚIterable)Ú	dataclass)ÚTYPE_CHECKING)ÚConfigError©Ú	nice_pair)ÚTArcÚTLineNo)ÚCoverageData)ÚFileReporterÚdatar   Ú	precisionÚintÚfile_reporterr   ÚfilenameÚstrÚreturnÚAnalysisc                ó¾  — |                       ¦   «         }|                     ¦   «         }|                     ¦   «         }|                     |                      |¦  «        pg ¦  «        |z  }|�r-|                     ¦   «         }|                      |¦  «        pg }	|                     |	¦  «        }	t          j        t          ¦  «        }
|D ] \  }}|
|          	                    |¦  «         Œ!d„ |
 
                    ¦   «         D ¦   «         }t          ¦   «         }|	D ]D\  }}||k    r| 	                    ||f¦  «         Œ#||v r| 	                    |||         f¦  «         ŒE|                     |¦  «        }|                     ¦   «         }|                     ¦   «         }n,t          ¦   «         }t          ¦   «         }i }t          ¦   «         }t          ||||||||||¬¦
  «
        S )z'Create an Analysis from a FileReporter.c                óf   — i | ].\  }}t          |¦  «        d k    ¯|t          |¦  «        d         “Œ/S )é   r   )ÚlenÚlist)Ú.0ÚfromnoÚtonoss      úO/home/lighthouse/health/venv/lib64/python3.11/site-packages/coverage/results.pyú
<dictcomp>z/analysis_from_file_reporter.<locals>.<dictcomp>+   s;   € ð 
ð 
ð 
Ù'4 v¨uÍÈUÉÌÐWXÊÈˆF•D˜‘K”K ”NÈÈÈó    ©
r   r   Úhas_arcsÚ
statementsÚexcludedÚexecutedÚarc_possibilities_setÚarcs_executed_setÚexit_countsÚ	no_branch)r"   ÚlinesÚexcluded_linesÚtranslate_linesÚarcsÚtranslate_arcsÚcollectionsÚdefaultdictÚsetÚaddÚitemsr(   Úno_branch_linesr   )r   r   r   r   r"   r#   r$   r%   r&   r-   Údestsr   ÚtonoÚsingle_destsÚnew_arcsr'   r(   r)   s                     r   Úanalysis_from_file_reporterr9      sþ  € ð �}Š}‰Œ€HØ×$Ò$Ñ&Ô&€JØ×+Ò+Ñ-Ô-€HØ×,Ò,¨T¯ZªZ¸Ñ-AÔ-AÐ-GÀRÑHÔHÈ:ÑU€Hàñ Ø -× 2Ò 2Ñ 4Ô 4ÐØ#Ÿyšy¨Ñ2Ô2Ð8°bˆØ×+Ò+¨DÑ1Ô1ˆõ Ô'­Ñ,Ô,ˆØ1ð 	$ð 	$‰LˆF�DØ�&ŒM×Ò˜dÑ#Ô#Ð#Ð#ð
ð 
Ø8=¿º¹¼ð
ñ 
ô 
ˆõ ‘5”5ˆØ ð 	Að 	A‰LˆF�DØ˜Š~ˆ~Ø—’˜f d˜^Ñ,Ô,Ð,Ð,à˜\Ð)Ð)Ø—L’L &¨,°vÔ*>Ð!?Ñ@Ô@Ð@øà)×8Ò8¸ÑBÔBÐØ#×/Ò/Ñ1Ô1ˆØ!×1Ò1Ñ3Ô3ˆ	ˆ	å #¡¤ÐÝ™EœEÐØˆÝ‘E”Eˆ	åØØØØØØØ3Ø+ØØðñ ô ð r    c                  óº   — e Zd ZU dZded<   ded<   ded<   ded	<   ded
<   ded<   ded<   ded<   ded<   ded<   d#d„Zd$d%d„Zd&d„Zd'd„Zd(d„Z	d)d„Z
d)d„Zd*d!„Zd"S )+r   z(The results of analyzing a FileReporter.r   r   r   r   Úboolr"   úset[TLineNo]r#   r$   r%   ú	set[TArc]r&   r'   zdict[TLineNo, int]r(   r)   r   ÚNonec           
     ó^  ‡ — t          ‰ j        ¦  «        ‰ _        t          ‰ j        ¦  «        ‰ _        ‰ j        ‰ j        z
  ‰ _        ‰ j        r�‰  	                    ¦   «         }‰  
                    ¦   «         }t          ˆ fd„|                     ¦   «         D ¦   «         ¦  «        }t          d„ |                     ¦   «         D ¦   «         ¦  «        }ndx}x}}t          ‰ j        dt          ‰ j        ¦  «        t          ‰ j        ¦  «        t          ‰ j        ¦  «        |||¬¦  «        ‰ _        d S )Nc              3  óN   •K  — | ]\  }}|‰j         v¯t          |¦  «        V — Œ d S ©N)Úmissingr   )r   ÚkÚvÚselfs      €r   ú	<genexpr>z)Analysis.__post_init__.<locals>.<genexpr>d   s;   øè è € Ð$]Ð$]±°°1ÀqÐPTÔP\ÐG\ÐG\¥S¨¡V¤VÐG\ÐG\ÐG\ÐG\Ð$]Ð$]r    c              3  ó:   K  — | ]\  }}t          |¦  «        V — Œd S rA   )r   )r   rC   rD   s      r   rF   z)Analysis.__post_init__.<locals>.<genexpr>e   s,   è è € Ð$DÐ$D±°°1¥S¨¡V¤VÐ$DÐ$DÐ$DÐ$DÐ$DÐ$Dr    r   r   )r   Ún_filesÚn_statementsÚ
n_excludedÚ	n_missingÚ
n_branchesÚn_partial_branchesÚn_missing_branches)Úsortedr&   Úarc_possibilitiesr'   Úarcs_executedr#   r%   rB   r"   Ú_total_branchesÚmissing_branch_arcsÚsumr3   ÚNumbersr   r   r$   Únumbers)rE   rL   ÚmbarM   rN   s   `    r   Ú__post_init__zAnalysis.__post_init__\   s  ø€ Ý!'¨Ô(BÑ!CÔ!CˆÔÝ# DÔ$:Ñ;Ô;ˆÔØ”¨¬Ñ6ˆŒàŒ=ð 	EØ×-Ò-Ñ/Ô/ˆJØ×*Ò*Ñ,Ô,ˆCÝ!$Ð$]Ð$]Ð$]Ð$]¸¿	º	¹¼Ð$]Ñ$]Ô$]Ñ!]Ô!]ÐÝ!$Ð$DÐ$D¸¿	º	¹¼Ð$DÑ$DÔ$DÑ!DÔ!DÐÐàCDÐDˆJÐDÐ+Ð.@åØ”nØÝ˜Tœ_Ñ-Ô-Ý˜4œ=Ñ)Ô)Ý˜$œ,Ñ'Ô'Ø!Ø1Ø1ð	
ñ 	
ô 	
ˆŒˆˆr    FÚbranchesc                óž   — |r.| j         r'|                      ¦   «                              ¦   «         }nd}t          | j        | j        |¬¦  «        S )z¯The missing line numbers, formatted nicely.

        Returns a string like "1-2, 5-11, 13-14".

        If `branches` is true, includes the missing branch arcs also.

        N)r-   )r"   rS   r3   Úformat_linesr#   rB   )rE   rY   r-   s      r   Úmissing_formattedzAnalysis.missing_formattedt   sR   € ð ð 	˜œð 	Ø×+Ò+Ñ-Ô-×3Ò3Ñ5Ô5ˆDˆDàˆDå˜DœO¨T¬\ÀÐEÑEÔEÐEr    ú
list[TArc]c                óH   ‡ — ˆ fd„‰ j         D ¦   «         }t          |¦  «        S )z:Returns a sorted list of the un-executed arcs in the code.c              3  ój   •K  — | ]-}|‰j         vr"|d          ‰j        vr|d         ‰j        v¯)|V — Œ.dS )r   r   N)r'   r)   r$   )r   ÚprE   s     €r   rF   z(Analysis.arcs_missing.<locals>.<genexpr>…   sa   øè è € ð 
ð 
àØ˜Ô.Ð.Ð.Ø�!”˜DœNÐ*Ð*Ø�!”˜DœMÐ)Ð)ð	 ð *Ð)Ð)Ð)ð
ð 
r    )rP   rO   )rE   rB   s   ` r   Úarcs_missingzAnalysis.arcs_missingƒ   s<   ø€ ð
ð 
ð 
ð 
àÔ+ð
ñ 
ô 
ˆõ �g‰ŒÐr    úlist[TLineNo]c                óH   — d„ | j                              ¦   «         D ¦   «         S )z<Returns a list of line numbers that have more than one exit.c                ó$   — g | ]\  }}|d k    ¯|‘ŒS )r   © )r   Úl1Úcounts      r   ú
<listcomp>z*Analysis._branch_lines.<locals>.<listcomp>�   s!   € ÐJÐJÐJ‘y�r˜5ÀÈÂ	À	�À	À	À	r    )r(   r3   ©rE   s    r   Ú_branch_lineszAnalysis._branch_linesŽ   s%   € àJÐJ DÔ$4×$:Ò$:Ñ$<Ô$<ÐJÑJÔJÐJr    c                ób   — t          d„ | j                             ¦   «         D ¦   «         ¦  «        S )z"How many total branches are there?c              3  ó&   K  — | ]}|d k    ¯|V — ŒdS )r   Nre   )r   rg   s     r   rF   z+Analysis._total_branches.<locals>.<genexpr>”   s&   è è € ÐMÐM˜UÀ5È1Â9À9�5À9À9À9À9ÐMÐMr    )rT   r(   Úvaluesri   s    r   rR   zAnalysis._total_branches’   s.   € åÐMÐM dÔ&6×&=Ò&=Ñ&?Ô&?ÐMÑMÔMÑMÔMÐMr    údict[TLineNo, list[TLineNo]]c                ó,  — |                       ¦   «         }t          |                      ¦   «         ¦  «        }t          j        t
          ¦  «        }|D ]B\  }}||k    sJ d| j        › d|› d|› �¦   «         ‚||v r||                              |¦  «         ŒC|S )zgReturn arcs that weren't executed from branch lines.

        Returns {l1:[l2a,l2b,...], ...}

        zIn z, didn't expect z == )ra   r1   rj   r/   r0   r   r   Úappend)rE   rB   Úbranch_linesrW   rf   Úl2s         r   rS   zAnalysis.missing_branch_arcs–   s¦   € ð ×#Ò#Ñ%Ô%ˆÝ˜4×-Ò-Ñ/Ô/Ñ0Ô0ˆÝÔ%¥dÑ+Ô+ˆØð 	#ð 	#‰FˆB�Ø˜’8�8�8ÐN 4¤=ÐNÐNÀ"ÐNÐNÈ"ÐNÐN‘8”8�8Ø�\Ð!Ð!Ø�B”—’˜rÑ"Ô"Ð"øØˆ
r    c                ó  — t          |                      ¦   «         ¦  «        }t          j        t          ¦  «        }| j        D ]F\  }}||k    sJ d|›d|›�¦   «         ‚||f| j        vrŒ'||v r||                              |¦  «         ŒG|S )zœReturn arcs that were executed from branch lines.

        Only include ones that we considered possible.

        Returns {l1:[l2a,l2b,...], ...}

        z+Oops: Didn't think this could happen: l1 = z, l2 = )r1   rj   r/   r0   r   rQ   r&   rp   )rE   rq   Úebarf   rr   s        r   Úexecuted_branch_arcszAnalysis.executed_branch_arcs¥   s£   € õ ˜4×-Ò-Ñ/Ô/Ñ0Ô0ˆÝÔ%¥dÑ+Ô+ˆØÔ(ð 	#ð 	#‰FˆB�Ø˜’8�8�8ÐVÀbÐVÐVÈrÐVÐV‘8”8�8Ø�Bˆx˜tÔ9Ð9Ð9ØØ�\Ð!Ð!Ø�B”—’˜rÑ"Ô"Ð"øØˆ
r    údict[TLineNo, tuple[int, int]]c                ó¸   — |                       ¦   «         }i }|                      ¦   «         D ].}| j        |         }t          ||         ¦  «        }|||z
  f||<   Œ/|S )z€Get stats about branches.

        Returns a dict mapping line numbers to a tuple:
        (total_exits, taken_exits).

        )rS   rj   r(   r   )rE   Úmissing_arcsÚstatsÚlnumÚexitsrB   s         r   Úbranch_statszAnalysis.branch_stats·   sm   € ð ×/Ò/Ñ1Ô1ˆØˆØ×&Ò&Ñ(Ô(ð 	3ð 	3ˆDØÔ$ TÔ*ˆEÝ˜, tÔ,Ñ-Ô-ˆGØ  %¨'¡/Ð2ˆE�$‰KˆKØˆr    N)r   r>   )F)rY   r;   r   r   )r   r]   )r   rb   ©r   r   )r   rn   )r   rv   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__rX   r\   ra   rj   rR   rS   ru   r|   re   r    r   r   r   M   s=  € € € € € € à2Ð2à€N€N�NØ€M€M�MØ€N€N�NØÐÐÑØÐÐÑØÐÐÑØ$Ð$Ð$Ñ$Ø Ð Ð Ñ Ø#Ð#Ð#Ñ#ØÐÐÑð
ð 
ð 
ð 
ð0Fð Fð Fð Fð Fð	ð 	ð 	ð 	ðKð Kð Kð KðNð Nð Nð Nðð ð ð ðð ð ð ð$ð ð ð ð ð r    c                  ó*   — e Zd ZdZdd„Zdd	„Zdd„ZdS )ÚAnalysisNarrowera  
    For reducing an `Analysis` to a subset of its lines.

    Originally this was a simpler method on Analysis, but that led to quadratic
    behavior.  This class does the bulk of the work up-front to provide the
    same results in linear time.

    Create an AnalysisNarrower from an Analysis, bulk-add region lines to it
    with `add_regions`, then individually request new narrowed Analysis objects
    for each region with `narrow`.  Doing most of the work in limited calls to
    `add_regions` lets us avoid poor performance.
    Úanalysisr   r   r>   c                óÈ   — || _         t          j        t          ¦  «        | _        t          j        t          ¦  «        | _        t          j        t          ¦  «        | _        d S rA   )r…   r/   r0   r1   Úregion2arc_possibilitiesÚregion2arc_executedÚdictÚregion2exit_counts)rE   r…   s     r   Ú__init__zAnalysisNarrower.__init__Û   sQ   € Ø ˆŒÝGRÔG^Õ_bÑGcÔGcˆÔ%ÝBMÔBYÕZ]ÑB^ÔB^ˆÔ ÝJUÔJaÝñK
ô K
ˆÔÐÐr    ÚlinessúIterable[set[TLineNo]]c                ór  ‡	— | j         j        r§i Š	|D ]}t          |¦  «        }|D ]}|‰	|<   ŒŒd	ˆ	fd„} || j         j        | j        ¦  «          || j         j        | j        ¦  «         | j         j                             ¦   «         D ].\  }}‰	 	                    |¦  «        x}r|| j
        |         |<   Œ-dS dS )
z™
        Pre-process a number of sets of line numbers.  Later calls to `narrow`
        with one of these sets will provide a narrowed Analysis.
        Úarc_setr=   Úregion2arcsúdict[TRegionLines, set[TArc]]r   r>   c                óè   •— | D ]m\  }}‰                      |¦  «        x}r||                              ||f¦  «         ‰                      |¦  «        x}r||                              ||f¦  «         Œnd S rA   )Úgetr2   )r�   r�   ÚaÚbÚrÚline2regions        €r   Úcollect_arcsz2AnalysisNarrower.add_regions.<locals>.collect_arcsð   s�   ø€ ð $ð 3ð 3‘D�A�qØ'ŸOšO¨AÑ.Ô.Ð.�qð 3Ø# Aœ×*Ò*¨A¨q¨6Ñ2Ô2Ð2Ø'ŸOšO¨AÑ.Ô.Ð.�qð 3Ø# Aœ×*Ò*¨A¨q¨6Ñ2Ô2Ð2øð	3ð 3r    N)r�   r=   r�   r‘   r   r>   )r…   r"   Ú	frozensetr&   r‡   r'   rˆ   r(   r3   r“   rŠ   )
rE   rŒ   r*   ÚfzlinesÚliner˜   ÚlnoÚnumr–   r—   s
            @r   Úadd_regionszAnalysisNarrower.add_regionsã   s  ø€ ð
 Œ=Ô!ð 	:Ø79ˆKàð 0ð 0�Ý# EÑ*Ô*�Ø!ð 0ð 0�DØ(/�K Ñ%Ð%ð0ð3ð 3ð 3ð 3ð 3ð 3ð ˆL˜œÔ<¸dÔ>[Ñ\Ô\Ð\ØˆL˜œÔ8¸$Ô:RÑSÔSÐSà œMÔ5×;Ò;Ñ=Ô=ð :ð :‘��SØ#Ÿš¨Ñ,Ô,Ð,�1ð :Ø69�DÔ+¨AÔ.¨sÑ3øð/	:ð 	:ð*:ð :r    r*   r<   c                óÆ  — | j         j        |z  }| j         j        |z  }| j         j        |z  }| j         j        rFt          |¦  «        }| j        |         }| j        |         }| j        |         }| j         j	        |z  }	n,t          ¦   «         }t          ¦   «         }i }t          ¦   «         }	t          | j         j        | j         j        | j         j        |||||||	¬¦
  «
        S )z�Create a narrowed Analysis.

        The current analysis is copied to make a new one that only considers
        the lines in `lines`.
        r!   )r…   r#   r$   r%   r"   r™   r‡   rˆ   rŠ   r)   r1   r   r   r   )
rE   r*   r#   r$   r%   rš   r&   r'   r(   r)   s
             r   ÚnarrowzAnalysisNarrower.narrow  së   € ð ”]Ô-°Ñ5ˆ
Ø”=Ô)¨EÑ1ˆØ”=Ô)¨EÑ1ˆàŒ=Ô!ð 
	Ý Ñ&Ô&ˆGØ$(Ô$AÀ'Ô$JÐ!Ø $Ô 8¸Ô AÐØÔ1°'Ô:ˆKØœÔ/°%Ñ7ˆIˆIå$'¡E¤EÐ!Ý #¡¤ÐØˆKÝ™œˆIåØ”mÔ-Ø”]Ô+Ø”]Ô+Ø!ØØØ"7Ø/Ø#Øð
ñ 
ô 
ð 	
r    N)r…   r   r   r>   )rŒ   r�   r   r>   )r*   r<   r   r   )r~   r   r€   r�   r‹   rž   r    re   r    r   r„   r„   Ë   sZ   € € € € € ðð ð
ð 
ð 
ð 
ð:ð :ð :ð :ð<&
ð &
ð &
ð &
ð &
ð &
r    r„   c                  ó¤  — e Zd ZU dZdZded<   dZded<   dZded<   dZded<   dZ	ded<   dZ
ded	<   dZded
<   dZded<   ed"d„¦   «         Zed"d„¦   «         Zed#d„¦   «         Zed#d„¦   «         Zd$d„Zed%d„¦   «         Zed%d„¦   «         Zed%d„¦   «         Zed&d„¦   «         Zed&d„¦   «         Zed&d„¦   «         Zed#d„¦   «         Zd'd„Zd(d „Zd!S ))rU   zœThe numerical results of measuring coverage.

    This holds the basic statistics from `Analysis`, and is used to roll
    up statistics across files.

    r   r   r   rH   rI   rJ   rK   rL   rM   rN   r   c                ó    — | j         | j        z
  S )z*Returns the number of executed statements.)rI   rK   ri   s    r   Ú
n_executedzNumbers.n_executed<  s   € ð Ô  4¤>Ñ1Ð1r    c                ó    — | j         | j        z
  S )z(Returns the number of executed branches.)rL   rN   ri   s    r   Ún_executed_brancheszNumbers.n_executed_branchesA  s   € ð Œ Ô!8Ñ8Ð8r    útuple[int, int]c                ó   — | j         | j        fS )z4Return numerator/denominator for statement coverage.)r£   rI   ri   s    r   Úratio_statementszNumbers.ratio_statementsF  s   € ð Œ Ô 1Ð1Ð1r    c                ó   — | j         | j        fS )z1Return numerator/denominator for branch coverage.)r¥   rL   ri   s    r   Úratio_brancheszNumbers.ratio_branchesK  s   € ð Ô'¨¬Ð8Ð8r    Ú	numeratorÚdenominatorÚfloatc                ó"   — |dk    rd|z  |z  S dS )zHelper for pc_* properties.r   ç      Y@re   ©rE   r«   r¬   s      r   Ú_percentzNumbers._percentP  s    € à˜Š?ˆ?Ø˜IÑ%¨Ñ4Ð4Øˆur    c                ó    —  | j         | j        Ž S )z/Returns a single percentage value for coverage.)r±   Úratio_coveredri   s    r   Ú
pc_coveredzNumbers.pc_coveredV  s   € ð ˆtŒ}˜dÔ0Ð1Ð1r    c                ó    —  | j         | j        Ž S )z.Returns the percentage covered for statements.)r±   r¨   ri   s    r   Úpc_statementszNumbers.pc_statements[  s   € ð ˆtŒ}˜dÔ3Ð4Ð4r    c                ó    —  | j         | j        Ž S )z,Returns the percentage covered for branches.)r±   rª   ri   s    r   Úpc_brancheszNumbers.pc_branches`  s   € ð ˆtŒ}˜dÔ1Ð2Ð2r    r   c                ó6   — t          | j        | j        ¦  «        S )a  Returns the percent covered, as a string, without a percent sign.

        Note that "0" is only returned when the value is truly zero, and "100"
        is only returned when the value is truly 100.  Rounding can never
        result in either "0" or "100".

        )Údisplay_coveredr´   r   ri   s    r   Úpc_covered_strzNumbers.pc_covered_stre  s   € õ ˜tœ°´Ñ?Ô?Ð?r    c                ó6   — t          | j        | j        ¦  «        S )z=Returns the statement percent covered without a percent sign.)rº   r¶   r   ri   s    r   Úpc_statements_strzNumbers.pc_statements_strp  s   € õ ˜tÔ1°4´>ÑBÔBÐBr    c                ó6   — t          | j        | j        ¦  «        S )z:Returns the branch percent covered without a percent sign.)rº   r¸   r   ri   s    r   Úpc_branches_strzNumbers.pc_branches_stru  s   € õ ˜tÔ/°´Ñ@Ô@Ð@r    c                óF   — | j         | j        z   }| j        | j        z   }||fS )z:Return a numerator and denominator for the coverage ratio.)r£   r¥   rI   rL   r°   s      r   r³   zNumbers.ratio_coveredz  s-   € ð ”O dÔ&>Ñ>ˆ	ØÔ'¨$¬/Ñ9ˆØ˜+Ð%Ð%r    Úotherc                óî   — t          | j        | j        |j        z   | j        |j        z   | j        |j        z   | j        |j        z   | j        |j        z   | j        |j        z   | j        |j        z   ¦  «        S rA   )	rU   r   rH   rI   rJ   rK   rL   rM   rN   ©rE   rÁ   s     r   Ú__add__zNumbers.__add__�  su   € ÝØŒNØŒL˜5œ=Ñ(ØÔ Ô 2Ñ2ØŒO˜eÔ.Ñ.ØŒN˜Uœ_Ñ,ØŒO˜eÔ.Ñ.ØÔ# eÔ&>Ñ>ØÔ# eÔ&>Ñ>ñ	
ô 	
ð 		
r    c                ó   — |dk    sJ ‚| S )Nr   re   rÃ   s     r   Ú__radd__zNumbers.__radd__�  s   € à˜ŠzˆzˆzˆzØˆr    Nr}   )r   r¦   )r«   r   r¬   r   r   r­   )r   r­   )r   r   )rÁ   rU   r   rU   )rÁ   r   r   rU   )r~   r   r€   r�   r   r‚   rH   rI   rJ   rK   rL   rM   rN   Úpropertyr£   r¥   r¨   rª   r±   r´   r¶   r¸   r»   r½   r¿   r³   rÄ   rÆ   re   r    r   rU   rU   *  sR  € € € € € € ðð ð €IÐÐÐÑØ€GÐÐÐÑØ€LÐÐÐÑØ€JÐÐÐÑØ€IÐÐÐÑØ€JÐÐÐÑØÐÐÐÐÑØÐÐÐÐÑàð2ð 2ð 2ñ „Xð2ð ð9ð 9ð 9ñ „Xð9ð ð2ð 2ð 2ñ „Xð2ð ð9ð 9ð 9ñ „Xð9ðð ð ð ð ð2ð 2ð 2ñ „Xð2ð ð5ð 5ð 5ñ „Xð5ð ð3ð 3ð 3ñ „Xð3ð ð@ð @ð @ñ „Xð@ð ðCð Cð Cñ „XðCð ðAð Að Añ „XðAð ð&ð &ð &ñ „Xð&ð

ð 

ð 

ð 

ðð ð ð ð ð r    rU   Úpcr­   c                óš   — dd|z  z  }d| cxk     r|k     rn n|} n)d|z
  | cxk     rdk     r	n nd|z
  } nt          | |¦  «        } | d|› d�›S )zîReturn a displayable total percentage, as a string.

    Note that "0" is only returned when the value is truly zero, and "100"
    is only returned when the value is truly 100.  Rounding can never
    result in either "0" or "100".

    g      ð?é
   r   r¯   éd   ú.Úf)Úround)rÈ   r   Únear0s      r   rº   rº   “  s‰   € ð �"�i‘-Ñ€EØˆ2€~€~‚~€~�‚~€~€~€~€~ØˆˆØ
�%‰-˜2Ð	#Ð	#Ò	#Ð	# Ò	#Ð	#Ð	#Ð	#Ð	#Ø�U‰]ˆˆå�2�yÑ!Ô!ˆØÐ �9Ð Ð Ð Ð Ð r    r#   úIterable[TLineNo]r*   úlist[tuple[TLineNo, TLineNo]]c                ó  — t          | ¦  «        } t          |¦  «        }g }d}d}| D ]J}|t          |¦  «        k    r n4|||         k    r|dz  }|s|}|}Œ/|r|                     ||f¦  «         d}ŒK|r|                     ||f¦  «         |S )z,Produce a list of ranges for `format_lines`.Nr   r   )rO   r   rp   )r#   r*   ÚpairsÚstartÚlidxÚstmtÚends          r   Ú_line_rangesrØ   ¥  sÃ   € õ
 ˜
Ñ#Ô#€JÝ�5‰MŒM€Eà€EØ €EØ€DØð 
ð 
ˆØ•3�u‘:”:ÒÐØˆEØ�5˜”;ÒÐØ�A‰IˆDØð Ø�ØˆCˆCØð 	Ø�LŠL˜% ˜Ñ&Ô&Ð&ØˆEøØð #Ø�Š�e˜S�\Ñ"Ô"Ð"Ø€Lr    r-   ú.Iterable[tuple[TLineNo, list[TLineNo]]] | Nonec                óD  — d„ t          | |¦  «        D ¦   «         }|�Wt          |¦  «        }|D ]E\  }}t          |¦  «        D ]0}||vr*||vr&|dk    r|nd}|                     ||› d|› �f¦  «         Œ1ŒFd                     d„ t          |¦  «        D ¦   «         ¦  «        }	|	S )a¿  Nicely format a list of line numbers.

    Format a list of line numbers for printing by coalescing groups of lines as
    long as the lines represent consecutive statements.  This will coalesce
    even if there are gaps between statements.

    For example, if `statements` is [1,2,3,4,5,10,11,12,13,14] and
    `lines` is [1,2,5,10,11,13,14] then the result will be "1-2, 5-11, 13-14".

    Both `lines` and `statements` can be any iterable. All of the elements of
    `lines` must be in `statements`, and all of the values must be positive
    integers.

    If `arcs` is provided, they are (start,[end,end,end]) pairs that will be
    included in the output as long as start isn't in `lines`.

    c                ó<   — g | ]}|d          t          |¦  «        f‘ŒS )r   r   )r   Úpairs     r   rh   z format_lines.<locals>.<listcomp>Ö  s'   € ÐYÐYÐY°�4˜”7�I d™OœOÐ,ÐYÐYÐYr    Nr   Úexitz->z, c              3  ó&   K  — | ]}|d          V — ŒdS )éÿÿÿÿNre   )r   Úts     r   rF   zformat_lines.<locals>.<genexpr>ß  s&   è è € Ð6Ð6˜a�A�b”EÐ6Ð6Ð6Ð6Ð6Ð6r    )rØ   rO   rp   Újoin)
r#   r*   r-   Ú
line_itemsÚ
line_exitsr›   r{   ÚexÚdestÚrets
             r   r[   r[   À  sá   € ð, ZÐY½ÀjÐRWÑ9XÔ9XÐYÑYÔY€JØÐÝ˜D‘\”\ˆ
Ø%ð 	Að 	A‰KˆD�%Ý˜U‘m”mð Að A�Ø˜uÐ$Ð$¨°5¨¨Ø!# a¢ ˜2˜2¨V�DØ×%Ò% t°Ð->Ð->¸Ð->Ð->Ð&?Ñ@Ô@Ð@øðAð
 �)Š)Ð6Ð6¥6¨*Ñ#5Ô#5Ð6Ñ6Ô6Ñ
6Ô
6€CØ€Jr    ÚtotalÚ
fail_underr;   c                óŽ   — d|cxk    rdk    sn d|› d�}t          |¦  «        ‚|dk    r| dk    rdS t          | |¦  «        |k     S )a'  Determine if a total should fail due to fail-under.

    `total` is a float, the coverage measurement total. `fail_under` is the
    fail_under setting to compare with. `precision` is the number of digits
    to consider after the decimal point.

    Returns True if the total should fail.

    r   r¯   zfail_under=z' is invalid. Must be between 0 and 100.T)r   rÎ   )rç   rè   r   Úmsgs       r   Úshould_fail_underrë   ã  sp   € ð �Ð$Ð$Ò$Ð$˜uÒ$Ð$Ð$Ð$ØO˜JÐOÐOÐOˆÝ˜#ÑÔÐð �UÒÐ˜u¨š~˜~Øˆtå�˜	Ñ"Ô" ZÒ/Ð/r    )
r   r   r   r   r   r   r   r   r   r   )rÈ   r­   r   r   r   r   )r#   rÐ   r*   rÐ   r   rÑ   rA   )r#   rÐ   r*   rÐ   r-   rÙ   r   r   )rç   r­   rè   r­   r   r   r   r;   )r�   Ú
__future__r   r/   Úcollections.abcr   Údataclassesr   Útypingr   Úcoverage.exceptionsr   Úcoverage.miscr	   Úcoverage.typesr
   r   Úcoverage.datar   Úcoverage.pluginr   r9   r   r™   ÚTRegionLinesr„   rU   rº   rØ   r[   rë   re   r    r   ú<module>rö      sû  ðð 'Ð &à "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø $Ð $Ð $Ð $Ð $Ð $Ø !Ð !Ð !Ð !Ð !Ð !Ø  Ð  Ð  Ð  Ð  Ð  à +Ð +Ð +Ð +Ð +Ð +Ø #Ð #Ð #Ð #Ð #Ð #Ø (Ð (Ð (Ð (Ð (Ð (Ð (Ð (àð -Ø*Ð*Ð*Ð*Ð*Ð*Ø,Ð,Ð,Ð,Ð,Ð,ð4ð 4ð 4ð 4ðn ðwð wð wð wð wñ wô wñ „ðwðt ˜Ô!€ð\
ð \
ð \
ð \
ð \
ñ \
ô \
ð \
ð~ ðeð eð eð eð eñ eô eñ „ðeðP!ð !ð !ð !ð$ð ð ð ð< <@ð ð  ð  ð  ð  ðF0ð 0ð 0ð 0ð 0ð 0r    