code: def approx_compare(a, b, max_delta):
      """
      Compares <a> and <b>, allowing numbers to differ by up to <delta>.
      """
      aa = approx_parse(a)
      bb = approx_parse(b)
      if len(aa) != len(bb):
          return 1
      ret = 1
      for (at, an), (bt, bn) in zip(aa, bb):
          if at != bt:
              break
          if an is not None and bn is not None:
              if abs(an - bn) >= max_delta:
                  print(f"diff={an-bn}: an={an} bn={bn}")
                  break
          elif (an is None) != (bn is None):
              break
      else:
          ret = 0
      if ret:
          print(f"Differ:\n    a={a!r}\n    b={b!r}")
      return ret
  
file_path: pymudf/tests/test_insertpdf.py
imports: import os
  import re
  import fitz
label_desc: Use image node_id 2 for calling a global function with example usage: approx_compare(a, b, max_delta) and returns: ret, int