#NEWLINE# @ typecheck ( basestring , float , CommandSent ) #NEWLINE# @ logged ( ) #NEWLINE# def finish_experiment_usage( self , reservation_id , end_date , last_command ) : #NEWLINE# #INDENT# session = self . Session ( ) #NEWLINE# try : #NEWLINE# #INDENT# user_used_experiment = session . query ( model . DbUserUsedExperiment ) . filter_by ( reservation_id = reservation_id ) . first ( ) #NEWLINE# if ( user_used_experiment is None ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# user_used_experiment . set_end_date ( end_date ) #NEWLINE# session . add ( user_used_experiment ) #NEWLINE# session . add ( model . DbUserCommand ( session , last_command . command . commandstring , last_command . timestamp_before , last_command . response . commandstring , last_command . timestamp_after ) ) #NEWLINE# session . commit ( ) #NEWLINE# return True #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# session . close ( )