5b2766aae94c0615aef2c8d6ac178428e6d28745,pymc/database/mysql.py,Trace,_initialize,#Trace#Any#,26

Before Change


            self.db.cur.execute(query)
        except Exception:
            self.db.cur.execute("SELECT MAX(trace) FROM %s" % self.obj.name)
            last_trace = self.db.cur.fetchall()[0][0]
            if last_trace: self.current_trace =  last_trace + 1

    def tally(self, index):
        Adds current value to trace
        try:
            self._trace[index] = self.obj.value.copy()

After Change


        dbname = self.model.__name__
        
        // Connect to database
        self.DB = MySQLdb.connect(user=self._user, passwd=self._passwd, host=self._host, port=self._port)
        self.cur = self.DB.cursor()
        
        try:
            // Try and create database with model name
            self.cur.execute("CREATE DATABASE %s" % dbname)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: pymc-devs/pymc3
Commit Name: 5b2766aae94c0615aef2c8d6ac178428e6d28745
Time: 2008-07-20
Author: fonnesbeck@15d7aa0b-6f1a-0410-991a-d59f85d14984
File Name: pymc/database/mysql.py
Class Name: Trace
Method Name: _initialize


Project Name: danforthcenter/plantcv
Commit Name: 1e56357baee99a5fa02d54df0db476c58258ffbf
Time: 2017-02-03
Author: mgehan@danforthcenter.org
File Name: plantcv-pipeline.py
Class Name:
Method Name: db_connect


Project Name: danforthcenter/plantcv
Commit Name: 4bd9e98e3a538f9ef3676db3f2f3947de138e256
Time: 2017-02-20
Author: maxjfeldman@gmail.com
File Name: plantcv-pipeline.py
Class Name:
Method Name: db_connect