code: def extract_cells(content):
      """
      Extract the code/output cells from content.
      """
      cells = []
      current_cell = None
      is_output = False
      for line in content.split("\n"):
          if re_python_code.search(line) is not None:
              is_output = False
              current_cell = []
          elif re_output_code.search(line) is not None:
              is_output = True
              current_cell = []
          elif (
              re_end_code.search(line) is not None
              and current_cell is not None
          ):
              cell = "\n".join(current_cell)
              if is_output:
                  if not isinstance(cells[-1], tuple):
                      cells[-1] = (cells[-1], cell)
              else:
                  cells.append(cell)
              current_cell = None
              current_md = []
          elif current_cell is not None:
              current_cell.append(line)
  
      return cells
  
file_path: hf-course/utils/generate_notebooks.py
imports: import argparse
  import os
  import re
  import nbformat
  import shutil
  import yaml
  from pathlib import Path
label_desc: Use image node_id 2 for calling a global function with example usage: extract_cells(content) and returns: cells