class_docstr: A priority queue implementation.
  
  This is an implemented of a priority queue using a heap implemtnation. It
  has O(log n) time for adding and popping elements but constant time
  deletion. It is based off of the implementation that is provided at
  
  https://docs.python.org/2/library/heapq.html
  
  This implementation assumes that the items with the highest priority
  are the ones with the lowest "weight" that gets passed in. If higher
  weights are supposed to correspond to higher priority, consider reversing
  the sign of the weight.
  
  Parameters
  ----------
  None
  
  Attributes
  ----------
  pq : list
      A list containing the heapified priority queue.
  
  lookup : dict
      A dictionary containing links to each of the elements, allowing
      constant time lookups and deletions.
class_docstr_tok: ["A","priority","queue","implementation",".","This","is","an","implemented","of","a","priority","queue","using","a","heap","implemtnation",".","It","has","O","(","log","n",")","time","for","adding","and","popping","elements","but","constant","time","deletion",".","It","is","based","off","of","the","implementation","that","is","provided","at","https",":","\/\/docs.python.org\/2\/library\/heapq.html","This","implementation","assumes","that","the","items","with","the","highest","priority","are","the","ones","with","the","lowest","``","weight","''","that","gets","passed","in",".","If","higher","weights","are","supposed","to","correspond","to","higher","priority",",","consider","reversing","the","sign","of","the","weight",".","Parameters","--","--","--","--","--","None","Attributes","--","--","--","--","--","pq",":","list","A","list","containing","the","heapified","priority","queue",".","lookup",":","dict","A","dictionary","containing","links","to","each","of","the","elements",",","allowing","constant","time","lookups","and","deletions","."]
docstr: Peek at the first element in the priority queue.
  
  Parameters
  ----------
  None
  
  Returns
  -------
  weight : double
      The weight of the element as passed in in the `add` method
  
  item : object
      The item that was passed in in the `add` method
docstr_tok: ["Peek","at","the","first","element","in","the","priority","queue",".","Parameters","--","--","--","--","--","None","Returns","--","--","--","-","weight",":","double","The","weight","of","the","element","as","passed","in","in","the","`","add","`","method","item",":","object","The","item","that","was","passed","in","in","the","`","add","`","method"]
code: def peek(self):
      """Peek at the first element in the priority queue.
  
      Parameters
      ----------
      None
  
      Returns
      -------
      weight : double
          The weight of the element as passed in in the `add` method
  
      item : object
          The item that was passed in in the `add` method
      """
  
      return self.pq[0][0], self.pq[0][2]
  
file_path: apricot/apricot/utils.py
imports: import numbers
  import numpy
  import itertools
  from heapq import heappush
  from heapq import heappop
  from heapq import heapify
  from heapq import heapreplace
  from scipy.sparse import csr_matrix
  from sklearn.metrics import pairwise_distances
  from sklearn.neighbors import KNeighborsTransformer
label_desc: Use image node_id 4 for calling the PriorityQueue obj's underlying member method code with example usage: obj.peek() and returns: self,  self