§
    ŠtjT  ã                   óD   — d dl mZmZ ddddddddd	d
dœ
Zd„ Zddefd„ZdS )é    )ÚDecimalÚInvalidOperationéýÿÿÿéþÿÿÿéÿÿÿÿé   é   é   é   é   é   )
ÚnÚuÚmÚKÚkÚMÚGÚTÚPÚEc                 ó¨  — t          | t          t          t          f¦  «        rt          | ¦  «        S t	          | ¦  «        } | }d}t          | ¦  «        dk    r0| d         dk    r$| d         t          v r| dd…         }| dd…         }n6t          | ¦  «        dk    r#| d         t          v r| dd…         }| dd…         }	 t          |¦  «        }n0# t          $ r# t          d 	                    |¦  «        ¦  «        ‚w xY w|€|S | 
                    d¦  «        rd}n8t          |¦  «        dk    rd	}n"t          d
 	                    | ¦  «        ¦  «        ‚|dk    r"t          d
 	                    | ¦  «        ¦  «        ‚|d         t          vr"t          d
 	                    | ¦  «        ¦  «        ‚t          t          |d                  ¦  «        }|||z  z  S )aÀ  
    Parse kubernetes canonical form quantity like 200Mi to a decimal number.
    Supported SI suffixes:
    base1024: Ki | Mi | Gi | Ti | Pi | Ei
    base1000: n | u | m | "" | k | M | G | T | P | E

    See https://github.com/kubernetes/apimachinery/blob/master/pkg/api/resource/quantity.go

    Input:
    quantity: string. kubernetes canonical form quantity

    Returns:
    Decimal

    Raises:
    ValueError on invalid or unknown input
    Nr	   r   Úir   r   zInvalid number format: {}é   éè  z{} has unknown suffixÚkir   )Ú
isinstanceÚintÚfloatr   ÚstrÚlenÚ
_EXPONENTSr   Ú
ValueErrorÚformatÚendswith)ÚquantityÚnumberÚsuffixÚbaseÚexponents        úW/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/kubernetes/utils/quantity.pyÚparse_quantityr,      sè  € õ$ �(�S¥%­Ð1Ñ2Ô2ð !Ý�xÑ Ô Ð å�8‰}Œ}€HØ€FØ€FÝ
ˆ8�}„}˜ÒÐ˜h rœl¨cÒ1Ð1Ø�BŒ<�:Ð%Ð%Ø˜c˜r˜c”]ˆFØ˜b˜c˜c”]ˆFøÝ	ˆX‰Œ˜!Ò	Ð	 ¨¤µ
Ð :Ð :Ø˜#˜2˜#”ˆØ˜"˜#˜#”ˆðEÝ˜‘”ˆˆøÝð Eð Eð EÝÐ4×;Ò;¸FÑCÔCÑDÔDÐDðEøøøð €~Øˆà‡‚�sÑÔð CØˆˆÝ	ˆV‰Œ˜Ò	Ð	ØˆˆåÐ0×7Ò7¸ÑAÔAÑBÔBÐBð �‚~€~ÝÐ0×7Ò7¸ÑAÔAÑBÔBÐBàˆa„y�
Ð"Ð"ÝÐ0×7Ò7¸ÑAÔAÑBÔBÐBå•z &¨¤)Ô,Ñ-Ô-€HØ�T˜XÑ%Ñ&Ð&s   Â?C Ã-C<NÚreturnc                 ó¶  — |st          | ¦  «        S |                     d¦  «        rd}n(t          |¦  «        dk    rd}nt          | › d�¦  «        ‚|dk    rt          | › d�¦  «        ‚|d         t          vrt          | › d�¦  «        ‚| t          |¦  «        t          |d                  z  z  }|�|                     |¦  «        }t          |d	¦  «        |z   S )
a@  
    Takes a decimal and produces a string value in kubernetes' canonical quantity form,
    like "200Mi".Users can specify an additional decimal number to quantize the output.

    Example -  Relatively increase pod memory limits:

    # retrieve my_pod
    current_memory: Decimal = parse_quantity(my_pod.spec.containers[0].resources.limits.memory)
    desired_memory = current_memory * 1.2
    desired_memory_str = format_quantity(desired_memory, suffix="Gi", quantize=Decimal(1))
    # patch pod with desired_memory_str

    'quantize=Decimal(1)' ensures that the result does not contain any fractional digits.

    Supported SI suffixes:
    base1024: Ki | Mi | Gi | Ti | Pi | Ei
    base1000: n | u | m | "" | k | M | G | T | P | E

    See https://github.com/kubernetes/apimachinery/blob/master/pkg/api/resource/quantity.go

    Input:
    quantity: Decimal.  Quantity as a number which is supposed to converted to a string
                        with SI suffix.
    suffix: string.     The desired suffix/unit-of-measure of the output string
    quantize: Decimal.  Can be used to round/quantize the value before the string
                        is returned. Defaults to None.

    Returns:
    string. Canonical Kubernetes quantity string containing the SI suffix.

    Raises:
    ValueError if the SI suffix is not supported.
    r   r   r   r   z has unknown suffixr   r   NÚf)r    r%   r!   r#   r"   r   Úquantizer$   )Úquantity_valuer(   r0   r)   Údifferent_scales        r+   Úformat_quantityr3   X   sø   € ðF ð #Ý�>Ñ"Ô"Ð"à‡‚�sÑÔð AØˆˆÝ	ˆV‰Œ˜Ò	Ð	Øˆˆå˜NÐ?Ð?Ð?Ñ@Ô@Ð@à�‚~€~Ý˜NÐ?Ð?Ð?Ñ@Ô@Ð@àˆa„y�
Ð"Ð"Ý˜NÐ?Ð?Ð?Ñ@Ô@Ð@à$­°©¬½ÀFÈ1ÄIÔ9NÑ(NÑO€OØÐØ)×2Ò2°8Ñ<Ô<ˆÝ�/ 3Ñ'Ô'¨&Ñ0Ð0ó    )N)Údecimalr   r   r"   r,   r    r3   © r4   r+   ú<module>r7      s…   ðð .Ð -Ð -Ð -Ð -Ð -Ð -Ð -ð 
Ø	Ø	Ø	
Ø	
Ø	
Ø	
Ø	
Ø	
Ø	
ðð €
ð7'ð 7'ð 7'ðt61ð 61¸cð 61ð 61ð 61ð 61ð 61ð 61r4   