python implementation of locality sensitive.