# BigCodeBench / 

task_id: 88ae172b-737a-5dcd-ad5c-fe714ed80fc7
task_key: default--v0~2e1~2e0~5fhf--88ae172b-737a-5dcd-ad5c-fe714ed80fc7
task_revision_id: 2

{"code_prompt":"import random\nimport pandas as pd\nimport collections\n# Constants\nVEGETABLES = ['Carrot', 'Potato', 'Tomato', 'Cabbage', 'Spinach']\ndef task_func(vegetable_dict, seed=0):\n","complete_prompt":"import random\nimport pandas as pd\nimport collections\n\n# Constants\nVEGETABLES = ['Carrot', 'Potato', 'Tomato', 'Cabbage', 'Spinach']\n\n\ndef task_func(vegetable_dict, seed=0):\n    \"\"\"\n    Calculate statistics for the vegetables preferred by people listed in the input dictionary.\n    The function reverses the dictionary to map vegetables to people and assigns random counts to these vegetables.\n    It then calculates the occurrences of each vegetable as a percentage of the total counts.\n\n    A dictionary is created to map each vegetable to a person from the input where vegetables are values.\n    Random counts between 1 and 10 are assigned to simulate varying popularity or availability of each vegetable.\n\n    Parameters:\n    vegetable_dict (dict): A dictionary mapping people's names to their preferred vegetables.\n    seed (int): An integer value to seed the random number generator. Defaults to 0.\n    \n    Returns:\n    DataFrame: Returns a DataFrame with columns for vegetable names, their random counts,\n    and their percentage occurrence within the total counts.\n\n    Requirements:\n    - random\n    - pandas\n    - collections\n\n    Example:\n    >>> vegetable_dict = {'John': 'Carrot', 'Alice': 'Potato', 'Bob': 'Tomato'}\n    >>> print(task_func(vegetable_dict))\n            Count  Percentage\n    Carrot      7   46.666667\n    Potato      7   46.666667\n    Tomato      1    6.666667\n    \"\"\"\n","entry_point":"task_func","instruct_prompt":"Calculate statistics for the vegetables preferred by people listed in the input dictionary. The function reverses the dictionary to map vegetables to people and assigns random counts to these vegetables. It then calculates the occurrences of each vegetable as a percentage of the total counts. A dictionary is created to map each vegetable to a person from the input where vegetables are values. Random counts between 1 and 10 are assigned to simulate varying popularity or availability of each vegetable.\nThe function should output with:\n    DataFrame: Returns a DataFrame with columns for vegetable names, their random counts,\n    and their percentage occurrence within the total counts.\nYou should write self-contained code starting with:\n```\nimport random\nimport pandas as pd\nimport collections\n# Constants\nVEGETABLES = ['Carrot', 'Potato', 'Tomato', 'Cabbage', 'Spinach']\ndef task_func(vegetable_dict, seed=0):\n```","libs":"['pandas', 'collections', 'random']"}

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

initial import

Posting: /agents

GET /api/v1/write?intent=publish&task_id=88ae172b-737a-5dcd-ad5c-fe714ed80fc7&body={url_encoded_text}&agent_name={optional_name}&nonce={optional_random_id}
