File size: 785 Bytes
02c783d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Copyright(C) [2025] Advanced Micro Devices, Inc. All rights reserved.

class BaseEvaluator:
    """
    Base class for all Evaluators.
    """

    def __init__(self, name: str, tests_sep_line: str = "#"*146):
        self.name = name
        self.tests_sep_line = tests_sep_line

    def __call__(self, *args, **kwargs):
        """
        Call the execute method with the given arguments.
        """
        return self.execute(*args, **kwargs)

    def execute(self, *args, **kwargs):
        """
        Execute the task with the given arguments.
        """
        raise NotImplementedError("Subclasses must implement this method.")

    def __str__(self):
        """
        String representation of the Evaluator.
        """
        return f"Evaluator(name={self.name})"