code: def check_permission_safety(path):
      
      f_stats = os.stat(path)
      return (f_stats.st_mode & (stat.S_IRWXG | stat.S_IRWXO)) == 0 and f_stats.st_uid == os.getuid()
docs: Check if the file at the given path is safe to use as a state file.
  
      This checks that group and others have no permissions on the file and that the current user is
      the owner.