4563e383962690cc196f4551f217d488501b660e,bin/count_users_in_rooms.py,,,#,38

Before Change


            dbname, dbuser, dbhost, dbport, dbpass)
        )
    except:
        raise RuntimeError("could not connect to db")

    cur = conn.cursor()
    cur.execute(select count(*) from rooms_users_association_table)
    the_count = cur.fetchone()[0]

After Change


    if dbtype == "rdbms" and dbdriver.startswith("mysql"):
        import MySQLdb

        conn = MySQLdb.connect(passwd=dbpass, db=dbname, user=dbuser, host=dbhost, port=dbport)
        cur = conn.cursor()
        cur.execute(select count(*) from rooms_users_association_table)
        the_count = cur.fetchone()[0]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: thenetcircle/dino
Commit Name: 4563e383962690cc196f4551f217d488501b660e
Time: 2019-12-29
Author: oscar.eriks@gmail.com
File Name: bin/count_users_in_rooms.py
Class Name:
Method Name:


Project Name: ilastik/ilastik
Commit Name: 8598c54914f6a977e8bb77a3917251adbc8cd26c
Time: 2012-12-14
Author: bernhard.kausler@iwr.uni-heidelberg.de
File Name: workflows/tracking/trackingWorkflow.py
Class Name: TrackingWorkflow
Method Name: connectLane


Project Name: home-assistant/home-assistant
Commit Name: e6ece4bf6d9d38a5361342a22943233f51485aaa
Time: 2016-10-29
Author: adam@armills.info
File Name: homeassistant/components/light/zwave.py
Class Name: ZwaveColorLight
Method Name: __init__