<s> '''<STR_LIT>''' <EOL> from brain . session . base import Base <EOL> from brain . session . base_data import Base_Data <EOL> from brain . database . save_entity import Save_Entity <EOL> class Data_Append ( Base , Base_Data ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , svm_data ) : <EOL> '''<STR_LIT>''' <EOL> super ( Data_Append , self ) . __init__ ( svm_data ) <EOL> self . observation_labels = [ ] <EOL> self . list_error = [ ] <EOL> self . uid = <NUM_LIT:1> <EOL> def save_svm_entity ( self , session_type , session_id ) : <EOL> '''<STR_LIT>''' <EOL> svm_entity = { <EOL> '<STR_LIT:title>' : self . svm_data [ '<STR_LIT:data>' ] [ '<STR_LIT>' ] . get ( '<STR_LIT>' , None ) , <EOL> '<STR_LIT>' : self . uid , <EOL> '<STR_LIT>' : session_id , <EOL> } <EOL> db_save = Save_Entity ( svm_entity , session_type ) <EOL> db_return = db_save . save ( ) <EOL> if not db_return [ '<STR_LIT:status>' ] : <EOL> self . list_error . append ( db_return [ '<STR_LIT:error>' ] ) <EOL> return { '<STR_LIT:status>' : False , '<STR_LIT:error>' : self . list_error } <EOL> elif db_return [ '<STR_LIT:status>' ] and session_type == '<STR_LIT>' : <EOL> return { '<STR_LIT:status>' : True , '<STR_LIT:error>' : None } </s>
