Imported from https://github.com/neurodata/LOL