code: def GetParentFileEntry(self):
      
      parent_location = None
  
      location = getattr(self.path_spec, 'location', None)
      if location is not None:
        parent_location = self._file_system.DirnamePath(location)
        if parent_location == '':
          parent_location = self._file_system.PATH_SEPARATOR
  
      parent_identifier = self._fsapfs_file_entry.parent_identifier
      if parent_identifier is None:
        return None
  
      parent_path_spec = getattr(self.path_spec, 'parent', None)
      path_spec = apfs_path_spec.APFSPathSpec(
          location=parent_location, identifier=parent_identifier,
          parent=parent_path_spec)
  
      is_root = bool(
          parent_location == self._file_system.LOCATION_ROOT or
          parent_identifier == self._file_system.ROOT_DIRECTORY_IDENTIFIER)
  
      return APFSFileEntry(
          self._resolver_context, self._file_system, path_spec, is_root=is_root)
docs: Retrieves the parent file entry.
  
      Returns:
        APFSFileEntry: parent file entry or None if not available.