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

Before Change


    @staticmethod
    def get_knobs_for_session(session):
        // Returns a dict of the knob
        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]

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: 8bc46bda10949ec121c784fa0dd70deea12438f9
Time: 2019-08-22
Author: arielsvn@gmail.com
File Name: foreman/data_refinery_foreman/foreman/management/commands/rerun_salmon_old_samples.py
Class Name:
Method Name: update_salmon_versions


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