code: def get_languages() -> set[str]:
      def lang_error(output):
          msg = (
              "Tesseract failed to report available languages.\n"
              "Output from Tesseract:\n"
              "-----------\n"
          )
          msg += output
          return msg
  
      args_tess = ["tesseract", "--list-langs"]
      try:
          proc = run(
              args_tess,
              text=True,
              stdout=PIPE,
              stderr=STDOUT,
              logs_errors_to_stdout=True,
              check=True,
          )
          output = proc.stdout
      except CalledProcessError as e:
          raise MissingDependencyError(lang_error(e.output)) from e
  
      for line in output.splitlines():
          if line.startswith("Error"):
              raise MissingDependencyError(lang_error(output))
      _header, *rest = output.splitlines()
      return {lang.strip() for lang in rest}
  
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 3 for calling a global function with example usage: get_languages() and returns: unknown, msg