def getClosestOppositeIntersectionPaths(yIntersectionPaths):
 yIntersectionPaths.sort(compareDistanceFromCenter)
 beforeFirst = (yIntersectionPaths[0].yMinusCenter < 0.0)
 yCloseToCenterPaths = [yIntersectionPaths[0]]
 for yIntersectionPath in yIntersectionPaths[1:]:
  beforeSecond = (yIntersectionPath.yMinusCenter < 0.0)
  if (beforeFirst != beforeSecond):
   yCloseToCenterPaths.append(yIntersectionPath)
   return yCloseToCenterPaths
 return yCloseToCenterPaths

def getClosestOppositeIntersectionPaths ( yIntersectionPaths ) : yIntersectionPaths . sort ( compareDistanceFromCenter ) beforeFirst = ( yIntersectionPaths [ 0 ] . yMinusCenter < 0.0 ) yCloseToCenterPaths = [ yIntersectionPaths [ 0 ] ] for yIntersectionPath in yIntersectionPaths [ 1 : ] : beforeSecond = ( yIntersectionPath . yMinusCenter < 0.0 ) if ( beforeFirst != beforeSecond ) : yCloseToCenterPaths . append ( yIntersectionPath ) return yCloseToCenterPaths return yCloseToCenterPaths
get the close to center paths .