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

Function write_data

graphlearn/python/tests/utils.py:56–66  ·  view source on GitHub ↗
(f, value, schema)

Source from the content-addressed store, hash-verified

54 f.write(meta)
55
56 def write_data(f, value, schema):
57 line = '%d' % value
58 if WEIGHTED in schema:
59 line = '%s\t%f' % (line, value / 10.0)
60 if LABELED in schema:
61 line = '%s\t%d' % (line, value)
62 if ATTRIBUTED in schema:
63 attr = '%d:%f:%d:%s' % (value, value / 1.0, value, 'hehe')
64 line = '%s\t%s' % (line, attr)
65 line += '\n'
66 f.write(line)
67
68 path = '%s/%s_%d_%s' % (DATA_PATH, id_type, int(time.time() * 1000), mask)
69 with open(path, 'w') as f:

Callers 8

gen_userMethod · 0.85
gen_itemMethod · 0.85
gen_edgeMethod · 0.85
gen_node_dataFunction · 0.85
gen_edge_dataFunction · 0.85
gen_entity_nodeFunction · 0.85
gen_relation_edgeFunction · 0.85
gen_cond_nodeFunction · 0.85

Calls

no outgoing calls

Tested by 3

gen_userMethod · 0.68
gen_itemMethod · 0.68
gen_edgeMethod · 0.68