code: def resolve_plugins(category):
      # Called to return a list of classes that are the available plugins for 'category'
  
      # The ENABLED_<category> variable is set in process_plugins
      # based on all the plugins that are found; it can contain either names of
      # plugins or -/+<name_of_plugin> indicating a "toggle" to activate/de-activate
      # a plugin.
      list_of_plugins = globals()["ENABLED_%s" % category.upper()]
      _ext_debug("    Resolving %s plugins" % category)
      _ext_debug(
          "        Raw list of plugins is: %s" % str(list_of_plugins)
      )
      set_of_plugins = set()
      for p in list_of_plugins:
          if p.startswith("-"):
              set_of_plugins.discard(p[1:])
          elif p.startswith("+"):
              set_of_plugins.add(p[1:])
          else:
              set_of_plugins.add(p)
  
      available_plugins = globals()[_dict_for_category(category)]
      name_extractor = _plugin_categories[category]
      if not name_extractor:
          # If we have no name function, it means we just use the name in the dictionary
          # and we return a dictionary. This is for sidecars mostly as they do not have
          # a field that indicates their name
          to_return = {}
      else:
          to_return = []
      _ext_debug(
          "        Resolved list of plugins is: %s"
          % str(set_of_plugins)
      )
      # Various error checks to make sure the plugin exists -- basically converts a string
      # representing a class path to the actual class. We try to give useful messages
      # in case of errors.
      for name in set_of_plugins:
          class_path = available_plugins.get(name, None)
          if class_path is None:
              raise ValueError(
                  "Configuration requested %s plugin '%s' but no such plugin is available"
                  % (category, name)
              )
          path, cls_name = class_path.rsplit(".", 1)
          try:
              plugin_module = importlib.import_module(path)
          except ImportError:
              raise ValueError(
                  "Cannot locate %s plugin '%s' at '%s'"
                  % (category, name, path)
              )
          cls = getattr(plugin_module, cls_name, None)
          if cls is None:
              raise ValueError(
                  "Cannot locate '%s' class for %s plugin at '%s'"
                  % (cls_name, category, path)
              )
          if name_extractor and name_extractor(cls) != name:
              raise ValueError(
                  "Class '%s' at '%s' for %s plugin expected to be named '%s' but got '%s'"
                  % (
                      cls_name,
                      path,
                      category,
                      name,
                      name_extractor(cls),
                  )
              )
          globals()[cls_name] = cls
          if name_extractor is not None:
              to_return.append(cls)
          else:
              to_return[name] = cls
          _ext_debug(
              "        Added %s plugin '%s' from '%s'"
              % (category, name, class_path)
          )
      return to_return
  
file_path: metaflow/metaflow/extension_support/plugins.py
imports: import importlib
  import traceback
  from metaflow.metaflow_config_funcs import from_conf
  from .None import _ext_debug, alias_submodules, get_modules, lazy_load_aliases
label_desc: Use image node_id 3 for calling a global function with example usage: resolve_plugins(category) and returns: to_return