code: def write_nb(root, nb_name, cells):
      
      nb = new_notebook(cells=cells,
                        metadata={
                          'language': 'python',
                          })
      nb_path = os.path.join(root, '%s.ipynb' % nb_name)
      with codecs.open(nb_path, encoding='utf-8', mode='w') as nb_file:
          nbformat.write(nb, nb_file, NB_VERSION)
      print("Created Jupyter notebook at:\n%s" % nb_path)
docs: Write a jupyter notebook to disk.
  
      Takes a given a root directory, a notebook name, and a list of cells.