code: def ipy_blocks(notebook):
      if "worksheets" in list(notebook.keys()):
          return notebook["worksheets"][0][
              "cells"
          ]  # just take the first worksheet
      elif "cells" in list(notebook.keys()):
          return notebook["cells"]
      else:
          raise NotImplementedError(
              "ipython notebook cell/block json format not handled"
          )
  
imports: import json
  import codecs
label_desc: Use image node_id 2 for calling a global function with example usage: ipy_blocks(notebook) and returns: notebook, notebook