#NEWLINE# @ defer . inlineCallbacks #NEWLINE# def set_password( self , user_id , newpassword , requester = None ) : #NEWLINE# #INDENT# password_hash = self . hash ( newpassword ) #NEWLINE# except_access_token_ids = ( [ self . access_token_id ] if requester else [ ] ) #NEWLINE# ( yield self . store . user_set_password_hash ( user_id , password_hash ) ) #NEWLINE# ( yield self . store . user_delete_access_tokens ( user_id , except_access_token_ids ) ) #NEWLINE# ( yield self . hs . get_pusherpool ( ) . remove_pushers_by_user ( user_id , except_access_token_ids ) )