def getLoopsInOrderOfArea(compareAreaFunction, loops):
 loopAreas = []
 for loop in loops:
  loopArea = LoopArea(loop)
  loopAreas.append(loopArea)
 loopAreas.sort(compareAreaFunction)
 loopsInDescendingOrderOfArea = []
 for loopArea in loopAreas:
  loopsInDescendingOrderOfArea.append(loopArea.loop)
 return loopsInDescendingOrderOfArea

def getLoopsInOrderOfArea ( compareAreaFunction , loops ) : loopAreas = [ ] for loop in loops : loopArea = LoopArea ( loop ) loopAreas . append ( loopArea ) loopAreas . sort ( compareAreaFunction ) loopsInDescendingOrderOfArea = [ ] for loopArea in loopAreas : loopsInDescendingOrderOfArea . append ( loopArea . loop ) return loopsInDescendingOrderOfArea
get the loops in the order of area according to the compare function .