{"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":"8ea946e9-3cb9-5e76-93e3-7dca32eaf9ee","task_key":"default--v0~2e1~2e0~5fhf--8ea946e9-3cb9-5e76-93e3-7dca32eaf9ee","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 8ea946e9-3cb9-5e76-93e3-7dca32eaf9ee","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import re\\nimport urllib.request\\nimport json\\n# Constants\\nIP_REGEX = r'[0-9]+(?:\\\\.[0-9]+){3}'\\ndef task_func(API_URL):\\n\",\"complete_prompt\":\"import re\\nimport urllib.request\\nimport json\\n\\n# Constants\\nIP_REGEX = r'[0-9]+(?:\\\\.[0-9]+){3}'\\n\\ndef task_func(API_URL):\\n    \\\"\\\"\\\"\\n    Get the public IP address of the current host from an API.\\n    \\n    Parameters:\\n    API_URL (str): The API url that will return json format of the 'ip'.\\n\\n    Returns:\\n    str: The public IP address.\\n    \\n    Raises:\\n    If the API request fails, the function will return the error message.\\n    \\n    Requirements:\\n    - re\\n    - urllib.request\\n    - json\\n    \\n    Example:\\n    >>> import json\\n    >>> from unittest.mock import MagicMock\\n    >>> mock_response = MagicMock()\\n    >>> mock_response.read.return_value = json.dumps({'ip': '192.168.1.1'}).encode('utf-8')\\n    >>> mock_urlopen = MagicMock(return_value=mock_response)\\n    >>> with unittest.mock.patch('urllib.request.urlopen', mock_urlopen):\\n    ...     task_func('https://api.ipify.org?format=json')\\n    '192.168.1.1'\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Get the public IP address of the current host from an API.\\nThe function should raise the exception for: If the API request fails, the function will return the error message.\\nThe function should output with:\\n    str: The public IP address.\\nYou should write self-contained code starting with:\\n```\\nimport re\\nimport urllib.request\\nimport json\\n# Constants\\nIP_REGEX = r'[0-9]+(?:\\\\.[0-9]+){3}'\\ndef task_func(API_URL):\\n```\",\"libs\":\"['urllib', 're', 'json']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}