{"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":"1485d79e-ef57-5d08-9c0c-c6a0b4a0159e","task_key":"default--v0~2e1~2e0~5fhf--1485d79e-ef57-5d08-9c0c-c6a0b4a0159e","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 1485d79e-ef57-5d08-9c0c-c6a0b4a0159e","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import re\\nimport pandas as pd\\ndef task_func(df: pd.DataFrame, column_name: str, pattern: str) -> pd.DataFrame:\\n\",\"complete_prompt\":\"import re\\nimport pandas as pd\\n\\n\\ndef task_func(df: pd.DataFrame, column_name: str, pattern: str) -> pd.DataFrame:\\n    \\\"\\\"\\\"\\n    Reverse the order of words in a specific column of a pandas DataFrame where the words\\n    match a user-specified regular expression pattern, using a nested helper function.\\n    Words are considered to be whitespace-separated strings. This function maintains the\\n    original order of non-matching words.\\n\\n    Parameters:\\n    - df (pd.DataFrame): The pandas DataFrame.\\n    - column_name (str): The name of the column to be modified.\\n    - pattern (str), the regular expression pattern to match words against.\\n\\n    Returns:\\n    - pd.DataFrame: A new pandas DataFrame with the specified column's words reordered\\n    if they match the pattern, maintaining the original order of words that do not match,\\n    and returning a copy of the unaltered DataFrame if the pattern is empty.\\n\\n    Requirements:\\n    - pandas\\n    - re\\n\\n    Example:\\n    >>> df = pd.DataFrame({'A': ['apple orange', 'red yellow green'], 'B': [1, 2]})\\n    >>> pattern = r'\\\\b(?:apple|yellow)\\\\b'\\n    >>> reversed_df = task_func(df, 'A', pattern)\\n    >>> reversed_df\\n                      A  B\\n    0      apple orange  1\\n    1  red yellow green  2\\n    >>> df = pd.DataFrame({'A': ['yellow car red', 'green apple yellow'], 'B': [3, 4]})\\n    >>> pattern = r'\\\\b(?:car|apple|yellow)\\\\b'\\n    >>> reversed_df = task_func(df, 'A', pattern)\\n    >>> reversed_df\\n                        A  B\\n    0      yellow car red  3\\n    1  green apple yellow  4\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Reverse the order of words in a specific column of a pandas DataFrame where the words match a user-specified regular expression pattern, using a nested helper function. Words are considered to be whitespace-separated strings. This function maintains the original order of non-matching words.\\nThe function should output with:\\n    pd.DataFrame: A new pandas DataFrame with the specified column's words reordered\\n    if they match the pattern, maintaining the original order of words that do not match,\\n    and returning a copy of the unaltered DataFrame if the pattern is empty.\\nYou should write self-contained code starting with:\\n```\\nimport re\\nimport pandas as pd\\ndef task_func(df: pd.DataFrame, column_name: str, pattern: str) -> pd.DataFrame:\\n```\",\"libs\":\"['pandas', 're']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}