d691d1b9e1bea69067156faa1a517dc7e0213b17,api/data_refinery_api/views.py,Stats,_get_nomad_jobs_breakdown,#Stats#,1196

Before Change


        jobs = self._get_nomad_jobs()
        parameterized_jobs = [job for job in jobs if job["ParameterizedJob"]]

        aggregated_jobs_by_type = groupby(parameterized_jobs, lambda job: self._get_job_details(job)[0])
        nomad_pending_jobs_by_type, nomad_running_jobs_by_type = self._aggregate_nomad_jobs(aggregated_jobs_by_type)

        // To get the total jobs for running and pending, the easiest
        // AND the most efficient way is to sum up the stats we"ve

After Change


        parameterized_jobs = [job for job in jobs if job["ParameterizedJob"]]

        // groupby must be executed on a sorted iterable https://docs.python.org/2/library/itertools.html//itertools.groupby
        sorted_jobs_by_type = sorted(filter(self._get_job_type, parameterized_jobs), key=self._get_job_type)
        aggregated_jobs_by_type = groupby(sorted_jobs_by_type, self._get_job_type)
        nomad_pending_jobs_by_type, nomad_running_jobs_by_type = self._aggregate_nomad_jobs(aggregated_jobs_by_type)

        // To get the total jobs for running and pending, the easiest
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: AlexsLemonade/refinebio
Commit Name: d691d1b9e1bea69067156faa1a517dc7e0213b17
Time: 2019-03-19
Author: arielsvn@gmail.com
File Name: api/data_refinery_api/views.py
Class Name: Stats
Method Name: _get_nomad_jobs_breakdown


Project Name: probcomp/bayeslite
Commit Name: 47afe2f3d36bc46e2504ef90774f0794a3c1bd8c
Time: 2020-02-25
Author: ulli@mit.edu
File Name: src/backends/cgpm_backend.py
Class Name: CGPM_Backend
Method Name: _json_ready_model


Project Name: probcomp/bayeslite
Commit Name: e2042f7bec0605ba18e50186be1451f68d89bd56
Time: 2020-02-25
Author: ulli@mit.edu
File Name: src/backends/cgpm_backend.py
Class Name: CGPM_Backend
Method Name: _json_ready_model


Project Name: Pinafore/qb
Commit Name: aa913fbeb5bd531981b6a01d2ea727c87db26e24
Time: 2018-04-18
Author: sjtufs@gmail.com
File Name: qanta/buzzer/util.py
Class Name:
Method Name: read_data