Critics have remarked that those four worthies were truly peerless throughout the ages; yet the present falls short of the pastβ€”the ancients favored unadorned simplicity, whereas the moderns prefer refined elegance. Styles of substance and ornament rise and fall in succession, shifting with the changing mores of the times; such evolution is simply the natural order of things. The ideal lies in honoring antiquity without clashing with the present, and embracing modernity without succumbing to its flawsβ€”embodying that perfect balance of substance and refinement that defines the true gentleman. There is surely no need to abandon a carved palace in favor of a cave dwelling, or to trade a jade carriage for a primitive cart with solid wooden wheels.🌌 SpectraShell

🌌 SpectraShell

Current path: lib64/python3.6/__pycache__/



⬆️ Go up: /lib64/python3.6

πŸ“„ Viewing: queue.cpython-36.pyc

3


 \L"οΏ½
@sοΏ½dZyddlZWnek
r,ddlZYnXddlmZddlmZmZddl	m
Z	dddd	d
gZGddοΏ½deοΏ½Z
GddοΏ½deοΏ½ZGd
dοΏ½dοΏ½ZGdd	οΏ½d	eοΏ½ZGdd
οΏ½d
eοΏ½ZdS)z'A multi-producer, multi-consumer queue.οΏ½N)οΏ½deque)οΏ½heappushοΏ½heappop)οΏ½	monotonicοΏ½EmptyοΏ½FullοΏ½QueueοΏ½
PriorityQueueοΏ½	LifoQueuec@seZdZdZdS)rz4Exception raised by Queue.get(block=0)/get_nowait().N)οΏ½__name__οΏ½
__module__οΏ½__qualname__οΏ½__doc__οΏ½rrοΏ½/usr/lib64/python3.6/queue.pyr
sc@seZdZdZdS)rz4Exception raised by Queue.put(block=0)/put_nowait().N)rrr
rrrrrrsc@sοΏ½eZdZdZd!ddοΏ½ZddοΏ½ZddοΏ½Zd	d
οΏ½ZddοΏ½Zd
dοΏ½Z	d"ddοΏ½Z
d#ddοΏ½ZddοΏ½ZddοΏ½Z
ddοΏ½ZddοΏ½ZddοΏ½Zdd οΏ½ZdS)$rzjCreate a queue object with a given maximum size.

    If maxsize is <= 0, the queue size is infinite.
    rcCsN||_|j|οΏ½tjοΏ½|_tj|jοΏ½|_tj|jοΏ½|_tj|jοΏ½|_d|_	dS)Nr)
οΏ½maxsizeοΏ½_initοΏ½	threadingZLockοΏ½mutexZ	ConditionοΏ½	not_emptyοΏ½not_fullοΏ½all_tasks_doneοΏ½unfinished_tasks)οΏ½selfrrrrοΏ½__init__s

zQueue.__init__c	CsH|jοΏ½8|jd}|dkr4|dkr*tdοΏ½οΏ½|jjοΏ½||_WdQRXdS)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)rrοΏ½
ValueErrorZ
notify_all)rZ
unfinishedrrrοΏ½	task_done2s

zQueue.task_donec	Cs,|jοΏ½x|jr|jjοΏ½q
WWdQRXdS)aοΏ½Blocks 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)rrοΏ½wait)rrrrοΏ½joinHs	z
Queue.joinc	Cs|jοΏ½
|jοΏ½SQRXdS)z9Return the approximate size of the queue (not reliable!).N)rοΏ½_qsize)rrrrοΏ½qsizeUszQueue.qsizec	Cs|jοΏ½|jοΏ½SQRXdS)aοΏ½Return 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.
        N)rr )rrrrοΏ½emptyZszQueue.emptyc
Cs0|jοΏ½ d|jko |jοΏ½kSSQRXdS)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)rrr )rrrrοΏ½fullhsz
Queue.fullTNc
CsοΏ½|jοΏ½οΏ½|jdkrοΏ½|s*|jοΏ½|jkrοΏ½tοΏ½nz|dkrRxp|jοΏ½|jkrN|jjοΏ½q4WnR|dkrdtdοΏ½οΏ½n@tοΏ½|}x4|jοΏ½|jkrοΏ½|tοΏ½}|dkrοΏ½tοΏ½|jj|οΏ½qpW|j|οΏ½|jd7_|j	j
οΏ½WdQRXdS)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).
        rNz''timeout' must be a non-negative numbergr)rrr rrrοΏ½timeοΏ½_putrrοΏ½notify)rοΏ½itemοΏ½blockοΏ½timeoutοΏ½endtimeοΏ½	remainingrrrοΏ½putss&




z	Queue.putc	CsοΏ½|jοΏ½οΏ½|s|jοΏ½sοΏ½tοΏ½nn|dkr<xd|jοΏ½s8|jjοΏ½q$WnL|dkrNtdοΏ½οΏ½n:tοΏ½|}x.|jοΏ½sοΏ½|tοΏ½}|dkrxtοΏ½|jj|οΏ½qZW|jοΏ½}|jjοΏ½|SQRXdS)aRemove 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).
        Nrz''timeout' must be a non-negative numberg)	rr rrrr$οΏ½_getrr&)rr(r)r*r+r'rrrοΏ½getοΏ½s$





z	Queue.getcCs|j|ddοΏ½S)zοΏ½Put an item into the queue without blocking.

        Only enqueue the item if a free slot is immediately available.
        Otherwise raise the Full exception.
        F)r()r,)rr'rrrοΏ½
put_nowaitοΏ½szQueue.put_nowaitcCs|jddοΏ½S)zοΏ½Remove and return an item from the queue without blocking.

        Only get an item if one is immediately available. Otherwise
        raise the Empty exception.
        F)r()r.)rrrrοΏ½
get_nowaitοΏ½szQueue.get_nowaitcCstοΏ½|_dS)N)rοΏ½queue)rrrrrrοΏ½szQueue._initcCs
t|jοΏ½S)N)οΏ½lenr1)rrrrr οΏ½szQueue._qsizecCs|jj|οΏ½dS)N)r1οΏ½append)rr'rrrr%οΏ½sz
Queue._putcCs
|jjοΏ½S)N)r1οΏ½popleft)rrrrr-οΏ½sz
Queue._get)r)TN)TN)rrr
rrrrr!r"r#r,r.r/r0rr r%r-rrrrrs


 

c@s0eZdZdZddοΏ½ZddοΏ½ZddοΏ½Zdd	οΏ½Zd
S)r	zοΏ½Variant of Queue that retrieves open entries in priority order (lowest first).

    Entries are typically tuples of the form:  (priority number, data).
    cCs
g|_dS)N)r1)rrrrrrοΏ½szPriorityQueue._initcCs
t|jοΏ½S)N)r2r1)rrrrr οΏ½szPriorityQueue._qsizecCst|j|οΏ½dS)N)rr1)rr'rrrr%οΏ½szPriorityQueue._putcCs
t|jοΏ½S)N)rr1)rrrrr-οΏ½szPriorityQueue._getN)rrr
rrr r%r-rrrrr	οΏ½s
c@s0eZdZdZddοΏ½ZddοΏ½ZddοΏ½Zdd	οΏ½Zd
S)r
zBVariant of Queue that retrieves most recently added entries first.cCs
g|_dS)N)r1)rrrrrrοΏ½szLifoQueue._initcCs
t|jοΏ½S)N)r2r1)rrrrr οΏ½szLifoQueue._qsizecCs|jj|οΏ½dS)N)r1r3)rr'rrrr%οΏ½szLifoQueue._putcCs
|jjοΏ½S)N)r1οΏ½pop)rrrrr-οΏ½szLifoQueue._getN)rrr
rrr r%r-rrrrr
οΏ½s
)rrοΏ½ImportErrorZdummy_threadingοΏ½collectionsrοΏ½heapqrrr$rοΏ½__all__οΏ½	Exceptionrrrr	r
rrrrοΏ½<module>sB


πŸ“