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

Before Change


                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


                seed = struct.pack("<QQQQ", 0, 0, k, n)
                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:
                cursor = bdb.sql_execute("""
                     SELECT _rowid_ FROM %s ORDER BY _rowid_ ASC
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

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: RaRe-Technologies/gensim
Commit Name: 1aa7e115fcf87b443373c14b7b2f3dd2e3383584
Time: 2011-02-19
Author: radimrehurek@seznam.cz
File Name: src/gensim/corpora/svmlightcorpus.py
Class Name: SvmLightCorpus
Method Name: saveCorpus


Project Name: NifTK/NiftyNet
Commit Name: bbf4350363dc25cb9cdabb9d8fb635e96a617f32
Time: 2017-08-28
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/io/image_type.py
Class Name: SpatialImage3D
Method Name: shape