class_docstr: A binary heap.
class_docstr_tok: ["A","binary","heap","."]
code: def min(self):
      dict = self._dict
      if not dict:
          raise nx.NetworkXError("heap is empty")
      heap = self._heap
      pop = heappop
      # Repeatedly remove stale key-value pairs until a up-to-date one is
      # met.
      while True:
          value, _, key = heap[0]
          if key in dict and value == dict[key]:
              break
          pop(heap)
      return (key, value)
  
imports: from heapq import heappop, heappush
  from itertools import count
  import networkx
label_desc: Use image node_id 2 for calling the BinaryHeap obj's underlying member method code with example usage: obj.min() and returns: key,  value