@classmethod
def instance(cls, key, server):
    """Get an existing instance of the lock, if any, from server.active_locks,
        otherwise make a new one."""
    if key in server.active_locks:
        return server.active_locks[key]
    else:
        inst = cls(key, server)
        server.active_locks[key] = inst
        return inst
