{"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":"4dda2536-7ca6-508b-b151-4727d8f39296","task_key":"default--v0~2e1~2e0~5fhf--4dda2536-7ca6-508b-b151-4727d8f39296","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 4dda2536-7ca6-508b-b151-4727d8f39296","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import pandas as pd\\nfrom sklearn.preprocessing import StandardScaler\\n# Constants\\nFEATURES = ['feature1', 'feature2', 'feature3', 'feature4', 'feature5']\\nTARGET = 'target'\\ndef task_func(df, dict_mapping, plot_histogram=False):\\n\",\"complete_prompt\":\"import pandas as pd\\nfrom sklearn.preprocessing import StandardScaler\\n\\n\\n\\n# Constants\\nFEATURES = ['feature1', 'feature2', 'feature3', 'feature4', 'feature5']\\nTARGET = 'target'\\n\\ndef task_func(df, dict_mapping, plot_histogram=False):\\n    \\\"\\\"\\\"\\n    Pre-processes a DataFrame by replacing values according to a dictionary mapping, standardizing specified features, \\n    and optionally drawing a histogram of the target variable.\\n\\n    Parameters:\\n    - df (DataFrame): The input DataFrame to be preprocessed. It should contain columns named as in FEATURES and TARGET.\\n    - dict_mapping (dict): A dictionary for replacing values in df. The keys should correspond to existing values in df.\\n    - plot_histogram (bool, optional): If True, a histogram of the target variable is displayed. Default is False.\\n\\n    Returns:\\n    - DataFrame: The preprocessed DataFrame with standardized features and values replaced as per dict_mapping.\\n    - Axes: The histogram of the target variable if plot_histogram is True, otherwise None.\\n\\n    Raises:\\n    - The function will raise ValueError if the FEATURES and TARGET columns not in the input DataFrame.\\n    - The function will raise ValueError if the input df is not a DataFrame.\\n\\n    Requirements:\\n    - pandas\\n    - sklearn.preprocessing.StandardScaler\\n\\n    Example:\\n    >>> df = pd.DataFrame({'feature1': [1, 2, 3], 'feature2': [4, 5, 6], 'feature3': [7, 8, 9],'feature4': [10, 11, 12], 'feature5': [13, 14, 15], 'target': [0, 1, 1]})\\n    >>> dict_mapping = {1: 11, 0: 22}\\n    >>> isinstance(task_func(df, dict_mapping, plot_histogram=True)[1], plt.Axes)\\n    True\\n    >>> plt.close()\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Pre-processes a DataFrame by replacing values according to a dictionary mapping, standardizing specified features, and optionally drawing a histogram of the target variable.\\nThe function should raise the exception for: The function will raise ValueError if the FEATURES and TARGET columns not in the input DataFrame. The function will raise ValueError if the input df is not a DataFrame.\\nThe function should output with:\\n    DataFrame: The preprocessed DataFrame with standardized features and values replaced as per dict_mapping.\\n    Axes: The histogram of the target variable if plot_histogram is True, otherwise None.\\nYou should write self-contained code starting with:\\n```\\nimport pandas as pd\\nfrom sklearn.preprocessing import StandardScaler\\n# Constants\\nFEATURES = ['feature1', 'feature2', 'feature3', 'feature4', 'feature5']\\nTARGET = 'target'\\ndef task_func(df, dict_mapping, plot_histogram=False):\\n```\",\"libs\":\"['pandas', 'sklearn']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}