def __edge_weight(edge_id, dfs_data):
graph = dfs_data['<STR_LIT>']<EOL>edge_lookup = dfs_data['<STR_LIT>']<EOL>edge = graph.get_edge(edge_id)<EOL>u, v = edge['<STR_LIT>']<EOL>d_u = D(u, dfs_data)<EOL>d_v = D(v, dfs_data)<EOL>lp_1 = L1(v, dfs_data)<EOL>d_lp_1 = D(lp_1, dfs_data)<EOL>if edge_lookup[edge_id] == '<STR_LIT>' and d_v < d_u:<EOL><INDENT>return <NUM_LIT:2>*d_v<EOL><DEDENT>elif is_type_I_branch(u, v, dfs_data):<EOL><INDENT>return <NUM_LIT:2>*d_lp_1<EOL><DEDENT>elif is_type_II_branch(u, v, dfs_data):<EOL><INDENT>return <NUM_LIT:2>*d_lp_1 + <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>return <NUM_LIT:2>*graph.num_nodes() + <NUM_LIT:1><EOL><DEDENT>
Calculates the edge weight used to sort edges.