def _fill_diagonals(m, diag_indices):
assert m.ndim == <NUM_LIT:3>, "<STR_LIT>"<EOL>assert m.shape[<NUM_LIT:1>] == m.shape[<NUM_LIT:2>], "<STR_LIT>"<EOL>for r in range(m.shape[<NUM_LIT:0>]):<EOL><INDENT>scipy.fill_diagonal(m[r], <NUM_LIT:0>)<EOL>m[r][diag_indices] -= scipy.sum(m[r], axis=<NUM_LIT:1>)<EOL><DEDENT>
Fills diagonals of `nsites` matrices in `m` so rows sum to 0.