docstr: Initialize a queue object with a given maximum size.
  
  If `maxsize` is <= 0, the queue size is infinite.
  
  If `use_lifo` is True, this Queue acts like a Stack (LIFO).
docstr_tok: ["Initialize","a","queue","object","with","a","given","maximum","size",".","If","`","maxsize","`","is","<","=","0",",","the","queue","size","is","infinite",".","If","`","use_lifo","`","is","True",",","this","Queue","acts","like","a","Stack","(","LIFO",")","."]
code: def __init__(self, maxsize: int = 0, use_lifo: bool = False):
      """Initialize a queue object with a given maximum size.
  
      If `maxsize` is <= 0, the queue size is infinite.
  
      If `use_lifo` is True, this Queue acts like a Stack (LIFO).
      """
  
      self._init(maxsize)
      # mutex must be held whenever the queue is mutating.  All methods
      # that acquire mutex must release it before returning.  mutex
      # is shared between the two conditions, so acquiring and
      # releasing the conditions also acquires and releases mutex.
      self.mutex = threading.RLock()
      # Notify not_empty whenever an item is added to the queue; a
      # thread waiting to get is notified then.
      self.not_empty = threading.Condition(self.mutex)
      # Notify not_full whenever an item is removed from the queue;
      # a thread waiting to put is notified then.
      self.not_full = threading.Condition(self.mutex)
      # If this queue uses LIFO or FIFO
      self.use_lifo = use_lifo
  
imports: from __future__ import annotations
  import asyncio
  from collections import deque
  import threading
  from time import time
  from typing import Any
  from typing import Deque
  from typing import Generic
  from typing import Optional
  from typing import TypeVar
  from .concurrency import await_
  from .langhelpers import memoized_property
label_desc: Use image node_id 1 to create a new Queue object from inherited base classes: QueueCommon with example: obj = Queue(maxsize, use_lifo)