code: def ScanForStorageMediaImage(self, source_path_spec):
      
      try:
        type_indicators = analyzer.Analyzer.GetStorageMediaImageTypeIndicators(
            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:
        # The RAW storage media image type cannot be detected based on
        # a signature so we try to detect it based on common file naming schemas.
        file_system = resolver.Resolver.OpenFileSystem(
            source_path_spec, resolver_context=self._resolver_context)
        raw_path_spec = path_spec_factory.Factory.NewPathSpec(
            definitions.TYPE_INDICATOR_RAW, parent=source_path_spec)
  
        try:
          # The RAW glob function will raise a PathSpecError if the path
          # specification is unsuitable for globbing.
          glob_results = raw.RawGlobPathSpec(file_system, raw_path_spec)
        except errors.PathSpecError:
          glob_results = None
  
        file_system.Close()
  
        if not glob_results:
          return None
  
        return raw_path_spec
  
      if len(type_indicators) > 1:
        raise errors.BackEndError(
            'Unsupported source found more than one storage media image types.')
  
      return path_spec_factory.Factory.NewPathSpec(
          type_indicators[0], parent=source_path_spec)
docs: Scans the path specification for a supported storage media image format.
  
      Args:
        source_path_spec (PathSpec): source path specification.
  
      Returns:
        PathSpec: storage media image path specification or None if no supported
            storage media image type was found.
  
      Raises:
        BackEndError: if the source cannot be scanned or more than one storage
            media image type is found.