#NEWLINE# def store_credentials( self , token , credentials ) : #NEWLINE# #INDENT# assert ( ( 'id' in credentials ) and ( 'key' in self ) ) #NEWLINE# try : #NEWLINE# #INDENT# self . __get_raw_token ( credentials [ 'id' ] ) #NEWLINE# raise backend_exceptions . CredentialsAlreadyExist ( credentials [ 'id' ] ) #NEWLINE# #UNINDENT# except backend_exceptions . CredentialsNotFound : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# doc = dict ( token = token , credentials = credentials , type = 'token' ) #NEWLINE# self . _db . save ( doc )