def __embed_frond(node_u, node_w, dfs_data, as_branch_marker=False):
d_u = D(node_u, dfs_data)<EOL>d_w = D(node_w, dfs_data)<EOL>comp_d_w = abs(d_w)<EOL>if as_branch_marker:<EOL><INDENT>d_w *= -<NUM_LIT:1><EOL>if dfs_data['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>__insert_frond_RF(d_w, d_u, dfs_data)<EOL><DEDENT>else:<EOL><INDENT>__insert_frond_LF(d_w, d_u, dfs_data)<EOL><DEDENT>return True<EOL><DEDENT>LF = dfs_data['<STR_LIT>']<EOL>m = dfs_data['<STR_LIT>']['<STR_LIT:m>']<EOL>l_w = lw(dfs_data)<EOL>r_w = rw(dfs_data)<EOL>u_m = u(m, dfs_data)<EOL>x_m = fn_x(m, dfs_data)<EOL>case_1 = False<EOL>case_2 = False<EOL>case_3 = False<EOL>if d_u > u_m and d_u > x_m:<EOL><INDENT>case_1 = True<EOL><DEDENT>elif d_u <= u_m and d_u > x_m:<EOL><INDENT>case_2 = True<EOL><DEDENT>elif d_u > u_m and d_u <= x_m:<EOL><INDENT>case_3 = True<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>if comp_d_w >= l_w and comp_d_w >= r_w:<EOL><INDENT>__insert_frond_LF(d_w, d_u, dfs_data)<EOL>dfs_data['<STR_LIT>']['<STR_LIT:m>'] += <NUM_LIT:1><EOL>m = dfs_data['<STR_LIT>']['<STR_LIT:m>']<EOL>n = dfs_data['<STR_LIT>'].num_nodes()<EOL>Lm = {'<STR_LIT:u>': d_w, '<STR_LIT:v>': d_u}<EOL>Rm = {'<STR_LIT:x>': n, '<STR_LIT:y>': <NUM_LIT:0>} <EOL>dfs_data['<STR_LIT>'][m] = [Lm, Rm]<EOL>return True<EOL><DEDENT>elif comp_d_w >= l_w and comp_d_w < r_w:<EOL><INDENT>return __do_case_5_work(d_w, d_u, case_1, case_2, case_3, dfs_data)<EOL><DEDENT>elif comp_d_w < l_w and comp_d_w >= r_w:<EOL><INDENT>return __do_case_6_work(d_w, d_u, case_1, case_2, case_3, dfs_data)<EOL><DEDENT>elif comp_d_w < l_w and comp_d_w < r_w:<EOL><INDENT>while comp_d_w < l_w and comp_d_w < r_w:<EOL><INDENT>if d_u > u_m and d_u > x_m:<EOL><INDENT>return False<EOL><DEDENT>switch_sides(d_u, dfs_data)<EOL>l_w = lw(dfs_data)<EOL>r_w = rw(dfs_data)<EOL>m = dfs_data['<STR_LIT>']['<STR_LIT:m>']<EOL>u_m = u(m, dfs_data)<EOL>x_m = fn_x(m, dfs_data)<EOL><DEDENT>case_1 = False<EOL>case_2 = False<EOL>case_3 = False<EOL>if d_u <= u_m and d_u > x_m:<EOL><INDENT>case_2 = True<EOL><DEDENT>elif d_u > u_m and d_u <= x_m:<EOL><INDENT>case_3 = True<EOL><DEDENT>if comp_d_w >= l_w and comp_d_w < r_w:<EOL><INDENT>return __do_case_5_work(d_w, d_u, case_1, case_2, case_3, dfs_data)<EOL><DEDENT>if comp_d_w < l_w and comp_d_w >= r_w:<EOL><INDENT>return __do_case_6_work(d_w, d_u, case_1, case_2, case_3, dfs_data)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>return False<EOL>
Embeds a frond uw into either LF or RF. Returns whether the embedding was successful.