#NEWLINE# def remove_empty( self ) : #NEWLINE# #INDENT# ' Removes empty segments in track ' #NEWLINE# result = [ ] #NEWLINE# for segment in self . segments : #NEWLINE# #INDENT# if ( len ( segment . points ) > 0 ) : #NEWLINE# #INDENT# result . append ( result ) #NEWLINE# #UNINDENT# #UNINDENT# self . segments = result