code: def _GetTSKPartitionIdentifiers(self, scan_node):
      
      if not scan_node or not scan_node.path_spec:
        raise errors.SourceScannerError('Invalid scan node.')
  
      volume_system = tsk_volume_system.TSKVolumeSystem()
      volume_system.Open(scan_node.path_spec)
  
      volume_identifiers = self._source_scanner.GetVolumeIdentifiers(
          volume_system)
      if not volume_identifiers:
        return []
  
      # TODO: refactor self._partitions to use scan options.
      if self._partitions:
        if self._partitions == 'all':
          partitions = range(1, volume_system.number_of_volumes + 1)
        else:
          partitions = self._partitions
  
        selected_volume_identifiers = self._NormalizedVolumeIdentifiers(
            volume_system, partitions, prefix='p')
  
        if not set(selected_volume_identifiers).difference(volume_identifiers):
          return selected_volume_identifiers
  
      if len(volume_identifiers) == 1:
        return volume_identifiers
  
      try:
        volume_identifiers = self._PromptUserForPartitionIdentifiers(
            volume_system, volume_identifiers)
      except KeyboardInterrupt:
        raise errors.UserAbort('File system scan aborted.')
  
      return self._NormalizedVolumeIdentifiers(
          volume_system, volume_identifiers, prefix='p')
docs: Determines the TSK partition identifiers.
  
      This method first checks for the preferred partition number, then
      falls back to prompt the user if no usable preferences were specified.
  
      Args:
        scan_node (dfvfs.SourceScanNode): scan node.
  
      Returns:
        list[str]: TSK partition identifiers.
  
      Raises:
        RuntimeError: if the volume for a specific identifier cannot be
            retrieved.
        SourceScannerError: if the format of or within the source
            is not supported or the the scan node is invalid.