code: def _csr_matrix_indices(S):
      
      m, n = S.shape
  
      for i in range(m):
          for j in range(S.indptr[i], S.indptr[i+1]):
              row_index, col_index = i, S.indices[j]
              yield row_index, col_index
docs: Generate the indices of nonzero entries of a csr_matrix S