class_docstr: pluggy.PluginManager that can fork.
  
  Capable of reconstructing itself in child workers.
  
  Arguments:
      setup_func: callback that initializes the plugin manager with all
          standard plugins
class_docstr_tok: ["pluggy.PluginManager","that","can","fork",".","Capable","of","reconstructing","itself","in","child","workers",".","Arguments",":","setup_func",":","callback","that","initializes","the","plugin","manager","with","all","standard","plugins"]
code: def setup_plugins(self):
      self.add_hookspecs(pluginspec)
  
      # 1. Register builtins
      if self.__builtins:
          for module in sorted(
              pkgutil.iter_modules(ocrmypdf.builtin_plugins.__path__)
          ):
              name = f"ocrmypdf.builtin_plugins.{module.name}"
              module = importlib.import_module(name)
              self.register(module)
  
      # 2. Install semfree if needed
      try:
          # pylint: disable=import-outside-toplevel
          from multiprocessing.synchronize import SemLock
  
          del SemLock
      except ImportError:
          self.register(
              importlib.import_module("ocrmypdf.extra_plugins.semfree")
          )
  
      # 3. Register setuptools plugins
      self.load_setuptools_entrypoints("ocrmypdf")
  
      # 4. Register plugins specified on command line
      for name in self.__plugins:
          if isinstance(name, Path) or name.endswith(".py"):
              # Import by filename
              module_name = Path(name).stem
              spec = importlib.util.spec_from_file_location(
                  module_name, name
              )
              module = importlib.util.module_from_spec(spec)
              sys.modules[module_name] = module
              spec.loader.exec_module(module)
          else:
              # Import by dotted module name
              module = importlib.import_module(name)
          self.register(module)
  
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 4 for calling the OcrmypdfPluginManager obj's underlying member method code with example usage: obj.setup_plugins() without return types