def __get_sorted(self):

        # first check to see if result was cached
        if not hasattr(self,'_has_sorted_indices'):
            self._has_sorted_indices = _sparsetools.csr_has_sorted_indices(
                len(self.indptr) - 1, self.indptr, self.indices)
        return self._has_sorted_indices
Determine whether the matrix has sorted indices
dataset/ETHPy150Open scipy/scipy/scipy/sparse/compressed.py/_cs_matrix.__get_sorted