Ë
    eQêjP  ã                   ó”   — d dl mZ d dlZd dlZd dlZ ej
                  d«      ZdZdej                  fd„Z	dej                  de
fd„Zy)	é    )ÚListNz^([0-9]{1,5}(h|m|s|ms)){1,4}$l   ÿX#OÚreturnc                 óŠ   — t         j                  | «      st        dj                  | «      «      ‚t	        j
                  | «      S )a5  
    Parse GEP-2257 Duration format to a datetime.timedelta object.

    The GEP-2257 Duration format is a restricted form of the input to the Go
    time.ParseDuration function; specifically, it must match the regex
    "^([0-9]{1,5}(h|m|s|ms)){1,4}$".

    See https://gateway-api.sigs.k8s.io/geps/gep-2257/ for more details.

    Input: duration: string
    Returns: datetime.timedelta

    Raises: ValueError on invalid or unknown input

    Examples:
    >>> parse_duration("1h")
    datetime.timedelta(seconds=3600)
    >>> parse_duration("1m")
    datetime.timedelta(seconds=60)
    >>> parse_duration("1s")
    datetime.timedelta(seconds=1)
    >>> parse_duration("1ms")
    datetime.timedelta(microseconds=1000)
    >>> parse_duration("1h1m1s")
    datetime.timedelta(seconds=3661)
    >>> parse_duration("10s30m1h")
    datetime.timedelta(seconds=5410)

    Units are always required.
    >>> parse_duration("1")
    Traceback (most recent call last):
        ...
    ValueError: Invalid duration format: 1

    Floating-point and negative durations are not valid.
    >>> parse_duration("1.5m")
    Traceback (most recent call last):
        ...
    ValueError: Invalid duration format: 1.5m
    >>> parse_duration("-1m")
    Traceback (most recent call last):
        ...
    ValueError: Invalid duration format: -1m
    zInvalid duration format: {})Ú
reDurationÚmatchÚ
ValueErrorÚformatÚ
durationpyÚfrom_str)Údurations    ú^/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/kubernetes/utils/duration.pyÚparse_durationr      s;   € ô\ ×Ñ˜HÔ%ÜÐ6×=Ñ=¸hÓGÓHÐHä×Ñ˜xÓ(Ð(ó    Údeltac                 ó¼  — | t        j                  d«      k(  ry| t        j                  d«      k  rt        dj                  | «      «      ‚| t        j                  t        ¬«      kD  rt        dj                  | «      «      ‚| j
                  }|dz  dk7  rt        dj                  | «      «      ‚t        | j                  «       «      }g }|dz  }|dkD  r|j                  |› d	�«       ||dz  z  }|d
z  }|dkD  r|j                  |› d�«       ||d
z  z  }|dkD  r|j                  |› d�«       |dkD  r|j                  |dz  › d�«       dj                  |«      S )a‡  
    Format a datetime.timedelta object to GEP-2257 Duration format.

    The GEP-2257 Duration format is a restricted form of the input to the Go
    time.ParseDuration function; specifically, it must match the regex
    "^([0-9]{1,5}(h|m|s|ms)){1,4}$".

    See https://gateway-api.sigs.k8s.io/geps/gep-2257/ for more details.

    Input: duration: datetime.timedelta

    Returns: string

    Raises: ValueError if the timedelta given cannot be expressed as a
    GEP-2257 Duration.

    Examples:
    >>> format_duration(datetime.timedelta(seconds=3600))
    '1h'
    >>> format_duration(datetime.timedelta(seconds=60))
    '1m'
    >>> format_duration(datetime.timedelta(seconds=1))
    '1s'
    >>> format_duration(datetime.timedelta(microseconds=1000))
    '1ms'
    >>> format_duration(datetime.timedelta(seconds=5410))
    '1h30m10s'

    The zero duration is always "0s".
    >>> format_duration(datetime.timedelta(0))
    '0s'

    Sub-millisecond precision is not allowed.
    >>> format_duration(datetime.timedelta(microseconds=100))
    Traceback (most recent call last):
        ...
    ValueError: Cannot express sub-millisecond precision in GEP-2257: 0:00:00.000100

    Negative durations are not allowed.
    >>> format_duration(datetime.timedelta(seconds=-1))
    Traceback (most recent call last):
        ...
    ValueError: Cannot express negative durations in GEP-2257: -1 day, 23:59:59
    r   Ú0sz1Cannot express negative durations in GEP-2257: {})ÚmillisecondszFCannot express durations longer than 99999h59m59s999ms in GEP-2257: {}iè  z8Cannot express sub-millisecond precision in GEP-2257: {}i  Úhé<   ÚmÚsÚmsÚ )
ÚdatetimeÚ	timedeltar   r	   ÚmaxDuration_msÚmicrosecondsÚintÚtotal_secondsÚappendÚjoin)r   Údelta_usÚsecsÚoutputÚhoursÚminutess         r   Úformat_durationr'   S   sl  € ð^ ”×"Ñ" 1Ó%Ò%Øð Œx×!Ñ! !Ó$Ò$ÜÐL×SÑSÐTYÓZÓ[Ð[àŒx×!Ñ!¬~Ô>Ò>ÜØT×[Ñ[Ð\aÓbódð 	dð ×!Ñ!€Hà�4‰˜AÒÜØFß‰V�E‹]ó
ð 	
ô ˆu×"Ñ"Ó$Ó%€Dà€Fà�D‰L€EØˆq‚yØ�‰˜˜˜q�kÔ"Ø�˜‘Ñˆà�b‰j€GØ�‚{Ø�‰˜˜	 �mÔ$Ø�˜"‘Ñˆàˆa‚xØ�‰˜˜˜a�jÔ!à�!‚|Ø�‰˜ TÑ)Ð*¨"Ð-Ô.à�7‰7�6‹?Ðr   )Útypingr   r   Úrer
   Úcompiler   r   r   r   Ústrr'   © r   r   ú<module>r-      s]   ðõ ã Û 	ã ð
 ˆR�Z‰ZÐ8Ó9€
ð C€ð1) × 2Ñ 2ó 1)ðh[˜8×-Ñ-ð [°#ô [r   