File size: 569 Bytes
761f203
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dc990fa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from __future__ import annotations

from env.models import FlakySleuthAction
from graders.task1_grader import grade as grade_t1
from graders.task2_grader import grade as grade_t2
from graders.task3_grader import grade as grade_t3


def grade_action(action: FlakySleuthAction, task: dict) -> float:
    task_type = task.get("task_type")
    if task_type == "classify":
        return grade_t1(action, task)
    if task_type == "root_cause":
        return grade_t2(action, task)
    if task_type == "fix_proposal":
        return grade_t3(action, task)
    return 0.001