def iter_halfs_double(graph):
edges = graph.edges<EOL>for index1, (atom_a1, atom_b1) in enumerate(edges):<EOL><INDENT>for atom_a2, atom_b2 in edges[:index1]:<EOL><INDENT>try:<EOL><INDENT>affected_atoms1, affected_atoms2, hinge_atoms = graph.get_halfs_double(atom_a1, atom_b1, atom_a2, atom_b2)<EOL>yield affected_atoms1, affected_atoms2, hinge_atoms<EOL><DEDENT>except GraphError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>
Select two random non-consecutive bonds that divide the molecule in two