'Returns a copy of row self[i, cslice]'

def _get_row_slice(self, i, cslice):

    (M, N) = self.shape
    if (i < 0):
        i += M
    if ((i < 0) or (i >= M)):
        raise IndexError(('index    (%d)    out    of    range' % i))
    (start, stop, stride) = cslice.indices(N)
    if (stride == 1):
        (row_indptr, row_indices, row_data) = get_csr_submatrix(M, N, self.indptr, self.indices, self.data, i, (i + 1), start, stop)
    else:
        row_indices = self.indices[self.indptr[i]:self.indptr[(i + 1)]]
        row_data = self.data[self.indptr[i]:self.indptr[(i + 1)]]
        if (stride > 0):
            ind = ((row_indices >= start) & (row_indices < stop))
        else:
            ind = ((row_indices <= start) & (row_indices > stop))
        if (abs(stride) > 1):
            ind &= (((row_indices - start) % stride) == 0)
        row_indices = ((row_indices[ind] - start) // stride)
        row_data = row_data[ind]
        row_indptr = np.array([0, len(row_indices)])
        if (stride < 0):
            row_data = row_data[::(-1)]
            row_indices = abs(row_indices[::(-1)])
    shape = (1, int(np.ceil((float((stop - start)) / stride))))
    return csr_matrix((row_data, row_indices, row_indptr), shape=shape, dtype=self.dtype, copy=False)
