download_prepare.sh 691 Bytes
Newer Older
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
#!/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

# change to extracted directory
cd py150

# convert ast to bracket notation
python ../parse_json.py --inputfile python100k_train.json > python_ast.bracket

# convert ast to bracket notation
python ../parse_json.py --inputfile python50k_eval.json >> python_ast.bracket

# sort the trees ascending by their size
../sort_dataset.sh python_ast.bracket