-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
35 lines (22 loc) · 922 Bytes
/
main.py
File metadata and controls
35 lines (22 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from dependency_analyzer import ETSDependencyAnalyzer
from topo_sort import SimpleTopologicalSorter
from generate_api_dataset import APICodeDataGenerator
from generate_dataset import CodeDataGenerator
import os
from tqdm import tqdm
def main():
file = os.listdir("../harmony_base_code")
# print(file)
for f in tqdm(file):
if os.path.isdir(os.path.join("../harmony_base_code", f)):
path = os.path.join("../harmony_base_code", f)
# print(path)
analyzer = ETSDependencyAnalyzer(path)
analyzer.analyze_project()
metainfo_path = analyzer.export_dataset()
topo_sorter = SimpleTopologicalSorter(metainfo_path)
topo_path = topo_sorter.export_topological_sort()
generator = CodeDataGenerator(metainfo_path, topo_path)
generator.generate_data()
if __name__ == "__main__":
main()