25bdfd7ca876bf714309c84648317b4a3f7227ce,plantcv-pipeline.py,,db_connect,#Any#,370

Before Change


        if os.path.isfile(args.db):
            os.remove(args.db)

    if os.path.isfile(args.db):
        args.connect = sqlite3.connect(args.db)
        // Replace the row_factory result constructor with a dictionary constructor
        args.connect.row_factory = dict_factory
        // Change the text output format from unicode to UTF-8
        args.connect.text_factory = str
        // Database handler
        args.sq = args.connect.cursor()

        for row in args.sq.execute("SELECT MAX(run_id) AS max FROM runinfo"):
            if row["max"] is not None:
                args.run_id = row["max"]

        // Get the last run ID
        for row in args.sq.execute("SELECT MAX(image_id) AS max FROM metadata"):
            if row["max"] is not None:
                args.image_id = row["max"]

    if os.path.isfile(args.db) == False:
        // Connect to the database
        args.connect = sqlite3.connect(args.db)
        // Replace the row_factory result constructor with a dictionary constructor

After Change


    for row in args.sq.execute("SELECT name FROM sqlite_master WHERE type="table""):
        if row["name"] == "runinfo":
            runinfo = True
        elif row["name"] == "metadata":
            metadata = True

    if runinfo is True and metadata is True:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: danforthcenter/plantcv
Commit Name: 25bdfd7ca876bf714309c84648317b4a3f7227ce
Time: 2017-04-05
Author: noahfahlgren@gmail.com
File Name: plantcv-pipeline.py
Class Name:
Method Name: db_connect


Project Name: NeuromorphicProcessorProject/snn_toolbox
Commit Name: cd3e85f75755a2d1f02e03b2d76b74179a64c622
Time: 2016-06-06
Author: bodo.rueckauer@gmail.com
File Name: snntoolbox/core/pipeline.py
Class Name:
Method Name: test_full


Project Name: danforthcenter/plantcv
Commit Name: 25bdfd7ca876bf714309c84648317b4a3f7227ce
Time: 2017-04-05
Author: noahfahlgren@gmail.com
File Name: plantcv-pipeline.py
Class Name:
Method Name: db_connect


Project Name: 1adrianb/face-alignment
Commit Name: f90efe38fb0b1019e5bdc06b8a325aefe44893ea
Time: 2018-12-19
Author: bulat.adrian@gmail.com
File Name: face_alignment/detection/sfd/sfd_detector.py
Class Name: SFDDetector
Method Name: __init__