MCPcopy Create free account
hub / github.com/alibaba/graph-learn / gen_cond_node

Function gen_cond_node

graphlearn/python/tests/utils.py:174–188  ·  view source on GitHub ↗
(node_type)

Source from the content-addressed store, hash-verified

172
173
174def gen_cond_node(node_type):
175 def write_meta(f):
176 meta = 'id:int64\tweight:float\tfeature:string\n'
177 f.write(meta)
178
179 def write_data(f):
180 for i in range(200):
181 line = '%d\t%f\t%d:%d:%f:%s\n' % (i, i * 0.1, i % 5, i % 4, i * 0.3, str(i%3))
182 f.write(line)
183
184 path = '%s/%s_%d' % (DATA_PATH, node_type, int(time.time() * 1000))
185 with open(path, 'w') as f:
186 write_meta(f)
187 write_data(f)
188 return path
189
190
191def check_node_ids(nodes, ids):

Callers

nothing calls this directly

Calls 2

write_metaFunction · 0.85
write_dataFunction · 0.85

Tested by

no test coverage detected