code: def image_to_data(
      image,
      lang=None,
      config="",
      nice=0,
      output_type=Output.STRING,
      timeout=0,
      pandas_config=None,
  ):
      """
      Returns string containing box boundaries, confidences,
      and other information. Requires Tesseract 3.05+
      """
  
      if get_tesseract_version(cached=True) < TESSERACT_MIN_VERSION:
          raise TSVNotSupported()
  
      config = f"-c tessedit_create_tsv=1 {config.strip()}"
      args = [image, "tsv", lang, config, nice, timeout]
  
      return {
          Output.BYTES: lambda: run_and_get_output(*(args + [True])),
          Output.DATAFRAME: lambda: get_pandas_output(
              args + [True],
              pandas_config,
          ),
          Output.DICT: lambda: file_to_dict(
              run_and_get_output(*args), "\t", -1
          ),
          Output.STRING: lambda: run_and_get_output(*args),
      }[output_type]()
  
imports: import logging
  import re
  import shlex
  import string
  import subprocess
  import sys
  from contextlib import contextmanager
  from csv import QUOTE_NONE
  from errno import ENOENT
  from functools import wraps
  from glob import iglob
  from io import BytesIO
  from os import environ
  from os import extsep
  from os import linesep
  from os import remove
  from os.path import normcase
  from os.path import normpath
  from os.path import realpath
  from tempfile import NamedTemporaryFile
  from time import sleep
  from typing import List
  from typing import Optional
  from packaging.version import InvalidVersion
  from packaging.version import parse
  from packaging.version import Version
  from PIL import Image
label_desc: Use image node_id 23 for calling a global function with example usage: image_to_data(image, lang, config, nice, output_type, timeout, pandas_config) and returns: dict