8cec62160ffd56f90c781f7524f643b95896c455,server/website/website/utils.py,TaskUtil,get_tasks,#Any#,75
Before Change
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
After Change
@staticmethod
def get_tasks(task_ids):
task_ids = task_ids or []
if isinstance(task_ids, str):
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:
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: tensorflow/tpu
Commit Name: 546866f67f0674e52fa76547e98380ba51921b8c
Time: 2019-10-08
Author: power@google.com
File Name: models/official/mobilenet/inception_preprocessing.py
Class Name:
Method Name: apply_with_random_selector
Project Name: marcoancona/DeepExplain
Commit Name: 2fe1f942de95b3fe11acb4881c8f18f65d73bd8e
Time: 2017-11-03
Author: marco.ancona@inf.ethz.ch
File Name: deepexplain/tensorflow/methods.py
Class Name:
Method Name: deepexplain_grad