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)
                rowids = rowids[:k]
                cursor = ((rowid,) for rowid in rowids)
            else:
                cursor = bdb.sql_execute("""
                     SELECT _rowid_ FROM %s ORDER BY _rowid_ ASC
                """ % (qt,))

After Change


                k = do_subsample
                sql = "SELECT COUNT(*) FROM %s" % (qt,)
                cursor = bdb.sql_execute(sql)
                n = cursor.next()[0]
                sql = "SELECT _rowid_ FROM %s ORDER BY _rowid_ ASC" % (qt,)
                cursor = bdb.sql_execute(sql)
                seed = struct.pack("<QQQQ", 0, 0, k, n)
                uniform = weakprng.weakprng(seed).weakrandom_uniform
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

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: reinforceio/tensorforce
Commit Name: 4ae93820517945aa7c33fecccc1d32f9c58da722
Time: 2017-12-23
Author: aok25@cl.cam.ac.uk
File Name: tensorforce/environments/minimal_test.py
Class Name: MinimalTest
Method Name: execute


Project Name: chainer/chainercv
Commit Name: 5e01619e1f495db4ce7201c1444a66fbf46059c4
Time: 2019-02-23
Author: ktns.87@gmail.com
File Name: chainercv/links/model/pickable_sequential_chain.py
Class Name: PickableSequentialChain
Method Name: pick