Module Expr Str Import alias Import alias Import alias Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Dict Str Str Str Str Assign NameStore Set Str Str Str Str Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str If CompareNotEq NameLoad Str body Raise Call NameLoad Str If UnaryOpNot NameLoad body If NameLoad body Raise Call NameLoad Str Assign NameStore NameLoad With Call NameLoad NameLoad Str NameStore body If BoolOpOr NameLoad BoolOpAnd CompareIs NameLoad NameLoad Call AttributeLoad NameLoad attr Str body With Call AttributeLoad NameLoad attr keyword NameLoad NameStore body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotIn Str NameLoad body Raise Call NameLoad Str If CompareNotIn Str NameLoad body Raise Call NameLoad Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str If UnaryOpNot Call NameLoad NameLoad NameLoad body Raise Call NameLoad Str For NameStore NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad If UnaryOpNot Call NameLoad NameLoad NameLoad body Raise Call NameLoad Str If UnaryOpNot CompareIn Str NameLoad body Raise Call NameLoad Str If CompareIn SubscriptLoad NameLoad Index Str NameLoad body Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index Str If CompareNotIn SubscriptLoad NameLoad Index Str NameLoad body Raise Call NameLoad Str Assign NameStore Call NameLoad GeneratorExp TupleLoad Call NameLoad NameLoad Call NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Str comprehension NameStore NameLoad With Call AttributeLoad NameLoad attr body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad Call NameLoad NameLoad If Call AttributeLoad NameLoad attr NameLoad NameLoad body If BoolOpAnd NameLoad UnaryOpNot NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareNotEq Call NameLoad NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad If CompareNotEq NameLoad NameLoad body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad If CompareLt Num Call NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad orelse If NameLoad body Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad orelse Raise Call NameLoad BinOpMod Str TupleLoad Call NameLoad NameLoad For NameStore NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad If CompareNotIn Str NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index Str If CompareNotIn Str NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad For TupleStore NameStore NameStore Call NameLoad SubscriptLoad NameLoad Index Str body If CompareNotIn Str NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index Str If UnaryOpNot Call NameLoad NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad For NameStore Call NameLoad Call NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore IfExp CompareIs NameLoad NameLoad Num BinOpAdd NameLoad Num Assign NameStore Str Assign NameStore Str For TupleStore NameStore NameStore Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr body Assign NameStore BinOpAdd NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore Num If BoolOpAnd CompareIn Str NameLoad Call NameLoad SubscriptLoad NameLoad Index Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Dict Str Str Str NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Dict Str Str Str NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Dict For NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index Call NameLoad NameLoad Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assert Call NameLoad GeneratorExp CompareIn SubscriptLoad NameLoad Index NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore Call NameLoad GeneratorExp Call NameLoad NameLoad comprehension NameStore NameLoad For NameStore NameLoad body If CompareNotIn NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore Call AttributeLoad Str attr GeneratorExp BinOpMod Str TupleLoad NameLoad SubscriptLoad NameLoad Index Call NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Str Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list
N/A N/A Support for legacy models from the previous incarnation of BayesDB. N/A gzip N/A json N/A pickle N/A bayeslite.core core bayeslite.sqlite3_util sqlite3_quote_name bayeslite.util casefold bayeslite.util cursor_value N/A renamed_column_stattypes N/A continuous multinomial numerical categorical N/A allowed_column_stattypes N/A categorical cyclic ignore key numerical bayesdb_load_legacy_models N/A N/A bdb generator table metamodel pathname create ifnotexists gzipped N/A False False None N/A N/A Load legacy BayesDB models from a file.

    Legacy models are from the previous incarnation of BayesDB, before
    bayeslite.  If you did not use the previous incarnation of
    BayesDB, you need not worry about this.

    :param bayeslite.BayesDB bdb: BayesDB instance
    :param str generator: name of generator
    :param str table: name of table
    :param str metamodel: name of metamodel, must be ``crosscat``
    :param str pathname: pathname of legacy models file
    :param bool create: if true and `generator` does not exist, create it
    :param bool ifnotexists: if true and `generator` exists, do it anyway
    :param bool gzipped: if true, or if ``None`` and `pathname`
        ends in ``.pkl.gz``, decompress with gzip first
     N/A N/A metamodel crosscat N/A N/A N/A ValueError Only crosscat legacy models are supported. N/A N/A create N/A N/A ifnotexists N/A N/A N/A ValueError Not creating generator whether or not exists! N/A pickled None N/A N/A open pathname rb f N/A N/A N/A gzipped N/A N/A gzipped None N/A N/A pathname endswith .pkl.gz N/A N/A N/A N/A gzip GzipFile fileobj f gzf N/A N/A pickled N/A N/A pickle load gzf N/A N/A pickled N/A N/A pickle load f N/A N/A schema pickled N/A N/A N/A IOError Invalid legacy model: missing schema N/A N/A models pickled N/A N/A N/A IOError Invalid legacy model: missing models N/A schema N/A pickled N/A schema N/A models N/A pickled N/A models N/A N/A N/A isinstance schema dict N/A N/A N/A IOError Invalid legacy model: schema is not a dict N/A column_name schema N/A N/A column_schema N/A schema N/A column_name N/A N/A N/A isinstance column_schema dict N/A N/A N/A IOError Invalid legacy model: column schema is not a dict N/A N/A N/A cctype column_schema N/A N/A N/A IOError Invalid legacy model: column schema missing cctype N/A N/A N/A column_schema N/A cctype renamed_column_stattypes N/A N/A N/A column_schema N/A cctype N/A renamed_column_stattypes N/A N/A column_schema N/A cctype N/A N/A N/A column_schema N/A cctype allowed_column_stattypes N/A N/A N/A IOError Invalid legacy model: unknown column type N/A column_stattypes N/A dict N/A N/A N/A casefold column_name N/A casefold N/A N/A schema N/A column_name N/A cctype N/A column_name schema N/A N/A N/A bdb savepoint N/A N/A N/A N/A N/A core bayesdb_has_table bdb table N/A N/A N/A ValueError N/A No such table: %s N/A N/A repr table N/A N/A N/A core bayesdb_has_generator bdb generator N/A N/A N/A create N/A ifnotexists N/A N/A N/A ValueError N/A Generator already exists: %s N/A N/A repr generator N/A generator_id N/A N/A core bayesdb_get_generator bdb generator N/A generator_table N/A N/A core bayesdb_generator_table bdb generator_id N/A N/A N/A casefold table generator_table N/A N/A N/A ValueError N/A Generator %r is for table %r, not for table: %r N/A generator generator_table table N/A generator_id N/A N/A core bayesdb_get_generator bdb generator N/A old_types N/A bayesdb_generator_column_stattypes bdb generator_id N/A N/A column_stattypes old_types N/A N/A sql 
                    SELECT COUNT(*) FROM bayesdb_generator_model
                        WHERE generator_id = ?
                 N/A cursor N/A N/A bdb sql_execute sql N/A generator_id N/A N/A 0 N/A cursor_value cursor N/A N/A N/A ValueError N/A Legacy models mismatch schema: %s N/A N/A repr generator N/A qg N/A sqlite3_quote_name generator N/A N/A N/A bdb execute N/A DROP GENERATOR %s N/A qg N/A N/A bayesdb_create_legacy_generator bdb generator table column_stattypes N/A N/A create N/A N/A N/A bayesdb_create_legacy_generator bdb generator table column_stattypes N/A N/A N/A ValueError N/A No such generator: %s N/A N/A repr generator N/A modelno models N/A N/A theta N/A models N/A modelno N/A N/A X_L theta N/A N/A N/A IOError N/A Invalid legacy model: no X_L in theta[%u] N/A modelno N/A X_L N/A theta N/A X_L N/A N/A view_state X_L N/A N/A N/A IOError N/A Invalid legacy model: no view_state in X_L[%u] N/A modelno N/A N/A viewno view_state N/A enumerate N/A X_L N/A view_state N/A N/A N/A column_names view_state N/A N/A N/A IOError N/A Invalid legacy model: no column names in view state %u of X_L[%u] N/A viewno modelno N/A view_column_names N/A view_state N/A column_names N/A N/A N/A isinstance view_column_names list N/A N/A N/A IOError N/A Invalid legacy model: non-list for view %u columns in X_L[%u] N/A viewno modelno N/A i N/A range N/A len view_column_names N/A N/A name N/A view_column_names N/A i N/A N/A N/A N/A core bayesdb_table_has_column bdb table name N/A N/A N/A IOError N/A No such column in table %s: %s N/A N/A repr table N/A repr name N/A colno N/A N/A core bayesdb_table_column_number bdb table name N/A name N/A N/A core bayesdb_table_column_name bdb table colno N/A N/A view_column_names N/A i name N/A generator_id N/A N/A core bayesdb_get_generator bdb generator N/A modelno_max_sql 
            SELECT MAX(modelno) FROM bayesdb_generator_model
                WHERE generator_id = ?
         N/A cursor N/A N/A bdb sql_execute modelno_max_sql N/A generator_id N/A modelno_max N/A cursor_value cursor N/A modelno_start N/A N/A modelno_max None 0 N/A modelno_max 1 N/A insert_model_sql 
            INSERT INTO bayesdb_generator_model
                (generator_id, modelno, iterations)
                VALUES (:generator_id, :modelno, :iterations)
         N/A insert_theta_json_sql 
            INSERT INTO bayesdb_crosscat_theta
                (generator_id, modelno, theta_json)
                VALUES (:generator_id, :modelno, :theta_json)
         N/A N/A i modelno_ext N/A enumerate N/A sorted N/A N/A models keys N/A N/A modelno N/A modelno_start i N/A theta N/A models N/A modelno_ext N/A iterations 0 N/A N/A N/A iterations theta N/A isinstance N/A theta N/A iterations int N/A N/A iterations N/A theta N/A iterations N/A N/A N/A bdb sql_execute insert_model_sql N/A generator_id modelno iterations generator_id modelno iterations N/A N/A N/A bdb sql_execute insert_theta_json_sql N/A generator_id modelno theta_json generator_id modelno N/A N/A json dumps theta N/A bayesdb_generator_column_stattypes N/A N/A bdb generator_id N/A N/A N/A column_stattypes N/A N/A name N/A N/A core bayesdb_generator_column_names bdb generator_id N/A N/A stattype N/A N/A core bayesdb_generator_column_stattype bdb generator_id name N/A N/A column_stattypes N/A N/A casefold name N/A casefold stattype N/A column_stattypes N/A bayesdb_create_legacy_generator N/A N/A bdb generator table column_stattypes N/A N/A N/A column_names N/A N/A core bayesdb_table_column_names bdb table N/A qcns N/A map sqlite3_quote_name column_names N/A N/A all N/A N/A N/A column_stattypes N/A name allowed_column_stattypes N/A name column_stattypes N/A column_name_set N/A set N/A N/A casefold name N/A name column_names N/A name column_stattypes N/A N/A N/A name column_name_set N/A N/A N/A IOError N/A No such column in table %s: %s N/A N/A repr table N/A repr name N/A schema N/A N/A , join N/A N/A %s %s N/A qcn N/A column_stattypes N/A N/A casefold name N/A N/A name qcn N/A zip column_names qcns N/A qg N/A sqlite3_quote_name generator N/A qt N/A sqlite3_quote_name table N/A qmm crosscat N/A N/A N/A bdb execute N/A CREATE GENERATOR %s FOR %s USING %s(%s) N/A qg qt qmm schema N/A