Convert indices to a boolean (integer) mask.

    >>> list(indices_to_bool_mask(np.array([2, 3]), 4))
    [False, False, True, True]

    >>> list(indices_to_bool_mask([2, 3], 4))
    [False, False, True, True]

    >>> indices_to_bool_mask(np.array([5]), 2)
    Traceback (most recent call last):
    ...
    IndexError: index 5 is out of bounds ...

def indices_to_bool_mask(indices, size):
    """ Convert indices to a boolean (integer) mask.

    >>> list(indices_to_bool_mask(np.array([2, 3]), 4))
    [False, False, True, True]

    >>> list(indices_to_bool_mask([2, 3], 4))
    [False, False, True, True]

    >>> indices_to_bool_mask(np.array([5]), 2)
    Traceback (most recent call last):
    ...
    IndexError: index 5 is out of bounds ...
    """
    mask = np.zeros(size, dtype=bool)
    mask[indices] = 1
    return mask