#NEWLINE# def valid_code( self , client_id , code ) : #NEWLINE# #INDENT# 'Validates if a code is (still) a valid one. It takes two arguments:\n        * The client application ID\n        * The temporary code given by the application\n        It returns True if the code is valid. Otherwise, False\n        ' #NEWLINE# try : #NEWLINE# #INDENT# data = self . db . codes ( ( self . db . codes . code_id == code ) ) . select ( self . db . expires_access ) . first ( ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# self . create_tables ( ) #NEWLINE# return False #NEWLINE# #UNINDENT# if data : #NEWLINE# #INDENT# return ( datetime . datetime . now ( ) < client_id . expires_access ) #NEWLINE# #UNINDENT# return False