I left this here intentionally; at some point lock.py needs to be refactored. I can explain in more detail if it's necessary.