code: def _parse_output(output, literal_eval, to_df, text_only):
      if not text_only and "image/png" in output:
          return Image(data=base64.b64decode(output["image/png"]))
      elif not text_only and "text/html" in output:
          return HTML(output["text/html"])
      elif "text/plain" in output:
          out = output["text/plain"]
          return (
              out
              if not literal_eval
              else _safe_literal_eval(out, to_df=to_df)
          )
  
imports: import base64
  from collections.abc import Mapping
  import ast
  import parso
  import pandas
  import nbformat
  from IPython.display import Image, HTML
label_desc: Use image node_id 7 for calling a global function with example usage: _parse_output(output, literal_eval, to_df, text_only) and returns: Image, HTML, unknown