code: def tess_base_args(
      langs: list[str], engine_mode: int | None
  ) -> list[str]:
      args = ["tesseract"]
      if langs:
          args.extend(["-l", "+".join(langs)])
      if engine_mode is not None:
          args.extend(["--oem", str(engine_mode)])
      return args
  
imports: from __future__ import annotations
  import logging
  import re
  from contextlib import suppress
  from math import pi
  from os import fspath
  from pathlib import Path
  from subprocess import PIPE, STDOUT, CalledProcessError, TimeoutExpired
  from packaging.version import Version
  from ocrmypdf.exceptions import MissingDependencyError, SubprocessOutputError, TesseractConfigError
  from ocrmypdf.pluginspec import OrientationConfidence
  from ocrmypdf.subprocess import get_version, run
label_desc: Use image node_id 4 for calling a global function with example usage: tess_base_args(langs, engine_mode) and returns: args