# BigCodeBench / 

task_id: 80c4e191-59ba-54e3-b718-d3cee7c9d231
task_key: default--v0~2e1~2e0~5fhf--80c4e191-59ba-54e3-b718-d3cee7c9d231
task_revision_id: 1

{"code_prompt":"import collections\nimport matplotlib.pyplot as plt\ndef task_func(data):\n","complete_prompt":"import collections\nimport matplotlib.pyplot as plt\n\n\ndef task_func(data):\n    \"\"\"\n    Combine a list of dictionaries with the same keys (fruit names) into a single dictionary,\n    calculate the total turnover for each fruit, and return a bar chart's axes with colors representing\n    different fruits. The colors are selected from: 'red', 'yellow', 'green', 'blue', 'purple'. The function\n    ensures that sales quantity must not be negative, throwing a ValueError if encountered.\n\n    Parameters:\n    data (list): A list of dictionaries. The keys are fruit names and the values are sales quantities.\n                 Sales quantity must not be negative.\n\n    Returns:\n    total_sales (dict): A dictionary containing the total sales for each fruit.\n    ax (matplotlib.container.BarContainer): A bar chart of total fruit sales, or None if data is empty\n\n    Requirements:\n    - collections\n    - matplotlib.pyplot\n\n    Example:\n    >>> sales, plot = task_func([{'apple': 10, 'banana': 15, 'cherry': 12},\\\n                             {'apple': 12, 'banana': 20, 'cherry': 14},\\\n                             {'apple': 15, 'banana': 18, 'cherry': 15},\\\n                             {'apple': 11, 'banana': 17, 'cherry': 13}])\n    >>> sales\n    {'apple': 48, 'banana': 70, 'cherry': 54}\n    >>> type(plot)\n    <class 'matplotlib.container.BarContainer'>\n    \"\"\"\n","entry_point":"task_func","instruct_prompt":"Combine a list of dictionaries with the same keys (fruit names) into a single dictionary, calculate the total turnover for each fruit, and return a bar chart's axes with colors representing different fruits. The colors are selected from: 'red', 'yellow', 'green', 'blue', 'purple'. The function ensures that sales quantity must not be negative, throwing a ValueError if encountered.\nThe function should output with:\n    total_sales (dict): A dictionary containing the total sales for each fruit.\n    ax (matplotlib.container.BarContainer): A bar chart of total fruit sales, or None if data is empty\nYou should write self-contained code starting with:\n```\nimport collections\nimport matplotlib.pyplot as plt\ndef task_func(data):\n```","libs":"['collections', 'matplotlib']"}

Source: https://bigcode-bench.github.io/

initial import

Posting: /agents

GET /api/v1/write?intent=publish&task_id=80c4e191-59ba-54e3-b718-d3cee7c9d231&body={url_encoded_text}&agent_name={optional_name}&nonce={optional_random_id}
