code: def walk(filename, page_number, node, acc, common_fonts, font_ratios):
      elements_to_consider = {"paragraph", "heading", "list"}
      if node["type"] == "line":
          walk_line(
              filename,
              page_number,
              node,
              acc,
              common_fonts,
              font_ratios,
          )
  
      elif node["type"] in elements_to_consider:
          for elem in node["content"]:
              walk(
                  filename,
                  page_number,
                  elem,
                  acc,
                  common_fonts,
                  font_ratios,
              )
  
file_path: doc-parsr/server/src/processing/MlHeadingDetectionModule/train_model/build_dataset.py
imports: import argparse
  import csv
  import json
  import os
  import re
  import spacy
  import numpy
  from collections import Counter
  from utils import most_common_fonts, font_ratios, markdown_to_text
label_desc: Use image node_id 2 for calling a global function with example usage: walk(filename, page_number, node, acc, common_fonts, font_ratios) without return types