code: def _GetHashes(self, target_queue, max_hashes):
      
      hashes = []
      for _ in range(0, max_hashes):
        try:
          item = target_queue.get_nowait()
        except Queue.Empty:
          continue
        hashes.append(item)
      return hashes
docs: Retrieves a list of items from a queue.
  
      Args:
        target_queue (Queue.queue): queue to retrieve hashes from.
        max_hashes (int): maximum number of items to retrieve from the
            target_queue.
  
      Returns:
        list[object]: list of at most max_hashes elements from the target_queue.
            The list may have no elements if the target_queue is empty.