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"]
code: def _get_single_element(self, row, col):
      M, N = self.shape
      if row < 0:
          row += M
      if col < 0:
          col += N
      if not (0 <= row < M) or not (0 <= col < N):
          raise IndexError(
              "index out of bounds: 0<=%d<%d, 0<=%d<%d"
              % (row, M, col, N)
          )
  
      major_index, minor_index = self._swap((row, col))
  
      start = self.indptr[major_index]
      end = self.indptr[major_index + 1]
  
      if self.has_sorted_indices:
          # Copies may be made, if dtypes of indices are not identical
          minor_index = self.indices.dtype.type(minor_index)
          minor_indices = self.indices[start:end]
          insert_pos_left = np.searchsorted(
              minor_indices, minor_index, side="left"
          )
          insert_pos_right = insert_pos_left + np.searchsorted(
              minor_indices[insert_pos_left:], minor_index, side="right"
          )
          return self.data[
              start + insert_pos_left : start + insert_pos_right
          ].sum(dtype=self.dtype)
      else:
          return np.compress(
              minor_index == self.indices[start:end],
              self.data[start:end],
          ).sum(dtype=self.dtype)
  
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 32 for calling the _cs_matrix obj's underlying member method code with example usage: obj._get_single_element(row, col) and returns: self, np