code: def setup_pipeline(
      options: argparse.Namespace,
      plugin_manager: OcrmypdfPluginManager,
  ) -> Executor:
      # Any changes to options will not take effect for options that are already
      # bound to function parameters in the pipeline. (For example
      # options.input_file, options.pdf_renderer are already bound.)
      if not options.jobs:
          options.jobs = available_cpu_count()
  
      pikepdf_enable_mmap()
      executor = setup_executor(plugin_manager)
      return executor
  
imports: from __future__ import annotations
  import argparse
  import json
  import logging
  import logging.handlers
  import os
  import shutil
  import sys
  import threading
  from collections.abc import Sequence
  from concurrent.futures.process import BrokenProcessPool
  from concurrent.futures.thread import BrokenThreadPool
  from contextlib import contextmanager
  from dataclasses import dataclass
  from pathlib import Path
  from typing import Callable, NamedTuple, cast
  import PIL
  from ocrmypdf._concurrent import Executor, setup_executor
  from ocrmypdf._jobcontext import PageContext, PdfContext
  from ocrmypdf._logging import PageNumberFilter
  from ocrmypdf._metadata import metadata_fixup
  from ocrmypdf._pipeline import convert_to_pdfa, create_ocr_image, create_pdf_page_from_image, create_visible_page_jpg, generate_postscript_stub, get_orientation_correction, get_pdf_save_settings, optimize_pdf, preprocess_clean, preprocess_deskew, preprocess_remove_background, rasterize, rasterize_preview, should_linearize, should_visible_page_image_use_jpg
  from ocrmypdf._plugin_manager import OcrmypdfPluginManager
  from ocrmypdf._validation import report_output_file_size
  from ocrmypdf.exceptions import ExitCode, ExitCodeException
  from ocrmypdf.helpers import available_cpu_count, check_pdf, pikepdf_enable_mmap, samefile
  from ocrmypdf.pdfa import file_claims_pdfa
label_desc: Use image node_id 8 for calling a global function with example usage: setup_pipeline(options, plugin_manager) and returns: executor