0ec2952c74b588529f5be74f93f14f3769787c71,pyemma/coordinates/data/util/traj_info_backends.py,SqliteDB,_clean,#SqliteDB#Any#,322

Before Change



        stmnt = "DELETE FROM traj_info WHERE hash in (%s)" % sql_compatible_ids
        cur = self._database.execute(stmnt)
        self._database.commit()
        assert cur.rowcount == len(ids), "deleted not as many rows(%s) as desired(%s)" %(cur.rowcount, len(ids))

        // iterate over all LRU databases and delete those ids, we"ve just deleted from the main db.
        age_by_hash.sort(key=itemgetter(2))

After Change


            // Do this within the same execution block of the main database, because we do not want the entry to be deleted,
            // in case of a subsequent failure.
            age_by_hash.sort(key=itemgetter(2))
            for db, values in itertools.groupby(age_by_hash, key=itemgetter(2)):
                values = tuple(v[0] for v in values)
                with sqlite3.connect(db, timeout=self.lru_timeout) as conn:
                        stmnt = "DELETE FROM usage WHERE hash IN (%s)" \
                                % SqliteDB._format_tuple_for_sql(values)
                        curr = conn.execute(stmnt)
                        assert curr.rowcount == len(values), curr.rowcount
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: markovmodel/PyEMMA
Commit Name: 0ec2952c74b588529f5be74f93f14f3769787c71
Time: 2017-06-19
Author: m.scherer@fu-berlin.de
File Name: pyemma/coordinates/data/util/traj_info_backends.py
Class Name: SqliteDB
Method Name: _clean


Project Name: home-assistant/home-assistant
Commit Name: 490ef6afad92cc8ade7872b26fb9d33fd2bc25ee
Time: 2017-02-07
Author: kellerza@gmail.com
File Name: tests/components/recorder/test_init.py
Class Name: TestRecorder
Method Name: _add_test_states


Project Name: HazyResearch/fonduer
Commit Name: 506a594e8e5fd755bc02ea2c5fe6437b8b682057
Time: 2018-08-14
Author: lwhsiao@stanford.edu
File Name: fonduer/utils/udf.py
Class Name: UDFRunner
Method Name: apply_mt