608fff2119f21191352ddf5d96eb82fc1ab099b0,dit/utils/misc.py,,partitions,#,370

Before Change


    
    // Thomas Dybdahl Ahle (https://github.com/thomasahle)
    // Source: http://compprog.wordpress.com/2007/10/15/generating-the-partitions-of-a-set
    if not set_:
        yield ()
        return
    for i in xrange(2**len(set_) / 2):
        parts = [set(), set()]
        for item in set_:
            parts[i&1].add(item)
            i >>= 1
        for b in partitions(parts[1]):

After Change



            // Convert the partition into a sorted tuple of sorted tuples.
            // Sort by smallest parts first, then lexicographically.
            partition = tuple(sorted(partition, cmp=len_cmp))

            yield partition
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: dit/dit
Commit Name: 608fff2119f21191352ddf5d96eb82fc1ab099b0
Time: 2013-02-25
Author: chebee7i@gmail.com
File Name: dit/utils/misc.py
Class Name:
Method Name: partitions


Project Name: unitedstates/congress-legislators
Commit Name: 068e81f7814dc02943f216c14b6904ef934af824
Time: 2017-02-14
Author: s.t.smith@ieee.org
File Name: congress_lookup.py
Class Name: CongressLookup
Method Name: lookup_legislator_properties


Project Name: unitedstates/congress-legislators
Commit Name: f1f222c883eb4f654ac88f35a794563696a08e2c
Time: 2017-02-12
Author: s.t.smith@ieee.org
File Name: congress_lookup.py
Class Name: CongressLookup
Method Name: lookup_legislator_properties