#NEWLINE# def _addTrainingData( self , labeled_pairs ) : #NEWLINE# #INDENT# '\n        Appends training data to the training data collection.\n        ' #NEWLINE# for ( label , examples ) in labeled_pairs . items ( ) : #NEWLINE# #INDENT# n_examples = len ( examples ) #NEWLINE# labels = ( [ label ] * n_examples ) #NEWLINE# new_data = numpy . empty ( n_examples , dtype = self . training_data . dtype ) #NEWLINE# new_data [ 'label' ] = labels #NEWLINE# new_data [ 'distances' ] = self . data_model . distances ( examples ) #NEWLINE# self . training_data = numpy . append ( self . training_data , new_data )