code: def graph_to_jpg(T, path="abcd.jpg"):
      """
      save the networkx digraph form of JST to an image.
      Args:
          T: networkx digraph object of the jst as returned from `simpler_common_trunk_tree_to_digraph` function
          path: path to save the jpg file.
  
      Returns:
          path of the saved image
      """
      from networkx.drawing.nx_agraph import to_agraph
  
      A = to_agraph(T)
      A.layout("dot")
      A.draw(path, format="jpg")
      return path
  
file_path: AIX360/aix360/algorithms/imd/utils.py
imports: import numpy
  import pandas
  import networkx
  from collections import defaultdict
  from aix360.algorithms.imd.rule import Rule
label_desc: Use image node_id 8 for calling a global function with example usage: graph_to_jpg(T, path) and returns: path