{"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":"3d8c2e3e-d823-5f81-bca4-68a3adf883f0","task_key":"default--v0~2e1~2e0~5fhf--3d8c2e3e-d823-5f81-bca4-68a3adf883f0","task_revision_id":"2","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 3d8c2e3e-d823-5f81-bca4-68a3adf883f0","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import pandas as pd\\nfrom random import choices, seed\\ndef task_func(products, ratings, weights, random_seed=42):\\n\",\"complete_prompt\":\"import pandas as pd\\nfrom random import choices, seed\\n\\ndef task_func(products, ratings, weights, random_seed=42):\\n    \\\"\\\"\\\"\\n    Generates a DataFrame containing ratings for a given list of products. Ratings are generated randomly based on the provided weights. \\n    The DataFrame is sorted by ratings in descending order.\\n\\n    Parameters:\\n    products (list): List of product names.\\n    ratings (list): List of possible ratings.\\n    weights (list): List of weights corresponding to each rating for weighted random selection.\\n    random_seed (int, optional): Seed for random number generation for reproducibility. Defaults to 42.\\n\\n    Returns:\\n    pandas.DataFrame: A DataFrame with two columns: 'Product' and 'Rating', sorted by 'Rating' in descending order.\\n\\n    Requirements:\\n    - pandas\\n    - random\\n\\n    Example:\\n    >>> products = [\\\"iPhone\\\", \\\"iPad\\\", \\\"Macbook\\\", \\\"Airpods\\\", \\\"Apple Watch\\\"]\\n    >>> ratings = [1, 2, 3, 4, 5]\\n    >>> weights = [0.05, 0.1, 0.2, 0.3, 0.35]\\n    >>> df = task_func(products, ratings, weights, 42)\\n    >>> print(df.head()) # Expected output is a DataFrame sorted by 'Rating', which may vary due to randomness.\\n           Product  Rating\\n    4  Apple Watch       5\\n    0       iPhone       4\\n    2      Macbook       3\\n    3      Airpods       3\\n    1         iPad       1\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Generates a DataFrame containing ratings for a given list of products. Ratings are generated randomly based on the provided weights. The DataFrame is sorted by ratings in descending order.\\nThe function should output with:\\n    pandas.DataFrame: A DataFrame with two columns: 'Product' and 'Rating', sorted by 'Rating' in descending order.\\nYou should write self-contained code starting with:\\n```\\nimport pandas as pd\\nfrom random import choices, seed\\ndef task_func(products, ratings, weights, random_seed=42):\\n```\",\"libs\":\"['pandas', 'random']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"noindex","subproblems":[],"grids":[]}