def boolmask(indices, maxval=None):
if maxval is None:<EOL><INDENT>indices = list(indices)<EOL>maxval = max(indices) + <NUM_LIT:1><EOL><DEDENT>mask = [False] * maxval<EOL>for index in indices:<EOL><INDENT>mask[index] = True<EOL><DEDENT>return mask<EOL>
Constructs a list of booleans where an item is True if its position is in
`indices` otherwise it is False.

Args:
    indices (list): list of integer indices

    maxval (int): length of the returned list. If not specified
        this is inferred from `indices`

Note:
    In the future the arg `maxval` may change its name to `shape`

Returns:
    list: mask: list of booleans. mask[idx] is True if idx in indices

Example:
    >>> import ubelt as ub
    >>> indices = [0, 1, 4]
    >>> mask = ub.boolmask(indices, maxval=6)
    >>> assert mask == [True, True, False, False, True, False]
    >>> mask = ub.boolmask(indices)
    >>> assert mask == [True, True, False, False, True]