code: def try_figure2html(obj):
      if hasattr(obj, "savefig"):
          return figure2html(obj)
      else:
          return obj
  
file_path: sklearn-evaluation/src/sklearn_evaluation/report/serialize.py
imports: from functools import reduce
  import base64
  from six import BytesIO
  import matplotlib
label_desc: Use image node_id 6 for calling a global function with example usage: try_figure2html(obj) and returns: figure2html, obj