code: def PreprocessSources(
        self, artifacts_registry_object, source_path_specs,
        resolver_context=None):
      
      detected_operating_systems = []
      for source_path_spec in source_path_specs:
        try:
          file_system, mount_point = self.GetSourceFileSystem(
              source_path_spec, resolver_context=resolver_context)
        except (RuntimeError, dfvfs_errors.BackEndError) as exception:
          logger.error(exception)
          continue
  
        try:
          searcher = file_system_searcher.FileSystemSearcher(
              file_system, mount_point)
  
          operating_system = self._DetermineOperatingSystem(searcher)
          if operating_system != definitions.OPERATING_SYSTEM_FAMILY_UNKNOWN:
            preprocess_manager.PreprocessPluginsManager.RunPlugins(
                artifacts_registry_object, file_system, mount_point,
                self.knowledge_base)
  
            detected_operating_systems.append(operating_system)
  
        finally:
          file_system.Close()
  
      if detected_operating_systems:
        logger.info('Preprocessing detected operating systems: {0:s}'.format(
            ', '.join(detected_operating_systems)))
        self.knowledge_base.SetValue(
            'operating_system', detected_operating_systems[0])
docs: Preprocesses the sources.
  
      Args:
        artifacts_registry_object (artifacts.ArtifactDefinitionsRegistry):
            artifact definitions registry.
        source_path_specs (list[dfvfs.PathSpec]): path specifications of
            the sources to process.
        resolver_context (Optional[dfvfs.Context]): resolver context.