code: def _set_many(self, i, j, x):
      
      i, j, M, N = self._prepare_indices(i, j)
  
      n_samples = len(x)
      offsets = np.empty(n_samples, dtype=self.indices.dtype)
      ret = _sparsetools.csr_sample_offsets(M, N, self.indptr, self.indices,
                                            n_samples, i, j, offsets)
      if ret == 1:
          # rinse and repeat
          self.sum_duplicates()
          _sparsetools.csr_sample_offsets(M, N, self.indptr,
                                          self.indices, n_samples, i, j,
                                          offsets)
  
      if -1 not in offsets:
          # make a list for interaction with h5py
          offsets = list(offsets)
          # only affects existing non-zero cells
          self.data[offsets] = x
          return
  
      else:
          # raise ValueError(
          #     'Currently, you cannot change the sparsity structure of a SparseDataset.')
          # replace where possible
          mask = offsets > -1
          self.data[offsets[mask]] = x[mask]
          # only insertions remain
          mask = ~mask
          i = i[mask]
          i[i < 0] += M
          j = j[mask]
          j[j < 0] += N
          self._insert_many(i, j, x[mask])
docs: Sets value at each (i, j) to x
  
      Here (i,j) index major and minor respectively, and must not contain
      duplicate entries.