code: def save_page_grids(page_grids, output_file):
      """
      Save a dict <page_grids> with page number -> grid structure as JSON to <output_file>.
      The grid can be generated with extract.make_grid_from_positions.
      This file can be displayed with pdf2xml-viewer.
      """
      with open(output_file, "w") as f:
          json.dump(page_grids, f, cls=JSONEncoderPlus)
  
imports: import xml.etree.ElementTree
  from collections import OrderedDict
  import json
  import struct
  import imghdr
  import numpy
  from .geom import pt, rect
label_desc: Use image node_id 2 for calling a global function with example usage: save_page_grids(page_grids, output_file) without return types