def neighbor_idcs(x, y):
    """
    Input x,y coordinates and return all the neighbor indices.
    """
    xidcs = [x-1, x, x+1, x-1, x+1, x-1, x, x+1] 
    yidcs = [y-1, y-1, y-1, y, y, y+1, y+1, y+1] 

    return xidcs, yidcs