#NEWLINE# def split( self , track_segment_no , track_point_no ) : #NEWLINE# #INDENT# '\n        Splits one of the segments in the track in two parts. If one of the\n        split segments is empty it will not be added in the result. The\n        segments will be split in place.\n\n        Parameters\n        ----------\n        track_segment_no : integer\n            The index of the segment to split\n        track_point_no : integer\n            The index of the track point in the segment to split\n        ' #NEWLINE# new_segments = [ ] #NEWLINE# for i in range ( len ( self . segments ) ) : #NEWLINE# #INDENT# segment = self . segments [ i ] #NEWLINE# if ( i == track_segment_no ) : #NEWLINE# #INDENT# ( segment_1 , segment_2 ) = segment . split ( track_point_no ) #NEWLINE# if segment_1 : #NEWLINE# #INDENT# new_segments . append ( segment_1 ) #NEWLINE# #UNINDENT# if segment_2 : #NEWLINE# #INDENT# new_segments . append ( segment_2 ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# new_segments . append ( segment ) #NEWLINE# #UNINDENT# #UNINDENT# self . segments = new_segments