code: def generate_hocr(input_file, output_hocr, output_text, options):
      with CacheOcrEngine.lock, patch(
          "ocrmypdf._exec.tesseract.run",
          new=partial(cached_run, options),
      ):
          TesseractOcrEngine.generate_hocr(
              input_file, output_hocr, output_text, options
          )
  
imports: from __future__ import annotations
  import argparse
  import json
  import logging
  import platform
  import re
  import shutil
  import threading
  from functools import partial
  from pathlib import Path
  from subprocess import PIPE, CalledProcessError, CompletedProcess
  from unittest.mock import patch
  from ocrmypdf import hookimpl
  from ocrmypdf.builtin_plugins.tesseract_ocr import TesseractOcrEngine
  from ocrmypdf.subprocess import run
label_desc: Use image node_id 3 for calling the CacheOcrEngine obj's underlying member method code with example usage: obj.generate_hocr(input_file, output_hocr, output_text, options) without return types