HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/compose/__pycache__/timeparse.cpython-310.pyc
o

S�`�
�@s�dZddlZdZdZdZdZdZdZd	d
�Zdj	ee�ee�ee�ee�ee�ee�d�Z
d
dddddd�Zdd�Zdd�Z
dS)z�
timeparse.py
(c) Will Roberts <wildwilhelm@gmail.com>  1 February, 2014

This is a vendored and modified copy of:
github.com/wroberts/pytimeparse @ cc0550d

It has been modified to mimic the behaviour of
https://golang.org/pkg/time/#ParseDuration
�Nz(?P<hours>[\d.]+)hz(?P<mins>[\d.]+)mz(?P<secs>[\d.]+)sz(?P<milli>[\d.]+)msu(?P<micro>[\d.]+)(?:us|µs)z(?P<nano>[\d.]+)nscCsdj|d�S)Nz(?:{x})?��x)�formatr�r�3/usr/lib/python3/dist-packages/compose/timeparse.py�opt+srz'{HOURS}{MINS}{SECS}{MILLI}{MICRO}{NANO})�HOURS�MINS�SECS�MILLI�MICRO�NANOi�<�g����MbP?g���ư>g��&�.>)�hours�mins�secs�milli�micro�nanocCsLt�dtd|tj�}|r|�d���sdS|��}tdd�|��D��S)a�Parse a time expression, returning it as a number of seconds.  If
    possible, the return value will be an `int`; if this is not
    possible, the return will be a `float`.  Returns `None` if a time
    expression cannot be parsed from the given string.

    Arguments:
    - `sval`: the string value to parse

    >>> timeparse('1m24s')
    84
    >>> timeparse('1.2 minutes')
    72
    >>> timeparse('1.2 seconds')
    1.2
    z\s*z\s*$rNcss,�|]\}}|durt|t|�VqdS�N)�MULTIPLIERS�cast)�.0�k�vrrr�	<genexpr>Ws�"�ztimeparse.<locals>.<genexpr>)	�re�match�
TIMEFORMAT�I�group�strip�	groupdict�sum�items)�svalr�mdictrrr�	timeparseBs�r(cCs|��rt|�St|�Sr)�isdigit�int�float)�valuerrrr[sr)�__doc__rrr	r
rrr
rrrrr(rrrrr�<module>s4�
�