#NEWLINE# def __save_segment( self ) : #NEWLINE# #INDENT# '\n        Write the segment to the Block if it exists\n        ' #NEWLINE# if ( self . __seg is None ) : #NEWLINE# #INDENT# self . __seg = False #NEWLINE# return #NEWLINE# #UNINDENT# if ( not self . __seg ) : #NEWLINE# #INDENT# self . __seg = Segment ( file_origin = self . _filename , ** self . __params ) #NEWLINE# self . __spiketimes = [ ] #NEWLINE# #UNINDENT# if self . __lazy : #NEWLINE# #INDENT# train = SpikeTrain ( pq . Quantity ( [ ] , dtype = np . float32 , units = pq . ms ) , t_start = ( 0 * pq . ms ) , t_stop = ( train . __t_stop * pq . ms ) , file_origin = self . _filename ) #NEWLINE# train . lazy_shape = len ( self . __spiketimes ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# times = pq . Quantity ( self . __spiketimes , dtype = np . float32 , units = pq . ms ) #NEWLINE# train = SpikeTrain ( times , t_start = ( 0 * pq . ms ) , t_stop = ( self . __t_stop * pq . ms ) , file_origin = self . _filename ) #NEWLINE# #UNINDENT# self . __seg . spiketrains = [ train ] #NEWLINE# self . __unit . spiketrains . append ( train ) #NEWLINE# self . _blk . segments . append ( self . __seg ) #NEWLINE# self . __seg = False