#NEWLINE# def _emit_post_update_statements( base_mapper , uowtransaction , cached_connections , mapper , table , update ) : #NEWLINE# #INDENT# 'Emit UPDATE statements corresponding to value lists collected\n    by _collect_post_update_commands().' #NEWLINE# def update_stmt( ) : #NEWLINE# #INDENT# clause = sql . and_ ( ) #NEWLINE# for col in mapper . _pks_by_table [ table ] : #NEWLINE# #INDENT# clause . clauses . append ( ( col == sql . bindparam ( col . _label , type_ = col . type ) ) ) #NEWLINE# #UNINDENT# return table . update ( clause ) #NEWLINE# #UNINDENT# statement = base_mapper . _memo ( ( 'post_update' , table ) , update_stmt ) #NEWLINE# for ( key , grouper ) in groupby ( update , ( lambda rec : ( rec [ 4 ] , list ( rec [ 2 ] . keys ( ) ) ) ) ) : #NEWLINE# #INDENT# connection = key [ 0 ] #NEWLINE# multiparams = [ params for ( state , state_dict , params , mapper , conn ) in grouper ] #NEWLINE# cached_connections [ connection ] . execute ( statement , multiparams )