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

Method write_context

demo/data/scripts/embedx_graph.py:174–180  ·  view source on GitHub ↗
(self, context_path)

Source from the content-addressed store, hash-verified

172 return stats
173
174 def write_context(self, context_path):
175 with open(context_path, 'w', encoding='utf-8') as fout:
176 for src_id in self.context.keys():
177 neighbor = self.context.find_neighbor(src_id)
178 neighbor_str = Context.get_neighbor_str(src_id, neighbor)
179 fout.write(neighbor_str)
180 fout.write("\n")
181
182 def write_node_feature(self, node_feature_path, group_config_path):
183 assert self.has_feature

Callers 1

runMethod · 0.80

Calls 3

keysMethod · 0.80
find_neighborMethod · 0.80
get_neighbor_strMethod · 0.80

Tested by

no test coverage detected