code: def iter_code_cells(self):
          
          for ws in self.nb.worksheets:
              for cell in ws.cells:
                  if cell.cell_type == 'code':
                      yield cell
docs: Iterate over the notebook cells containing code.