9e9c9c7510b6b50c221cefdde9d30c3b058a2620,server/website/website/models.py,SessionKnobManager,get_knobs_for_session,#Any#,185

Before Change


        knobs = KnobCatalog.objects.filter(dbms=session.dbms)
        knob_dicts = list(knobs.values())
        for i, _ in enumerate(knob_dicts):
            if SessionKnob.objects.filter(session=session, knob=knobs[i]).exists():
                new_knob = SessionKnob.objects.filter(session=session, knob=knobs[i])[0]
                knob_dicts[i]["minval"] = new_knob.minval
                knob_dicts[i]["maxval"] = new_knob.maxval

After Change


    @staticmethod
    def get_knobs_for_session(session):
        // Returns a dict of the knob
        session_knobs = SessionKnob.objects.filter(
            session=session, tunable=True).prefetch_related("knob")
        session_knobs = {s.knob.pk: s for s in session_knobs}
        knob_dicts = list(KnobCatalog.objects.filter(id__in=session_knobs.keys()).values())
        for knob_dict in knob_dicts:
            sess_knob = session_knobs[knob_dict["id"]]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: cmu-db/ottertune
Commit Name: 9e9c9c7510b6b50c221cefdde9d30c3b058a2620
Time: 2019-12-05
Author: dvanaken@cs.cmu.edu
File Name: server/website/website/models.py
Class Name: SessionKnobManager
Method Name: get_knobs_for_session


Project Name: AlexsLemonade/refinebio
Commit Name: 9185c7e257d22a4fe9ffea94474c3de5174ea4c3
Time: 2019-09-17
Author: kurt.wheeler91@gmail.com
File Name: workers/data_refinery_workers/processors/management/commands/create_compendia.py
Class Name:
Method Name: create_job_for_organism


Project Name: MTG/freesound
Commit Name: e252f8a31f777d0ff5aaa03ade04a1522c3d3cd1
Time: 2017-12-01
Author: andres.ferraro@upf.edu
File Name: sounds/management/commands/copy_downloads.py
Class Name: Command
Method Name: handle