code: def check_options(options):
      check_external_program(
          program="tesseract",
          package={"linux": "tesseract-ocr"},
          version_checker=tesseract.version,
          need_version="4.1.1",  # Ubuntu 22.04 version (also 20.04)
          version_parser=tesseract.TesseractVersion,
      )
  
      # Decide on what renderer to use
      if options.pdf_renderer == "auto":
          options.pdf_renderer = "sandwich"
  
      if (
          not tesseract.has_thresholding()
          and options.tesseract_thresholding != 0
      ):
          log.warning(
              "The installed version of Tesseract does not support changes to its "
              "thresholding method. The --tesseract-threshold argument will be "
              "ignored."
          )
      if options.tesseract_pagesegmode in (0, 2):
          log.warning(
              "The --tesseract-pagesegmode argument you select will disable OCR. "
              "This may cause processing to fail."
          )
  
imports: from __future__ import annotations
  import logging
  import os
  from PIL import Image
  from ocrmypdf import hookimpl
  from ocrmypdf._exec import tesseract
  from ocrmypdf._jobcontext import PageContext
  from ocrmypdf.cli import numeric, str_to_int
  from ocrmypdf.helpers import clamp
  from ocrmypdf.imageops import calculate_downsample, downsample_image
  from ocrmypdf.pluginspec import OcrEngine
  from ocrmypdf.subprocess import check_external_program
label_desc: Use image node_id 2 for calling a global function with example usage: check_options(options) without return types