python (3.11.7)

(root)/
lib/
python3.11/
__pycache__/
queue.cpython-311.pyc

e,JdZddlZddlZddlmZddlmZmZddlm	Z	ddl
mZn
#e$rdZYnwxYwgdZ
	ddl
mZn#e$rGd	d
eZYnwxYwGddeZGd
dZGddeZGddeZGddZeeZdSdS)z'A multi-producer, multi-consumer queue.N)deque)heappushheappop)	monotonic)SimpleQueue)EmptyFullQueue
PriorityQueue	LifoQueuer)rceZdZdZdS)rz4Exception raised by Queue.get(block=0)/get_nowait().N__name__
__module____qualname____doc__9/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/queue.pyrrs>>rrceZdZdZdS)r	z4Exception raised by Queue.put(block=0)/put_nowait().Nrrrrr	r	s::Drr	ceZdZdZddZdZdZdZdZdZ	ddZ
ddZd
ZdZ
dZdZdZdZeejZd
S)r
zjCreate a queue object with a given maximum size.

    If maxsize is <= 0, the queue size is infinite.
    rc0||_||tj|_tj|j|_tj|j|_tj|j|_d|_	dSNr)
maxsize_init	threadingLockmutex	Condition	not_emptynot_fullall_tasks_doneunfinished_tasksselfrs  r__init__zQueue.__init__"s}

7^%%
#,TZ88"+DJ77
(1$*== !rc|j5|jdz
}|dkr.|dkrtd|j||_ddddS#1swxYwYdS)a.Indicate that a formerly enqueued task is complete.

        Used by Queue consumer threads.  For each get() used to fetch a task,
        a subsequent call to task_done() tells the queue that the processing
        on the task is complete.

        If a join() is currently blocking, it will resume when all items
        have been processed (meaning that a task_done() call was received
        for every item that had been put() into the queue).

        Raises a ValueError if called more times than there were items
        placed in the queue.
        rz!task_done() called too many timesN)r"r#
ValueError
notify_all)r%
unfinisheds  r	task_donezQueue.task_done9s
 	/	/.2JQ>>$%HIII#..000$.D!
	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/sAAA"Ac|j5|jr |j|j ddddS#1swxYwYdS)aBlocks until all items in the Queue have been gotten and processed.

        The count of unfinished tasks goes up whenever an item is added to the
        queue. The count goes down whenever a consumer thread calls task_done()
        to indicate the item was retrieved and all work on it is complete.

        When the count of unfinished tasks drops to zero, join() unblocks.
        N)r"r#waitr%s rjoinz
Queue.joinOs
 	+	+'
+#((***'
+	+	+	+	+	+	+	+	+	+	+	+	+	+	+	+	+	+	+s(=AAcl|j5|cdddS#1swxYwYdS)9Return the approximate size of the queue (not reliable!).Nr_qsizer/s rqsizezQueue.qsize\sy
Z	!	!;;==	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!s)--cn|j5|cdddS#1swxYwYdS)aReturn True if the queue is empty, False otherwise (not reliable!).

        This method is likely to be removed at some point.  Use qsize() == 0
        as a direct substitute, but be aware that either approach risks a race
        condition where a queue can grow before the result of empty() or
        qsize() can be used.

        To create code that needs to wait for all queued tasks to be
        completed, the preferred technique is to use the join() method.
        Nr3r/s remptyzQueue.emptyas~Z	%	%{{}}$	%	%	%	%	%	%	%	%	%	%	%	%	%	%	%	%	%	%s*..c|j5d|jcxko|knccdddS#1swxYwYdS)aOReturn True if the queue is full, False otherwise (not reliable!).

        This method is likely to be removed at some point.  Use qsize() >= n
        as a direct substitute, but be aware that either approach risks a race
        condition where a queue can shrink before the result of full() or
        qsize() can be used.
        rN)rrr4r/s rfullz
Queue.fullosZ	5	5t|4444t{{}}4444	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5s'<AATNc|j5|jdkr|s%||jkrtn|T||jkr6|j||jk6n|dkrtdt
|z}||jkrU|t
z
}|dkrt|j|||jkU|||xjdz
c_|j	
ddddS#1swxYwYdS)aPut an item into the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until a free slot is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Full exception if no free slot was available within that time.
        Otherwise ('block' is false), put an item on the queue if a free slot
        is immediately available, else raise the Full exception ('timeout'
        is ignored in that case).
        rN''timeout' must be a non-negative numberr()r!rr4r	r.r)time_putr#r notify)r%itemblocktimeoutendtime	remainings      rputz	Queue.putzs]	$	$|a6{{}}44"
5_++--4<77
**,,,++--4<77q[[$%NOOO"ffw.G++--4<77$+dff$4	$++"&J
**9555	++--4<77

IIdOOO!!Q&!!N!!###'	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$sE E55E9<E9cr|j5|s|stn|B|s-|j|-n|dkrt	dt|z}|sL|tz
}|dkrt|j||L|}|j|cdddS#1swxYwYdS)Remove and return an item from the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until an item is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Empty exception if no item was available within that time.
        Otherwise ('block' is false), return an item if one is immediately
        available, else raise the Empty exception ('timeout' is ignored
        in that case).
        Nrr;r<)	r r4rr.r)r=_getr!r?)r%rArBrCrDr@s      rgetz	Queue.getsp^		
3{{}} K ++--*N'')))++--*1 !JKKK&&7*++--3 '$&& 0I C''#N''	222	++--3
99;;DM  """%																		sDD,,D03D0c0||dS)zPut an item into the queue without blocking.

        Only enqueue the item if a free slot is immediately available.
        Otherwise raise the Full exception.
        FrArEr%r@s  r
put_nowaitzQueue.put_nowaitxxEx***rc.|dSzRemove and return an item from the queue without blocking.

        Only get an item if one is immediately available. Otherwise
        raise the Empty exception.
        FrKrIr/s r
get_nowaitzQueue.get_nowaitxxex$$$rc,t|_dSN)rqueuer$s  rrzQueue._initsWW


rc*t|jSrVlenrWr/s rr4zQueue._qsize4:rc:|j|dSrVrWappendrMs  rr>z
Queue._put
$rc4|jSrV)rWpopleftr/s rrHz
Queue._getsz!!###r)rTN)rrrrr&r,r0r5r7r9rErIrNrSrr4r>rHclassmethodtypesGenericAlias__class_getitem__rrrr
r
s
"""".///,+++!!!
%%%	5	5	5$$$$@>+++%%%   $$$$E$677rr
c*eZdZdZdZdZdZdZdS)rzVariant of Queue that retrieves open entries in priority order (lowest first).

    Entries are typically tuples of the form:  (priority number, data).
    cg|_dSrVrWr$s  rrzPriorityQueue._init



rc*t|jSrVrYr/s rr4zPriorityQueue._qsizer[rc0t|j|dSrV)rrWrMs  rr>zPriorityQueue._putsT"""""rc*t|jSrV)rrWr/s rrHzPriorityQueue._getstz"""rNrrrrrr4r>rHrrrrrsZ
########rrc*eZdZdZdZdZdZdZdS)rzBVariant of Queue that retrieves most recently added entries first.cg|_dSrVrir$s  rrzLifoQueue._initrjrc*t|jSrVrYr/s rr4zLifoQueue._qsizer[rc:|j|dSrVr]rMs  rr>zLifoQueue._putr_rc4|jSrV)rWpopr/s rrHzLifoQueue._getsz~~rNrnrrrrrsVLL        rrc`eZdZdZdZddZddZdZdZd	Z	d
Z
eej
ZdS)_PySimpleQueuezYSimple, unbounded FIFO queue.

    This pure Python implementation is not reentrant.
    c^t|_tjd|_dSr)r_queuer	Semaphore_countr/s rr&z_PySimpleQueue.__init__s#gg)!,,rTNcl|j||jdS)zPut the item on the queue.

        The optional 'block' and 'timeout' arguments are ignored, as this method
        never blocks.  They are provided for compatibility with the Queue class.
        N)rxr^rzrelease)r%r@rArBs    rrEz_PySimpleQueue.puts4	
4   rc||dkrtd|j||st|jS)rGNrr;)r)rzacquirerrxra)r%rArBs   rrIz_PySimpleQueue.getsT7Q;;FGGG{""5'22	K{""$$$rc0||dS)zPut an item into the queue without blocking.

        This is exactly equivalent to `put(item, block=False)` and is only provided
        for compatibility with the Queue class.
        FrKrLrMs  rrNz_PySimpleQueue.put_nowait*rOrc.|dSrQrRr/s rrSz_PySimpleQueue.get_nowait2rTrc2t|jdkS)zCReturn True if the queue is empty, False otherwise (not reliable!).rrZrxr/s rr7z_PySimpleQueue.empty:s4;1$$rc*t|jS)r2rr/s rr5z_PySimpleQueue.qsize>s4;rrb)rrrrr&rErIrNrSr7r5rcrdrerfrrrrvrvs---%%%%"+++%%%%%%   $E$677rrv)rrrdcollectionsrheapqrrr=rrxrImportError__all__r	Exceptionr	r
rrrvrrr<module>rs
--########"""""""""""""KKKR
Q
Q








	





					9			
@8@8@8@8@8@8@8@8F#####E###&
 
 
 
 
 
 
 
  @8@8@8@8@8@8@8@8F KKKs'11AAA