hyb
2025-12-31 6cdcd01f77e11b72c323603e27ebdb85b15223c9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Ë
ñúhÍã óp—ddlmZddlmZddlmZmZmZmZm    Z    Gd„de    «Z
de dee
dee fd    „Z de d
ee d ee d ee dee f
d „Z     dde d
ee deee dee fd„Zedk(rHddlmZeGd„d««Ze deddd«eddd«eddd«g«Zeee««yy)é)ÚFraction)Úceil)ÚcastÚListÚOptionalÚSequenceÚProtocolcóB—eZdZUdZdZeeed<dZeed<dZ    eed<y)ÚEdgez1Any object that defines an edge (such as Layout).NÚsizeéÚratioÚ minimum_size)
Ú__name__Ú
__module__Ú __qualname__Ú__doc__r rÚintÚ__annotations__rr©óúJH:\Change_password\venv_build\Lib\site-packages\pip/_vendor/rich/_ratio.pyr r s&…Ù;à€Dˆ(3‰-ÓØ€Eˆ3ƒNØ€L#Ôrr ÚtotalÚedgesÚreturncó´—|Dcgc]}|jxsd‘Œ}}t}d|vrtt||««Dcgc]\}\}}|€||f‘Œ}}}}|t    d„|D««z
}|dkr1t||«Dcgc]\}}|€|j
xsdn|‘Œc}}S||t    d„|D«««}    |D]2\}}|    |j z|j
ksŒ#|j
||<n8|d«}
|D])\}}t|    |j z|
zd«\}}
|||<Œ+nd|vrŒttt|«Scc}wcc}}}wcc}}w)aŒDivide total space to satisfy size, ratio, and minimum_size, constraints.
 
    The returned list of integers should add up to total in most cases, unless it is
    impossible to satisfy all the constraints. For instance, if there are two edges
    with a minimum size of 20 each and `total` is 30 then the returned list will be
    greater than total. In practice, this would mean that a Layout object would
    clip the rows that would overflow the screen height.
 
    Args:
        total (int): Total number of characters.
        edges (List[Edge]): Edges within total space.
 
    Returns:
        List[int]: Number of characters for each edge.
    Nc3ó(K—|]
}|xsd–—Œ y­w)rNr)Ú.0r s  rú    <genexpr>z ratio_resolve.<locals>.<genexpr>,sèø€Ò<¨d ¢    ¨£    Ñ<ùs‚rr c3óBK—|]\}}|jxsd–—Œy­w)r N)r)rÚ_Úedges   rrz ratio_resolve.<locals>.<genexpr>5sèø€ÒK±°°D˜DŸJ™JšO¨!›OÑKùs‚) r rÚ    enumerateÚzipÚsumrrÚdivmodrrr) rrr"ÚsizesÚ    _FractionÚindexr Úflexible_edgesÚ    remainingÚportionÚ    remainders            rÚ ratio_resolver.sž€ð".3Ö 3 Tˆdi‰iÒ˜4ÑÐ 3€EÐ 3ä€Ið %Š-ô(1´°U¸EÓ1BÓ'C÷
ð
á#‘|˜˜d؈|ðDŠMð
ˆò
ð œCÑ<°eÔ<Ó<Ñ<ˆ    Ø ˜Š>ô#& e¨UÓ"3÷áD˜$ð.2¨\$×#Ñ#Ò(¡q¸tÑCóð ñ
Ø ”sÑK¸NÔKÓKó
ˆð
*ò     ‰KˆE4ؘŸ™Ñ# t×'8Ñ'8Ó8Ø#×0Ñ0e‘ áð         ñ" !› ˆIØ-ò $‘ tÜ"(¨°4·:±:Ñ)=À    Ñ)IÈ1Ó"M‘iØ#e’ ð $ð ðE %‹-ôH ””S‘    ˜5Ó !Ð!ùòS 4ùô
ùós…EÁE ÂEÚratiosÚmaximumsÚvaluescóF—t||«Dcgc] \}}|r|nd‘Œ }}}t|«}|s|ddS|}g}|j}    t|||«D]F\}}
} |r6|dkDr1t|
t    ||z|z ««} |    | | z
«|| z}||z}Œ?|    | «ŒH|Scc}}w)adDivide an integer total in to parts based on ratios.
 
    Args:
        total (int): The total to divide.
        ratios (List[int]): A list of integer ratios.
        maximums (List[int]): List of maximums values for each slot.
        values (List[int]): List of values
 
    Returns:
        List[int]: A list of integers guaranteed to sum to total.
    rN)r$r%ÚappendÚminÚround) rr/r0r1rÚ_maxÚ total_ratioÚtotal_remainingÚresultr3ÚmaximumÚvalueÚ distributeds              rÚ ratio_reducer=Ksʀô7:¸&À(Ó6K× L¡{ u¨d‘t‰e Ñ"Ð L€FÑ Lܐf“+€KÙ Ø‘aˆyÐØ€OØ€FØ ]‰]€FÜ!$ V¨X°vÓ!>òшˆw˜Ù [ 1’_ܘg¤u¨U°_Ñ-DÀ{Ñ-RÓ'SÓTˆKÙ 5˜;Ñ&Ô 'Ø ˜{Ñ *ˆOØ ˜5Ñ  ‰Ká 5Mðð €MùóMsBNÚminimumscób—|r"t||«Dcgc] \}}|r|nd‘Œ }}}t|«}|dkDsJd«‚|}g}|j}|€dgt|«z}    n|}    t||    «D]:\}}
|dkDrt    |
t ||z|z ««} n|} || «||z}|| z}Œ<|Scc}}w)a<Distribute an integer total in to parts based on ratios.
 
    Args:
        total (int): The total to divide.
        ratios (List[int]): A list of integer ratios.
        minimums (List[int]): List of minimum values for each slot.
 
    Returns:
        List[int]: A list of integers guaranteed to sum to total.
    rzSum of ratios must be > 0)r$r%r3ÚlenÚmaxr) rr/r>rÚ_minr7r8Údistributed_totalr3Ú    _minimumsÚminimumr<s             rÚratio_distributerFksã€ñÜ:=¸fÀhÓ:O×P©;¨5°$™4‘% QÑ&ÐPˆÑPܐf“+€KØ ˜Š?Ð7Ð7Ó7ˆ?à€OØ#%ÐØ × %Ñ %€FØÐؐCœ#˜f›+Ñ%‰    àˆ    Ü˜f iÓ0ò'‰ˆˆwØ ˜Š?ܘg¤t¨E°OÑ,CÀkÑ,QÓ'RÓS‰Kà)ˆKÙˆ{ÔØuш ؘ;Ñ&‰ð'ð Ðùó'Qs’B+Ú__main__)Ú    dataclasscó>—eZdZUdZeeed<dZeed<dZeed<y)ÚENr r rr)    rrrr rrrrrrrrrJrJ’s#…à"ˆˆhs‰mÓ"؈ˆs‹Øˆ cÔrrJénr )N)Ú    fractionsrÚmathrÚtypingrrrrr    r rr.r=rFrÚ dataclassesrHrJÚresolvedÚprintr%rrrú<module>rRsðÝÝß;Õ;ôˆ8ôð:"˜ð:" X¨d¡^ð:"¸¸S¹    ó:"ðzØ ðؘS™    ðØ-1°#©YðØ@DÀSÁ    ðà    ˆ#YóðBDHñ!Ø ð!ؘS™    ð!Ø-5°d¸3±iÑ-@ð!à    ˆ#Yó!ðH ˆzÒÝ%à÷ðóðñ
˜S¡1 T¨1¨a£=±!°D¸!¸Q³-ÁÀ4ÈÈAÃÐ"OÓP€HÙ    ‰#ˆh‹-Õðr