code: def _exec_page_sync(page_context: PageContext) -> PageResult:
      """Execute a pipeline for a single page synchronously."""
      set_thread_pageno(page_context.pageno + 1)
  
      if not is_ocr_required(page_context):
          return PageResult(pageno=page_context.pageno)
  
      (
          ocr_image_out,
          pdf_page_from_image_out,
          orientation_correction,
      ) = process_page(page_context)
      ocr_out, text_out = _image_to_ocr_text(
          page_context, ocr_image_out
      )
  
      return PageResult(
          pageno=page_context.pageno,
          pdf_page_from_image=pdf_page_from_image_out,
          ocr=ocr_out,
          text=text_out,
          orientation_correction=orientation_correction,
      )
  
imports: from __future__ import annotations
  import argparse
  import logging
  import logging.handlers
  from collections.abc import Sequence
  from functools import partial
  from pathlib import Path
  from tempfile import mkdtemp
  import PIL
  from ocrmypdf._concurrent import Executor
  from ocrmypdf._graft import OcrGrafter
  from ocrmypdf._jobcontext import PageContext, PdfContext
  from ocrmypdf._pipeline import copy_final, get_pdfinfo, is_ocr_required, merge_sidecars, ocr_engine_hocr, ocr_engine_textonly_pdf, render_hocr_page, triage, validate_pdfinfo_options
  from ocrmypdf._pipelines._common import PageResult, cli_exception_handler, manage_debug_log_handler, manage_work_folder, postprocess, process_page, report_output_pdf, set_thread_pageno, setup_pipeline, worker_init
  from ocrmypdf._plugin_manager import OcrmypdfPluginManager
  from ocrmypdf._progressbar import ProgressBar
  from ocrmypdf._validation import check_requested_output_file, create_input_file
  from ocrmypdf.exceptions import ExitCode
label_desc: Use image node_id 2 for calling a global function with example usage: _exec_page_sync(page_context) and returns: PageResult, PageResult