code: def parse_layout(elems, font_stat, combine=False):
      
      boxes_segments = elems.segments
      boxes_curves = elems.curves
      boxes_figures = elems.figures
      page_width = elems.layout.width
      #  page_height = elems.layout.height
      boxes = elems.mentions
      avg_font_pts = get_most_common_font_pts(elems.mentions, font_stat)
      width = get_page_width(boxes + boxes_segments + boxes_figures + boxes_curves)
      char_width = get_char_width(boxes)
      grid_size = avg_font_pts / 2.0
      for i, m in enumerate(boxes + elems.figures):
          m.id = i
          m.feats = defaultdict(bool)
          prefix = ""
          if isinstance(m, LTTextLine) and m.font_name:
              prefix = m.font_name + "-" + str(m.font_size) + "-"
          m.xc = (m.x0 + m.x1) / 2.0
          m.yc = (m.y0 + m.y1) / 2.0
          m.feats[prefix + "x0"] = m.x0_grid = m.x0 // grid_size
          m.feats[prefix + "x1"] = m.x1_grid = m.x1 // grid_size
          m.feats[prefix + "xc"] = m.xc_grid = m.xc // grid_size
          m.feats[prefix + "yc"] = m.yc_grid = m.yc // grid_size
  
      tbls, tbl_features = cluster_vertically_aligned_boxes(
          boxes,
          elems.layout.bbox,
          avg_font_pts,
          width,
          char_width,
          boxes_segments,
          boxes_curves,
          boxes_figures,
          page_width,
          combine,
      )
      return tbls, tbl_features
docs: Parses pdf texts into a hypergraph grouped into rows
      and columns and then output