MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / relabel_nodes

Function relabel_nodes

easygraph/utils/relabel.py:7–12  ·  view source on GitHub ↗
(G, mapping)

Source from the content-addressed store, hash-verified

5
6
7def relabel_nodes(G, mapping):
8 if not hasattr(mapping, "__getitem__"):
9 m = {n: mapping(n) for n in G}
10 else:
11 m = mapping
12 return _relabel_copy(G, m)
13
14
15def _relabel_copy(G, mapping):

Callers 1

Calls 1

_relabel_copyFunction · 0.85

Tested by

no test coverage detected