<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def order_edges(edges):
 r"""Return an ordered traversal of the edges of a two-dimensional polygon. Parameters edges: (2, N) ndarray List of unordered line segments, where each line segment is represented by two unique vertex codes. Returns ------- ordered_edges: (2, N) ndarray """

    edge = edges[0]
    edges = edges[1:]

    ordered_edges = [edge]

    num_max = len(edges)
    while len(edges) > 0 and num_max > 0:

        match = edge[1]

        for search_edge in edges:
            vertex = search_edge[0]
            if match == vertex:
                edge = search_edge
                edges.remove(edge)
                ordered_edges.append(search_edge)
                break
        num_max -= 1

    return ordered_edges