3bf5f2de89807642dcd1e030e45226ff3944779b,database_manager.py,DatabaseManager,get_everyone_elses_recent_submssions,#DatabaseManager#Any#Any#Any#,342

Before Change



        submissions = []

        for submission in self.db.submissions.aggregate(pipeline):
            if submission["username"] == username:
                continue
            submissions.append(submission)
        return submissions

    def get_filename(self, submission_id):
        Get the filename that is used by S3 based on submission_id

After Change


        
        if end_time is None:
            end_time = datetime.datetime.utcnow()
        cursor = self.postgres_db.cursor(cursor_factory=psycopg2.extras.RealDictCursor)
        query = "SELECT id FROM submissions WHERE round_id = "{}" AND user_id != "{}" AND inserted_at < "{}" ORDER BY inserted_at DESC".format(round_id, user_id, end_time)
        cursor.execute(query)
        results = cursor.fetchall()
        cursor.close()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: numerai/submission-criteria
Commit Name: 3bf5f2de89807642dcd1e030e45226ff3944779b
Time: 2017-11-10
Author: xander@numer.ai
File Name: database_manager.py
Class Name: DatabaseManager
Method Name: get_everyone_elses_recent_submssions


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