def addSpacedPortionDirection(portionDirection, spacedPortionDirections):
 lastSpacedPortionDirection = spacedPortionDirections[(-1)]
 if ((portionDirection.portion - lastSpacedPortionDirection.portion) > 0.003):
  spacedPortionDirections.append(portionDirection)
  return
 if (portionDirection.directionReversed > lastSpacedPortionDirection.directionReversed):
  spacedPortionDirections.append(portionDirection)

def addSpacedPortionDirection ( portionDirection , spacedPortionDirections ) : lastSpacedPortionDirection = spacedPortionDirections [ ( - 1 ) ] if ( ( portionDirection . portion - lastSpacedPortionDirection . portion ) > 0.003 ) : spacedPortionDirections . append ( portionDirection ) return if ( portionDirection . directionReversed > lastSpacedPortionDirection . directionReversed ) : spacedPortionDirections . append ( portionDirection )
add spaced portion directions .