{"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":"6af46385-9895-5c13-bc54-7240fb8638f6","task_key":"default--v0~2e1~2e0~5fhf--6af46385-9895-5c13-bc54-7240fb8638f6","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 6af46385-9895-5c13-bc54-7240fb8638f6","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import xmltodict\\nimport json\\ndef task_func(s, save_json, json_file_path):\\n\",\"complete_prompt\":\"import xmltodict\\nimport json\\n\\ndef task_func(s, save_json, json_file_path):\\n    \\\"\\\"\\\" \\n    Converts an XML string into a dictionary representation and optionally saves it as a JSON file.\\n\\n    This function is useful for easily accessing data stored in XML format and saving it for future use.\\n\\n    Parameters:\\n    s (str): The XML string to be converted.\\n    save_json (bool): Whether to save the parsed XML as a JSON file.\\n    json_file_path (str): The file path to save the JSON file. Required if save_json is True.\\n\\n    Returns:\\n    dict: A dictionary representation of the XML string.\\n\\n    Raises:\\n    ValueError: If the input XML string is empty or contains only whitespace.\\n\\n    Requirements:\\n    - xmltodict\\n    - json\\n\\n    Examples:\\n    Convert a simple XML string to a dictionary.\\n    >>> result = task_func('<person><name>John</name><age>30</age></person>')\\n    >>> result['person']['name'] + ', ' + result['person']['age']\\n    'John, 30'\\n\\n    Convert an XML string with nested elements.\\n    >>> result = task_func('<school><class><student>Emma</student></class></school>')\\n    >>> result['school']['class']['student']\\n    'Emma'\\n\\n    Save the parsed XML as a JSON file.\\n    >>> task_func('<data><item>1</item><item>2</item></data>', save_json=True, json_file_path='data.json')\\n    # A JSON file 'data.json' will be created with the parsed XML data.\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Converts an XML string into a dictionary representation and optionally saves it as a JSON file. This function is useful for easily accessing data stored in XML format and saving it for future use. Convert an XML string with nested elements. >>> result = task_func('<school><class><student>Emma</student></class></school>') >>> result['school']['class']['student'] 'Emma' Save the parsed XML as a JSON file. >>> task_func('<data><item>1</item><item>2</item></data>', save_json=True, json_file_path='data.json') # A JSON file 'data.json' will be created with the parsed XML data.\\nThe function should raise the exception for: ValueError: If the input XML string is empty or contains only whitespace.\\nThe function should output with:\\n    dict: A dictionary representation of the XML string.\\nYou should write self-contained code starting with:\\n```\\nimport xmltodict\\nimport json\\ndef task_func(s, save_json, json_file_path):\\n```\",\"libs\":\"['xmltodict', 'json']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}