code: def dump_equation_debug_data(doc, images, converted_spans):
      if not settings.DEBUG_DATA_FOLDER or settings.DEBUG_LEVEL == 0:
          return
  
      if len(images) == 0:
          return
  
      # We attempted one conversion per image
      assert len(converted_spans) == len(images)
  
      data_lines = []
      for idx, (pil_image, converted_span) in enumerate(
          zip(images, converted_spans)
      ):
          if converted_span is None:
              continue
          # Image is a BytesIO object
          img_bytes = io.BytesIO()
          pil_image.save(img_bytes, format="WEBP", lossless=True)
          b64_image = base64.b64encode(img_bytes.getvalue()).decode(
              "utf-8"
          )
          data_lines.append(
              {
                  "image": b64_image,
                  "text": converted_span.text,
                  "bbox": converted_span.bbox,
              }
          )
  
      # Remove extension from doc name
      doc_base = os.path.basename(doc.name).rsplit(".", 1)[0]
  
      debug_file = os.path.join(
          settings.DEBUG_DATA_FOLDER, f"{doc_base}_equations.json"
      )
      with open(debug_file, "w+") as f:
          json.dump(data_lines, f)
  
file_path: pdf-to-markdown/marker/debug/data.py
imports: import base64
  import json
  import os
  import zlib
  from typing import List
  from marker.schema import Page
  from marker.settings import settings
  from PIL import Image
  import io
label_desc: Use image node_id 1 for calling a global function with example usage: dump_equation_debug_data(doc, images, converted_spans) without return types