{"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":"23531552-ba0e-5c51-ab1e-d3ae1d65082c","task_key":"default--v0~2e1~2e0~5fhf--23531552-ba0e-5c51-ab1e-d3ae1d65082c","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 23531552-ba0e-5c51-ab1e-d3ae1d65082c","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import numpy as np\\nfrom sklearn.cluster import KMeans\\ndef task_func(data, n_clusters=2, random_state=0):\\n\",\"complete_prompt\":\"import numpy as np\\nfrom sklearn.cluster import KMeans\\n\\n\\ndef task_func(data, n_clusters=2, random_state=0):\\n    \\\"\\\"\\\"\\n    Perform KMeans clustering on a list of data points with 2D coordinates and \\n    return the cluster labels.\\n\\n    The function takes a list of tuples, each containing an identifier and its \\n    2D coordinates. It applies KMeans clustering to categorize the points.\\n\\n    Parameters:\\n    data (list of tuples): Each tuple contains an identifier and its 2D coordinates (e.g., ('A', 1, 1)).\\n    n_clusters (int): The number of clusters to form. Defaults to 2.\\n    random_state (int): Determines random number generation for centroid\\n                        initialization. Use an int for reproducible output.\\n                        Defaults to 0.\\n\\n    Returns:\\n    ndarray: A numpy array with the cluster labels for each item.\\n\\n    Requirements:\\n    - numpy\\n    - sklearn.cluster.KMeans\\n\\n    Example:\\n    >>> data = [('A', 1, 1), ('B', 2, 2), ('C', 300, 300), ('D', 400, 400)]\\n    >>> labels = task_func(data, n_clusters=2, random_state=42)\\n    >>> print(labels)\\n    [0 0 1 1]\\n    \\n    >>> data = [('T1', 1, 1), ('T2', 1, 1.1), ('T2', 1.1, 1), ('C1', 400, 400), ('C2', 401, 401), ('B1', 35, 35)]\\n    >>> labels = task_func(data, n_clusters=3, random_state=42)\\n    >>> print(labels)\\n    [0 0 0 1 1 2]\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Perform KMeans clustering on a list of data points with 2D coordinates and return the cluster labels. The function takes a list of tuples, each containing an identifier and its 2D coordinates. It applies KMeans clustering to categorize the points. >>> data = [('T1', 1, 1), ('T2', 1, 1.1), ('T2', 1.1, 1), ('C1', 400, 400), ('C2', 401, 401), ('B1', 35, 35)] >>> labels = task_func(data, n_clusters=3, random_state=42) >>> print(labels) [0 0 0 1 1 2]\\nThe function should output with:\\n    ndarray: A numpy array with the cluster labels for each item.\\nYou should write self-contained code starting with:\\n```\\nimport numpy as np\\nfrom sklearn.cluster import KMeans\\ndef task_func(data, n_clusters=2, random_state=0):\\n```\",\"libs\":\"['numpy', 'sklearn']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}