MCPcopy Index your code
hub / github.com/easy-graph/Easy-Graph / update

Method update

easygraph/utils/mapped_queue.py:104–113  ·  view source on GitHub ↗

Replace an element in the queue with a new one.

(self, elt, new)

Source from the content-addressed store, hash-verified

102 return elt
103
104 def update(self, elt, new):
105 """Replace an element in the queue with a new one."""
106 # Replace
107 pos = self.d[elt]
108 self.h[pos] = new
109 del self.d[elt]
110 self.d[new] = pos
111 # Restore invariant by sifting up, then down
112 pos = self._siftup(pos)
113 self._siftdown(pos)
114
115 def remove(self, elt):
116 """Remove an element from the queue."""

Callers 15

to_easygraph_graphFunction · 0.80
from_dict_of_dictsFunction · 0.80
_relabel_copyFunction · 0.80
convert_graph_classFunction · 0.80
from_pyGraphviz_agraphFunction · 0.80
to_pyGraphviz_agraphFunction · 0.80
_lazy_compileMethod · 0.80
__call__Method · 0.80
from_pandas_edgelistFunction · 0.80
set_edge_attributesFunction · 0.80
set_node_attributesFunction · 0.80

Calls 2

_siftupMethod · 0.95
_siftdownMethod · 0.95

Tested by

no test coverage detected