code: def get_lock(self, path):
          
          if self.lockfile:
              return self.lockfile.LockFile(path)
          else:
              with self.job_locks_lock:
                  if path not in self.job_locks:
                      lock = threading.Lock()
                      self.job_locks[path] = lock
                  else:
                      lock = self.job_locks[path]
              return lock
docs: Get a job lock corresponding to the path - assumes parent
          directory exists but the file itself does not.