def _binary_neighbour_ids(spatial_rank):
    """
    returns combinatorial binary indices::

        1-D: [[0], [1]]
        2-D: [[0, 0], [0, 1], [1, 0], [1, 1]]
        3-D: [[0, 0, 0], [0, 0, 1], [0, 1, 0],
              [0, 1, 1], [1, 0, 0], [1, 0, 1],
              [1, 1, 0], [1, 1, 1]]

    """
    return [[int(c) for c in format(i, '0%ib' % spatial_rank)]
            for i in range(2 ** spatial_rank)]