def remove_duplicate_edges_undirected(udg):
<EOL>lookup = {}<EOL>edges = sorted(udg.get_all_edge_ids())<EOL>for edge_id in edges:<EOL><INDENT>e = udg.get_edge(edge_id)<EOL>tpl_a = e['<STR_LIT>']<EOL>tpl_b = (tpl_a[<NUM_LIT:1>], tpl_a[<NUM_LIT:0>])<EOL>if tpl_a in lookup or tpl_b in lookup:<EOL><INDENT>udg.delete_edge_by_id(edge_id)<EOL><DEDENT>else:<EOL><INDENT>lookup[tpl_a] = edge_id<EOL>lookup[tpl_b] = edge_id<EOL><DEDENT><DEDENT>
Removes duplicate edges from an undirected graph.