code: def GetParentFileEntry(self):
      
      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_file_reference = None
      mft_attribute = getattr(self.path_spec, 'mft_attribute', None)
      if mft_attribute is not None:
        parent_file_reference = (
            self._fsntfs_file_entry.get_parent_file_reference_by_attribute_index(
                mft_attribute))
      else:
        parent_file_reference = (
            self._fsntfs_file_entry.get_parent_file_reference())
  
      if parent_file_reference is None:
        return None
  
      parent_mft_entry = (
          parent_file_reference & _FILE_REFERENCE_MFT_ENTRY_BITMASK)
  
      parent_path_spec = getattr(self.path_spec, 'parent', None)
      # TODO: determine and pass the mft_attribute of the parent
      # for a faster resolve of the file entry.
      path_spec = ntfs_path_spec.NTFSPathSpec(
          location=parent_location, mft_entry=parent_mft_entry,
          parent=parent_path_spec)
  
      # TODO: handle parent correctly use attribute index?
      is_root = bool(
          parent_location == self._file_system.LOCATION_ROOT or
          parent_mft_entry == self._file_system.MFT_ENTRY_ROOT_DIRECTORY)
  
      return NTFSFileEntry(
          self._resolver_context, self._file_system, path_spec, is_root=is_root)
docs: Retrieves the parent file entry.
  
      Returns:
        NTFSFileEntry: parent file entry or None if not available.