def getLoopListsByPath(derivation, endMultiplier, path):
 vertexes = []
 loopLists = [[]]
 if (len(derivation.loop) < 2):
  return loopLists
 for (pointIndex, pointComplex) in enumerate(derivation.loop):
  if ((endMultiplier != None) and (not derivation.isEndCloseToStart)):
   if (pointIndex == 0):
    nextPoint = derivation.loop[1]
    pointComplex = ((endMultiplier * (pointComplex - nextPoint)) + nextPoint)
   elif (pointIndex == (len(derivation.loop) - 1)):
    previousPoint = derivation.loop[(pointIndex - 1)]
    pointComplex = ((endMultiplier * (pointComplex - previousPoint)) + previousPoint)
  addLoopByComplex(derivation, endMultiplier, loopLists, path, pointComplex, vertexes)
 if derivation.isEndCloseToStart:
  loopLists[(-1)].append([])
 return loopLists

def getLoopListsByPath ( derivation , endMultiplier , path ) : vertexes = [ ] loopLists = [ [ ] ] if ( len ( derivation . loop ) < 2 ) : return loopLists for ( pointIndex , pointComplex ) in enumerate ( derivation . loop ) : if ( ( endMultiplier != None ) and ( not derivation . isEndCloseToStart ) ) : if ( pointIndex == 0 ) : nextPoint = derivation . loop [ 1 ] pointComplex = ( ( endMultiplier * ( pointComplex - nextPoint ) ) + nextPoint ) elif ( pointIndex == ( len ( derivation . loop ) - 1 ) ) : previousPoint = derivation . loop [ ( pointIndex - 1 ) ] pointComplex = ( ( endMultiplier * ( pointComplex - previousPoint ) ) + previousPoint ) addLoopByComplex ( derivation , endMultiplier , loopLists , path , pointComplex , vertexes ) if derivation . isEndCloseToStart : loopLists [ ( - 1 ) ] . append ( [ ] ) return loopLists
get loop lists from path .