Ë
    ßò€i\  ã                   ó0   — d dl Z d dlZd dlZ G d„ d«      Zy)é    Nc                   ó<   — e Zd ZdZdd	d„Zdedz  fd„Zd	d„Zd	d„Zy)
Ú	FileBatonz0A primitive, file-based synchronization utility.NÚreturnc                 ó<   — || _         || _        d| _        || _        y)an  
        Create a new :class:`FileBaton`.

        Args:
            lock_file_path: The path to the file used for locking.
            wait_seconds: The seconds to periodically sleep (spin) when
                calling ``wait()``.
            warn_after_seconds: The seconds to wait before showing
                lock file path to warn existing lock file.
        N)Úlock_file_pathÚwait_secondsÚfdÚwarn_after_seconds)Úselfr   r   r
   s       úP/var/www/html/engine/venv/lib/python3.12/site-packages/torch/utils/file_baton.pyÚ__init__zFileBaton.__init__
   s#   € ð -ˆÔØ(ˆÔØˆŒØ"4ˆÕó    c                 ó¬   — 	 t        j                  | j                  t         j                  t         j                  z  «      | _        y# t        $ r Y yw xY w)z–
        Try to atomically create a file under exclusive access.

        Returns:
            True if the file could be created, else False.
        TF)ÚosÚopenr   ÚO_CREATÚO_EXCLr	   ÚFileExistsError©r   s    r   Útry_acquirezFileBaton.try_acquire   sA   € ð	ä—g‘g˜d×1Ñ1´2·:±:ÄÇ	Á	Ñ3IÓJˆDŒGØøÜò 	Ùð	ús   ‚AA Á	AÁAc                 óâ  — d}t        j                   «       }t        j                  j                  | j                  «      r°t        j
                  | j                  «       | j                  Zt        j                   «       |z
  | j                  kD  r6|s4t        j                  d| j                  › d| j                  › dd¬«       d}t        j                  j                  | j                  «      rŒ¯yy)	zÆ
        Periodically sleeps for a certain amount until the baton is released.

        The amount of time slept depends on the ``wait_seconds`` parameter
        passed to the constructor.
        FNzWaited on lock file "z" for z	 seconds.é   )Ú
stacklevelT)
Útimer   ÚpathÚexistsr   Úsleepr   r
   ÚwarningsÚwarn)r   Ú
has_warnedÚ
start_times      r   ÚwaitzFileBaton.wait(   s´   € ð ˆ
ä—Y‘Y“[ˆ
Üg‰gn‰n˜T×0Ñ0Ô1ÜJ‰Jt×(Ñ(Ô)à×&Ñ&Ð2Ü—9‘9“; Ñ+¨d×.EÑ.EÒEÉjÜ—M‘MÐ$9¸$×:MÑ:MÐ9NÈfØ%)×%<Ñ%<Ð$=¸Yð#HØTUõWà!%Jô g‰gn‰n˜T×0Ñ0×1r   c                 ó˜   — | j                   t        j                  | j                   «       t        j                  | j                  «       y)z'Release the baton and removes its file.N)r	   r   ÚcloseÚremover   r   s    r   ÚreleasezFileBaton.release;   s.   € à7‰7ÐÜH‰HT—W‘WÔä
	‰	$×%Ñ%Õ&r   )gš™™™™™¹?N)r   N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úboolr   r"   r&   © r   r   r   r      s$   „ Ù:ô5ð ˜T D™[ó ó&ô&'r   r   )r   r   r   r   r,   r   r   ú<module>r-      s   ðã 	Û Û ÷9'ò 9'r   