Python port of Groupon's locality-uuid.java (https://github.com/groupon/locality-uuid.java)