def is_private(path):
    if not os.path.exists(path):
        return True  # Nonexistent file is secure ;-)

    if sys.platform == 'win32':  #pragma no cover
        if not HAVE_PYWIN32:
            return False  # No way to know.

        # Find the SIDs for user and system.
        username = win32api.GetUserNameEx(win32con.NameSamCompatible)

        # Map Cygwin 'root' to 'Administrator'. Typically these are intended
        # to be identical, but /etc/passwd might configure them differently.
        if username.endswith('\\root'):
            username = username.replace('\\root', '\\Administrator')
        user, domain, type = win32security.LookupAccountName('', username)
        system, domain, type = win32security.LookupAccountName('', 'System')

        # Find the DACL part of the Security Descriptor for the file
        sd = win32security.GetFileSecurity(path,
                                        win32security.DACL_SECURITY_INFORMATION)
        dacl = sd.GetSecurityDescriptorDacl()
        if dacl is None:
            logging.warning('is_private: No DACL for %r', path)
            return False  # Happened on a user's XP system.

        # Verify the DACL contains just the two entries we expect.
        count = dacl.GetAceCount()
        if count != 2:
            return False
        for i in range(count):
            ace = dacl.GetAce(i)
            if ace[2] != user and ace[2] != system:
                return False
        return True
    else:
        return (os.stat(path).st_mode & 0077) == 0
Get the cache record for a set of parameters
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.util/src/openmdao/util/publickey.py/is_private--crossover with--dataset/ETHPy150Open hydroshare/hydroshare2/ga_ows/views/wms/base.py/WMSAdapterBase.get_cache_record