class_docstr: Holds our context for a page.
  
  Must be pickle-able, so stores only intrinsic/simple data elements or those
  capable of their serializing themselves via ``__getstate__``.
class_docstr_tok: ["Holds","our","context","for","a","page",".","Must","be","pickle-able",",","so","stores","only","intrinsic\/simple","data","elements","or","those","capable","of","their","serializing","themselves","via","``","__getstate__","``","."]
code: def __getstate__(self):
      state = self.__dict__.copy()
  
      state["options"] = copy(self.options)
      if not isinstance(
          state["options"].input_file, (str, bytes, os.PathLike)
      ):
          state["options"].input_file = "stream"
      if not isinstance(
          state["options"].output_file, (str, bytes, os.PathLike)
      ):
          state["options"].output_file = "stream"
      return state
  
file_path: OCRmyPDF/src/ocrmypdf/_jobcontext.py
imports: from __future__ import annotations
  import os
  from argparse import Namespace
  from collections.abc import Iterator
  from copy import copy
  from pathlib import Path
  from pluggy import PluginManager
  from ocrmypdf.pdfinfo import PdfInfo
  from ocrmypdf.pdfinfo.info import PageInfo
label_desc: Use image node_id 3 for calling the PageContext obj's underlying member method code with example usage: obj.__getstate__() and returns: state