code: def put(self, item, block=True, timeout=None, size=None):
          
          if size is None:
              size = 1
          with self._lock:
              priority = self._get_item_priority(item)
              while self._size + size > self.maxsize > 0:
                  if not block:
                      raise QueueFull
                  if not self._notfull.wait_for(lambda: self._size+size <= self.maxsize, timeout):
                      raise QueueFull
              heapq.heappush(self._heap, (priority, size, item))
              self._size += size
              self._unfinished_tasks += 1
              self._notempty.notify()
docs: Put *item* into the queue.
  
          If the queue is currently full and *block* is True (the default), then
          wait up to *timeout* seconds for space to become available. If no
          timeout is specified, then wait indefinitely.
  
          If the queue is full and *block* is False or a timeout occurs, then
          raise a :class:`QueueFull` exception.
  
          The optional *size* argument may be used to specify a custom size for
          the item. The total :meth:`qsize` of the queue is the sum of the sizes
          of all the items. The default size for an item is 1.