#NEWLINE# def _set_models( self , bdb , generator_id , modelnos , sql ) : #NEWLINE# #INDENT# collect_stats_sql = '\n            SELECT colno, count, sum, sumsq FROM\n                bayesdb_nig_normal_column WHERE generator_id = ?\n        ' #NEWLINE# with bdb . savepoint ( ) : #NEWLINE# #INDENT# cursor = bdb . sql_execute ( collect_stats_sql , ( modelnos , ) ) #NEWLINE# for ( colno , count , xsum , sumsq ) in cursor : #NEWLINE# #INDENT# stats = ( count , xsum , sumsq ) #NEWLINE# for modelno in modelnos : #NEWLINE# #INDENT# ( mu , sig ) = self . _gibbs_step_params ( self . hypers , stats ) #NEWLINE# bdb . sql_execute ( sql , { #NEWLINE# #INDENT# 'generator_id' : generator_id , #NEWLINE# 'colno' : colno , #NEWLINE# 'modelno' : modelno , #NEWLINE# 'mu' : mu , #NEWLINE# 'sigma' : sig , #NEWLINE# #UNINDENT# } )