grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026o ®û|jÏã@s– ddlZddlZddlmZddlmZddlZddlmZdgZ eddƒZ de j_ d e j _ d e j _ d e j_ d e j_ d e j_ eƒZGdd„dƒZdS)éN)Ú namedtuple)Úcount)Ú monotonicÚ schedulerÚEventz2time, priority, sequence, action, argument, kwargszaNumeric type compatible with the return value of the timefunc function passed to the constructor.zSEvents scheduled for the same time will be executed in the order of their priority.zbA continually increasing sequence number that separates events if time and priority are equal.z?Executing the event means executing action(*argument, **kwargs)zGargument is a sequence holding the positional arguments for the action.zDkwargs is a dictionary holding the keyword arguments for the action.c@s^eZdZeejfdd„Zdefdd„Zdefdd„Z dd „Z d d „Z dd d„Z e dd„ƒZdS)rcCs* g|_t ¡|_||_||_tƒ|_dS©N)Ú_queueÚ threadingÚRLockÚ_lockÚtimefuncÚ delayfuncrÚ_sequence_generator)Úselfr r ©rú,/opt/alt/python310/lib64/python3.10/sched.pyÚ__init__5s   zscheduler.__init__rcCs` |turi}|j�t||t|jƒ|||ƒ}t |j|¡Wdƒ|S1s)wY|Sr)Ú _sentinelr rÚnextrÚheapqZheappushr)rÚtimeÚpriorityÚactionÚargumentÚkwargsÚeventrrrÚenterabs>sÿ ýüzscheduler.enterabscCs | ¡|}| |||||¡Sr)r r)rÚdelayrrrrrrrrÚenterNs zscheduler.entercCsF |j�|j |¡t |j¡WdƒdS1swYdSr)r rÚremoverZheapify)rrrrrÚcancelWs  "þzscheduler.cancelcCs4 |j� |j WdƒS1swYdSr)r r)rrrrÚemptybs$ÿzscheduler.emptyTcCsÆ |j}|j}|j}|j}tj} |�-|s WdƒdS|d\}}} } } } |ƒ} || kr3d}nd}||ƒWdƒn1sCwY|rW|sP|| S||| ƒn | | i| ¤Ž|dƒq)NTrF)r rr r rÚheappop)rZblockingÚlockÚqr r ÚpoprrÚsequencerrrZnowrrrrÚrungs8þ ÿ€ö îz scheduler.runcCsP |j�|jdd…}Wdƒn1swYtttj|gt|ƒƒƒSr)r rÚlistÚmaprr"Úlen)rZeventsrrrÚqueuešs  ÿzscheduler.queueN)T)Ú__name__Ú __module__Ú __qualname__Ú_timerÚsleeprrrrr r!r'Úpropertyr+rrrrr3s   3)rrÚ collectionsrÚ itertoolsrr rr/Ú__all__rÚ__doc__rr&rrrÚobjectrrrrrrÚs"