Imported from https://github.com/networkinference/ESL