§
    dŠtjß   ã                  óº  — U d dl mZ d dlZd dlZd dlZd dlmZmZ d dlm	Z	 d dl
mZ d:d„Zd;d„Zej        dk    �rd dlZd dlmZ  ej        dd¬¦  «        Zded<   ej        gej        _        ej        ej        _        ej        ej        ej        gej        _        ej        ej        _        ej         ej        ej        ¦  «         ej        ej        ¦  «         ej        ej        ¦  «         ej        ej        ¦  «        gej        _        ej        ej        _        dZded<   dZded<   dZ ded<   dZ!ded <   d<d!„Z"d=d"„Z#n�d<d#„Z"ej        d$v rd%Z$ded&<   d>d'„Z% e%¦   «         Z&ded(<   d=d)„Z#ndej        d*k    rUd dlZd dl'Z' ej(        dd¬+¦  «        Z)d,ed-<   d.Z*ded/<   d0Z+ded1<   d.Z,ded2<   d3Z-d4ed5<    e'j.        e-¦  «        Z/ded6<   d=d7„Z#nd=d8„Z#g d9¢Z0dS )?é    )ÚannotationsN)ÚEPERMÚESRCH)ÚPath)ÚFinalÚreturnÚstrc                 ó(   — t          j        ¦   «         S )zfThe hostname recorded alongside an owner, so a marker written on another machine is never probed here.)ÚsocketÚgethostname© ó    úP/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/filelock/_identity.pyÚ	host_namer      s   € åÔÑÔÐr   ÚpidÚintÚhostnameÚstart_tokenú
int | NoneÚboolc                ó†   — |t          ¦   «         k    rdS t          | ¦  «        sdS |€dS t          | ¦  «        }|duo||k    S )a‚  
    Whether the recorded owner is provably gone, so reclaiming its marker cannot detach a live holder.

    Fail closed: return ``True`` only when this process can prove the exact recorded owner is dead. A marker from
    another host cannot be probed; a live PID whose start token still matches, or whose token cannot be read, is the
    holder or is indistinguishable from it; a live PID whose start token differs is a recycled PID, so the process that
    wrote the marker is gone. PostgreSQL, Qt ``QLockFile`` and Mercurial all break a stale lock only on proof of death
    and treat an unreadable or foreign owner as still holding.
    FTN)r   Úprocess_aliveÚprocess_start_token)r   r   r   Úcurrents       r   Úowner_is_staler      sZ   € ð •9‘;”;ÒÐØˆuÝ˜ÑÔð ØˆtØÐØˆuÝ! #Ñ&Ô&€GØ˜$ÐÐ9 7¨kÒ#9Ð9r   Úwin32)ÚwintypesÚkernel32T)Úuse_last_errorzFinal[ctypes.WinDLL]Ú	_KERNEL32i   z
Final[int]Ú_WIN_SYNCHRONIZEi   Ú&_WIN_PROCESS_QUERY_LIMITED_INFORMATIONéW   Ú_WIN_ERROR_INVALID_PARAMETERFzFinal[bool]Ú_WIN_INHERIT_HANDLEc                óÂ   — t                                t          t          | ¦  «        }|rt                                |¦  «         dS t          j        ¦   «         t          k    S )zSWhether a process with this PID exists, treating an access denial as proof it does.T)r    ÚOpenProcessr!   r%   ÚCloseHandleÚctypesÚget_last_errorr$   )r   Úhandles     r   r   r   ;   sQ   € å×&Ò&Õ'7Õ9LÈcÑRÔRˆØð 	Ý×!Ò! &Ñ)Ô)Ð)Ø�4ÝÔ$Ñ&Ô&Õ*FÒFÐFr   c           	     ó4  — t                                t          t          | ¦  «        }|sdS d„ t	          d¦  «        D ¦   «         \  }}}}	 t                                |t          j        |¦  «        t          j        |¦  «        t          j        |¦  «        t          j        |¦  «        ¦  «        s	 t                                |¦  «         dS 	 t                                |¦  «         n# t                                |¦  «         w xY w|j	        dz  |j
        z  S )zXThe process creation FILETIME as a 100ns tick count, or ``None`` when it cannot be read.Nc              3  ó<   K  — | ]}t          j        ¦   «         V — Œd S )N)r   ÚFILETIME)Ú.0Ú_s     r   ú	<genexpr>z&process_start_token.<locals>.<genexpr>H   s+   è è € Ð6]Ð6]ÈqµxÔ7HÑ7JÔ7JÐ6]Ð6]Ð6]Ð6]Ð6]Ð6]r   é   é    )r    r'   r"   r%   ÚrangeÚGetProcessTimesr)   Úbyrefr(   ÚdwHighDateTimeÚdwLowDateTime)r   r+   ÚcreationÚ	exit_timeÚkernel_timeÚ	user_times         r   r   r   C   s  € å×&Ò&Õ'MÕObÐdgÑhÔhˆØð 	Ø�4Ø6]Ð6]ÕTYÐZ[ÑT\ÔT\Ð6]Ñ6]Ô6]Ñ3ˆ�)˜[¨)ð
	*Ý×,Ò,ØÝ”˜XÑ&Ô&Ý”˜YÑ'Ô'Ý”˜[Ñ)Ô)Ý”˜YÑ'Ô'ñô ð ð å×!Ò! &Ñ)Ô)Ð)Ð)Ð)ðõ ×!Ò! &Ñ)Ô)Ð)Ð)ø�I×!Ò! &Ñ)Ô)Ð)Ð)øøøØÔ'¨2Ñ-°Ô1GÑGÐGs   Á
A&C) Ã)Dc                ó²   — 	 t          j        | d¦  «         n?# t          $ r2}|j        t          k    rY d}~dS |j        t
          k    rY d}~dS ‚ d}~ww xY wdS )z_Whether a process with this PID exists, treating an access denial (``EPERM``) as proof it does.r   NFT)ÚosÚkillÚOSErrorÚerrnor   r   )r   Úerrors     r   r   r   X   su   € ð	ÝŒG�C˜‰OŒOˆOˆOøÝð 	ð 	ð 	ØŒ{�eÒ#Ð#Ø�u�u�u�u�uØŒ{�eÒ#Ð#Ø�t�t�t�t�tØøøøøð	øøøð ˆts   ‚ ˜
A¢A¸AÁAÁA>   ÚlinuxÚandroidé   Ú_STARTTIME_INDEXc                 óæ   — 	 t          d¦  «                             d¬¦  «        } t          |                      ¦   «                              dd¦  «        d¦  «        S # t
          t          f$ r Y dS w xY w)Nz/proc/sys/kernel/random/boot_idÚascii)Úencodingú-Ú é   r   )r   Ú	read_textr   ÚstripÚreplacer@   Ú
ValueError)Úboot_ids    r   Ú_read_boot_idrR   k   sv   € ðÝÐ@ÑAÔA×KÒKÐU\ÐKÑ]Ô]�Ý˜7Ÿ=š=™?œ?×2Ò2°3¸Ñ;Ô;¸RÑ@Ô@Ð@øÝ�ZÐ(ð ð ð Ø�q�qðøøøs   ‚AA ÁA0Á/A0Ú_BOOT_IDc                ó~  — 	 t          d| › d�¦  «                             ¦   «         }n# t          $ r Y dS w xY w||                     d¦  «        dz   d…                              ¦   «         }t          |¦  «        t          k    rdS 	 t          |t                   ¦  «        }n# t          $ r Y dS w xY wt          dz  |z  S )zeThe ``/proc/<pid>/stat`` ``starttime`` folded with the boot id, or ``None`` when the process is gone.z/proc/z/statNó   )é   é@   )
r   Ú
read_bytesr@   ÚrfindÚsplitÚlenrF   r   rP   rS   )r   ÚdataÚfieldsÚ	starttimes       r   r   r   y   sá   € ðÝÐ/ SÐ/Ð/Ð/Ñ0Ô0×;Ò;Ñ=Ô=��øÝð ð ð Ø�t�tðøøøð ˜$Ÿ*š* TÑ*Ô*¨QÑ.Ð0Ð0Ô1×7Ò7Ñ9Ô9ˆFÝ�6‰{Œ{Õ.Ò.Ð.Ø�tðÝ Õ'7Ô 8Ñ9Ô9�	�	øÝð ð ð Ø�t�tðøøøå ‘N iÑ/Ð/s   ‚%( ¨
6µ6ÂB! Â!
B/Â.B/Údarwin)Ú	use_errnozFinal[ctypes.CDLL]Ú_LIBCrV   Ú	_CTL_KERNé   Ú
_KERN_PROCÚ_KERN_PROC_PIDz<qiz
Final[str]Ú_TIMEVAL_AT_ZEROÚ_TIMEVAL_SIZEc                ó  — t          j        dz  t          t          t          | ¦  «        }t          j        d¦  «        }t                               |ddt          j        |¦  «        dd¦  «        dk    rdS t          j	        |j
        z  ¦   «         }t                               |d|t          j        |¦  «        dd¦  «        dk    s|j
        t          k     rdS t          j        t          |j        d¦  «        \  }}|dz  |z   S )zcThe process start time in microseconds from ``sysctl(KERN_PROC_PID)``, or ``None`` when it is gone.r2   r   Ni@B )r)   Úc_intrb   rd   re   Úc_size_tra   Úsysctlr6   Úc_charÚvaluerg   ÚstructÚunpack_fromrf   Úraw)r   ÚmibÚlengthÚbufferÚsecondsÚmicrosecondss         r   r   r   –   sÝ   € å”< !Ñ#¥Yµ
½NÈCÑPÔPˆCÝ”_ QÑ'Ô'ˆFõ �|Š|˜C  D­&¬,°vÑ*>Ô*>ÀÀaÑHÔHÈAÒMÐMØ�tÝ”m f¤lÑ2Ñ5Ô5ˆFÝ�|Š|˜C  F­F¬L¸Ñ,@Ô,@À$ÈÑJÔJÈaÒOÐOÐSYÔS_ÕboÒSoÐSoØ�tÝ$*Ô$6Õ7GÈÌÐUVÑ$WÔ$WÑ!ˆG�\Ø˜YÑ&¨Ñ5Ð5r   c                ó   — ~ dS )z_No proven start-time source, so the owner carries no token and liveness rests on the PID alone.Nr   )r   s    r   r   r   ¦   s
   € àØ�4r   )r   r   r   r   )r   r	   )r   r   r   r	   r   r   r   r   )r   r   r   r   )r   r   r   r   )r   r   )1Ú
__future__r   r>   r   ÚsysrA   r   r   Úpathlibr   Útypingr   r   r   Úplatformr)   r   ÚWinDLLr    Ú__annotations__ÚHANDLEr(   ÚargtypesÚBOOLÚrestypeÚDWORDr'   ÚPOINTERr.   r5   r!   r"   r$   r%   r   r   rF   rR   rS   rn   ÚCDLLra   rb   rd   re   rf   Úcalcsizerg   Ú__all__r   r   r   ú<module>r‡      sv  ðØ "Ð "Ð "Ð "Ð "Ð "Ð "à 	€	€	€	Ø €€€Ø 
€
€
€
Ø Ð Ð Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð ð ð  ð  ð  ð
:ð :ð :ð :ð( „<�7ÒÑØ€M€M€MØÐÐÐÐÐà&3 f¤m°JÈtÐ&TÑ&TÔ&T€IÐTÐTÐTÑTØ&.¤oÐ%6€IÔÔ"Ø$,¤M€IÔÔ!Ø&.¤n°h´mÀXÄ^Ð%T€IÔÔ"Ø$,¤O€IÔÔ!àŒØˆŒ�xÔ(Ñ)Ô)ØˆŒ�xÔ(Ñ)Ô)ØˆŒ�xÔ(Ñ)Ô)ØˆŒ�xÔ(Ñ)Ô)ð*€IÔÔ&ð )1¬€IÔÔ%à#+ÐÐ+Ð+Ð+Ñ+Ø9?Ð*Ð?Ð?Ð?Ñ?Ø/1Ð Ð1Ð1Ð1Ñ1Ø',ÐÐ,Ð,Ð,Ñ,ðGð Gð Gð GðHð Hð Hð Hð Hð*
ð 
ð 
ð 
ð „|Ð+Ð+Ð+ð
 (*ÐÐ)Ð)Ð)Ñ)ð
	ð 
	ð 
	ð 
	ð  -˜}™œˆÐ.Ð.Ð.Ñ.ð	0ð 	0ð 	0ð 	0ð 	0ð  
Œ˜Ò	!Ð	!ØˆˆˆØˆˆˆà$/ F¤K°ÀÐ$EÑ$EÔ$EˆÐEÐEÐEÑEØ !ˆ	Ð!Ð!Ð!Ñ!Ø!#ˆ
Ð#Ð#Ð#Ñ#Ø%&ˆÐ&Ð&Ð&Ñ&ð (-ÐÐ,Ð,Ð,Ñ,Ø$3 F¤OÐ4DÑ$EÔ$EˆÐEÐEÐEÑEð	6ð 	6ð 	6ð 	6ð 	6ð 	ð 	ð 	ð 	ðð ð €€€r   