code: def tesseract_log_output(stream: bytes) -> None:
      tlog = TesseractLoggerAdapter(
          log, extra=log.extra if hasattr(log, "extra") else None  # type: ignore
      )
  
      if not stream:
          return
      try:
          text = stream.decode()
      except UnicodeDecodeError:
          text = stream.decode("utf-8", "ignore")
  
      lines = text.splitlines()
      for line in lines:
          if line.startswith("Tesseract Open Source"):
              continue
          elif line.startswith("Warning in pixReadMem"):
              continue
          elif "diacritics" in line:
              tlog.warning("lots of diacritics - possibly poor OCR")
          elif line.startswith("OSD: Weak margin"):
              tlog.warning("unsure about page orientation")
          elif "Error in pixScanForForeground" in line:
              pass  # Appears to be spurious/problem with nonwhite borders
          elif "Error in boxClipToRectangle" in line:
              pass  # Always appears with pixScanForForeground message
          elif "parameter not found: " in line.lower():
              tlog.error(line.strip())
              problem = line.split("found: ")[1]
              raise TesseractConfigError(problem)
          elif "error" in line.lower() or "exception" in line.lower():
              tlog.error(line.strip())
          elif "warning" in line.lower():
              tlog.warning(line.strip())
          elif "read_params_file" in line.lower():
              tlog.error(line.strip())
          else:
              tlog.info(line.strip())
  
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 8 for calling a global function with example usage: tesseract_log_output(stream) without return types