code: def ocr_entire_page_tess(
      page, lang: str, spellchecker: Optional[SpellChecker] = None
  ) -> List[Block]:
      try:
          full_tp = page.get_textpage_ocr(
              flags=settings.TEXT_FLAGS,
              dpi=settings.OCR_DPI,
              full=True,
              language=lang,
          )
          blocks = page.get_text(
              "dict",
              sort=True,
              flags=settings.TEXT_FLAGS,
              textpage=full_tp,
          )["blocks"]
          full_text = page.get_text(
              "text",
              sort=True,
              flags=settings.TEXT_FLAGS,
              textpage=full_tp,
          )
  
          if len(full_text) == 0:
              return []
  
          # Check if OCR worked. If it didn't, return empty list
          # OCR can fail if there is a scanned blank page with some faint text impressions, for example
          if detect_bad_ocr(full_text, spellchecker):
              return []
      except RuntimeError:
          return []
      return blocks
  
file_path: pdf-to-markdown/marker/ocr/page.py
imports: import io
  from typing import List, Optional
  import fitz
  import ocrmypdf
  from spellchecker import SpellChecker
  from marker.ocr.utils import detect_bad_ocr
  from marker.schema import Block
  from marker.settings import settings
label_desc: Use image node_id 2 for calling a global function with example usage: ocr_entire_page_tess(page, lang, spellchecker) and returns: blocks, list, list, list