code: def _process_output(output):
      out_type = output["output_type"]
  
      if out_type == "stream":
          # this happens when doing
          # a = [1, 2, 3]
          # print(a)
          # return dict so they all have the same format
          # {mime_type: content, ...}
          return {"text/plain": output["text"]}
      elif out_type in {"execute_result", "display_data"}:
          # this happens when doing:
          # a = [1, 2, 3]
          # a
          return output["data"]
      else:
          raise NotImplementedError(
              'Processing output of type "{}" is not '
              "implemented".format(out_type)
          )
  
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 4 for calling a global function with example usage: _process_output(output) and returns: dict, output