code: def _CreateSanitizedDestination(
        self, source_file_entry, source_path_spec, source_data_stream_name,
        destination_path):
      
      file_system = source_file_entry.GetFileSystem()
      path = getattr(source_path_spec, 'location', None)
      path_segments = file_system.SplitPath(path)
  
      # Sanitize each path segment.
      for index, path_segment in enumerate(path_segments):
        path_segments[index] = ''.join([
            character if character not in self._DIRTY_CHARACTERS else '_'
            for character in path_segment])
  
      target_filename = path_segments.pop()
  
      parent_path_spec = getattr(source_file_entry.path_spec, 'parent', None)
  
      while parent_path_spec:
        if parent_path_spec.type_indicator == (
            dfvfs_definitions.TYPE_INDICATOR_TSK_PARTITION):
          path_segments.insert(0, parent_path_spec.location[1:])
          break
  
        elif parent_path_spec.type_indicator == (
            dfvfs_definitions.TYPE_INDICATOR_VSHADOW):
          path_segments.insert(0, parent_path_spec.location[1:])
  
        parent_path_spec = getattr(parent_path_spec, 'parent', None)
  
      target_directory = os.path.join(destination_path, *path_segments)
  
      if source_data_stream_name:
        target_filename = '{0:s}_{1:s}'.format(
            target_filename, source_data_stream_name)
  
      return target_directory, target_filename
docs: Creates a sanitized path of both destination directory and filename.
  
      This function replaces non-printable and other characters defined in
       _DIRTY_CHARACTERS with an underscore "_".
  
      Args:
        source_file_entry (dfvfs.FileEntry): file entry of the source file.
        source_path_spec (dfvfs.PathSpec): path specification of the source file.
        source_data_stream_name (str): name of the data stream of the source file
            entry.
        destination_path (str): path of the destination directory.
  
      Returns:
        tuple[str, str]: sanitized paths of both destination directory and
            filename.