{"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":"5c94be10-cac4-5760-b36e-cb602ad1be96","task_key":"default--v0~2e1~2e0~5fhf--5c94be10-cac4-5760-b36e-cb602ad1be96","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 5c94be10-cac4-5760-b36e-cb602ad1be96","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import numpy as np\\nimport cv2\\nimport os\\ndef task_func(image_path='image.jpg', threshold=128):\\n\",\"complete_prompt\":\"import numpy as np\\nimport cv2\\nimport os\\n\\ndef task_func(image_path='image.jpg', threshold=128):\\n    \\\"\\\"\\\"\\n    Read an RGB image, convert it to grayscale, binarize it using a given threshold, and return both the original and binarized images as numpy arrays.\\n    The function checks for the existence of the image file and validates the threshold value.\\n\\n    Parameters:\\n    - image_path (str): Path to the image file. Defaults to 'image.jpg'.\\n    - threshold (int): Threshold value for binarization. Must be an integer in the range 0-255. Defaults to 128.\\n\\n    Returns:\\n    - tuple: A tuple containing two numpy arrays. The first array represents the original grayscale image,\\n             and the second array represents the binarized image.\\n\\n    Raises:\\n    - FileNotFoundError: If the image file does not exist at the specified path.\\n    - ValueError: If the threshold is not an integer or not in the range 0-255.\\n\\n    Requirements:\\n    - opencv\\n    - numpy\\n    - os\\n    - PIL\\n\\n    Example:\\n    >>> img_path = 'image.jpg'\\n    >>> create_dummy_image(img_path)\\n    >>> original_img_array, binary_img_array = task_func(img_path, 128)\\n    >>> os.remove(img_path)\\n    >>> original_img_array.shape, binary_img_array.shape # ((image_height, image_width), (image_height, image_width))\\n    ((20, 20), (20, 20))\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Read an RGB image, convert it to grayscale, binarize it using a given threshold, and return both the original and binarized images as numpy arrays. The function checks for the existence of the image file and validates the threshold value.\\nThe function should raise the exception for: FileNotFoundError: If the image file does not exist at the specified path. ValueError: If the threshold is not an integer or not in the range 0-255.\\nThe function should output with:\\n    tuple: A tuple containing two numpy arrays. The first array represents the original grayscale image,\\n    and the second array represents the binarized image.\\nYou should write self-contained code starting with:\\n```\\nimport numpy as np\\nimport cv2\\nimport os\\ndef task_func(image_path='image.jpg', threshold=128):\\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":[]}