class_docstr: base matrix class for compressed row and column oriented matrices
class_docstr_tok: ["base","matrix","class","for","compressed","row","and","column","oriented","matrices"]
docstr: Determine whether the matrix has sorted indices and no duplicates
  
  Returns
      - True: if the above applies
      - False: otherwise
  
  has_canonical_format implies has_sorted_indices, so if the latter flag
  is False, so will the former be; if the former is found True, the
  latter flag is also set.
code: def __get_has_canonical_format(self):
      """Determine whether the matrix has sorted indices and no duplicates
  
      Returns
          - True: if the above applies
          - False: otherwise
  
      has_canonical_format implies has_sorted_indices, so if the latter flag
      is False, so will the former be; if the former is found True, the
      latter flag is also set.
      """
  
      # first check to see if result was cached
      if not getattr(self, "_has_sorted_indices", True):
          # not sorted => not canonical
          self._has_canonical_format = False
      elif not hasattr(self, "_has_canonical_format"):
          self.has_canonical_format = (
              _sparsetools.csr_has_canonical_format(
                  len(self.indptr) - 1, self.indptr, self.indices
              )
          )
      return self._has_canonical_format
  
imports: from __future__ import division, print_function, absolute_import
  from warnings import warn
  import operator
  import numpy
  from scipy._lib.six import zip
  from scipy._lib._util import _prune_array
  from .base import spmatrix, isspmatrix, SparseEfficiencyWarning
  from .data import _data_matrix, _minmax_mixin
  from .dia import dia_matrix
  from .None import _sparsetools
  from .sputils import upcast, upcast_char, to_native, isdense, isshape, getdtype, isscalarlike, IndexMixin, get_index_dtype, downcast_intp_index, get_sum_dtype, check_shape, matrix, asmatrix
label_desc: Use image node_id 37 for calling the _cs_matrix obj's underlying member method code with example usage: obj.__get_has_canonical_format() and returns: self