#NEWLINE# def line( self , points , opened ) : #NEWLINE# #INDENT# self . line_arcs = [ ] #NEWLINE# n = len ( points ) #NEWLINE# current_arc = Strut ( ) #NEWLINE# k = 0 #NEWLINE# p = False #NEWLINE# t = False #NEWLINE# if ( not opened ) : #NEWLINE# #INDENT# points . pop ( ) #NEWLINE# n -= 1 #NEWLINE# #UNINDENT# while ( k < n ) : #NEWLINE# #INDENT# t = self . arcs . peak ( points [ k ] ) #NEWLINE# if opened : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# if ( p and ( not mysterious_line_test ( p , t ) ) ) : #NEWLINE# #INDENT# tInP = all ( map ( ( lambda line : ( line in p ) ) , t ) ) #NEWLINE# pInT = all ( map ( ( lambda line : ( line in t ) ) , p ) ) #NEWLINE# if ( tInP and ( not pInT ) ) : #NEWLINE# #INDENT# k -= 1 #NEWLINE# #UNINDENT# break #NEWLINE# #UNINDENT# p = t #NEWLINE# k += 1 #NEWLINE# #UNINDENT# if ( ( k == n ) and isinstance ( p , list ) and ( len ( p ) > 1 ) ) : #NEWLINE# #INDENT# point0 = points [ 0 ] #NEWLINE# i = 2 #NEWLINE# k = 0 #NEWLINE# while ( i < n ) : #NEWLINE# #INDENT# point = points [ i ] #NEWLINE# if ( point_compare ( point0 , point ) > 0 ) : #NEWLINE# #INDENT# point0 = point #NEWLINE# k = i #NEWLINE# #UNINDENT# i += 1 #NEWLINE# #UNINDENT# #UNINDENT# i = ( - 1 ) #NEWLINE# if opened : #NEWLINE# #INDENT# m = ( n - 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# m = n #NEWLINE# #UNINDENT# while ( i < m ) : #NEWLINE# #INDENT# i += 1 #NEWLINE# point = points [ ( ( i + k ) % n ) ] #NEWLINE# p = self . arcs . peak ( point ) #NEWLINE# if ( not mysterious_line_test ( p , t ) ) : #NEWLINE# #INDENT# tInP = all ( map ( ( lambda line : ( line in p ) ) , t ) ) #NEWLINE# pInT = all ( map ( ( lambda line : ( line in t ) ) , p ) ) #NEWLINE# if tInP : #NEWLINE# #INDENT# current_arc . append ( point ) #NEWLINE# #UNINDENT# self . arc ( point0 ) #NEWLINE# if ( ( not tInP ) and ( not pInT ) and len ( current_arc ) ) : #NEWLINE# #INDENT# self . arc ( Strut ( [ current_arc [ ( - 1 ) ] , point ] ) ) #NEWLINE# #UNINDENT# if ( pInT and len ( current_arc ) ) : #NEWLINE# #INDENT# current_arc = Strut ( [ current_arc [ ( - 1 ) ] ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# current_arc = Strut ( ) #NEWLINE# #UNINDENT# #UNINDENT# if ( ( not len ( current_arc ) ) or point_compare ( current_arc [ ( - 1 ) ] , point ) ) : #NEWLINE# #INDENT# current_arc . append ( point ) #NEWLINE# #UNINDENT# t = p #NEWLINE# #UNINDENT# self . arc ( current_arc , True ) #NEWLINE# return self . line_arcs