{"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":"516305c1-8074-52c0-bcaf-71512093f9f4","task_key":"default--v0~2e1~2e0~5fhf--516305c1-8074-52c0-bcaf-71512093f9f4","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 516305c1-8074-52c0-bcaf-71512093f9f4","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import csv\\nimport random\\ndef task_func(csv_file='names.csv', \\n          latin_names=['Sopetón', 'Méndez', 'Gómez', 'Pérez', 'Muñoz'],\\n          names=['Smith', 'Johnson', 'Williams', 'Brown', 'Jones'],\\n          encoding='latin-1', rng_seed=None):\\n\",\"complete_prompt\":\"import csv\\nimport random\\n\\n\\ndef task_func(csv_file='names.csv', \\n          latin_names=['Sopetón', 'Méndez', 'Gómez', 'Pérez', 'Muñoz'],\\n          names=['Smith', 'Johnson', 'Williams', 'Brown', 'Jones'],\\n          encoding='latin-1', rng_seed=None):\\n    \\\"\\\"\\\"\\n    Create a CSV file with 100 lines. Each line contains a name and an age (randomly generated between 20 and 50).\\n    Half of the names are randomly selected from a list of Latin names (default: ['Sopetón', 'Méndez', 'Gómez', 'Pérez', 'Muñoz']), \\n    the other half from a list of English names (default: ['Smith', 'Johnson', 'Williams', 'Brown', 'Jones']).\\n    All names are encoded using the specified encoding.\\n    If empty name arrays are passed, a csv with headers but no entries is generated.\\n\\n    Args:\\n    - csv_file (str, optional): Name of the CSV file to be created. Defaults to 'names.csv'.\\n    - latin_names (list, optional): List of Latin names. Defaults to ['Sopetón', 'Méndez', 'Gómez', 'Pérez', 'Muñoz'].\\n    - names (list, optional): List of English names. Defaults to ['Smith', 'Johnson', 'Williams', 'Brown', 'Jones'].\\n    - encoding (str, optional): The encoding used for writing the names. Defaults to 'latin-1'\\n    - rng_seed (int, optional): The seed for the rng. Defaults to None.\\n\\n    Returns:\\n    - str: The CSV file name.\\n\\n    Raises:\\n    - TypeError: If csv_file is not a string.\\n    - TypeError: If latin_names is not an array.\\n    - TypeError: If names is not an array.\\n\\n    Requirements:\\n    - csv\\n    - random\\n\\n    Example:\\n    >>> file_name = task_func()\\n    >>> print(file_name)\\n    names.csv\\n\\n    >>> file_name = task_func(csv_file='test.csv', names=['simon', 'alex'], rng_seed=1)\\n    >>> with open(file_name, 'r', newline='', encoding='latin-1') as csvfile:\\n    ...     reader = csv.reader(csvfile)\\n    ...     rows = list(reader)\\n    ...     print(rows)\\n    [['Name', 'Age'], ['Méndez', '38'], ['simon', '28'], ['Sopetón', '35'], ['alex', '35'], ['Pérez', '45'], ['simon', '23'], ['Pérez', '20'], ['alex', '33'], ['Muñoz', '44'], ['simon', '42'], ['Pérez', '28'], ['simon', '38'], ['Sopetón', '48'], ['alex', '20'], ['Sopetón', '20'], ['simon', '50'], ['Pérez', '41'], ['simon', '33'], ['Sopetón', '36'], ['simon', '44'], ['Pérez', '50'], ['alex', '37'], ['Méndez', '31'], ['simon', '41'], ['Méndez', '44'], ['alex', '50'], ['Gómez', '49'], ['simon', '33'], ['Muñoz', '49'], ['simon', '25'], ['Gómez', '23'], ['alex', '48'], ['Muñoz', '49'], ['alex', '36'], ['Méndez', '29'], ['alex', '38'], ['Pérez', '47'], ['alex', '38'], ['Sopetón', '35'], ['simon', '43'], ['Pérez', '33'], ['simon', '31'], ['Muñoz', '48'], ['alex', '22'], ['Pérez', '41'], ['simon', '44'], ['Méndez', '36'], ['alex', '31'], ['Pérez', '43'], ['simon', '35'], ['Sopetón', '29'], ['alex', '40'], ['Méndez', '25'], ['simon', '20'], ['Méndez', '37'], ['simon', '32'], ['Muñoz', '31'], ['alex', '34'], ['Gómez', '41'], ['simon', '32'], ['Muñoz', '45'], ['simon', '36'], ['Muñoz', '26'], ['alex', '50'], ['Sopetón', '35'], ['alex', '38'], ['Muñoz', '26'], ['alex', '35'], ['Gómez', '33'], ['alex', '20'], ['Muñoz', '37'], ['alex', '34'], ['Muñoz', '20'], ['simon', '40'], ['Méndez', '37'], ['simon', '47'], ['Sopetón', '45'], ['alex', '21'], ['Sopetón', '22'], ['simon', '34'], ['Sopetón', '44'], ['alex', '27'], ['Gómez', '23'], ['simon', '31'], ['Gómez', '22'], ['simon', '25'], ['Gómez', '36'], ['simon', '41'], ['Gómez', '40'], ['alex', '34'], ['Gómez', '35'], ['alex', '23'], ['Sopetón', '29'], ['alex', '30'], ['Pérez', '45'], ['simon', '28'], ['Sopetón', '28'], ['simon', '50'], ['Muñoz', '33'], ['simon', '27']]\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Create a CSV file with 100 lines. Each line contains a name and an age (randomly generated between 20 and 50). Half of the names are randomly selected from a list of Latin names (default: ['Sopetón', 'Méndez', 'Gómez', 'Pérez', 'Muñoz']), the other half from a list of English names (default: ['Smith', 'Johnson', 'Williams', 'Brown', 'Jones']). All names are encoded using the specified encoding. If empty name arrays are passed, a csv with headers but no entries is generated. Args: - csv_file (str, optional): Name of the CSV file to be created. Defaults to 'names.csv'. - latin_names (list, optional): List of Latin names. Defaults to ['Sopetón', 'Méndez', 'Gómez', 'Pérez', 'Muñoz']. - names (list, optional): List of English names. Defaults to ['Smith', 'Johnson', 'Williams', 'Brown', 'Jones']. - encoding (str, optional): The encoding used for writing the names. Defaults to 'latin-1' - rng_seed (int, optional): The seed for the rng. Defaults to None. >>> file_name = task_func(csv_file='test.csv', names=['simon', 'alex'], rng_seed=1) >>> with open(file_name, 'r', newline='', encoding='latin-1') as csvfile: ...     reader = csv.reader(csvfile) ...     rows = list(reader) ...     print(rows) [['Name', 'Age'], ['Méndez', '38'], ['simon', '28'], ['Sopetón', '35'], ['alex', '35'], ['Pérez', '45'], ['simon', '23'], ['Pérez', '20'], ['alex', '33'], ['Muñoz', '44'], ['simon', '42'], ['Pérez', '28'], ['simon', '38'], ['Sopetón', '48'], ['alex', '20'], ['Sopetón', '20'], ['simon', '50'], ['Pérez', '41'], ['simon', '33'], ['Sopetón', '36'], ['simon', '44'], ['Pérez', '50'], ['alex', '37'], ['Méndez', '31'], ['simon', '41'], ['Méndez', '44'], ['alex', '50'], ['Gómez', '49'], ['simon', '33'], ['Muñoz', '49'], ['simon', '25'], ['Gómez', '23'], ['alex', '48'], ['Muñoz', '49'], ['alex', '36'], ['Méndez', '29'], ['alex', '38'], ['Pérez', '47'], ['alex', '38'], ['Sopetón', '35'], ['simon', '43'], ['Pérez', '33'], ['simon', '31'], ['Muñoz', '48'], ['alex', '22'], ['Pérez', '41'], ['simon', '44'], ['Méndez', '36'], ['alex', '31'], ['Pérez', '43'], ['simon', '35'], ['Sopetón', '29'], ['alex', '40'], ['Méndez', '25'], ['simon', '20'], ['Méndez', '37'], ['simon', '32'], ['Muñoz', '31'], ['alex', '34'], ['Gómez', '41'], ['simon', '32'], ['Muñoz', '45'], ['simon', '36'], ['Muñoz', '26'], ['alex', '50'], ['Sopetón', '35'], ['alex', '38'], ['Muñoz', '26'], ['alex', '35'], ['Gómez', '33'], ['alex', '20'], ['Muñoz', '37'], ['alex', '34'], ['Muñoz', '20'], ['simon', '40'], ['Méndez', '37'], ['simon', '47'], ['Sopetón', '45'], ['alex', '21'], ['Sopetón', '22'], ['simon', '34'], ['Sopetón', '44'], ['alex', '27'], ['Gómez', '23'], ['simon', '31'], ['Gómez', '22'], ['simon', '25'], ['Gómez', '36'], ['simon', '41'], ['Gómez', '40'], ['alex', '34'], ['Gómez', '35'], ['alex', '23'], ['Sopetón', '29'], ['alex', '30'], ['Pérez', '45'], ['simon', '28'], ['Sopetón', '28'], ['simon', '50'], ['Muñoz', '33'], ['simon', '27']]\\nThe function should raise the exception for: TypeError: If csv_file is not a string. TypeError: If latin_names is not an array. TypeError: If names is not an array.\\nThe function should output with:\\n    str: The CSV file name.\\nYou should write self-contained code starting with:\\n```\\nimport csv\\nimport random\\ndef task_func(csv_file='names.csv', \\n          latin_names=['Sopetón', 'Méndez', 'Gómez', 'Pérez', 'Muñoz'],\\n          names=['Smith', 'Johnson', 'Williams', 'Brown', 'Jones'],\\n          encoding='latin-1', rng_seed=None):\\n```\",\"libs\":\"['csv', 'random']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}