93a71bd6c3f3c731473bc0ddd9b894a252738d01,src/backends/cgpm_backend.py,CGPM_Backend,json_ready_models,#CGPM_Backend#Any#Any#,926

Before Change



        import operator, itertools
        // Sort (name, code, value) list by variable name
        sorted_cats = sorted(cursor, key=operator.itemgetter(0))
        // Group triples by variable name -> list? of (name, group)
        groups = itertools.groupby(sorted_cats, key=operator.itemgetter(0))

        return {"column-statistical-types": stattypes,
                "categories": {name: {triple[1]:triple[2] for triple in group} for name, group in groups},
                "models": []}

    def _unique_rowid(self, rowids):

After Change


        // do it in sqlite SQL
        import operator, itertools
        groups = \
            {colno: group for (colno, group) in 
                itertools.groupby(raw_categories, key=operator.itemgetter(0))}
        assert len(groups) > 0
        assert cat_variables[groups.keys()[0]]
        categories = {cat_variables[colno]:
                          {code: value for(_, code, value) in group}
                      for (colno, group) in groups.items()}
        assert len(categories) > 0

        
        cursor = bdb.sql_execute("""
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: probcomp/bayeslite
Commit Name: 93a71bd6c3f3c731473bc0ddd9b894a252738d01
Time: 2019-12-06
Author: jar23@mumble.net
File Name: src/backends/cgpm_backend.py
Class Name: CGPM_Backend
Method Name: json_ready_models


Project Name: biolab/orange3
Commit Name: 532c5db2b1520bc7422fa106576b11e36f4721ab
Time: 2015-08-06
Author: ales.erjavec@fri.uni-lj.si
File Name: Orange/canvas/help/manager.py
Class Name:
Method Name: create_html_inventory_provider


Project Name: biolab/orange3
Commit Name: 532c5db2b1520bc7422fa106576b11e36f4721ab
Time: 2015-08-06
Author: ales.erjavec@fri.uni-lj.si
File Name: Orange/canvas/help/manager.py
Class Name:
Method Name: create_html_provider