8cec62160ffd56f90c781f7524f643b95896c455,server/website/website/utils.py,TaskUtil,get_tasks,#Any#,75

Before Change



    @staticmethod
    def get_tasks(tasks):
        if not tasks:
            return []
        task_ids = tasks.split(",")
        res = []
        for task_id in task_ids:
            task = TaskMeta.objects.filter(task_id=task_id)
            if len(task) == 0:
                continue  // Task Not Finished
            res.append(task[0])
        return res

    @staticmethod
    def get_task_status(tasks):

After Change


            task_ids = task_ids.split(",")
        preserved = Case(*[
            When(task_id=task_id, then=pos) for pos, task_id in enumerate(task_ids)])
        return TaskMeta.objects.filter(task_id__in=task_ids).order_by(preserved)

    @staticmethod
    def get_task_status(tasks):
        if not tasks:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: cmu-db/ottertune
Commit Name: 8cec62160ffd56f90c781f7524f643b95896c455
Time: 2020-01-08
Author: dvanaken@cs.cmu.edu
File Name: server/website/website/utils.py
Class Name: TaskUtil
Method Name: get_tasks


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: okfn-brasil/serenata-de-amor
Commit Name: a460674c772c2c0685148c8eb94b1743afea71d5
Time: 2017-09-28
Author: cuducos@users.noreply.github.com
File Name: jarbas/dashboard/admin.py
Class Name: ReimbursementModelAdmin
Method Name: get_search_results