code: def get_tesseract_version():
      """Try to extract version from tesseract otherwise default min version."""
      config = {"libraries": ["tesseract", "lept"]}
      try:
          p = subprocess.Popen(
              ["tesseract", "-v"],
              stderr=subprocess.PIPE,
              stdout=subprocess.PIPE,
          )
          stdout_version, version = p.communicate()
          version = _read_string(version).strip()
          if version == "":
              version = _read_string(stdout_version).strip()
  
          version_match = re.search(
              r"^tesseract ((?:\d+\.)+\d+).*", version, re.M
          )
          if version_match:
              version = version_match.group(1)
          else:
              _LOGGER.warning(
                  "Failed to extract tesseract version number from: %s",
                  version,
              )
              version = _TESSERACT_MIN_VERSION
      except OSError as e:
          _LOGGER.warning(
              "Failed to extract tesseract version from executable: %s",
              e,
          )
          version = _TESSERACT_MIN_VERSION
  
      _LOGGER.info("Supporting tesseract v%s", version)
      config["compile_time_env"] = {
          "TESSERACT_MAJOR_VERSION": major_version(version),
          "TESSERACT_VERSION": version_to_int(version),
      }
      if sys.platform == "win32":
          libpaths = os.getenv("LIBPATH", None)
          if libpaths:
              libpaths = list(filter(None, libpaths.split(";")))
          else:
              libpaths = []
  
          if version:
              lib_version = "".join(version.split(".")[:2])
          else:
              lib_version = None
  
          tess_lib = find_library(
              "tesseract*.lib", libpaths, lib_version
          )
          if len(tess_lib) >= 1:
              base = os.path.basename(sorted(tess_lib, reverse=True)[0])
              tess_lib = os.path.splitext(base)[0]
          else:
              error = (
                  "Tesseract library not found in LIBPATH: {}".format(
                      libpaths
                  )
              )
              raise RuntimeError(error)
  
          lept_lib = find_library("lept*.lib", libpaths)
          if len(lept_lib) >= 1:
              base = os.path.basename(sorted(lept_lib, reverse=True)[0])
              lept_lib = os.path.splitext(base)[0]
          else:
              error = (
                  "Leptonica library not found in LIBPATH: {}".format(
                      libpaths
                  )
              )
              raise RuntimeError(error)
  
          includepaths = os.getenv("INCLUDE", None)
          if includepaths:
              includepaths = list(filter(None, includepaths.split(";")))
          else:
              includepaths = []
  
          config["libraries"] = [tess_lib, lept_lib]
          config["library_dirs"] = libpaths
          config["include_dirs"] = includepaths
  
      _LOGGER.info("Building with configs: %s", config)
      return config
  
imports: import codecs
  import errno
  import glob
  import itertools
  import logging
  import os
  import re
  import subprocess
  import sys
  from os.path import abspath, dirname
  from os.path import join
  from os.path import split
  from setuptools import setup
  from setuptools.command.build_ext import build_ext
  from setuptools.extension import Extension
label_desc: Use image node_id 7 for calling a global function with example usage: get_tesseract_version() and returns: config