from inspect_ai.dataset import Sample

record = {
    "task_id": "ClassEval_demo",
    "skeleton": 'import numpy as np\n\nclass Add_numbers:\n    """\n    This class adds numbers.\n    """\n\n    def __init__(self):\n        pass\n\n    def add(self, x, y):\n        """\n        Add the two numbers\n        :param x: float, first number\n        :param y: float, second number\n        :return: float, sum of the two numbers\n        >>> adder = Add_numbers()\n        >>> adder.add(1,2)',
    "solution_code": "No solution code provided.",
    "import_statement": ["import numpy as np"],
    "class_description": '    """\n    This class adds numbers.\n    """\n',
    "class_name": "Add_numbers",
    "test": "No test code provided.",
    "test_classes": ["AddTest"],
    "class_constructor": "class Add_numbers: \n    def __init__(self):\n        pass\n\n",
    "fields": [],
    "methods_info": [
        {
            "method_name": "add",
            "method_description": "def filter(self, request):\n        \"\"\"\n        Filter the incoming request based on certain rules and conditions.\n        :param request: dict, the incoming request details\n        :return: bool, True if the request is allowed, False otherwise\n        >>> filter = AccessGatewayFilter()\n        >>> filter.filter({'path': '/login', 'method': 'POST'})\n        True\n\n        \"\"\"",
            "test_class": "AddTest",
            "test_code": "pass",
            "dependencies": {
                "Standalone": True,
                "lib_dependencies": [],
                "field_dependencies": [],
                "method_dependencies": [],
            },
        }
    ],
}


sample = Sample(
    input='Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n            ### Instruction:\n            Please complete the class Add_numbers in the following code.\nimport numpy as np\n\nclass Add_numbers:\n    """\n    This class adds numbers.\n    """\n\n    def __init__(self):\n        pass\n\n    def add(self, x, y):\n        """\n        Add the two numbers\n        :param x: float, first number\n        :param y: float, second number\n        :return: float, sum of the two numbers\n        >>> adder = Add_numbers()\n        >>> adder.add(1,2)\n\n            ### Response:\n            ',
    choices=None,
    target="No solution code provided.",
    id="ClassEval_demo",
    metadata={
        "task_id": "ClassEval_demo",
        "skeleton": 'import numpy as np\n\nclass Add_numbers:\n    """\n    This class adds numbers.\n    """\n\n    def __init__(self):\n        pass\n\n    def add(self, x, y):\n        """\n        Add the two numbers\n        :param x: float, first number\n        :param y: float, second number\n        :return: float, sum of the two numbers\n        >>> adder = Add_numbers()\n        >>> adder.add(1,2)',
        "test": "No test code provided.",
        "solution_code": "No solution code provided.",
        "import_statement": ["import numpy as np"],
        "class_description": '    """\n    This class adds numbers.\n    """\n',
        "methods_info": [
            {
                "method_name": "add",
                "method_description": "def filter(self, request):\n        \"\"\"\n        Filter the incoming request based on certain rules and conditions.\n        :param request: dict, the incoming request details\n        :return: bool, True if the request is allowed, False otherwise\n        >>> filter = AccessGatewayFilter()\n        >>> filter.filter({'path': '/login', 'method': 'POST'})\n        True\n\n        \"\"\"",
                "test_class": "AddTest",
                "test_code": "pass",
                "dependencies": {
                    "Standalone": True,
                    "lib_dependencies": [],
                    "field_dependencies": [],
                    "method_dependencies": [],
                },
            }
        ],
        "class_name": "Add_numbers",
        "test_classes": ["AddTest"],
        "class_constructor": "class Add_numbers: \n    def __init__(self):\n        pass\n\n",
        "fields": [],
    },
    sandbox=None,
    files=None,
    setup=None,
)


prompt = r'''Below is an instruction that describes a task. Write a response that appropriately completes the request.

            ### Instruction:
            Please complete the class Add_numbers in the following code.
import numpy as np

class Add_numbers:
    """
    This class adds numbers.
    """

    def __init__(self):
        pass

    def add(self, x, y):
        """
        Add the two numbers
        :param x: float, first number
        :param y: float, second number
        :return: float, sum of the two numbers
        >>> adder = Add_numbers()
        >>> adder.add(1,2)

            ### Response:
            '''

raw_code = r"""Test text
```python
print("Hello, World!")```
Test text 
"""  # noqa: W291

sample_code = r"""print("Hello, World!")"""


INSTRUCTION = """

You are an expert Python programmer. You will be given a task, and the tests that your code must pass.

"""
