A thread-safe Python query cacher using the Borg design pattern