a9eb629bcfc8239e86916661f80f0bee9ca26b79,fonduer/snorkel/models/meta.py,,new_sessionmaker,#,37

Before Change


    // Otherwise any e.g. query starts a transaction, locking tables... very bad for e.g. multiple notebooks
    // open, multiple processes, etc.
    if snorkel_postgres:
        snorkel_engine = create_engine(snorkel_conn_string, isolation_level="AUTOCOMMIT")
    else:
        snorkel_engine = create_engine(snorkel_conn_string)

    // New sessionmaker

After Change


    // Otherwise any e.g. query starts a transaction, locking tables... very
    // bad for e.g. multiple notebooks open, multiple processes, etc.
    if Meta.snorkel_postgres and Meta.ready:
        snorkel_engine = create_engine(
            Meta.conn_string, isolation_level="AUTOCOMMIT")
    else:
        raise ValueError(
            "Meta variables have not been initialized with a postgres connection string."
        )
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: HazyResearch/fonduer
Commit Name: a9eb629bcfc8239e86916661f80f0bee9ca26b79
Time: 2018-03-29
Author: lwhsiao@stanford.edu
File Name: fonduer/snorkel/models/meta.py
Class Name:
Method Name: new_sessionmaker


Project Name: snorkel-team/snorkel
Commit Name: ce82cfbcc098b820e13a9027576d68d39c156c34
Time: 2018-05-09
Author: stephenhbach@gmail.com
File Name: test/learning/pytorch/pytorch_test_base.py
Class Name: PyTorchTestBase
Method Name: setUpClass


Project Name: pythonstock/stock
Commit Name: d8c0ed264a487e156fb5de69716de8aef4403d79
Time: 2017-12-26
Author: yhy
File Name: libs/common.py
Class Name:
Method Name: engine