docstr: :param plugin_type: class of plugin to discover, None for all
  :return: a list of plugins implementing the plugin type (or all if plugin type is None)
docstr_tok: [":","param","plugin_type",":","class","of","plugin","to","discover",",","None","for","all",":","return",":","a","list","of","plugins","implementing","the","plugin","type","(","or","all","if","plugin","type","is","None",")"]
code: def discover(
      self, plugin_type: Optional[Type[Plugin]] = None
  ) -> List[Type[Plugin]]:
      """
      :param plugin_type: class of plugin to discover, None for all
      :return: a list of plugins implementing the plugin type (or all if plugin type is None)
      """
      Plugins.check_usage(self)
      ret: List[Type[Plugin]] = []
      if plugin_type is None:
          plugin_type = Plugin
      assert issubclass(plugin_type, Plugin)
      if plugin_type not in self.plugin_type_to_subclass_list:
          return []
      for clazz in self.plugin_type_to_subclass_list[plugin_type]:
          ret.append(clazz)
  
      return ret
  
imports: import importlib
  import importlib.util
  import inspect
  import pkgutil
  import sys
  import warnings
  from collections import defaultdict
  from dataclasses import dataclass, field
  from timeit import default_timer
  from typing import Any, Dict, List, Optional, Tuple, Type
  from omegaconf import DictConfig
  from hydra._internal.sources_registry import SourcesRegistry
  from hydra.core.singleton import Singleton
  from hydra.plugins.completion_plugin import CompletionPlugin
  from hydra.plugins.config_source import ConfigSource
  from hydra.plugins.launcher import Launcher
  from hydra.plugins.plugin import Plugin
  from hydra.plugins.search_path_plugin import SearchPathPlugin
  from hydra.plugins.sweeper import Sweeper
  from hydra.types import HydraContext, TaskFunction
  from hydra.utils import instantiate
label_desc: Use image node_id 12 for calling the Plugins obj's underlying member method code with example usage: obj.discover(plugin_type) and returns: ret, list