code: def _lock(self):
      
      lockfile = '{}.lock'.format(self._get_cookie_file())
      safe_mkdir_for(lockfile)
      return OwnerPrintingInterProcessFileLock(lockfile)
docs: An identity-keyed inter-process lock around the cookie file.