<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ScanForFileSystem(self, source_path_spec):
 """Scans the path specification for a supported file system format. Args: source_path_spec (PathSpec):
 source path specification. Returns: PathSpec: file system path specification or None if no supported file system type was found. Raises: BackEndError: if the source cannot be scanned or more than one file system type is found. """

    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 path_spec_factory.Factory.NewPathSpec(
          definitions.TYPE_INDICATOR_APFS, location='/',
          parent=source_path_spec)

    try:
      type_indicators = analyzer.Analyzer.GetFileSystemTypeIndicators(
          source_path_spec, resolver_context=self._resolver_context)
    except RuntimeError as exception:
      raise errors.BackEndError((
          'Unable to process source path specification with error: '
          '{0!s}').format(exception))

    if not type_indicators:
      return None

    type_indicator = type_indicators[0]
    if len(type_indicators) > 1:
      if definitions.PREFERRED_NTFS_BACK_END not in type_indicators:
        raise errors.BackEndError(
            'Unsupported source found more than one file system types.')

      type_indicator = definitions.PREFERRED_NTFS_BACK_END

    # TODO: determine root location from file system or path specification.
    if type_indicator == definitions.TYPE_INDICATOR_NTFS:
      root_location = '\\'
    else:
      root_location = '/'

    file_system_path_spec = path_spec_factory.Factory.NewPathSpec(
        type_indicator, location=root_location, parent=source_path_spec)

    if type_indicator == definitions.TYPE_INDICATOR_TSK:
      # Check if the file system can be opened since the file system by
      # signature detection results in false positives.
      try:
        file_system = resolver.Resolver.OpenFileSystem(
            file_system_path_spec, resolver_context=self._resolver_context)
        file_system.Close()
      except errors.BackEndError:
        file_system_path_spec = None

    return file_system_path_spec