ó
    ¸®iÔ
  ã                  óÄ   • S SK Jr  S SKJr  S SKJr  S SKJr  S SKrSSK	J
r
JrJr  \(       a  S SKJr  \R                  \R                   " S	S	S
9 " S S5      5       5       rg)é    )Úannotations)Údefaultdict)Úasynccontextmanager)ÚTYPE_CHECKINGNé   )ÚEventÚ_coreÚ_util)ÚAsyncIteratorF)ÚeqÚslotsc                  ó´   • \ rS rSr% Sr\R                  " S SS9rS\S'   \R                  " \	SS9r
S\S	'   \R                  " SSS
9rS\S'   \SS j5       rSrg)Ú	Sequenceré   a`  A convenience class for forcing code in different tasks to run in an
explicit linear order.

Instances of this class implement a ``__call__`` method which returns an
async context manager. The idea is that you pass a sequence number to
``__call__`` to say where this block of code should go in the linear
sequence. Block 0 starts immediately, and then block N doesn't start until
block N-1 has finished.

Example:
  An extremely elaborate way to print the numbers 0-5, in order::

     async def worker1(seq):
         async with seq(0):
             print(0)
         async with seq(4):
             print(4)

     async def worker2(seq):
         async with seq(2):
             print(2)
         async with seq(5):
             print(5)

     async def worker3(seq):
         async with seq(1):
             print(1)
         async with seq(3):
             print(3)

     async def main():
        seq = trio.testing.Sequencer()
        async with trio.open_nursery() as nursery:
            nursery.start_soon(worker1, seq)
            nursery.start_soon(worker2, seq)
            nursery.start_soon(worker3, seq)

c                 ó    • [        [        5      $ )N)r   r   © ó    ÚDC:\des-py\RoboSAPF\venv\Lib\site-packages\trio/testing/_sequencer.pyÚ<lambda>ÚSequencer.<lambda>:   s	   € œ¤EÔ*r   F)ÚfactoryÚinitzdefaultdict[int, Event]Ú_sequence_pointszset[int]Ú_claimed)Údefaultr   ÚboolÚ_brokenc               ó˜  #   • XR                   ;   a  [        SU 35      eU R                  (       a  [        S5      eU R                   R                  U5        US:w  aC   U R                  U   R                  5       I S h  v•N   U R                  (       a  [        S5      e  S 7v •  U R                  US-      R                  5         g  NH! [        R                   aE    SU l        U R                  R                  5        H  nUR                  5         M     [        S5      S ef = f! U R                  US-      R                  5         f = f7f)Nz"Attempted to reuse sequence point zsequence broken!r   Tz+Sequencer wait cancelled -- sequence brokené   )
r   ÚRuntimeErrorr   Úaddr   Úwaitr	   Ú	CancelledÚvaluesÚset)ÚselfÚpositionÚevents      r   Ú__call__ÚSequencer.__call__@   s  é € à—}‘}Ó$ÜÐ!CÀHÀ:ÐNÓOÐOØ�<�<ÜÐ1Ó2Ð2Ø�‰×Ñ˜(Ô#Ø�q‹=ð;Ø×+Ñ+¨HÑ5×:Ñ:Ó<×<Ð<ð —<—<Ü&Ð'9Ó:Ð:ð  ð	6Üà×!Ñ! (¨Q¡,Ñ/×3Ñ3Õ5ñ =øÜ—?‘?ó Ø#�”Ø!×2Ñ2×9Ñ9Ö;�EØ—I‘I–Kñ <ä"ØAóàðð	ûð ×!Ñ! (¨Q¡,Ñ/×3Ñ3Õ5üsI   ‚AE
Á C	 Á>CÁ?C	 ÂE
Â!D% Â&!E
ÃC	 Ã	AD"Ä"E
Ä%"EÅE
)r   N)r'   ÚintÚreturnzAsyncIterator[None])Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚattrsÚfieldr   Ú__annotations__r%   r   r   r   r)   Ú__static_attributes__r   r   r   r   r      se   ‡ ñ%ðN 16·²Ù*Øñ1ÐÐ-ó ð Ÿš¨S°uÑ=€HˆhÓ=Ø—K’K¨°EÑ:€GˆTÓ:àó6ó ó6r   r   )Ú
__future__r   Úcollectionsr   Ú
contextlibr   Útypingr   r2   Ú r   r	   r
   Úcollections.abcr   ÚfinalÚdefiner   r   r   r   Ú<module>r>      sS   ðÝ "å #Ý *Ý  ã ç "Ñ "æÝ-ð ‡�Ø‡‚�˜eÑ$÷F6ð F6ó %ó ñF6r   