
    vKgS                    2    S SK Jr  S SKrS/r " S S5      rg)    )annotationsNDeadlinec                  4    \ rS rSrSrS	S jrSS.S
S jjrSrg)r   	   z|
Manage timeouts across multiple steps.

Args:
    timeout: Time available in seconds or :obj:`None` if there is no limit.

c                X    U   Uc  S U l         g [        R                  " 5       U-   U l         g )N)deadlinetime	monotonic)selftimeouts     U/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/websockets/sync/utils.py__init__Deadline.__init__   s$    ? DM NN,w6DM    T)raise_if_elapsedc                   U R                   c  gU R                   [        R                  " 5       -
  nU(       a  US::  a  [        S5      eU$ )a  
Calculate a timeout from a deadline.

Args:
    raise_if_elapsed: Whether to raise :exc:`TimeoutError`
        if the deadline lapsed.

Raises:
    TimeoutError: If the deadline lapsed.

Returns:
    Time left in seconds or :obj:`None` if there is no limit.

Nr   z	timed out)r   r	   r
   TimeoutError)r   r   r   s      r   r   Deadline.timeout   s?     == --$.."221{++r   )r   N)r   float | NonereturnNone)r   boolr   r   )__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes__ r   r   r   r   	   s    7 37  r   )
__future__r   r	   __all__r   r   r   r   <module>r"      s    "  ,$ $r   