def snake_index_to_coordinates(index, x_dimension, y_dimension):
    """Obtain the column and row coordinates corresponding to a snake ordering
    index on a 2-d grid.
    """
    if index > x_dimension * y_dimension - 1:
        raise ValueError('Index exceeds x_dimension * y_dimension - 1.')

    row = index // x_dimension
    if row % 2 == 0:
        column = index % x_dimension
    else:
        column = x_dimension - 1 - index % x_dimension

    return column, row