{"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":"079e8999-89e6-520f-9f51-bb4c3c59c21b","task_key":"default--v0~2e1~2e0~5fhf--079e8999-89e6-520f-9f51-bb4c3c59c21b","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 079e8999-89e6-520f-9f51-bb4c3c59c21b","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import heapq\\nimport random\\ndef task_func(obj_list, attr, top_n=5, seed=None):\\n\",\"complete_prompt\":\"import heapq\\nimport random\\n\\ndef task_func(obj_list, attr, top_n=5, seed=None):\\n    \\\"\\\"\\\"\\nFind the top N values of the specified attribute in a list of objects.\\nReturn the top N values as well a a randomly sampled value of all attributes.\\n\\nParameters:\\nobj_list (list): The list of objects.\\nattr (str): The attribute to find the top N values.\\ntop_n (int, optional): The number of top values to retrieve. Defaults to 5.\\nseed (float, optional): The seed used for randomly choosing an attribute.\\n\\nReturns:\\nlist[int]: The top N values as a list of integers. Empty list if there are no attributes.\\nfloat: A randomly chosen value of all attributes, None if there are no attributes.\\n\\nRequirements:\\n- heapq\\n- random\\n    \\nExample:\\n    >>> # Sample data class used in the example\\n    >>> class Object:\\n    ...     def __init__(self, value):\\n    ...         self.value = value\\n    ...\\n    >>> random.seed(1)\\n    >>> obj_list = [Object(random.randint(1, 100)) for _ in range(33)]\\n    >>> top_values, random_value = task_func(obj_list, 'value', 5, seed=1)\\n    >>> print(top_values)\\n    [99, 98, 98, 98, 93]\\n    >>> print(random_value)\\n    58\\n\\n    >>> class Object:\\n    ...     def __init__(self, value):\\n    ...         self.test = value\\n    ...\\n    >>> random.seed(2)\\n    >>> obj_list = [Object(random.randint(1, 12)) for _ in range(13)]\\n    >>> top_values, random_value = task_func(obj_list, 'test', 2, 12)\\n    >>> print(top_values)\\n    [12, 11]\\n    >>> print(random_value)\\n    5\\n\\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Find the top N values of the specified attribute in a list of objects. Return the top N values as well a a randomly sampled value of all attributes. >>> class Object: ...     def __init__(self, value): ...         self.test = value ... >>> random.seed(2) >>> obj_list = [Object(random.randint(1, 12)) for _ in range(13)] >>> top_values, random_value = task_func(obj_list, 'test', 2, 12) >>> print(top_values) [12, 11] >>> print(random_value) 5\\nThe function should output with:\\n    list[int]: The top N values as a list of integers. Empty list if there are no attributes.\\n    float: A randomly chosen value of all attributes, None if there are no attributes.\\nYou should write self-contained code starting with:\\n```\\nimport heapq\\nimport random\\ndef task_func(obj_list, attr, top_n=5, seed=None):\\n```\",\"libs\":\"['random', 'heapq']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}