MCPcopy Create free account
hub / github.com/Tencent/embedx / __build_node_id_map

Method __build_node_id_map

demo/data/scripts/dataset.py:143–157  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

141 return edges
142
143 def __build_node_id_map(self):
144 node_id_map = {}
145 node_id = 0
146 for node, _, __ in self.node_label_feature:
147 if node not in node_id_map:
148 node_id_map[node] = node_id
149 node_id += 1
150 for src_node, dst_node in self.edges:
151 if src_node not in node_id_map:
152 node_id_map[src_node] = node_id
153 node_id += 1
154 if dst_node not in node_id_map:
155 node_id_map[dst_node] = node_id
156 node_id += 1
157 return node_id_map
158
159
160class PPIDataset(Dataset):

Callers 1

to_nx_graphMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected