code: def ScanForVolumeSystem(self, source_path_spec):
      
      if source_path_spec.type_indicator == definitions.TYPE_INDICATOR_VSHADOW:
        # It is technically possible to scan for VSS-in-VSS but makes no sense
        # to do so.
        return None
  
      if source_path_spec.IsVolumeSystemRoot():
        return source_path_spec
  
      if source_path_spec.type_indicator == (
          definitions.TYPE_INDICATOR_APFS_CONTAINER):
        # TODO: consider changes this when upstream changes have been made.
        # Currently pyfsapfs does not support reading from a volume as a device.
        # Also see: https://github.com/log2timeline/dfvfs/issues/332
        return None
  
      try:
        type_indicators = analyzer.Analyzer.GetVolumeSystemTypeIndicators(
            source_path_spec, resolver_context=self._resolver_context)
      except (IOError, RuntimeError) as exception:
        raise errors.BackEndError((
            'Unable to process source path specification with error: '
            '{0!s}').format(exception))
  
      if not type_indicators:
        return None
  
      if len(type_indicators) > 1:
        raise errors.BackEndError(
            'Unsupported source found more than one volume system types.')
  
      if (type_indicators[0] == definitions.TYPE_INDICATOR_TSK_PARTITION and
          source_path_spec.type_indicator in [
              definitions.TYPE_INDICATOR_TSK_PARTITION]):
        return None
  
      if type_indicators[0] in definitions.VOLUME_SYSTEM_TYPE_INDICATORS:
        return path_spec_factory.Factory.NewPathSpec(
            type_indicators[0], location='/', parent=source_path_spec)
  
      return path_spec_factory.Factory.NewPathSpec(
          type_indicators[0], parent=source_path_spec)
docs: Scans the path specification for a supported volume system format.
  
      Args:
        source_path_spec (PathSpec): source path specification.
  
      Returns:
        PathSpec: volume system path specification or None if no supported volume
            system type was found.
  
      Raises:
        BackEndError: if the source cannot be scanned or more than one volume
            system type is found.