ed9179bb9f9bc1d55d5977615f364c26641dfe3f,src/metamodels/crosscat.py,CrosscatMetamodel,create_generator,#CrosscatMetamodel#Any#Any#Any#Any#,497

Before Change


            qt = sqlite3_quote_name(table)
            cursor = None
            if do_subsample:
                cursor = bdb.sql_execute("""
                    SELECT _rowid_ FROM %s ORDER BY _rowid_ ASC LIMIT ?
                """ % (qt,), (do_subsample,))
            else:
                cursor = bdb.sql_execute("""
                     SELECT _rowid_ FROM %s ORDER BY _rowid_ ASC
                """ % (qt,))

After Change


                k = do_subsample
                sql = "SELECT _rowid_ FROM %s ORDER BY _rowid_ ASC" % (qt,)
                cursor = bdb.sql_execute(sql)
                rowids = [row[0] for row in cursor]
                n = len(rowids)
                seed = struct.pack("<QQQQ", 0, 0, k, n)
                uniform = weakprng.weakprng(seed).weakrandom_uniform
                randomly_permute(rowids, uniform)
                rowids = rowids[:k]
                cursor = ((rowid,) for rowid in rowids)
            else:
                cursor = bdb.sql_execute("""
                     SELECT _rowid_ FROM %s ORDER BY _rowid_ ASC
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: probcomp/bayeslite
Commit Name: ed9179bb9f9bc1d55d5977615f364c26641dfe3f
Time: 2015-09-23
Author: riastradh+probcomp@csail.mit.edu
File Name: src/metamodels/crosscat.py
Class Name: CrosscatMetamodel
Method Name: create_generator


Project Name: probcomp/bayeslite
Commit Name: 47fadc359c7b6fc44475e89a3fdcfe9362e02558
Time: 2017-02-04
Author: fsaad@mit.edu
File Name: src/bql.py
Class Name:
Method Name: execute_phrase


Project Name: probcomp/bayeslite
Commit Name: 3ea17a40f51af80dee5a66187e7867ad18d31f41
Time: 2017-07-19
Author: michael_truell@horacemann.org
File Name: src/bql.py
Class Name:
Method Name: execute_phrase