(self, convert_dir, out_dir)
| 78 | mutag_zip.extractall(out_dir) |
| 79 | |
| 80 | def convert2json(self, convert_dir, out_dir): |
| 81 | prefix = os.path.join(self.data_dir, 'MUTAG_') |
| 82 | adj_list = read_adj(prefix + 'A.txt') |
| 83 | graph_indicator = read_graph_indicator(prefix + 'graph_indicator.txt') |
| 84 | graph_label = read_graph_label(prefix + 'graph_labels.txt') |
| 85 | node_label = read_node_label(prefix + 'node_labels.txt') |
| 86 | self.generate_index_meta() |
| 87 | with open(out_dir, 'w') as out: |
| 88 | out.write(gen_graph_json(adj_list, graph_indicator, |
| 89 | graph_label, node_label)) |
| 90 | with open(self.id_file, 'w') as id_out: |
| 91 | start_idx = int(self.total_size * self.train_rate) |
| 92 | for i in range(start_idx, self.total_size): |
| 93 | id_out.write(str(i) + '\n') |
nothing calls this directly
no test coverage detected