def line_indices(xxx_todo_changeme, xxx_todo_changeme1):
    """
    Takes two cells in the grid (each described by a pair of integer
    indices), and returns a list of the cells in the grid that are on the
    line segment between the cells.
    """
    i0, j0 = xxx_todo_changeme
    i1, j1 = xxx_todo_changeme1
    assert type(i0) == int, 'Args to lineIndices must be pairs of integers'
    assert type(j0) == int, 'Args to lineIndices must be pairs of integers'
    assert type(i1) == int, 'Args to lineIndices must be pairs of integers'
    assert type(j1) == int, 'Args to lineIndices must be pairs of integers'
    ans = [(i0, j0)]
    di = i1 - i0
    dj = j1 - j0
    t = 0.5
    if abs(di) > abs(dj):
        m = float(dj) / float(di)
        t += j0
        if di < 0:
            di = -1
        else:
            di = 1
        m *= di
        while i0 != i1:
            i0 += di
            t += m
            ans.append((i0, int(t)))
    elif dj != 0:
        m = float(di) / float(dj)
        t += i0
        if dj < 0:
            dj = -1
        else:
            dj = 1
        m *= dj
        while j0 != j1:
            j0 += dj
            t += m
            ans.append((int(t), j0))
    return ans
