| 142 | |
| 143 | |
| 144 | class TaskHandler: |
| 145 | def match(self, task_name) -> bool: |
| 146 | raise NotImplementedError() |
| 147 | |
| 148 | def get_main_metric(self, overall_result): |
| 149 | raise NotImplementedError() |
| 150 | |
| 151 | def get_order_priority(self): |
| 152 | return 100000 |
| 153 | |
| 154 | @staticmethod |
| 155 | def get_handler(task_name) -> "TaskHandler": |
| 156 | handlers = [DCG(), HH(), OS(), DB(), KG(), LTP(), WB(), WS()] |
| 157 | for handler in handlers: |
| 158 | if handler.match(task_name): |
| 159 | return handler |
| 160 | raise ValueError(f"Unknown task: {task_name}") |
| 161 | |
| 162 | |
| 163 | class DCG(TaskHandler): |
nothing calls this directly
no outgoing calls
no test coverage detected