def _revalidate_node_edges(rag, node, heap_list):
 for nbr in rag.neighbors(node):
  data = rag[node][nbr]
  try:
   data['heap item'][3] = False
   _invalidate_edge(rag, node, nbr)
  except KeyError:
   pass
  wt = data['weight']
  heap_item = [wt, node, nbr, True]
  data['heap item'] = heap_item
  heapq.heappush(heap_list, heap_item)

def _revalidate_node_edges ( rag , node , heap_list ) : for nbr in rag . neighbors ( node ) : data = rag [ node ] [ nbr ] try : data [ 'heap item' ] [ 3 ] = False _invalidate_edge ( rag , node , nbr ) except KeyError : pass wt = data [ 'weight' ] heap_item = [ wt , node , nbr , True ] data [ 'heap item' ] = heap_item heapq . heappush ( heap_list , heap_item )
handles validation and invalidation of edges incident to a node .