#NEWLINE# def append( self , request , response ) : #NEWLINE# #INDENT# 'Append data to file.\n\n    Args:\n      request: An instance of file_service_pb.AppendRequest.\n      response: An instance of file_service_pb.AppendResponse.\n    ' #NEWLINE# sequence_key = request . sequence_key ( ) #NEWLINE# if sequence_key : #NEWLINE# #INDENT# current_sequence_key = self . file_storage . get_sequence_key ( self . filename ) #NEWLINE# if ( current_sequence_key and ( current_sequence_key >= sequence_key ) ) : #NEWLINE# #INDENT# raise_error ( file_service_pb . FileServiceErrors . SEQUENCE_KEY_OUT_OF_ORDER , error_detail = current_sequence_key ) #NEWLINE# #UNINDENT# self . file_storage . set_sequence_key ( self . filename , sequence_key ) #NEWLINE# #UNINDENT# self . file_storage . append ( self . filename , request . data ( ) )