def get_flows_segments(flows):
source_param_name = "<STR_LIT:source>"<EOL>target_param_name = "<STR_LIT:target>"<EOL>segments = []<EOL>for flow in flows:<EOL><INDENT>waypoints = copy.deepcopy(flow[<NUM_LIT:2>][consts.Consts.waypoints])<EOL>source = waypoints.pop(<NUM_LIT:0>)<EOL>while len(waypoints) > <NUM_LIT:0>:<EOL><INDENT>target = waypoints.pop(<NUM_LIT:0>)<EOL>segments.append({source_param_name: {consts.Consts.x: float(source[<NUM_LIT:0>]), consts.Consts.y: float(source[<NUM_LIT:1>])},<EOL>target_param_name: {consts.Consts.x: float(target[<NUM_LIT:0>]), consts.Consts.y: float(target[<NUM_LIT:1>])}})<EOL>source = target<EOL><DEDENT><DEDENT>return segments<EOL>
:param flows: