#NEWLINE# def create_temp_gen( bdb , table , target_metamodel , schema ) : #NEWLINE# #INDENT# 'Create a generator.\n\n    :param BayesDB bdb: The BayesDB instance.\n    :param string table: Name of table for generator.\n    :param IBayesDBMetamodel target_metamodel: Metamodel for generator.\n    :param list schema: A valid schema for that metamodel.\n    :return: A :class:`Generator` representing the resulting\n        generator.\n    ' #NEWLINE# gen_name = bdb . temp_table_name ( ) #NEWLINE# gen_id_box = [ None ] #NEWLINE# def instantiate( columns ) : #NEWLINE# #INDENT# ( gen_id , column_list ) = bql . instantiate_generator ( bdb , gen_name , table , target_metamodel , columns , default = True ) #NEWLINE# gen_id_box [ 0 ] = gen_id #NEWLINE# return ( gen_id , column_list ) #NEWLINE# #UNINDENT# with bdb . savepoint ( ) : #NEWLINE# #INDENT# target_metamodel . create_generator ( bdb , table , schema , instantiate ) #NEWLINE# #UNINDENT# return Generator ( bdb , target_metamodel , gen_id_box [ 0 ] , gen_name )