Would this be fixed by changing it to:
```
self.sum_duplicates()
sparsetools.csr_sample_offsets(M, N, self.indptr, self.indices, n_samples, i, j, offsets)
```
In this case, the sampling should always succeed, right?

If this works, it would be useful to change the function prototype to 
```
int csr_sample_offsets(...)
```
and signal the duplicate-values failure condition via a return value.