{"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":"242c23e7-5a89-5db9-be8e-753f576a8547","task_key":"default--v0~2e1~2e0~5fhf--242c23e7-5a89-5db9-be8e-753f576a8547","task_revision_id":"1","upstream_id":"","short_description":"BigCodeBench v0.1.0_hf 242c23e7-5a89-5db9-be8e-753f576a8547","config":"default","split":"v0.1.0_hf","body":"{\"code_prompt\":\"import numpy as np\\nimport secrets\\nimport hashlib\\nimport base64\\ndef task_func(num, from_base, to_base, alphabet):\\n\",\"complete_prompt\":\"import numpy as np\\nimport secrets\\nimport hashlib\\nimport base64\\n\\ndef task_func(num, from_base, to_base, alphabet):\\n    \\\"\\\"\\\"\\n    Converts a number from one base to another, adds a random salt, hashes the result using SHA-256,\\n    and then encodes the hash in base64 using a custom alphabet. The function also returns the used salt.\\n\\n    Parameters:\\n    num (str): The number to be converted, represented as a string.\\n    from_base (int): The base of the number to be converted.\\n    to_base (int): The base to convert the number to.\\n    alphabet (str): The custom alphabet to be used for base64 encoding. Each character in the provided alphabet\\n        represents a value in the base64 encoding scheme. For example, the standard base64 alphabet is:\\n        \\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\\\".\\n        The function uses this alphabet to encode the hash of the converted number. The length of the alphabet\\n        determines the possible characters in the resulting base64-encoded hash.\\n\\n    Returns:\\n    tuple: A tuple containing the base64-encoded hash of the converted number and the used salt.\\n\\n    Raises:\\n    ValueError: If `from_base` or `to_base` is less than 2, indicating an invalid base for conversion.\\n    ValueError: If the `num` string contains characters not valid in the `from_base` specified, indicating an invalid number format for conversion.\\n\\n    Requirements:\\n    - numpy\\n    - secrets\\n    - hashlib\\n    - base64\\n\\n    Examples:\\n    Convert a hexadecimal number to octal, hash it using SHA-256, and return the base64-encoded hash and salt using a custom alphabet.\\n    >>> alphabet = \\\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/\\\"\\n    >>> encoded, salt = task_func('A1', 16, 8, alphabet)\\n    >>> isinstance(encoded, str) and isinstance(salt, str)\\n    True\\n\\n    Verify that different invocations produce different results due to the random salt.\\n    >>> result1, salt1 = task_func('FF', 16, 8, alphabet)\\n    >>> result2, salt2 = task_func('FF', 16, 8, alphabet)\\n    >>> result1 != result2\\n    True\\n    \\\"\\\"\\\"\\n\",\"entry_point\":\"task_func\",\"instruct_prompt\":\"Converts a number from one base to another, adds a random salt, hashes the result using SHA-256, and then encodes the hash in base64 using a custom alphabet. The function also returns the used salt. Verify that different invocations produce different results due to the random salt. >>> result1, salt1 = task_func('FF', 16, 8, alphabet) >>> result2, salt2 = task_func('FF', 16, 8, alphabet) >>> result1 != result2 True\\nThe function should raise the exception for: ValueError: If `from_base` or `to_base` is less than 2, indicating an invalid base for conversion. ValueError: If the `num` string contains characters not valid in the `from_base` specified, indicating an invalid number format for conversion.\\nThe function should output with:\\n    tuple: A tuple containing the base64-encoded hash of the converted number and the used salt.\\nYou should write self-contained code starting with:\\n```\\nimport numpy as np\\nimport secrets\\nimport hashlib\\nimport base64\\ndef task_func(num, from_base, to_base, alphabet):\\n```\",\"libs\":\"['secrets', 'base64', 'hashlib', 'numpy']\"}","display_format":"code","language":"","answer_status":"published","assets":[],"source_url":"https://bigcode-bench.github.io/","history":"initial import","indexing_mode":"index","subproblems":[],"grids":[]}