Mining Natural APIs from Large Code Corpora using a Mixture of Hidden Markov Models