{"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":"noindex","profile":{"resources":[],"task_format":"","scoring":"","metric":"","size":"","answer_access":"","license":"","citation":"","maintainer":"","released":"","why_hard":"","related":[]}},"task_id":"839c0bb1-94f0-50f5-a14e-c9c798f3520c","task_key":"default--v0~2e1~2e0~5fhf--839c0bb1-94f0-50f5-a14e-c9c798f3520c","task_revision_id":"2","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 839c0bb1-94f0-50f5-a14e-c9c798f3520c","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import collections\\nfrom itertools import zip_longest\\nfrom random import choices\\ndef task_func(l1, l2, K=10):\\n\",\"complete_prompt\":\"import collections\\nfrom itertools import zip_longest\\nfrom random import choices\\n\\ndef task_func(l1, l2, K=10):\\n    \\\"\\\"\\\"\\n    Combine two lists by alternating their elements, even if they are of different lengths. \\n    Elements from the longer list without a counterpart in the shorter one will be included on their own.\\n    Then, create a random sample of size K from the combined list, and calculate the frequency of \\n    each element in the sample.\\n\\n    Parameters:\\n    l1 (list): The first list containing any hashable types.\\n    l2 (list): The second list containing any hashable types.\\n    K (int): the size of the random sample from the combined list. Default to 10.\\n\\n    Returns:\\n    collections.Counter: An object that counts the frequency of each element in the sample.\\n\\n    Requirements:\\n    - collections\\n    - itertools.zip_longest\\n    - random.choices\\n\\n    Example:\\n    >>> import random\\n    >>> random.seed(32)\\n    >>> l1 = list(range(10))\\n    >>> l2 = list(range(10, 20))\\n    >>> freq = task_func(l1, l2)\\n    >>> print(freq)\\n    Counter({5: 2, 10: 1, 2: 1, 3: 1, 9: 1, 14: 1, 7: 1, 1: 1, 8: 1})\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Combine two lists by alternating their elements, even if they are of different lengths. Elements from the longer list without a counterpart in the shorter one will be included on their own. Then, create a random sample of size K from the combined list, and calculate the frequency of each element in the sample.\\nThe function should output with:\\n    collections.Counter: An object that counts the frequency of each element in the sample.\\nYou should write self-contained code starting with:\\n```\\nimport collections\\nfrom itertools import zip_longest\\nfrom random import choices\\ndef task_func(l1, l2, K=10):\\n```\",\"libs\":\"['collections', 'random', 'itertools']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"noindex","subproblems":[],"grids":[]}