{"kind":"task","effective_mode":"full","benchmark":{"kind":"benchmark","effective_mode":"full","slug":"bigcodebench","formal_name":"BigCodeBench","introduction":"BigCodeBench poses 1,140 function-level tasks drawn across 139 libraries. It tests whether a model can compose several real APIs correctly rather than write one self-contained function.","introduction_ja":"","introduction_en":"","category":"Category not supplied","task_count":null,"acquisition_status":"Acquisition status not supplied","official_url":"https://bigcode-bench.github.io/","indexing_mode":"index","profile":{"resources":[],"task_format":"","scoring":"","metric":"","size":"","answer_access":"","license":"","citation":"","maintainer":"","released":"","why_hard":"","related":[],"history":"","construction":"","limitations":"","saturation":"","scores":[]}},"task_id":"be8e1be0-3726-54ee-8ca5-0fc3372baf43","task_key":"default--v0~2e1~2e0~5fhf--be8e1be0-3726-54ee-8ca5-0fc3372baf43","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf be8e1be0-3726-54ee-8ca5-0fc3372baf43","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import json\\nfrom datetime import datetime\\nimport numpy as np\\nfrom decimal import Decimal\\ndef task_func(my_obj):\\n\",\"complete_prompt\":\"import json\\nfrom datetime import datetime\\nimport numpy as np\\nfrom decimal import Decimal\\n\\ndef task_func(my_obj):\\n    \\\"\\\"\\\"\\n    Serializes an object to a JSON string, handling complex data types through a custom JSONEncoder.\\n    This function is capable of serializing data types such as datetime, numpy.ndarray, and Decimal\\n    which are not natively supported by the default JSON serialization mechanisms.\\n\\n    Parameters:\\n    my_obj (object):  The object to serialize. This could be any Python object, typically a dictionary or a list containing complex data types.\\n\\n    Returns:\\n    str: The serialized JSON string of the object.\\n\\n    Raises:\\n    TypeError: If an object of an unsupported type is encountered that cannot be serialized by both the custom and default JSON encoders. This ensures that users are made aware of serialization limitations for types not explicitly handled.\\n\\n    Requirements:\\n    - json\\n    - datetime.datetime\\n    - numpy\\n    - decimal.Decimal\\n\\n    Examples:\\n    Serialize a dictionary containing datetime, numpy array, and Decimal.\\n    >>> result = task_func({'time': datetime(2023, 4, 1, 12, 0, tzinfo=pytz.utc), 'array': np.array([1, 2, 3]), 'amount': Decimal('10.99')})\\n    >>> '2023-04-01T12:00:00+00:00' in result and '[1, 2, 3]' in result and '10.99' in result\\n    True\\n\\n    Serialize a simple dictionary.\\n    >>> task_func({'name': 'Alice', 'age': 30})\\n    '{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}'\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Serializes an object to a JSON string, handling complex data types through a custom JSONEncoder. This function is capable of serializing data types such as datetime, numpy.ndarray, and Decimal which are not natively supported by the default JSON serialization mechanisms. Serialize a simple dictionary. >>> task_func({'name': 'Alice', 'age': 30}) '{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}'\\nThe function should raise the exception for: TypeError: If an object of an unsupported type is encountered that cannot be serialized by both the custom and default JSON encoders. This ensures that users are made aware of serialization limitations for types not explicitly handled.\\nThe function should output with:\\n    str: The serialized JSON string of the object.\\nYou should write self-contained code starting with:\\n```\\nimport json\\nfrom datetime import datetime\\nimport numpy as np\\nfrom decimal import Decimal\\ndef task_func(my_obj):\\n```\",\"libs\":\"['decimal', 'datetime', 'numpy', 'json']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}