def METHOD_NAME(edges, reverse=True, flip=True):
    result = []
    input = reversed(edges) if reverse else edges
    for edge in input:
        if flip:
            edge.reverse()
        result.append(edge)
    return result