{"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":"460616f1-8c36-50d7-ab2d-0791d3c3d495","task_key":"default--v0~2e1~2e0~5fhf--460616f1-8c36-50d7-ab2d-0791d3c3d495","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 460616f1-8c36-50d7-ab2d-0791d3c3d495","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import cv2\\nimport os\\nimport numpy as np\\ndef task_func(image_file: str) -> np.ndarray:\\n\",\"complete_prompt\":\"import cv2\\nimport os\\nimport numpy as np\\n\\ndef task_func(image_file: str) -> np.ndarray:\\n    \\\"\\\"\\\"\\n    Creates a histogram of the pixel values of a grayscale image.\\n\\n    Parameters:\\n    - image_file (str): The path to the image file.\\n\\n    Returns:\\n    - np.ndarray: A 1D numpy array representing the histogram of the image, with 256 bins corresponding to \\n      the pixel values in the range [0, 256). Each entry in the array represents the frequency of a pixel value \\n      in the grayscale image.\\n\\n    Raises:\\n    - FileNotFoundError: If the specified image file does not exist.\\n    - ValueError: If the image file is not a valid image.\\n\\n    Requirements:\\n    - opencv: For reading the image file in grayscale.\\n    - os: For checking the existence of the image file.\\n    - numpy: For calculating and storing the histogram data.\\n\\n    Example:\\n    >>> dummy_image_path = 'dummy_image.png'\\n    >>> np.random.seed(48)\\n    >>> dummy_image = np.random.randint(0, 256, (10, 10), dtype=np.uint8)\\n    >>> cv2.imwrite(dummy_image_path, dummy_image)\\n    True\\n    >>> histogram = task_func(dummy_image_path)\\n    >>> os.remove(dummy_image_path)\\n    >>> print(histogram.shape)\\n    (256,)\\n\\n    Note:\\n    - The function assumes the image is in grayscale format.\\n    - The histogram array is 1D with a size of 256, where each index corresponds to a pixel value, and the value at each index\\n      represents the count of pixels in the image with that pixel value.\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Creates a histogram of the pixel values of a grayscale image.\\nNote that: The function assumes the image is in grayscale format. The histogram array is 1D with a size of 256, where each index corresponds to a pixel value, and the value at each index represents the count of pixels in the image with that pixel value.\\nThe function should raise the exception for: FileNotFoundError: If the specified image file does not exist. ValueError: If the image file is not a valid image.\\nThe function should output with:\\n    np.ndarray: A 1D numpy array representing the histogram of the image, with 256 bins corresponding to\\n    the pixel values in the range [0, 256). Each entry in the array represents the frequency of a pixel value\\n    in the grayscale image.\\nYou should write self-contained code starting with:\\n```\\nimport cv2\\nimport os\\nimport numpy as np\\ndef task_func(image_file: str) -> np.ndarray:\\n```\",\"libs\":\"['numpy', 'cv2', 'os']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}