code: def _sum_duplicates(self, indices, data):
      # Assumes indices not in canonical format.
      if len(data) == 0:
          return indices, data
      # Sort indices w.r.t. rows, then cols. This corresponds to C-order,
      # which we rely on for argmin/argmax to return the first index in the
      # same way that numpy does (in the case of ties).
      order = np.lexsort(indices[::-1])
      indices = tuple(idx[order] for idx in indices)
      data = data[order]
      unique_mask = np.logical_or.reduce(
          [idx[1:] != idx[:-1] for idx in indices]
      )
      unique_mask = np.append(True, unique_mask)
      indices = tuple(idx[unique_mask] for idx in indices)
      (unique_inds,) = np.nonzero(unique_mask)
      data = np.add.reduceat(data, unique_inds, dtype=self.dtype)
      return indices, data
  
imports: import math
  from warnings import warn
  import numpy
  from ._matrix import spmatrix
  from ._sparsetools import coo_tocsr, coo_todense, coo_matvec
  from ._base import issparse, SparseEfficiencyWarning, _spbase, sparray
  from ._data import _data_matrix, _minmax_mixin
  from ._sputils import upcast, upcast_char, to_native, isshape, getdtype, getdata, downcast_intp_index, get_index_dtype, check_shape, check_reshape_kwargs
  import operator
label_desc: Use image node_id 21 for calling the _coo_base obj's underlying member method code with example usage: obj._sum_duplicates(indices, data) and returns: indices,  data, indices,  data