code: def sort_edge(edges):
          
          return sorted(edges, key=lambda x: (x.L, x.R))
docs: Sort iterable of edges first by left node indices then right.
  
          Args:
              edges(list[Edge]): List of edges to be sorted.
  
          Returns:
              list[Edge]: Sorted list by left and right node indices.