download_prepare.sh 645 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/bash
# file: download_prepare.sh
#
# Program: Downloads and prepares data containing abstract syntax trees 
# from python programs. (https://www.sri.inf.ethz.ch/py150)
#
# Author: Thomas Huetter

# download abstract syntax trees
wget http://files.srl.inf.ethz.ch/data/py150.tar.gz

# extract abstract syntax trees
tar -xzf py150.tar.gz

# convert ast to bracket notation
Thomas Huetter's avatar
Thomas Huetter committed
16
python3 parse_json.py --inputfile python100k_train.json > python_ast.bracket
17 18

# convert ast to bracket notation
Thomas Huetter's avatar
Thomas Huetter committed
19
python3 parse_json.py --inputfile python50k_eval.json >> python_ast.bracket
20 21

# sort the trees ascending by their size
Thomas Huetter's avatar
Thomas Huetter committed
22
./sort_dataset.sh python_ast.bracket