<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
a
    XC?h,                     @   s   d dl Z d dlZd dlmZ d dlmZmZ d dlmZ zd dl	m
Z
 W n ey^   dZ
Y n0 g dZzd dl	mZ W n" ey   G dd	 d	eZY n0 G d
d deZG dd dZG dd deZG dd deZG dd dZe
du reZ
dS )    N)deque)heappushheappop)	monotonic)SimpleQueue)EmptyFullQueuePriorityQueue	LifoQueuer   )r   c                   @   s   e Zd ZdS )r   N__name__
__module____qualname__ r   r   */opt/alt/python39/lib64/python3.9/queue.pyr      s   r   c                   @   s   e Zd ZdS )r   Nr   r   r   r   r   r      s   r   c                   @   s   e Zd Zd ddZdd Zdd Zdd	 Zd
d Zdd Zd!ddZ	d"ddZ
dd Zdd Zdd Zdd Zdd Zdd ZeejZdS )#r	   r   c                 C   sN   || _ | | t | _t| j| _t| j| _t| j| _d| _	d S Nr   )
maxsize_init	threadingZLockmutexZ	Condition	not_emptynot_fullall_tasks_doneunfinished_tasksselfr   r   r   r   __init__"   s    

zQueue.__init__c                 C   s\   | j B | jd }|dkr4|dk r*td| j   || _W d    n1 sN0    Y  d S )N   r   z!task_done() called too many times)r   r   
ValueErrorZ
notify_all)r   Z
unfinishedr   r   r   	task_done9   s    

zQueue.task_donec                 C   s<   | j " | jr| j   qW d    n1 s.0    Y  d S N)r   r   waitr   r   r   r   joinO   s    	z
Queue.joinc                 C   s2   | j  |  W  d    S 1 s$0    Y  d S r!   r   _qsizer#   r   r   r   qsize\   s    zQueue.qsizec                 C   s4   | j  |   W  d    S 1 s&0    Y  d S r!   r%   r#   r   r   r   emptya   s    zQueue.emptyc                 C   sH   | j . d| j  k o |  kn  W  d    S 1 s:0    Y  d S r   )r   r   r&   r#   r   r   r   fullo   s    z
Queue.fullTNc                 C   s   | j  | jdkr|s*|  | jkrtnr|d u rN|  | jkr| j   q2nN|dk r`tdn<t | }|  | jkr|t  }|dkrt| j | qj| | |  jd7  _| j	
  W d    n1 s0    Y  d S )Nr   ''timeout' must be a non-negative number        r   )r   r   r&   r   r"   r   time_putr   r   notify)r   itemblocktimeoutendtime	remainingr   r   r   putz   s&    




z	Queue.putc                 C   s   | j  |s|  stnf|d u r8|  s| j   q"nH|dk rJtdn6t | }|  s|t  }|dkrrt| j | qT|  }| j  |W  d    S 1 s0    Y  d S )Nr   r*   r+   )	r   r&   r   r"   r   r,   _getr   r.   )r   r0   r1   r2   r3   r/   r   r   r   get   s$    



z	Queue.getc                 C   s   | j |ddS NF)r0   r4   r   r/   r   r   r   
put_nowait   s    zQueue.put_nowaitc                 C   s   | j ddS r7   r6   r#   r   r   r   
get_nowait   s    zQueue.get_nowaitc                 C   s   t  | _d S r!   )r   queuer   r   r   r   r      s    zQueue._initc                 C   s
   t | jS r!   lenr=   r#   r   r   r   r&      s    zQueue._qsizec                 C   s   | j | d S r!   r=   appendr9   r   r   r   r-      s    z
Queue._putc                 C   s
   | j  S r!   )r=   popleftr#   r   r   r   r5      s    z
Queue._get)r   )TN)TN)r   r   r   r   r    r$   r'   r(   r)   r4   r6   r:   r<   r   r&   r-   r5   classmethodtypesGenericAlias__class_getitem__r   r   r   r   r	      s   

 
r	   c                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
r
   c                 C   s
   g | _ d S r!   r=   r   r   r   r   r      s    zPriorityQueue._initc                 C   s
   t | jS r!   r>   r#   r   r   r   r&      s    zPriorityQueue._qsizec                 C   s   t | j| d S r!   )r   r=   r9   r   r   r   r-      s    zPriorityQueue._putc                 C   s
   t | jS r!   )r   r=   r#   r   r   r   r5      s    zPriorityQueue._getNr   r   r   r   r&   r-   r5   r   r   r   r   r
      s   r
   c                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
r   c                 C   s
   g | _ d S r!   rG   r   r   r   r   r      s    zLifoQueue._initc                 C   s
   t | jS r!   r>   r#   r   r   r   r&      s    zLifoQueue._qsizec                 C   s   | j | d S r!   r@   r9   r   r   r   r-      s    zLifoQueue._putc                 C   s
   | j  S r!   )r=   popr#   r   r   r   r5      s    zLifoQueue._getNrH   r   r   r   r   r      s   r   c                   @   sR   e Zd Zdd ZdddZdddZd	d
 Zdd Zdd Zdd Z	e
ejZdS )_PySimpleQueuec                 C   s   t  | _td| _d S r   )r   _queuer   Z	Semaphore_countr#   r   r   r   r     s    z_PySimpleQueue.__init__TNc                 C   s   | j | | j  d S r!   )rK   rA   rL   release)r   r/   r0   r1   r   r   r   r4     s    z_PySimpleQueue.putc                 C   s4   |d ur|dk rt d| j||s*t| j S )Nr   r*   )r   rL   acquirer   rK   rB   )r   r0   r1   r   r   r   r6     s
    z_PySimpleQueue.getc                 C   s   | j |ddS r7   r8   r9   r   r   r   r:   *  s    z_PySimpleQueue.put_nowaitc                 C   s   | j ddS r7   r;   r#   r   r   r   r<   2  s    z_PySimpleQueue.get_nowaitc                 C   s   t | jdkS r   r?   rK   r#   r   r   r   r(   :  s    z_PySimpleQueue.emptyc                 C   s
   t | jS r!   rO   r#   r   r   r   r'   >  s    z_PySimpleQueue.qsize)TN)TN)r   r   r   r   r4   r6   r:   r<   r(   r'   rC   rD   rE   rF   r   r   r   r   rJ     s   

	
rJ   )r   rD   collectionsr   heapqr   r   r,   r   rK   r   ImportError__all__r   	Exceptionr   r	   r
   r   rJ   r   r   r   r   <module>   s*   
 DC