On top of Typilus, this repository can be used to generate augmented ASTs that were used in Typilus.
The graphs contain the following edges:
CHILD
– AST edgesNEXT
– edges connecting subsequent tokens in codeNEXT_USE
– next usage of a variableLAST_LEXICAL_USE
– previous usage of a variableOCCURRENCES_OF
– edges between occurrences of the same variableSUBTOKEN_OF
– edges from subtokens to their originCOMPUTED_FROM
– edges that point to the origins of a variableRETURNS_TO
– edges from return/yield statements to the function definition
Currently, there are no CFG edges.
- Go to
src/data_preparation/scripts
- Install dependencies with
pip install -r requirements.txt
- Run
python -m graph_generator.run -i {input_dir} -o {output_dir}
- You can select output format with
-f {format}
. Currently,dot
andjsonl_gz
are supported - To explore graphs you can use
prettyprint_graph
insrc/data_preparation/scripts/graph_generator/graphgenutils.py
A deep learning algorithm for predicting types in Python. Please find a preprint here.
This repository contains its implementation (src/
) and experiments (exp/
).
Please cite as:
@inproceedings{allamanis2020typilus,
title={Typilus: Neural Type Hints},
author={Allamanis, Miltiadis and Barr, Earl T and Ducousso, Soline and Gao, Zheng},
booktitle={PLDI},
year={2020}
}