code: def get_parser_options_plugins(
      args: Sequence[str],
  ) -> tuple[
      argparse.ArgumentParser, argparse.Namespace, pluggy.PluginManager
  ]:
      pre_options, _unused = plugins_only_parser.parse_known_args(
          args=args
      )
      plugin_manager = get_plugin_manager(pre_options.plugins)
  
      parser = get_parser()
      plugin_manager.hook.initialize(  # pylint: disable=no-member
          plugin_manager=plugin_manager
      )
      plugin_manager.hook.add_options(
          parser=parser
      )  # pylint: disable=no-member
  
      options = parser.parse_args(args=args)
      return parser, options, plugin_manager
  
file_path: OCRmyPDF/src/ocrmypdf/_plugin_manager.py
imports: from __future__ import annotations
  import argparse
  import importlib
  import importlib.util
  import pkgutil
  import sys
  from collections.abc import Sequence
  from pathlib import Path
  import pluggy
  import ocrmypdf.builtin_plugins
  from ocrmypdf import pluginspec
  from ocrmypdf.cli import get_parser, plugins_only_parser
label_desc: Use image node_id 2 for calling a global function with example usage: get_parser_options_plugins(args) and returns: parser,  options,  plugin_manager