code: def recorder(elpos):
      """We only record positions of table rows and cells.
  
      Information is stored in "coords" with page number as key.
      """
      global coords  # dictionary of row and cell coordinates per page
      if (
          elpos.open_close != 2
      ):  # only consider coordinates provided at "close"
          return
      if elpos.id not in (
          "row",
          "country",
          "capital",
          "population",
          "percent",
          "year",
      ):
          return  # only look at row / cell content
  
      rect = fitz.Rect(elpos.rect)  # cell rectangle
      if (
          rect.y1 > elpos.filled
      ):  # ignore stuff below the filled rectangle
          return
  
      # per page, we store the floats top-most y, right-most x, column left
      # and row bottom borders.
      x, y, x1, y0 = coords.get(
          elpos.page, (set(), set(), 0, sys.maxsize)
      )
  
      if elpos.id != "row":
          x.add(rect.x0)  # add cell left border coordinate
          if rect.x1 > x1:  # store right-most cell border on page
              x1 = rect.x1
      else:
          y.add(rect.y1)  # add row bottom border coordinate
          if rect.y0 < y0:  # store top-most cell border per page
              y0 = rect.y0
  
      coords[elpos.page] = (x, y, x1, y0)  # write back info per page
      return
  
imports: import io
  import sqlite3
  import sys
  import fitz
label_desc: Use image node_id 1 for calling a global function with example usage: recorder(elpos) without return types