def _tosubsj(self, ixlist):
n = len(ixlist)<EOL>N = self.shape[self._distaxis]<EOL>ss = []<EOL>ms = []<EOL>js = []<EOL>if n == <NUM_LIT:0>:<EOL><INDENT>return ss, ms, js<EOL><DEDENT>j = <NUM_LIT:0> <EOL>ix = ixlist[j]<EOL>if ix >= N or ix < -N:<EOL><INDENT>raise IndexError(<EOL>'<STR_LIT>',<EOL>ix, self._distaxis, N)<EOL><DEDENT>if ix < <NUM_LIT:0>:<EOL><INDENT>ix += N<EOL><DEDENT>while j < n:<EOL><INDENT>for s in range(<NUM_LIT:0>, self._n):<EOL><INDENT>low = self._si[s]<EOL>high = self._si[s + <NUM_LIT:1>]<EOL>if ix >= low and ix < high:<EOL><INDENT>ss.append(s)<EOL>msj = [ix - low]<EOL>jsj = [j]<EOL>j += <NUM_LIT:1><EOL>while j < n:<EOL><INDENT>ix = ixlist[j]<EOL>if ix >= N or ix < -N:<EOL><INDENT>raise IndexError(<EOL>'<STR_LIT>',<EOL>ix, self._distaxis, N)<EOL><DEDENT>if ix < <NUM_LIT:0>:<EOL><INDENT>ix += N<EOL><DEDENT>if ix < low or ix >= high:<EOL><INDENT>break<EOL><DEDENT>msj.append(ix - low)<EOL>jsj.append(j)<EOL>j += <NUM_LIT:1><EOL><DEDENT>ms.append(msj)<EOL>js.append(jsj)<EOL><DEDENT>if ix < low:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>return ss, ms, js<EOL>
Like _tosubs(), maps a list of integer indices of the DistArray to
        subarray indices, but also returns the positions processed in the
        original index list.
        ixlist can contain repeated indices and does not need to be sorted.
        Returns tuple (ss, ms, js) where ss is a list of subarrays, ms is a
        list of lists of subindices m (one list for each subarray s in ss), and
        js is a list of lists of positions in ixlist that were processed (one
        list for each subarray s in ss).