original_docstring: 
          discover all plugins that are located in the plugins directory
          and that do match the given subclass
  
          :param subclass: subclass for which should be filtered,
                           defaults to Plugin
          :type subclass: Plugin, optional
          
docstring: discover all plugins that are located in the plugins directory
  and that do match the given subclass
docstring_tokens: discover all plugins that are located in the plugins directory and that do match the given subclass
code: def discover(
          self,
          subclass: Plugin = Plugin,
      ) -> None:
          """
          discover all plugins that are located in the plugins directory
          and that do match the given subclass
  
          :param subclass: subclass for which should be filtered,
                           defaults to Plugin
          :type subclass: Plugin, optional
          """
          assert (subclass is None) or issubclass(subclass, Plugin)
  
          self.log.debug(
              f"Discovering all plugins in '{self.plugins_directory}' for "
              f"subclass '{subclass}'..."
          )
          for fn in self.plugins_directory.glob("**/*.py"):
              # derive from relative path the module name
              module_name = (
                  fn.with_suffix("").relative_to(
                      self.plugins_directory
                  ).as_posix()
              ).replace("/", ".")
  
              # load the module
              load_module(module_name, fn)
  
          # return all classes that are a subclass of the given class
          plugin_classes = [
              plugincls
              for plugincls in Plugin.__subclasses__()
              if (
                  issubclass(plugincls, subclass) and
                  (plugincls is not subclass)
              )
          ]
  
          self.log.debug(
              f"Found {len(plugin_classes)} plugins: "
              f"{', '.join([p.__name__ for p in plugin_classes])}"
          )
  
          return plugin_classes
code_tokens: def discover ( self , subclass : Plugin = Plugin , ) -> None : assert ( subclass is None ) or issubclass ( subclass , Plugin ) self . log . debug ( f"Discovering all plugins in '{self.plugins_directory}' for " f"subclass '{subclass}'..." ) for fn in self . plugins_directory . glob ( "**/*.py" ) : module_name = ( fn . with_suffix ( "" ) . relative_to ( self . plugins_directory ) . as_posix ( ) ) . replace ( "/" , "." ) load_module ( module_name , fn ) plugin_classes = [ plugincls for plugincls in Plugin . __subclasses__ ( ) if ( issubclass ( plugincls , subclass ) and ( plugincls is not subclass ) ) ] self . log . debug ( f"Found {len(plugin_classes)} plugins: " f"{', '.join([p.__name__ for p in plugin_classes])}" ) return plugin_classes
short_docstring: discover all plugins that are located in the plugins directory
  and that do match the given subclass
short_docstring_tokens: discover all plugins that are located in the plugins directory and that do match the given subclass
comment: """
          discover all plugins that are located in the plugins directory
          and that do match the given subclass
  
          :param subclass: subclass for which should be filtered,
                           defaults to Plugin
          :type subclass: Plugin, optional
          """$SEP$# derive from relative path the module name$SEP$# load the module$SEP$# return all classes that are a subclass of the given class