+
    ‘°³j¼M  ã                  óè  a € 0 t $ R t^ RIHt ^ RIt^ RIt^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHtHtHtHt ^ RIHt ^ RIHt ]'       d   ^ R	IHt ]R,,          t]R-,          tR
tR]R&   ^tR]R&   ^ tR]R&   R.tR]R&   ^@tR]R&   RtR]R&   Rt R]R&   Rt!R]R&    ! R R]4      t"]	! RR7       ! R R4      4       t#R R lt$R  R! lt%R" R# lt&R$ R% lt' ! R& R'4      t( ! R( R)4      t) ! R* R+4      t*. R/Ot+R# )0aw  
The generation-log protocol behind :class:`~filelock.SoftReadWriteLock`.

The lock's whole state is a sequence of immutable snapshots, ``gen/<N>``, each naming the writer and the readers that
hold the lock at generation ``N``. Every transition is one atomic publication of the next snapshot: a participant reads
the latest generation, derives the successor it wants, and links a fully written temporary file to ``gen/<N+1>``. The
link fails if a peer got there first, so the participant re-reads and tries again. No step is ever half done: a crash
leaves at most an unlinked temporary file, never a state that another participant must repair before it can proceed.

Liveness rests on a nonce, not a clock. Each participant keeps ``holders/<token>`` and rewrites its nonce every
heartbeat. A contender records the bytes it read there and the moment it read them on its own monotonic clock; a
member whose bytes have not changed for ``stale_threshold`` is evicted by committing a snapshot without it. Two hosts
never compare clocks, so a skewed file server or a suspended virtual machine cannot make a live holder look dead.

The generation number is monotonic and unique to one transition, so the generation at which a hold was granted fences
it: a resource that rejects anything carrying a lower generation than the highest it has accepted refuses a holder
that paused past its expiry and resumed.
)ÚannotationsN)Úsuppress)Ú	dataclass)ÚPath)ÚTYPE_CHECKINGÚFinalÚLiteralÚProtocol)ÚSoftFileLockProtocolError)Ú	host_name)ÚCallablezfilelock-rw/1z
Final[str]Ú	_PROTOCOLz
Final[int]Ú_GENERATION_DIGITSÚ_TOKEN_HEX_LENGTHÚ_MAX_RECORD_SIZEÚ_RETAINED_GENERATIONSÚgenÚ_GENERATIONS_DIRECTORYÚholdersÚ_HOLDERS_DIRECTORYz.commit-Ú_TEMPORARY_PREFIXc                  ón   € ] tR t^4tRtR R ltR R ltR R ltR R	 ltR
 R lt	R R lt
R R ltRtR# )ÚFilesz`The filesystem operations the protocol runs on; :mod:`._storage` implements them over :mod:`os`.c               ó    € V ^8„  d   QhRRRR/# )é   ÚpathÚstrÚreturnúbytes | None© )Úformats   "Ú\/home/luca/screen-checking/.venv/lib/python3.14/site-packages/filelock/_soft_rw/_protocol.pyÚ__annotate__ÚFiles.__annotate__7   s   € ÷ kñ k˜ð k ñ kó    c                ó   € R# )z\The file's bytes, ``None`` when it does not exist, or ``b""`` when it is not a regular file.Nr   ©Úselfr   s   &&r!   ÚreadÚ
Files.read7   ó   ‚ r$   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   ÚdataÚbytesr   ÚNoner   )r    s   "r!   r"   r#   :   s&   € ÷ sñ s˜3ð s eð s°ñ sr$   c                ó   € R# )zdCreate the file exclusively with the whole record written; raise ``FileExistsError`` when it exists.Nr   ©r'   r   r,   s   &&&r!   ÚcreateÚFiles.create:   r*   r$   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úsourcer   Útargetr   Úboolr   )r    s   "r!   r"   r#   =   s&   € ÷ yñ y˜3ð y¨ð y°ñ yr$   c                ó   € R# )zjHard-link *source* to *target* without replacing; ``True`` when *target* names *source*'s file afterwards.Nr   )r'   r4   r5   s   &&&r!   ÚlinkÚ
Files.link=   r*   r$   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   r,   r-   r   r6   r   )r    s   "r!   r"   r#   @   s&   € ÷ ^ñ ^˜cð ^¨ð ^°4ñ ^r$   c                ó   € R# )zORewrite the file in place from offset zero; ``False`` when it no longer exists.Nr   r0   s   &&&r!   Ú	overwriteÚFiles.overwrite@   r*   r$   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   r.   r   )r    s   "r!   r"   r#   C   s   € ÷ Dñ D˜3ð D 4ñ Dr$   c                ó   € R# )z5Remove the file, tolerating one that is already gone.Nr   r&   s   &&r!   ÚunlinkÚFiles.unlinkC   r*   r$   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   z	list[str]r   )r    s   "r!   r"   r#   F   s   € ÷ Sñ S˜Cð S Iñ Sr$   c                ó   € R# )zDThe names in the directory, or an empty list when it does not exist.Nr   r&   s   &&r!   ÚlistdirÚFiles.listdirF   r*   r$   c               ó    € V ^8„  d   QhRRRR/# )r   Úrootr   r   r.   r   )r    s   "r!   r"   r#   I   s   € ÷ vñ v˜Cð v Dñ vr$   c                ó   € R# )zgCreate the protocol directories under *root*, refusing anything at those paths that is not a directory.Nr   )r'   rG   s   &&r!   ÚprepareÚFiles.prepareI   r*   r$   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r(   r1   r8   r<   r@   rD   rI   Ú__static_attributes__r   r$   r!   r   r   4   s5   † Ùjõkõsõyõ^õDõS÷vñ vr$   r   T)Úfrozenc                  ó\   € ] tR t^Mt$ RtR]R&   R]R&   R]R&   ]R R	 l4       tR
 R ltRt	R# )ÚSnapshotzJThe lock's state at one generation: which token writes, which tokens read.ÚintÚ
generationú
str | NoneÚwriterúfrozenset[str]Úreadersc               ó   € V ^8„  d   QhRR/# )r   r   rX   r   )r    s   "r!   r"   ÚSnapshot.__annotate__V   s   € ÷ Uñ U˜ñ Ur$   c                ór   € V P                   f   V P                  # V P                  V P                   0,          # )z"Every token this generation names.)rW   rY   ©r'   s   &r!   ÚmembersÚSnapshot.membersU   s+   € ð  $Ÿ{™{Ò2ˆt�|‰|ÐT¸¿¹ÈÏÉÀ}Õ8TÐTr$   c               ó   € V ^8„  d   QhRR/# )r   r   r-   r   )r    s   "r!   r"   r[   Z   s   € ÷ Fñ F˜ñ Fr$   c                	ó(  € \         R V P                   2.pV P                  e   VP                  RV P                   24       VP	                  R \        V P                  4       4       4       RP                  R V 4       4      P                  R4      # )zgeneration=zwriter=c              3  ó,   "  € T F
  pR V 2x € K  	  R# 5i)zreader=Nr   )Ú.0Útokens   & r!   Ú	<genexpr>Ú"Snapshot.encode.<locals>.<genexpr>^   s   é € ÐIÑ4H¨5�w˜u˜gÕ&Ó4Hùs   ‚Ú c              3  ó*   "  € T F	  q R 2x € K  	  R# 5i)Ú
Nr   )rc   Úlines   & r!   re   rf   _   s   é € Ð5©u t˜˜r•{«uùó   ‚Úascii)	r   rU   rW   ÚappendÚextendÚsortedrY   ÚjoinÚencode)r'   Úliness   & r!   rq   ÚSnapshot.encodeZ   st   € Ü˜k¨$¯/©/Ð):Ð;Ð<ˆØ�;‰;Ò"Ø�L‰L˜7 4§;¡; -Ð0Ô1Ø�‰ÑI´F¸4¿<¹<Ô4HÓIÔIØ�w‰wÑ5©uÓ5Ó5×<Ñ<¸WÓEÐEr$   r   N)
rK   rL   rM   rN   rO   Ú__annotations__Úpropertyr^   rq   rP   r   r$   r!   rS   rS   M   s6   ‡ áTàƒOØÓØÓàôUó ðU÷Fñ Fr$   rS   c               ó    € V ^8„  d   QhRRRR/# )r   r,   r-   r   úSnapshot | Noner   )r    s   "r!   r"   r"   b   s   € ÷ vñ v˜ð v ?ñ vr$   c                óØ  € V '       d   \        V 4      \        8”  d   R#  V P                  R4      P                  R4      pT^ ,          \
        8w  g   TR	,          '       d   R# RpRp\        4       pT^R	  FÄ  pTP                  R4      w  rgpTR8X  dU   TfQ   \        T4      \        8:  d=   TP                  4       '       d'   \        \        T4      4      T8X  d   \        T4      pKr  TR8X  d   Tf   \        T4      '       d   TpK’  TR8X  d+   \        T4      '       d   Y„9  d   TP                  T4       KÃ   R# 	  Tf   R# \        Y#\        T4      R7      #   \         d     R# i ; i)
zTThe snapshot a ``gen/<N>`` record encodes, or ``None`` when the record is malformed.Nrl   ri   Ú=rU   rW   Úreader©rU   rW   rY   éÿÿÿÿ)Úlenr   ÚdecodeÚsplitÚUnicodeDecodeErrorr   ÚsetÚ	partitionr   Úisdigitr   rT   Úis_tokenÚaddrS   Ú	frozenset)	r,   rr   rU   rW   rY   rj   ÚkeyÚ_Úvalues	   &        r!   Úparse_snapshotrŠ   b   s,  € ç”3�t“9Ô/Ô/ÙðØ—‘˜GÓ$×*Ñ*¨4Ó0ˆð ˆQ…x”9Ô  b§	¤	ÙØ!€JØ€FÜ›€GØ�a˜“ˆØŸ™ sÓ+‰ˆ�à�<ÔØÒ"Ü�E“
Ô0Ô0Ø—‘—’Ü”C˜“J“ 5Ô(ä˜U›ŠJØ�HŒ_ ¢´H¸U·O²OØŠFØ�HŒ_¤¨%§¢°UÔ5IØ�K‰K˜Öâñ ð  Ò%ˆ4Ðu¬8¸zÔbkÐlsÓbtÔ+uÐuøô/ ô Úðús     E ÅE)Å(E)c               ó    € V ^8„  d   QhRRRR/# )r   r‰   r   r   r6   r   )r    s   "r!   r"   r"   ‚   s   € ÷ kñ k�Cð k˜Dñ kr$   c                óž   € \        V 4      \        8H  ;'       d5    \        ;QJ d    R V  4       F  '       d   K   R# 	  R# ! R V  4       4      # )zBWhether *value* is a claim token: exactly 32 lowercase hex digits.c              3  ó*   "  € T F	  qR 9   x € K  	  R# 5i)Ú0123456789abcdefNr   )rc   Ú	characters   & r!   re   Úis_token.<locals>.<genexpr>„   s   é € Ð2jÑdiÐW`Ð@RÖ3RÓdiùrk   FT)r}   r   Úall)r‰   s   &r!   r„   r„   ‚   s?   € äˆu‹:Ô*Ñ*×jÐj¯s«sÑ2jÑdiÓ2j¯s¬sÐjªsÐj¨sÑ2jÑdiÓ2jÓ/jÐjr$   c               ó   € V ^8„  d   QhRR/# )r   r   r   r   )r    s   "r!   r"   r"   ‡   s   € ÷ 5ñ 5�3ñ 5r$   c                 óD   € \         P                  ! \        ^,          4      # )zA fresh claim token.)ÚsecretsÚ	token_hexr   r   r$   r!   Ú	new_tokenr–   ‡   s   € ä×ÒÔ.°!Õ3Ó4Ð4r$   c               ó$   € V ^8„  d   QhRRRRRR/# )r   rd   r   Únoncer   r-   r   )r    s   "r!   r"   r"   Œ   s&   € ÷ qñ q˜ð q Sð q¨Uñ qr$   c           
     ó€   € \          RV  R\        P                  ! 4        R\        4        RV R2
P	                  R4      # )zhThe ``holders/<token>`` record; only the nonce changes between heartbeats, so the length stays constant.z
token=z
pid=z
host=z
nonce=ri   rl   )r   ÚosÚgetpidr   rq   )rd   r˜   s   &&r!   Úencode_holderrœ   Œ   s>   € äˆ[˜   v¬b¯iªi«k¨]¸'Ä)Ã+ÀÈhÐW\ÐV]Ð]_Ð`×gÑgÐhoÓpÐpr$   c                  ó>   € ] tR t^‘tRtR R ltR R ltR R ltRtR	# )
ÚLedgera|  
How long each observed value has stayed the same, measured on this observer's monotonic clock.

A value that has not changed for ``stale_threshold`` belongs to a participant that stopped refreshing it. The clock
is the observer's own and only ever measures the gap between two of its own observations, which is what lets two
hosts agree on liveness without agreeing on the time.
c               ó    € V ^8„  d   QhRRRR/# )r   ÚclockúCallable[[], float]r   r.   r   )r    s   "r!   r"   ÚLedger.__annotate__š   s   € ÷ ?ñ ?Ð1ð ?°dñ ?r$   c                	ó    € Wn         / V n        R # ©N©Ú_clockÚ_seen)r'   r    s   &&r!   Ú__init__ÚLedger.__init__š   s   € ØŒØ<>ˆŽ
r$   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r‡   r   r‰   r   r   Úfloatr   )r    s   "r!   r"   r¢   ž   s!   € ÷ ñ ˜3ð  |ð ¸ñ r$   c                ó¾   € V P                  4       pV P                  P                  V4      ;pe   V^ ,          V8w  d   W#3V P                  V&   R# W4^,          ,
          # )zCRecord *value* for *key* and return how long it has been unchanged.g        )r¦   r§   Úget)r'   r‡   r‰   ÚnowÚseens   &&&  r!   ÚobserveÚLedger.observež   sN   € à�k‰k‹mˆØ—J‘J—N‘N 3Ó'Ð'ˆDÒ0°D¸µG¸uÔ4DØ$˜lˆD�J‰J�s‰OÙØ˜!•W�}Ðr$   c               ó    € V ^8„  d   QhRRRR/# )r   r‡   r   r   r.   r   )r    s   "r!   r"   r¢   ¦   s   € ÷ "ñ "˜#ð " $ñ "r$   c                	ó>   € V P                   P                  VR 4       R # r¤   )r§   Úpop)r'   r‡   s   &&r!   ÚforgetÚLedger.forget¦   s   € Ø�
‰
�‰�s˜DÖ!r$   r¥   N)	rK   rL   rM   rN   rO   r¨   r°   rµ   rP   r   r$   r!   rž   rž   ‘   s   † ñõ?õ÷"ñ "r$   rž   c                  ó„   € ] tR t^ªtRtR R ltR R ltR R ltR R	 ltR
 R lt	R R lt
R R lt]R R l4       tRtR# )ÚGenerationLogzeThe ordered snapshots under ``gen/``, found by listing and probing, advanced by linking the next one.c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   Úfilesr   Ú	lock_filer   rG   r   r.   r   )r    s   "r!   r"   ÚGenerationLog.__annotate__­   s(   € ÷ -ñ -˜eð -°ð -¸3ð -À4ñ -r$   c                	óV   € Wn         W n        \        V\        4      V n        R V n        R # r¤   )Ú_filesÚ
_lock_filer   r   Ú
_directoryÚ_latest)r'   rº   r»   rG   s   &&&&r!   r¨   ÚGenerationLog.__init__­   s"   € ØŒØ#ŒÜ˜tÔ%;Ó<ˆŒØ(,ˆŽr$   c               ó   € V ^8„  d   QhRR/# )r   r   rS   r   )r    s   "r!   r"   r¼   ³   s   € ÷ ñ ˜ñ r$   c                ó¤  € V P                  4       pV P                  V4      ;pf[   V P                  4       pV P                  V4      ;pf6   V'       d   \        V P                  RR4      h\	        ^ R\        4       R7      pTpVP                  p^ pV\        8  d0   V^,          pV P                  V4      ;pf   V^,          pK4  Tp^ pK:  W0n	        V# )am  
The newest snapshot.

Lists the directory on every call, since opening it is what makes an NFS client revalidate what it has cached
about the names inside, then starts from the newest readable generation the listing or memory names and probes
forward by name across the retained window. A listing served stale, a generation compacted between the listing
and the read, and a hole left by a committer that died before it compacted are all covered by the probe; only a
listing that names generations of which none can be read is refused, because that is a client so far behind
the log that nothing it reads can be trusted.
Nz)generation log names no readable snapshotr{   )
Ú_listÚ_startr
   r¿   rS   r†   rU   r   Ú_readrÁ   )r'   ÚlistedÚstartÚlatestrU   ÚgapÚsnapshots   &      r!   rÊ   ÚGenerationLog.latest³   sÆ   € ð —‘“ˆØ—[‘[ Ó(Ð(ˆEÒ1ð —Z‘Z“\ˆFØŸ™ VÓ,Ð,�Ò5ßÜ3°D·O±OÀTÐKvÓwÐwÜ ¨A°dÄIÃKÔP�ØˆØ×%Ñ%ˆ
ØˆØÔ)Ô)Ø˜!�OˆJØ ŸJ™J zÓ2Ð2�Ò;Ø�q•�ÙØˆFØŠCØŒØˆr$   c               ó   € V ^8„  d   QhRR/# )r   r   ú	list[int]r   )r    s   "r!   r"   r¼   Ô   s   € ÷ /ñ /�yñ /r$   c                	ó  € \        R  V P                  P                  \        V P                  4      4       4       4      pVR\
        )   F-  pV P                  P                  V P                  V4      4       K/  	  V\
        ) R # )c              3  ó”   "  € T F>  pVP                  4       '       g   K  \        V4      \        8X  g   K1  \        V4      x € K@  	  R # 5ir¤   )rƒ   r}   r   rT   )rc   Únames   & r!   re   Ú&GenerationLog._list.<locals>.<genexpr>Õ   s:   é € ð 
áA�Ø�|‰|�~ô ä"% d£)Ô/AÑ"Aô ŒC��IˆIÛAùs   ‚AŸAµAN)ro   r¾   rD   r   rÀ   r   r@   Ú_path)r'   rÈ   rU   s   &  r!   rÅ   ÚGenerationLog._listÔ   sv   € Üñ 
àŸ™×+Ñ+¬C°·±Ó,@ÔAó
ó 
ˆð
 !Ð!8Ô#8Ð"8Ó9ˆJØ�K‰K×Ñ˜tŸz™z¨*Ó5Ö6ñ :àÔ,Ð,Ð-Ð.Ð.r$   c               ó    € V ^8„  d   QhRRRR/# )r   rÈ   rÏ   r   rw   r   )r    s   "r!   r"   r¼   Þ   s   € ÷ ñ ˜Yð ¨?ñ r$   c                	ó¦   € V P                   p\        V4       F5  pVe   VP                  V8¼  d   Vu # V P                  V4      ;pf   K3  Vu # 	  V# r¤   )rÁ   ÚreversedrU   rÇ   )r'   rÈ   Ú
rememberedrU   rÌ   s   &&   r!   rÆ   ÚGenerationLog._startÞ   sT   € Ø—\‘\ˆ
Ü" 6Ö*ˆJØÒ%¨*×*?Ñ*?À:Ô*MØ!Ò!Ø ŸJ™J zÓ2Ð2�Ô?Ø’ñ	 +ð
 Ðr$   c               ó    € V ^8„  d   QhRRRR/# )r   rU   rT   r   rw   r   )r    s   "r!   r"   r¼   ç   s   € ÷ ñ  ð ¨ñ r$   c                	óö   € V P                   P                  V P                  V4      4      ;pf   R # \        V4      ;pe   VP                  V8w  d)   V P                  V4      p\        V P                  VR4      hV# )Nzmalformed generation record)r¾   r(   rÔ   rŠ   rU   Ú_namer
   r¿   )r'   rU   r,   rÌ   rÒ   s   &&   r!   rÇ   ÚGenerationLog._readç   sm   € Ø—K‘K×$Ñ$ T§Z¡Z°
Ó%;Ó<Ð<ˆDÒEÙÜ& tÓ,Ð,ˆHÒ5¸×9LÑ9LÐPZÔ9ZØ—:‘:˜jÓ)ˆDÜ+¨D¯O©O¸TÐC`ÓaÐaØˆr$   c               ó    € V ^8„  d   QhRRRR/# )r   Ú	successorrS   r   r6   r   )r    s   "r!   r"   r¼   ï   s   € ÷ ñ  ð ¨Tñ r$   c                ó<  € \        V P                  \         \        4        2,          4      pV P                  P                  W!P                  4       4        V P                  P                  W P                  VP                  4      4      pV P                  P                  V4       V'       g   R# Wn        V P                  P                  V P                  VP                  \        ,
          ^,
          4      4       R#   T P                  P                  T4       i ; i)aœ  
Publish *successor* as the next generation; ``False`` when a peer published that generation first.

The record is complete before it gets its public name, and a no-replace hard link is the compare-and-swap: only
one link to ``gen/<N+1>`` can ever succeed. The link's return code is not trusted, because an NFS retry can
report a link that did land as failed; the file's identity after the call is what decides.
FT)r   rÀ   r   r–   r¾   r1   rq   r8   rÔ   rU   r@   rÁ   r   )r'   rà   Ú	temporaryÚlinkeds   &&  r!   ÚcommitÚGenerationLog.commitï   sÊ   € ô ˜Ÿ™Ô->Ð,?Ä	Ã¸}Ð*MÕMÓNˆ	Ø�‰×Ñ˜9×&6Ñ&6Ó&8Ô9ð	*Ø—[‘[×%Ñ% i·±¸I×<PÑ<PÓ1QÓRˆFà�K‰K×Ñ˜yÔ)ßÙØ ŒØ�‰×Ñ˜4Ÿ:™: i×&:Ñ&:Ô=RÕ&RÐUVÕ&VÓWÔXÙøð �K‰K×Ñ˜yÕ)ús   Á4C> Ã>Dc               ó    € V ^8„  d   QhRRRR/# ©r   rU   rT   r   r   r   )r    s   "r!   r"   r¼     s   € ÷ =ñ = ð =¨ñ =r$   c                	óX   € \        V P                  V P                  V4      ,          4      # r¤   )r   rÀ   rÝ   )r'   rU   s   &&r!   rÔ   ÚGenerationLog._path  s   € Ü�4—?‘? T§Z¡Z°
Ó%;Õ;Ó<Ð<r$   c               ó    € V ^8„  d   QhRRRR/# rç   r   )r    s   "r!   r"   r¼     s   € ÷ 6ñ 6˜#ð 6 #ñ 6r$   c                	ó   € V R \          R2 # )Ú0Úd)r   )rU   s   &r!   rÝ   ÚGenerationLog._name  s   € à˜QÔ1Ð2°!Ð3Ð4Ð5r$   )rÀ   r¾   rÁ   r¿   N)rK   rL   rM   rN   rO   r¨   rÊ   rÅ   rÆ   rÇ   rä   rÔ   ÚstaticmethodrÝ   rP   r   r$   r!   r¸   r¸   ª   s=   † Ùoõ-õõB/õõõõ(=ð ô6ó ô6r$   r¸   c                  óª   € ] tR tRtRtR R ltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltR R ltR R ltR R ltR R ltR R ltRtR# )ÚParticipanti  a  
One acquisition, from publishing a claim through holding the lock to leaving.

``advance`` is polled until it reports the lock granted, ``heartbeat`` runs on the holder's schedule, and ``leave``
commits the participant out. None of them sleep: the caller owns the deadline and the poll interval. The ledger and
the log outlive one acquisition: how long a peer's record has stayed unchanged is knowledge every attempt against
the same lock shares, or a caller whose attempts are each shorter than the stale threshold could never evict.
c               ó8   € V ^8„  d   QhRRRRRRRRR	R
RRRRRR/# )r   rº   r   rG   r   ÚmodeÚModeÚstale_thresholdr«   r    r¡   Úledgerrž   Úlogr¸   r   r.   r   )r    s   "r!   r"   ÚParticipant.__annotate__  sZ   € ÷ #ñ #àð#ð ð#ð ð	#ð ð#ð #ð#ð ð#ð ð#ð 
ñ#r$   c               	óì   € \        4       V n        W0n        R V n        Wn        W n        W@n        WPn        W`n        Wpn	        V P                  V P                  4      V n        RV n        V! 4       V n        R # )NF)r–   rd   ró   rU   r¾   Ú_rootÚ_stale_thresholdr¦   Ú_ledgerÚ_logÚ_holder_pathÚ_holderÚ_enteredÚ_next_sweep)r'   rº   rG   ró   rõ   r    rö   r÷   s   &&&&$$$$r!   r¨   ÚParticipant.__init__  s_   € ô "+£ˆŒ
Ø!%Œ	Ø&*ˆŒØŒØŒ
Ø /ÔØŒØŒØŒ	Ø×(Ñ(¨¯©Ó4ˆŒØˆŒÙ ›7ˆÖr$   c               ó   € V ^8„  d   QhRR/# ©r   r   r.   r   )r    s   "r!   r"   rø   -  s   € ÷ Qñ Q˜ñ Qr$   c                óÔ   € V P                   P                  V P                  4       V P                   P                  V P                  \        V P                  \        4       4      4       R# )zfCreate the holder record peers watch for liveness; it exists before the token appears in any snapshot.N)r¾   rI   rú   r1   rÿ   rœ   rd   r–   r]   s   &r!   ÚpublishÚParticipant.publish-  s=   € à�‰×Ñ˜DŸJ™JÔ'Ø�‰×Ñ˜4Ÿ<™<¬°t·z±zÄ9Ã;Ó)OÖPr$   c               ó   € V ^8„  d   QhRR/# ©r   r   r6   r   )r    s   "r!   r"   rø   2  s   € ÷ "ñ "˜ñ "r$   c                ó(  a € \        ^4       EF€  pS P                  P                  4       pS P                  V4       S P	                  V4       \        V 3R lVP                  S P                  0,
           4       4      pVP                  V9   d   RMVP                  pVP                  V,
          pS P                  '       gY   Ve   V'       d   S P                  W$WS4        R# S P                  R8X  d   S P                  V3MRVS P                  0,          3w  rES P                  R8H  ;'       g    V'       * pS P                  '       d   V'       g   V'       g    R# S P                  W$WS4      ;pf   EKi  RS n
        V'       d   VS n        Vu # 	  R# )aÆ  
Take the next step toward holding the lock; ``True`` once the lock is granted.

A reader enters as soon as no live writer is named. A writer enters as soon as no live writer is named, which
blocks every new reader, then waits for the named readers to leave. Stale members are evicted in the same commit
that admits this participant, and a writer's final admission is itself a commit, so no admission can rest on a
snapshot a peer is about to supersede.
c              3  óZ   <"  € T F   pSP                  V4      '       g   K  Vx € K"  	  R # 5ir¤   )Ú	_is_stale)rc   rd   r'   s   & €r!   re   Ú&Participant.advance.<locals>.<genexpr>A  s$   øé € ÐhÑ1N¨ÐRV×R`ÑR`Ðaf×RgŸešeÓ1Nùs   ƒ+¡
+NFÚwriter(   T)Úrangerý   rÊ   Ú_keep_claim_freshÚ_sweepr†   r^   rd   rW   rY   r   Ú_commitró   rU   )r'   rˆ   rÊ   ÚstalerW   rY   ÚgrantedrU   s   f       r!   ÚadvanceÚParticipant.advance2  s4  ø€ ô �q—ˆAØ—Y‘Y×%Ñ%Ó'ˆFØ×"Ñ" 6Ô*Ø�K‰K˜ÔÜÔh°·±À4Ç:Á:À,Ö1NÓhÓhˆEØ#Ÿ]™]¨eÔ3‘T¸¿¹ˆFØ—n‘n uÕ,ˆGØ—=—=�=ØÒ%çØŸ™ V°WÔDÚ Ø;?¿9¹9ÈÔ;O 4§:¡:¨wÑ"7ÐVZÐ\cÐgk×gqÑgqÐfrÕ\rÐUs‘�Ø—i‘i 6Ñ)×8Ð8°¬[ˆGØ�}�}ˆ}§U·7ÚØ"Ÿl™l¨6¸7ÓJÐJ�
ÒSÚØ ˆDŒMßØ",�”ØŠNñ- ñ. r$   c               ó    € V ^8„  d   QhRRRR/# ©r   rÊ   rS   r   r.   r   )r    s   "r!   r"   rø   V  s   € ÷ Yñ Y¨ð Y°Tñ Yr$   c           
     	ó^  € V P                   VP                  9   V n        V P                  4       '       ge   \	        \
        4      ;_uu_ 4        V P                  P                  V P                  \        V P                   \        4       4      4       R R R 4       R # R #   + '       g   i     R # ; ir¤   )rd   r^   r   Ú_refresh_noncer   ÚFileExistsErrorr¾   r1   rÿ   rœ   r–   )r'   rÊ   s   &&r!   r  ÚParticipant._keep_claim_freshV  sn   € ð
 Ÿ
™
 f§n¡nÑ4ˆŒØ×"Ñ"×$Ò$Üœ/×*Õ*Ø—‘×"Ñ" 4§<¡<´¸t¿z¹zÌ9Ë;Ó1WÔX÷ +Ñ*ñ %ß*×*Ð*ús   ÁABÂB,	c               ó    € V ^8„  d   QhRRRR/# r  r   )r    s   "r!   r"   rø   `  s   € ÷ Lñ L˜Xð L¨$ñ Lr$   c                	óÒ  € V P                  4       ;q P                  8  d   R # W P                  ^,          ,           V n        \        V P                  \
        4      pV P                  P                  \        V4      4       F^  pW@P                  8w  g   K  WAP                  9  g   K'  \        V4      '       g   K:  V P                  RV 2\        W4,          4      4       K`  	  \        V P                  \        4      pV P                  P                  \        V4      4       FD  pVP                  \        4      '       g   K   V P                  RV 2\        WT,          4      4       KF  	  R # )Nzholder:z
temporary:)r¦   r  rû   r   rú   r   r¾   rD   r   rd   r^   r„   Ú_collectr   Ú
startswithr   )r'   rÊ   r®   r   rÒ   Úgenerationss   &&    r!   r  ÚParticipant._sweep`  s÷   € ð —;‘;“=Ð ˆC×$4Ñ$4Ô4ÙØ×!6Ñ!6¸Õ!:Õ:ˆÔÜ�t—z‘zÔ#5Ó6ˆØ—K‘K×'Ñ'¬¨G«Ö5ˆDØ—z‘zÖ! d·.±.Ö&@ÄXÈdÇ^Ä^Ø—‘ ¨ vÐ.´°GµNÓ0CÖDñ 6ô ˜4Ÿ:™:Ô'=Ó>ˆØ—K‘K×'Ñ'¬¨KÓ(8Ö9ˆDØ�‰Ô0×1Ô1Ø—‘ 
¨4¨&Ð1´3°{Õ7IÓ3JÖKó :r$   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r‡   r   r   r   r.   r   )r    s   "r!   r"   rø   p  s!   € ÷ %ñ %˜Cð % sð %¨tñ %r$   c                	óü   € V P                   P                  WP                  P                  V4      4      V P                  8¼  d9   V P                  P                  V4       V P                   P                  V4       R # R # r¤   )rü   r°   r¾   r(   rû   r@   rµ   )r'   r‡   r   s   &&&r!   r  ÚParticipant._collectp  sX   € Ø�<‰<×Ñ §[¡[×%5Ñ%5°dÓ%;Ó<À×@UÑ@UÔUØ�K‰K×Ñ˜tÔ$Ø�L‰L×Ñ Ö$ñ Vr$   c          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
r   rÊ   rS   rW   rV   rY   rX   r  r   z
int | Noner   )r    s   "r!   r"   rø   u  s4   € ÷ 	$ñ 	$Øð	$Ø(2ð	$Ø=Kð	$ØTbð	$à	ñ	$r$   c                	ó8  € \        VP                  ^,           W#R7      pV P                  P                  V4      '       g   R# V FH  pV P                  P                  V P                  V4      4       V P                  P                  V4       KJ  	  VP                  # )é   r{   N)	rS   rU   rý   rä   r¾   r@   rþ   rü   rµ   )r'   rÊ   rW   rY   r  rà   rd   s   &&&&&  r!   r  ÚParticipant._commitu  sz   € ô ¨×(9Ñ(9¸AÕ(=ÀfÔ^ˆ	Ø�y‰y×Ñ 	×*Ò*ÙÛˆEØ�K‰K×Ñ˜t×0Ñ0°Ó7Ô8Ø�L‰L×Ñ Ö&ñ ð ×#Ñ#Ð#r$   c               ó    € V ^8„  d   QhRRRR/# )r   rd   r   r   r6   r   )r    s   "r!   r"   rø   €  s   € ÷ pñ p˜sð p tñ pr$   c                	ó¢   € V P                   P                  WP                  P                  V P	                  V4      4      4      V P
                  8¬  # r¤   )rü   r°   r¾   r(   rþ   rû   ©r'   rd   s   &&r!   r  ÚParticipant._is_stale€  s=   € Ø�|‰|×#Ñ# E¯;©;×+;Ñ+;¸D×<MÑ<MÈeÓ<TÓ+UÓVÐZ^×ZoÑZoÑoÐor$   c               ó    € V ^8„  d   QhRRRR/# )r   rd   r   r   r   )r    s   "r!   r"   rø   ƒ  s   € ÷ @ñ @ #ð @¨#ñ @r$   c                	óJ   € \        \        V P                  \        V4      4      # r¤   )r   r   rú   r   r,  s   &&r!   rþ   ÚParticipant._holder_pathƒ  s   € Ü”4˜Ÿ
™
Ô$6¸Ó>Ó?Ð?r$   c               ó   € V ^8„  d   QhRR/# r	  r   )r    s   "r!   r"   rø   †  s   € ÷ [ñ [ ñ [r$   c                	ó†   € V P                   P                  V P                  \        V P                  \        4       4      4      # r¤   )r¾   r<   rÿ   rœ   rd   r–   r]   s   &r!   r  ÚParticipant._refresh_nonce†  s*   € Ø�{‰{×$Ñ$ T§\¡\´=ÀÇÁÌYË[Ó3YÓZÐZr$   c               ó   € V ^8„  d   QhRR/# )r   r   z'tuple[HeartbeatOutcome, OSError | None]r   )r    s   "r!   r"   rø   ‰  s   € ÷ Hñ HÐBñ Hr$   c                ó.  €  V P                  4       '       g   R#   T P                  P                  4       pT P	                  T4       T P
                  TP                  9   d   R# RR3#   \         d   pRT3u Rp?# Rp?ii ; i  \         d    Ru # i ; i)a¼  
Refresh the nonce and confirm the latest snapshot still names this participant.

``lost`` means a peer evicted this participant or removed its holder record: the lock is no longer held, and the
holder must stop using what it protects. ``transient`` is a filesystem error refreshing the nonce, worth
retrying on the next tick. A failure to read the log or to sweep decides nothing about this holder's liveness,
so it is not counted against it.
ÚlostNÚ	transient)r6  N)ÚokN)r  ÚOSErrorrý   rÊ   r  rd   r^   )r'   ÚerrorrÊ   s   &  r!   Ú	heartbeatÚParticipant.heartbeat‰  s™   € ð	&Ø×&Ñ&×(Ò(Ø#Ð#ð )ð	Ø—Y‘Y×%Ñ%Ó'ˆFØ�K‰K˜Ôð Ÿ
™
 f§n¡nÔ4ÐGÐG¸&À4ÐGÐGøô ô 	&Ø Ð%Õ%ûð	&ûô
 ô 	ØÒð	ús3   ‚A( ˜A( œ+B Á(BÁ3A<Á6BÁ<BÂBÂBc               ó   € V ^8„  d   QhRR/# r  r   )r    s   "r!   r"   rø   ž  s   € ÷ )ñ )�tñ )r$   c                óâ  € V P                   V P                  P                  4       ;pP                  9   d‡   \	        VP
                  ^,           VP                  V P                   8X  d   RMVP                  VP                  V P                   0,
          R7      pV P                  P                  V4      '       g   Kº   RV n	        RV n        V P                  P                  V P                  4       R# )zRCommit this participant out of the latest snapshot, then remove its holder record.Nr{   F)rd   rý   rÊ   r^   rS   rU   rW   rY   rä   r   r¾   r@   rÿ   )r'   rÊ   rà   s   &  r!   ÚleaveÚParticipant.leavež  s¦   € à�j‰j t§y¡y×'7Ñ'7Ó'9Ð9˜V×BÑBÔBÜ Ø!×,Ñ,¨qÕ0Ø%Ÿ}™}°·
±
Ô:‘tÀÇÁØŸ™¨$¯*©*¨Õ5ôˆIð
 �y‰y×Ñ 	×*Ô*ØØˆŒØˆŒØ�‰×Ñ˜4Ÿ<™<Ö(r$   )r¦   r   r¾   rÿ   rü   rý   r  rú   rû   rU   ró   rd   N)rK   rL   rM   rN   rO   r¨   r  r  r  r  r  r  r  rþ   r  r;  r?  rP   r   r$   r!   rñ   rñ     sP   † ñõ#õ0Qõ
"õHYõLõ %õ
	$õpõ@õ[õH÷*)ñ )r$   rñ   )r(   r  )r8  r6  r7  i   )r   r¸   ÚHeartbeatOutcomerž   rô   rñ   rS   rœ   r„   r–   rŠ   ),Ú__conditional_annotations__rO   Ú
__future__r   rš   r”   Ú
contextlibr   Údataclassesr   Úpathlibr   Útypingr   r   r   r	   Úfilelock._errorr
   Úfilelock._identityr   Úcollections.abcr   rô   rA  r   rt   r   r   r   r   r   r   r   r   rS   rŠ   r„   r–   rœ   rž   r¸   rñ   Ú__all__)rB  s   @r!   Ú<module>rL     s  øðôõ& #ã 	Û Ý Ý !Ý ß :Ó :å 5Ý (çÝ(àˆÕ€ØÐ4Õ5Ð à'€	ˆ:Ó 'Ø!#Ð �JÓ #Ø "Ð �:Ó "à&Ð �*Ó &ð %'Ð �zÓ &Ø%*Ð ˜
Ó *Ø!*Ð �JÓ *Ø *Ð �:Ó *ôvˆHô vñ2 �$Ô÷Fð Fó ðFõ(võ@kõ
5õ
q÷
"ñ "÷2^6ñ ^6÷B_)ñ _)òD‚r$   