class_docstr: This proxy class separates the heap element from its priority.
  
  The idea is that using a 2-tuple (priority, element) works
  for sorting, but not for dict lookup because priorities are
  often floating point values so round-off can mess up equality.
  
  So, we need inequalities to look at the priority (for sorting)
  and equality (and hash) to look at the element to enable
  updates to the priority.
  
  Unfortunately, this class can be tricky to work with if you forget that
  `__lt__` compares the priority while `__eq__` compares the element.
  In `greedy_modularity_communities()` the following code is
  used to check that two _HeapElements differ in either element or priority:
  
      if d_oldmax != row_max or d_oldmax.priority != row_max.priority:
  
  If the priorities are the same, this implementation uses the element
  as a tiebreaker. This provides compatibility with older systems that
  use tuples to combine priority and elements.
class_docstr_tok: ["This","proxy","class","separates","the","heap","element","from","its","priority",".","The","idea","is","that","using","a","2-tuple","(","priority",",","element",")","works","for","sorting",",","but","not","for","dict","lookup","because","priorities","are","often","floating","point","values","so","round-off","can","mess","up","equality",".","So",",","we","need","inequalities","to","look","at","the","priority","(","for","sorting",")","and","equality","(","and","hash",")","to","look","at","the","element","to","enable","updates","to","the","priority",".","Unfortunately",",","this","class","can","be","tricky","to","work","with","if","you","forget","that","`","__lt__","`","compares","the","priority","while","`","__eq__","`","compares","the","element",".","In","`","greedy_modularity_communities","(",")","`","the","following","code","is","used","to","check","that","two","_HeapElements","differ","in","either","element","or","priority",":","if","d_oldmax","!","=","row_max","or","d_oldmax.priority","!","=","row_max.priority",":","If","the","priorities","are","the","same",",","this","implementation","uses","the","element","as","a","tiebreaker",".","This","provides","compatibility","with","older","systems","that","use","tuples","to","combine","priority","and","elements","."]
code: def __getitem__(self, indx):
      return self.priority if indx == 0 else self.element[indx - 1]
  
file_path: networkx/networkx/utils/mapped_queue.py
imports: import heapq
label_desc: Use image node_id 6 for calling the _HeapElement obj's underlying member method code with example usage: obj.__getitem__(indx) and returns: unknown