code: def acquire(self):
          
  
          pid_file = os.open(self.pid_filename, os.O_CREAT | os.O_EXCL | os.O_RDWR)
          os.write(pid_file, str(os.getpid()).encode('utf-8'))
          os.close(pid_file)
  
          if hasattr(os, 'symlink') and platform.system() != 'Windows':
              os.symlink(self.pid_filename, self.lock_filename)
          else:
              # Windows platforms doesn't support symlinks, at least not through the os API
              self.lock_filename = self.pid_filename
docs: Create a pid filename and create a symlink (the actual lock file)
          across platforms that points to it. Symlink is used because it's an
          atomic operation across platforms.