68a7d5553fa4cef09e0159ac5e100a6424172386,src/metamodels/crosscat.py,CrosscatMetamodel,create_generator,#CrosscatMetamodel#Any#Any#Any#Any#,500

Before 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)

After Change


                uniform = weakprng.weakprng(seed).weakrandom_uniform
                samples = [None] * k
                for i, row in enumerate(cursor):
                    r = uniform(i + 1)
                    if r < k:
                        samples[r] = row
                cursor = [s for s in samples if s is not None]
            else:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: probcomp/bayeslite
Commit Name: 68a7d5553fa4cef09e0159ac5e100a6424172386
Time: 2015-09-24
Author: gremio@acm.org
File Name: src/metamodels/crosscat.py
Class Name: CrosscatMetamodel
Method Name: create_generator


Project Name: dit/dit
Commit Name: 670529245c67eb7fc1d368f370caf2728bd1d881
Time: 2013-12-09
Author: ryangregoryjames@gmail.com
File Name: dit/multivariate/tests/test_entropy.py
Class Name:
Method Name: test_H5


Project Name: dit/dit
Commit Name: 670529245c67eb7fc1d368f370caf2728bd1d881
Time: 2013-12-09
Author: ryangregoryjames@gmail.com
File Name: dit/multivariate/tests/test_entropy.py
Class Name:
Method Name: test_H4