Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
3 \L"ã @s¶dZy ddlZWnek r,ddlZYnXddlmZddlmZmZddl m Z dddd d gZ Gd d„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)r r r rrrrrrsc@s†eZdZdZd!dd„Zdd„Zdd„Zd d „Zd d „Zd d„Z d"dd„Z d#dd„Z dd„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ÚqsizeUsz Queue.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ÚemptyZs z Queue.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|dkrs   B