<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _tomask(self, indices, element):
 r""" This is a generalized version of tomask that accepts a string of 'pore' or 'throat' for programmatic access. """

        element = self._parse_element(element, single=True)
        indices = self._parse_indices(indices)
        N = sp.shape(self[element + '.all'])[0]
        ind = sp.array(indices, ndmin=1)
        mask = sp.zeros((N, ), dtype=bool)
        mask[ind] = True
        return mask