code: def _check_required_plugins(
      plugins: list[Plugin],
      expected: frozenset[str],
  ) -> None:
      plugin_names = {
          utils.normalize_pypi_name(plugin.package)
          for plugin in plugins
      }
      expected_names = {
          utils.normalize_pypi_name(name) for name in expected
      }
      missing_plugins = expected_names - plugin_names
  
      if missing_plugins:
          raise ExecutionError(
              f"required plugins were not installed!\n"
              f"- installed: {', '.join(sorted(plugin_names))}\n"
              f"- expected: {', '.join(sorted(expected_names))}\n"
              f"- missing: {', '.join(sorted(missing_plugins))}"
          )
  
imports: from __future__ import annotations
  import configparser
  import importlib.metadata
  import inspect
  import itertools
  import logging
  import sys
  from typing import Any
  from typing import Generator
  from typing import Iterable
  from typing import NamedTuple
  from flake8 import utils
  from flake8.defaults import VALID_CODE_PREFIX
  from flake8.exceptions import ExecutionError
  from flake8.exceptions import FailedToLoadPlugin
label_desc: Use image node_id 6 for calling a global function with example usage: _check_required_plugins(plugins, expected) without return types