def _check_groups(s, groups):
ans = []<EOL>for g in groups:<EOL><INDENT>ans.extend(g)<EOL><DEDENT>if np.unique(ans).size != np.size(ans):<EOL><INDENT>return False<EOL><DEDENT>elif np.unique(ans).size != s.obj_get_positions().shape[<NUM_LIT:0>]:<EOL><INDENT>return False<EOL><DEDENT>else:<EOL><INDENT>return (np.arange(s.obj_get_radii().size) == np.sort(ans)).all()<EOL><DEDENT>
Ensures that all particles are included in exactly 1 group