'Create a lock for a key, if necessary, and return a lock object.'

def _get_lock(self, key):

    if (key not in self._locks):
        self._locks[key] = Lock(self._lock_path(key))
    return self._locks[key]
