code: def RegisterPlugin(cls, plugin_class):
      
      name = getattr(
          plugin_class, 'ARTIFACT_DEFINITION_NAME', plugin_class.__name__)
      name = name.lower()
      if name in cls._plugins:
        raise KeyError(
            'Artifact plugin class already set for name: {0:s}.'.format(name))
  
      preprocess_plugin = plugin_class()
  
      cls._plugins[name] = preprocess_plugin
  
      if isinstance(
          preprocess_plugin, interface.FileSystemArtifactPreprocessorPlugin):
        cls._file_system_plugins[name] = preprocess_plugin
  
      elif isinstance(
          preprocess_plugin, interface.KnowledgeBasePreprocessorPlugin):
        cls._knowledge_base_plugins[name] = preprocess_plugin
  
      elif isinstance(
          preprocess_plugin,
          interface.WindowsRegistryKeyArtifactPreprocessorPlugin):
        cls._windows_registry_plugins[name] = preprocess_plugin
docs: Registers an preprocess plugin class.
  
      Args:
        plugin_class (type): preprocess plugin class.
  
      Raises:
        KeyError: if plugin class is already set for the corresponding name.
        TypeError: if the source type of the plugin class is not supported.