def getOrientedLoops(loops):
 for (loopIndex, loop) in enumerate(loops):
  leftPoint = euclidean.getLeftPoint(loop)
  isInFilledRegion = euclidean.getIsInFilledRegion((loops[:loopIndex] + loops[(loopIndex + 1):]), leftPoint)
  if (isInFilledRegion == euclidean.isWiddershins(loop)):
   loop.reverse()
 return loops

def getOrientedLoops ( loops ) : for ( loopIndex , loop ) in enumerate ( loops ) : leftPoint = euclidean . getLeftPoint ( loop ) isInFilledRegion = euclidean . getIsInFilledRegion ( ( loops [ : loopIndex ] + loops [ ( loopIndex + 1 ) : ] ) , leftPoint ) if ( isInFilledRegion == euclidean . isWiddershins ( loop ) ) : loop . reverse ( ) return loops
orient the loops which must be in descending order .