code: def compare_image(baseline, fig, tol=0, fmt="json"):
      if fmt == "json":
          return _compare_image_json(baseline, fig)
  
      raise NotImplementedError(
          f"Image format {fmt} not implemented yet"
      )
  
file_path: python-igraph/tests/drawing/plotly/utils.py
imports: from pathlib import Path
  import sys
  import inspect
  import functools
label_desc: Use image node_id 7 for calling a global function with example usage: compare_image(baseline, fig, tol, fmt) and returns: _compare_image_json