ó
    <Ð¦i‹  ã                   ó(   • S SK r S SKr " S S5      rg)é    Nc                   ó4   • \ rS rSrSrS	S jrS rS rS rSr	g)
Ú	FileBatoné   z0A primitive, file-based synchronization utility.c                 ó*   • Xl         X l        SU l        g)zÀ
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()``.
N)Úlock_file_pathÚwait_secondsÚfd)Úselfr   r   s      ÚU/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/torch/utils/file_baton.pyÚ__init__ÚFileBaton.__init__	   s   € ð -ÔØ(ÔØˆó    c                 ó°   •  [         R                  " U R                  [         R                  [         R                  -  5      U l        g! [         a     gf = f)zv
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_acquireÚFileBaton.try_acquire   sA   € ð	Ü—g’g˜d×1Ñ1´2·:±:ÄÇ	Á	Ñ3IÓJˆDŒGØøÜó 	Ùð	ús   ‚AA Á
AÁAc                 ó  • [         R                  R                  U R                  5      (       aQ  [        R
                  " U R                  5        [         R                  R                  U R                  5      (       a  MP  gg)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.
N)r   ÚpathÚexistsr   ÚtimeÚsleepr   r   s    r   ÚwaitÚFileBaton.wait#   sJ   € ô g‰gn‰n˜T×0Ñ0×1Ñ1ÜJŠJt×(Ñ(Ô)ô g‰gn‰n˜T×0Ñ0×1Õ1r   c                 óž   • U R                   b   [        R                  " U R                   5        [        R                  " U R                  5        g)z'Release the baton and removes its file.N)r	   r   ÚcloseÚremover   r   s    r   ÚreleaseÚFileBaton.release-   s.   € à7‰7ÑÜHŠHT—W‘WÔä
	Š	$×%Ñ%Õ&r   )r	   r   r   N)gš™™™™™¹?)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r"   Ú__static_attributes__© r   r   r   r      s   † Ù:ôòò*õ'r   r   )r   r   r   r*   r   r   Ú<module>r+      s   ðã 	Û ÷,'ò ,'r   