f648bb8b7e332c9e1c58c776d177ab7eedc64d38,gb/hypergraph/sql.py,SQL,dec_degree,#SQL#Any#,195

Before Change



    def dec_degree(self, vert_str):
        Decrements the degree of a vertex.
        cur = self.conn.cursor()
        cur.execute("UPDATE vertices SET degree=degree-1 WHERE id=?", (vert_str,))
        res = cur.rowcount > 0
        self.conn.commit()
        cur.close()
        return res

    def add_raw(self, edge, timestamp):
        Auxiliary function for add to call from inside a transaction.

After Change


        self.close_cursor(cur, local=True, commit=True)
        return res

    def dec_degree(self, vert_str):
        Decrements the degree of a vertex.
        cur = self.open_cursor()
        cur.execute("UPDATE vertices SET degree=degree-1 WHERE id=?", (vert_str,))
        res = cur.rowcount > 0
        self.close_cursor(cur, local=True, commit=True)
        return res

    def add_raw(self, edge, timestamp):
        Auxiliary function for add to call from inside a transaction.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 7

Instances


Project Name: graphbrain/graphbrain
Commit Name: f648bb8b7e332c9e1c58c776d177ab7eedc64d38
Time: 2016-07-30
Author: telmo@telmomenezes.net
File Name: gb/hypergraph/sql.py
Class Name: SQL
Method Name: dec_degree


Project Name: graphbrain/graphbrain
Commit Name: f648bb8b7e332c9e1c58c776d177ab7eedc64d38
Time: 2016-07-30
Author: telmo@telmomenezes.net
File Name: gb/hypergraph/sql.py
Class Name: SQL
Method Name: dec_degree


Project Name: graphbrain/graphbrain
Commit Name: f648bb8b7e332c9e1c58c776d177ab7eedc64d38
Time: 2016-07-30
Author: telmo@telmomenezes.net
File Name: gb/hypergraph/sql.py
Class Name: SQL
Method Name: destroy


Project Name: graphbrain/graphbrain
Commit Name: f648bb8b7e332c9e1c58c776d177ab7eedc64d38
Time: 2016-07-30
Author: telmo@telmomenezes.net
File Name: gb/hypergraph/sql.py
Class Name: SQL
Method Name: remove_str


Project Name: graphbrain/graphbrain
Commit Name: f648bb8b7e332c9e1c58c776d177ab7eedc64d38
Time: 2016-07-30
Author: telmo@telmomenezes.net
File Name: gb/hypergraph/sql.py
Class Name: SQL
Method Name: update_or_insert


Project Name: graphbrain/graphbrain
Commit Name: f648bb8b7e332c9e1c58c776d177ab7eedc64d38
Time: 2016-07-30
Author: telmo@telmomenezes.net
File Name: gb/hypergraph/sql.py
Class Name: SQL
Method Name: inc_degree