def _get_row_slice(self, i, cslice):
if i < <NUM_LIT:0>:<EOL><INDENT>i += self.shape[<NUM_LIT:0>]<EOL><DEDENT>if i < <NUM_LIT:0> or i >= self.shape[<NUM_LIT:0>]:<EOL><INDENT>raise IndexError('<STR_LIT>' % i)<EOL><DEDENT>start, stop, stride = cslice.indices(self.shape[<NUM_LIT:1>])<EOL>if stride == <NUM_LIT:1>:<EOL><INDENT>row_slice = self._get_submatrix(i, cslice)<EOL><DEDENT>else:<EOL><INDENT>row_indices = self.indices[self.indptr[i]:self.indptr[i + <NUM_LIT:1>]]<EOL>row_data = self.data[self.indptr[i]:self.indptr[i + <NUM_LIT:1>]]<EOL>if stride > <NUM_LIT:0>:<EOL><INDENT>ind = (row_indices >= start) & (row_indices < stop)<EOL><DEDENT>elif stride < <NUM_LIT:0>:<EOL><INDENT>ind = (row_indices <= start) & (row_indices > stop)<EOL><DEDENT>if abs(stride) > <NUM_LIT:1>:<EOL><INDENT>ind = ind & ((row_indices - start) % stride == <NUM_LIT:0>)<EOL><DEDENT>row_indices = (row_indices[ind] - start) // stride<EOL>row_data = row_data[ind]<EOL>row_indptr = np.array([<NUM_LIT:0>, len(row_indices)])<EOL>if stride < <NUM_LIT:0>:<EOL><INDENT>row_data = row_data[::-<NUM_LIT:1>]<EOL>row_indices = abs(row_indices[::-<NUM_LIT:1>])<EOL><DEDENT>shape = (<NUM_LIT:1>, int(np.ceil(float(stop - start) / stride)))<EOL>row_slice = csr_matrix((row_data, row_indices, row_indptr),<EOL>shape=shape)<EOL><DEDENT>return row_slice<EOL>
Returns a copy of row self[i, cslice]