def output_component(graph, edge_stack, u, v):
edge_list = []<EOL>while len(edge_stack) > <NUM_LIT:0>:<EOL><INDENT>edge_id = edge_stack.popleft()<EOL>edge_list.append(edge_id)<EOL>edge = graph.get_edge(edge_id)<EOL>tpl_a = (u, v)<EOL>tpl_b = (v, u)<EOL>if tpl_a == edge['<STR_LIT>'] or tpl_b == edge['<STR_LIT>']:<EOL><INDENT>break<EOL><DEDENT><DEDENT>return edge_list<EOL>
Helper function to pop edges off the stack and produce a list of them.