code: def display_graph(g, format="svg", include_asset_exists=False):
      """
      Display a TermGraph interactively from within IPython.
      """
      try:
          import IPython.display as display
      except ImportError:
          raise NoIPython(
              "IPython is not installed.  Can't display graph."
          )
  
      if format == "svg":
          display_cls = display.SVG
      elif format in ("jpeg", "png"):
          display_cls = partial(
              display.Image, format=format, embed=True
          )
  
      out = BytesIO()
      _render(g, out, format, include_asset_exists=include_asset_exists)
      return display_cls(data=out.getvalue())
  
imports: from __future__ import unicode_literals
  from contextlib import contextmanager
  import errno
  from functools import partial
  from io import BytesIO
  from subprocess import Popen, PIPE
  from networkx import topological_sort
  from six import iteritems
  from catalyst.pipeline.data import BoundColumn
  from catalyst.pipeline import Filter, Factor, Classifier, Term
  from catalyst.pipeline.term import AssetExists
label_desc: Use image node_id 10 for calling a global function with example usage: display_graph(g, format, include_asset_exists) and returns: display_cls