{"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":"913a3402-ddf3-55ab-b8d7-d19f826cef36","task_key":"default--v0~2e1~2e0~5fhf--913a3402-ddf3-55ab-b8d7-d19f826cef36","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 913a3402-ddf3-55ab-b8d7-d19f826cef36","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"from collections import defaultdict\\nfrom operator import itemgetter\\nfrom itertools import groupby\\ndef task_func(news_articles):\\n\",\"complete_prompt\":\"from collections import defaultdict\\nfrom operator import itemgetter\\nfrom itertools import groupby\\n\\ndef task_func(news_articles):\\n    \\\"\\\"\\\"\\n    Sort a list of news articles by \\\"category\\\" and \\\"title.\\\" The news articles are then grouped by \\\"category.\\\"\\n\\n    Parameters:\\n    news_articles (list): A list of dictionaries where each dictionary represents\\n    a news article with keys 'title', 'title_url', 'id', and 'category'.\\n\\n    Returns:\\n    dict: A dictionary where the keys are categories and the values are lists\\n    of articles sorted by 'title' in that category. Each article is represented as a dictionary\\n    with keys 'title', 'title_url', 'id', and 'category'.\\n\\n    Raises:\\n    ValueError: If dictionary keys do not match the requirements.\\n\\n    Requirements:\\n    - collections.defaultdict\\n    - operator.itemgetter\\n    - itertools.groupby\\n\\n    Example:\\n    >>> articles = [{'title': 'Apple News', 'title_url': 'Apple_News', 'id': 2, 'category': 'Technology'},\\n    ...             {'title': 'New York Times', 'title_url': 'New_York_Times', 'id': 4, 'category': 'Sports'},\\n    ...             {'title': 'USA Today', 'title_url': 'USA_Today', 'id': 6, 'category': 'Health'}]\\n    >>> sorted_articles = task_func(articles)\\n    >>> print(sorted_articles)\\n    defaultdict(<class 'list'>, {'Health': [{'title': 'USA Today', 'title_url': 'USA_Today', 'id': 6, 'category': 'Health'}], 'Sports': [{'title': 'New York Times', 'title_url': 'New_York_Times', 'id': 4, 'category': 'Sports'}], 'Technology': [{'title': 'Apple News', 'title_url': 'Apple_News', 'id': 2, 'category': 'Technology'}]})\\n\\n    >>> articles = [\\n    ...        {'title': 'Der Standard', 'title_url': 'standard', 'id': 2, 'category': 'climate'},\\n    ...        {'title': 'tecky', 'title_url': 'tecky', 'id': 4, 'category': 'climate'},\\n    ...        {'title': 'earth magazine', 'title_url': 'earth', 'id': 4, 'category': 'environment'}\\n    ...    ]\\n    >>> sorted_articles = task_func(articles)\\n    >>> print(sorted_articles)\\n    defaultdict(<class 'list'>, {'climate': [{'title': 'Der Standard', 'title_url': 'standard', 'id': 2, 'category': 'climate'}, {'title': 'tecky', 'title_url': 'tecky', 'id': 4, 'category': 'climate'}], 'environment': [{'title': 'earth magazine', 'title_url': 'earth', 'id': 4, 'category': 'environment'}]})\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Sort a list of news articles by \\\"category\\\" and \\\"title.\\\" The news articles are then grouped by \\\"category.\\\" >>> articles = [ ...        {'title': 'Der Standard', 'title_url': 'standard', 'id': 2, 'category': 'climate'}, ...        {'title': 'tecky', 'title_url': 'tecky', 'id': 4, 'category': 'climate'}, ...        {'title': 'earth magazine', 'title_url': 'earth', 'id': 4, 'category': 'environment'} ...    ] >>> sorted_articles = task_func(articles) >>> print(sorted_articles) defaultdict(<class 'list'>, {'climate': [{'title': 'Der Standard', 'title_url': 'standard', 'id': 2, 'category': 'climate'}, {'title': 'tecky', 'title_url': 'tecky', 'id': 4, 'category': 'climate'}], 'environment': [{'title': 'earth magazine', 'title_url': 'earth', 'id': 4, 'category': 'environment'}]})\\nThe function should raise the exception for: ValueError: If dictionary keys do not match the requirements.\\nThe function should output with:\\n    dict: A dictionary where the keys are categories and the values are lists\\n    of articles sorted by 'title' in that category. Each article is represented as a dictionary\\n    with keys 'title', 'title_url', 'id', and 'category'.\\nYou should write self-contained code starting with:\\n```\\nfrom collections import defaultdict\\nfrom operator import itemgetter\\nfrom itertools import groupby\\ndef task_func(news_articles):\\n```\",\"libs\":\"['operator', 'collections', 'itertools']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}