def remap_line_numbers(cell_lines):
    """Create a mapping from script line number to notebook cell/line."""
    line_map = {}
    cell_start = 0
    for cell, cell_length in enumerate(cell_lines, 1):
        for line in range(1, cell_length + 1):
            line_map[cell_start + line] = cell, line
        cell_start += cell_length
    return line_map