def find_cell(nb, cell_name):
    """
    find a named cell within a notebook
    """
    for cell in nb.cells:
        if 'name' in cell.metadata and cell.metadata['name'] == cell_name:
            return nb.cells.index(cell), cell
    return None, None
