Module Import alias Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias Import alias FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameStore body Expr Yield TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameStore body With Call AttributeLoad NameLoad attr keyword Str NameStore body With Call NameLoad AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad Expr Yield TupleLoad NameLoad AttributeLoad NameLoad attr decorator_list AttributeLoad NameLoad attr FunctionDef arguments args defaults body With Call NameLoad Str TupleStore NameStore NameStore body With Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args defaults body With Call NameLoad Str TupleStore NameStore NameStore body With Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args defaults body With Call NameLoad Str TupleStore NameStore NameStore body Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad keyword NameLoad With Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Str Str decorator_list FunctionDef arguments args defaults body With Call NameLoad Str TupleStore NameStore NameStore body Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args defaults body With Call NameLoad Str TupleStore NameStore NameStore body With Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args defaults body With Call NameLoad Str TupleStore NameStore NameStore body With Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args defaults body With Call NameLoad Str TupleStore NameStore NameStore body With Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad keyword NameLoad With Call NameLoad Str TupleStore NameStore NameStore body With Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad keyword NameLoad decorator_list Assign NameStore Str FunctionDef arguments args defaults body With Call NameLoad NameLoad TupleStore NameStore NameStore body Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args defaults body With Call NameLoad NameLoad TupleStore NameStore NameStore body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad Call AttributeLoad NameLoad attr Str attr With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Raise Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad Call AttributeLoad NameLoad attr Str attr With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args defaults body With Call NameLoad NameLoad TupleStore NameStore NameStore body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Str Str decorator_list FunctionDef arguments args defaults body With Call NameLoad NameLoad TupleStore NameStore NameStore body Expr Call AttributeLoad NameLoad attr Str With Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args defaults body With Call NameLoad NameLoad TupleStore NameStore NameStore body Expr Call AttributeLoad NameLoad attr Str With Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad keyword NameLoad decorator_list Assign NameStore Str FunctionDef arguments args defaults body With Call NameLoad NameLoad TupleStore NameStore NameStore body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad keyword NameLoad keyword NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list Expr Call NameLoad Str Expr Call NameLoad Str Expr Call NameLoad Str Assert CompareEq Call AttributeLoad Call AttributeLoad NameLoad attr Str attr ListLoad TupleLoad Num Num Num TupleLoad Num NameLoad Num TupleLoad Num Num NameLoad TupleLoad Num Num Num decorator_list
N/A N/A StringIO N/A apsw N/A contextlib N/A pytest N/A tempfile N/A bayeslite N/A bayeslite.guess bayeslite bql_quote_name N/A test_core bayesdb_csv_stream N/A N/A csv N/A N/A N/A N/A N/A test_core bayesdb bdb N/A N/A N/A N/A bdb N/A N/A StringIO StringIO csv N/A N/A contextlib contextmanager bayesdb_csv_file N/A N/A csv N/A N/A N/A N/A N/A test_core bayesdb bdb N/A N/A N/A N/A tempfile NamedTemporaryFile prefix bayeslite f N/A N/A N/A open N/A f name w out N/A N/A N/A N/A out write csv N/A N/A N/A bdb N/A f name N/A N/A contextlib contextmanager test_csv_import_empty N/A N/A N/A N/A N/A N/A bayesdb_csv_stream N/A bdb f N/A N/A N/A N/A pytest raises IOError N/A N/A N/A N/A bayeslite bayesdb_read_csv bdb empty f header True create True N/A test_csv_import_nocols N/A N/A N/A N/A N/A N/A bayesdb_csv_stream N/A bdb f N/A N/A N/A N/A pytest raises IOError N/A N/A N/A N/A bayeslite bayesdb_read_csv bdb nocols f header True create True N/A test_csv_import_onecol_key N/A N/A N/A N/A N/A N/A bayesdb_csv_stream foo
0
one
2
 N/A bdb f N/A N/A N/A N/A bayeslite bayesdb_read_csv bdb onecol_key f header True create True N/A N/A N/A pytest raises ValueError N/A N/A N/A N/A N/A bayeslite guess bayesdb_guess_generator bdb onecol_key_cc onecol_key crosscat N/A test_csv_import_onecol N/A N/A N/A N/A N/A N/A bayesdb_csv_stream foo
0
one
2
0
 N/A bdb f N/A N/A N/A N/A bayeslite bayesdb_read_csv bdb onecol f header True create True N/A test_csv_import_toofewcols N/A N/A N/A N/A N/A N/A bayesdb_csv_stream foo,bar
0,1
0
 N/A bdb f N/A N/A N/A N/A pytest raises IOError N/A N/A N/A N/A bayeslite bayesdb_read_csv bdb bad f header True create True N/A test_csv_import_toomanycols N/A N/A N/A N/A N/A N/A bayesdb_csv_stream foo,bar
0,1
0,1,2
 N/A bdb f N/A N/A N/A N/A pytest raises IOError N/A N/A N/A N/A bayeslite bayesdb_read_csv bdb bad f header True create True N/A test_csv_import_dupcols N/A N/A N/A N/A N/A N/A bayesdb_csv_stream foo,foo
0,1
 N/A bdb f N/A N/A N/A N/A pytest raises IOError N/A N/A N/A N/A bayeslite bayesdb_read_csv bdb bad f header True create True N/A N/A bayesdb_csv_stream foo,FOO
0,1
 N/A bdb f N/A N/A N/A N/A pytest raises IOError N/A N/A N/A N/A bayeslite bayesdb_read_csv bdb bad f header True create True N/A N/A csv_data age, gender, salary, height, division, rank
34, M, 74000, 65, sales, 3
41, M, 65600, 72, marketing, 4
25, M, 52000, 69, accounting, 5
23, F, 81000, 67, data science, 3
36, F, 96000, 70, management, 2
30, M, 70000, 73, sales, 4
30, F, 81000, 73, engineering, 3
 test_csv_import N/A N/A N/A N/A N/A N/A bayesdb_csv_stream csv_data N/A bdb f N/A N/A N/A N/A bayeslite bayesdb_read_csv bdb employees f header True create True N/A test_csv_import_schema N/A N/A N/A N/A N/A N/A bayesdb_csv_stream csv_data N/A bdb f N/A N/A N/A N/A bdb sql_execute 
            CREATE TABLE employees(
                age INTEGER,
                gender TEXT,
                salary REAL,
                height INTEGER,
                division TEXT,
                rank INTEGER
            )
         N/A N/A N/A bayeslite bayesdb_read_csv bdb employees f header True create False N/A N/A N/A N/A N/A bdb execute select height from employees fetchall N/A N/A N/A pytest raises N/A apsw SQLError N/A N/A N/A N/A bdb execute select idontexist from employees N/A N/A N/A apsw SQLError BQL compiler is broken; a.k.a. sqlite3 is stupid. N/A N/A N/A bdb execute 
            CREATE GENERATOR employees_cc FOR employees USING crosscat(
                age NUMERICAL,
                gender CATEGORICAL,
                salary CYCLIC,
                division CATEGORICAL,
                rank CATEGORICAL
            )
         N/A N/A N/A N/A N/A bdb execute estimate height from employees_cc fetchall N/A N/A N/A pytest raises N/A bayeslite BQLError N/A N/A N/A N/A bdb execute estimate predict height with confidence 0.9 from employees_cc N/A test_csv_import_schema_case N/A N/A N/A N/A N/A N/A bayesdb_csv_stream csv_data N/A bdb f N/A N/A N/A N/A bdb sql_execute 
            CREATE TABLE emPloyEES(
                AGE INTeger,
                geNder Text,
                saLAry REal,
                heighT inteGER,
                DIVision TEXt,
                rank INTEGER
            )
         N/A N/A N/A bayeslite bayesdb_read_csv bdb employees f header True create False N/A N/A N/A N/A bayeslite guess bayesdb_guess_generator bdb employees_cc employees crosscat N/A test_csv_import_badschema0 N/A N/A N/A N/A N/A N/A bayesdb_csv_stream csv_data N/A bdb f N/A N/A N/A N/A bdb sql_execute 
            CREATE TABLE emPloyEES(
                AGE INTeger,
                geNder Text,
                -- saLAry REal,
                heighT inteGER,
                DIVision TEXt,
                rank INTEGER
            )
         N/A N/A N/A pytest raises IOError N/A N/A N/A N/A bayeslite bayesdb_read_csv bdb employees f header True create False N/A test_csv_import_badschema1 N/A N/A N/A N/A N/A N/A bayesdb_csv_stream csv_data N/A bdb f N/A N/A N/A N/A bdb sql_execute 
            CREATE TABLE employees(
                age INTEGER,
                zorblaxianism TEXT,
                salary INTEGER,
                height INTEGER NOT NULL PRIMARY KEY,
                division TEXT,
                rank CATEGORICAL
            )
         N/A N/A N/A pytest raises IOError N/A N/A N/A N/A bayeslite bayesdb_read_csv bdb employees f header True create False N/A N/A csv_data_missing a,b,c
1,2,3
10,,30
100,200,nan
4,5,6
 test_csv_missing N/A N/A N/A N/A N/A N/A bayesdb_csv_stream csv_data_missing N/A bdb f N/A N/A N/A N/A bdb sql_execute CREATE TABLE t(a REAL, b REAL, c REAL) N/A N/A N/A bayeslite bayesdb_read_csv bdb t f header True create False clean N/A N/A column_name N/A N/A N/A qcn N/A bql_quote_name column_name N/A sql N/A UPDATE t SET %s = NULL WHERE %s = '' OR %s LIKE 'NaN' N/A qcn qcn qcn N/A N/A N/A bdb sql_execute sql N/A N/A N/A clean a N/A N/A clean b N/A N/A clean c N/A N/A N/A N/A N/A N/A bdb execute select * from t fetchall N/A N/A 1.0 2.0 3.0 N/A 10.0 None 30.0 N/A 100.0 200.0 None N/A 4.0 5.0 6.0 N/A