data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are given a tuple `times` containing the names of football teams in a specific league. Your task is to write a Python function that performs the following operations: A) Return a list of the first five teams in alphabetical order. B) Determine the position of the team 'Chap... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert league_operations(('Atl\\u00e9tico-MG', 'Palmeiras', 'Fortaleza', 'Bragantino', 'Flamengo', 'Corinthians', 'Atl\\u00e9tico-GO', 'Cear\\u00e1 SC', 'Athletico-PR', 'Internacional', 'Santos', 'S\\u00e3o Paulo', 'Juvetude', 'Cuiab\\u00e1', 'Bahia', 'Fluminense',... | {
"split": "train",
"index": 71100,
"acecode_id": "oss_24637",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the number of distinct quartets (four-element combinations) in a given list of integers whose sum matches a specified total. The function should accept a list of integers and an integer total as arguments. Each quartet must be considered dis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_combinations([1, 2, 3, 4, 5], 10) == (1, [[1, 2, 3, 4]])\", \"assert find_combinations([1, 1, 1, 1, 1], 4) == (1, [[1, 1, 1, 1]])\", \"assert find_combinations([0, 0, 0, 0, 0], 0) == (1, [[0, 0, 0, 0]])\", \"assert find_combinations([2, 2, 2, 2, 2], 8) ... | {
"split": "train",
"index": 71101,
"acecode_id": "evol_10163",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `word_freq(text: str, word: str) -> int` that determines the frequency of a specific word within a provided text passage. The function should handle cases where the word is not provided and should ignore punctuation marks as well as letter casing in the tex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_freq('To be, or not to be: that is the question.', 'be') == 2\", \"assert word_freq('Hello, world! Hello!', 'hello') == 2\", \"assert word_freq('Python is great. Python is fun!', 'Python') == 2\", \"assert word_freq('A quick brown fox jumps over the laz... | {
"split": "train",
"index": 71102,
"acecode_id": "evol_6237",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a sparse array. Your task is to implement a function `copy_sparse_array(arr: List[int], skip: int, seek: int, length: int) -> List[int]`. This function should return a new list that contains elements from the input list `arr`, start... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert copy_sparse_array([1, 2, 3, 4, 5], 0, 0, 3) == [1, 2, 3]\", \"assert copy_sparse_array([1, 2, 3, 4, 5], 2, 0, 2) == [3, 4]\", \"assert copy_sparse_array([1, 2, 3, 4, 5], 5, 0, 2) == []\", \"assert copy_sparse_array([1, 2, 3, 4, 5], 0, 5, 3) == [1, 2, 3]\", \... | {
"split": "train",
"index": 71103,
"acecode_id": "bigcode_python_fns_40070",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `set_and_get_value(new_value: str) -> str` that takes a string argument `new_value` and returns it. This function simulates setting a value and then retrieving it. The function should only return the value passed to it without any modifications.\nPlease rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_and_get_value('Hello World') == 'Hello World'\", \"assert set_and_get_value('Python') == 'Python'\", \"assert set_and_get_value('LeetCode') == 'LeetCode'\", \"assert set_and_get_value('Test String') == 'Test String'\", \"assert set_and_get_value('12345')... | {
"split": "train",
"index": 71104,
"acecode_id": "evol_24661",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are working on a distributed computing system that manages expert nodes and their capacities. Your task is to implement a function that limits the global expert count based on a given capacity. Write a function `limit_global_expert_count(topk_idx, num_expert, world_size, ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert limit_global_expert_count([0, 1], 2, 2, 1) == 1\", \"assert limit_global_expert_count([1, 2], 100, 200, 300) == 300\", \"assert limit_global_expert_count([1, 1, 1], 10, 10, 5) == 5\", \"assert limit_global_expert_count([2, 4], 3, 6, 2) == 2\", \"assert limit... | {
"split": "train",
"index": 71105,
"acecode_id": "oss_37562",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simplified version of appending a directory to a list of search paths. Your function should be named `append_directory(directory: str, search_paths: List[str]) -> List[str]`. It takes a string `directory` and a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert append_directory('/home/user/custom', ['/usr/lib/python3', '/usr/local/lib/python3']) == ['/usr/lib/python3', '/usr/local/lib/python3', '/home/user/custom']\", \"assert append_directory('/usr/lib/python3', ['/usr/lib/python3', '/usr/local/lib/python3']) == [... | {
"split": "train",
"index": 71106,
"acecode_id": "oss_14183",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the behavior of a user profile system. The function should take a user's name, email, date of birth, and a boolean indicating whether the user's email address has been verified, and return a dictionary representation... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user_profile('John Doe', 'john.doe@example.com', '1990-05-15', True) == {'name': 'John Doe', 'email': 'john.doe@example.com', 'date_of_birth': '1990-05-15', 'email_verified': True}\", \"assert create_user_profile('Alice Smith', 'alice.smith@example.co... | {
"split": "train",
"index": 71107,
"acecode_id": "oss_12483",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of RGB color values, where each color is represented as a tuple of three integers (R, G, B) that range from 0 to 255. Your task is to convert each RGB color value to its corresponding CIE Lab color value using a simplified conversion formula. The CIE Lab va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_RGB_to_Lab([(255, 0, 0)]) == [(76.5, 178.5, -76.5)]\", \"assert convert_RGB_to_Lab([(255, 255, 255)]) == [(255.0, 0.0, 0.0)]\", \"assert convert_RGB_to_Lab([(0, 0, 0)]) == [(0.0, 0.0, 0.0)]\", \"assert convert_RGB_to_Lab([(150, 150, 150)]) == [(150.0... | {
"split": "train",
"index": 71108,
"acecode_id": "bigcode_python_fns_49052",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python to determine if a given character appears in a specified string. The function should return True if the character exists in the string, and False otherwise. You may assume the string and character are both non-empty. Implement the function `search_cha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_character('Hello', 'l') == True\", \"assert search_character('Hello', 'o') == True\", \"assert search_character('Hello', 'H') == True\", \"assert search_character('Hello', 'e') == True\", \"assert search_character('Hello', 'x') == False\", \"assert se... | {
"split": "train",
"index": 71109,
"acecode_id": "evol_5984",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the deletion of a volume from a storage volume manager (SVM). The function should take a list of volume names and a volume name to delete. If the volume to delete exists in the list, it should be removed, and the functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_volume(['Volume1', 'Volume2', 'Volume3'], 'Volume2') == ['Volume1', 'Volume3']\", \"assert delete_volume(['Volume1', 'Volume1', 'Volume2'], 'Volume1') == ['Volume1', 'Volume2']\", \"assert delete_volume(['Volume1', 'Volume2', 'Volume3'], 'Volume4') ==... | {
"split": "train",
"index": 71110,
"acecode_id": "bigcode_python_fns_46480",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_encoding(n: int) -> str` that generates a unique encoding for a given prime number. The encoding generation process should follow these rules: 1. The encoding should start with the square of the prime number. 2. The remainder of this square when d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_encoding(2) == '4' + '0' + '2'\", \"assert generate_encoding(3) == '9' + '0' + '3'\", \"assert generate_encoding(5) == '25' + '0' + '5'\", \"assert generate_encoding(7) == '49' + '0' + '7'\", \"assert generate_encoding(11) == '121' + '0' + '11'\", \... | {
"split": "train",
"index": 71111,
"acecode_id": "evol_6492",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of three integers representing a coordinate in sexagesimal notation (degrees, minutes, seconds), implement a function that converts these coordinates into decimal degree notation. The function should take a list `sexag_unit` where `sexag_unit[0]` is the degrees, `s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(sexag_to_dec([30, 15, 30]) - 30.258333) < 1e-6\", \"assert abs(sexag_to_dec([0, 0, 0]) - 0.0) < 1e-6\", \"assert abs(sexag_to_dec([45, 0, 0]) - 45.0) < 1e-6\", \"assert abs(sexag_to_dec([180, 0, 0]) - 180.0) < 1e-6\", \"assert abs(sexag_to_dec([60, 0, 0]... | {
"split": "train",
"index": 71112,
"acecode_id": "bigcode_python_fns_1896",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `extract_supervisors(data: List[Dict[str, Any]]) -> List[Dict[str, Any]]` that takes a list of dictionaries representing personnel data. Each dictionary contains keys like 'name', 'role_classification', and other details. The function should return a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_supervisors([{'name': 'Alice', 'role_classification': 'supervisor'}, {'name': 'Bob', 'role_classification': 'employee'}]) == [{'name': 'Alice', 'role_classification': 'supervisor'}]\", \"assert extract_supervisors([{'name': 'Charlie', 'role_classific... | {
"split": "train",
"index": 71113,
"acecode_id": "evol_3761",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the arithmetic mean of all integers between two given whole numbers n and m (both inclusive). The result should be rounded up to the nearest integer and converted to a specified numeric base ranging from 2 to 10. If m is less than n, return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert advanced_base_translation_avg(1, 5, 2) == '0b11'\", \"assert advanced_base_translation_avg(7, 5, 2) == -1\", \"assert advanced_base_translation_avg(10, 20, 2) == '0b1111'\", \"assert advanced_base_translation_avg(4, 4, 10) == '4'\", \"assert advanced_base_tr... | {
"split": "train",
"index": 71114,
"acecode_id": "evol_7897",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `modify_color_map(cMap, position)` that modifies a color map represented as a list of 4-tuples (R, G, B, A). The color map `cMap` is a list of colors where each color is represented as a tuple of four float values in the range [0, 1]. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_color_map([(0.2, 0.4, 0.6, 1), (0.8, 0.1, 0.5, 1), (0.3, 0.7, 0.9, 1)], 1) == None\", \"assert modify_color_map([(0.0, 0.0, 0.0, 1), (0.5, 0.5, 0.5, 1)], 0) == None\", \"assert modify_color_map([(1, 0, 0, 1), (0, 1, 0, 1), (0, 0, 1, 1)], 2) == None\",... | {
"split": "train",
"index": 71115,
"acecode_id": "oss_31060",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of results from a competition and returns the top three scores along with the corresponding letters. Each result is represented as a tuple containing a score and a letter. The function should return the top three... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert top_three_results([(95, 'A'), (87, 'B'), (92, 'C'), (89, 'D'), (98, 'E')]) == [(98, 'E'), (95, 'A'), (92, 'C')]\", \"assert top_three_results([(50, 'X'), (50, 'Y'), (50, 'Z')]) == [(50, 'X'), (50, 'Y'), (50, 'Z')]\", \"assert top_three_results([(100, 'P'), (... | {
"split": "train",
"index": 71116,
"acecode_id": "oss_13813",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of terminal sessions. Implement a function `manage_terminals(operations: List[Tuple[str, str]]) -> Dict[str, str]` that simulates the creation, retrieval, and closure of terminal sessions based on a list of operations. Each operation is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_terminals([('create', 'session1'), ('get', 'session1'), ('close', 'session1'), ('get', 'session1')]) == {'session1': 'Not Found'}\", \"assert manage_terminals([('create', 'sessionA'), ('create', 'sessionB'), ('get', 'sessionA'), ('close', 'sessionB'),... | {
"split": "train",
"index": 71117,
"acecode_id": "oss_12494",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether a given token is present in a configuration dictionary. Write a function named `has_token` that takes a dictionary `config` as input and checks if the key 'token' in the dictionary has a non-None value. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_token({'token': 'abc123'}) == True\", \"assert has_token({'token': None}) == False\", \"assert has_token({'token': ''}) == True\", \"assert has_token({'other_key': 'value'}) == False\", \"assert has_token({'token': 42}) == True\", \"assert has_token({'to... | {
"split": "train",
"index": 71118,
"acecode_id": "oss_27981",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `custom_tanh(x: List[float], scale: float) -> List[float]` that takes two parameters: a list of floats `x` representing the input values and a float `scale` representing the scaling factor to be applied to the hyperbolic tangent function. The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_tanh([-2.0, 0.5, 2.0], 1.0) == [-0.9640275800758169, 0.46211715726000974, 0.9640275800758169]\", \"assert custom_tanh([0.0], 3.0) == [0.0]\", \"assert custom_tanh([-100.0, 100.0], 5.0) == [-5.0, 5.0]\", \"assert custom_tanh([-0.5, -1.0, -1.5, -2.0], 1... | {
"split": "train",
"index": 71119,
"acecode_id": "oss_13010",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that extracts and returns the keys of the first dictionary in a list of dictionaries. The function should also handle a verbosity level, where at a certain level it will print the keys and their types. Write a function `extract_keys(t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_keys([{'a': 1, 'b': 2}], 1) == ['a', 'b']\", \"assert extract_keys([{'x': 5, 'y': 10}], 3) == ['x', 'y']\", \"assert extract_keys([{'name': 'Alice', 'age': 30}], 2) == ['name', 'age']\", \"assert extract_keys([{'key1': 'value1', 'key2': 'value2', 'ke... | {
"split": "train",
"index": 71120,
"acecode_id": "oss_13959",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the factorial of a non-negative integer. The function should take an integer n as its first parameter, an optional second parameter power which defaults to 1, and an optional third parameter modulo. If the power parameter is provided, the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(5) == 120\", \"assert factorial(5, 2) == 14400\", \"assert factorial(5, 2, 10) == 0\", \"assert factorial(5, 1, 10) == 0\", \"assert factorial(10, 1) == 3628800\", \"assert factorial(10, 2) == 13168189440000\", \"asser... | {
"split": "train",
"index": 71121,
"acecode_id": "evol_34909",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a camera configuration function for a robotics project. The function should create a camera object based on the provided parameters and return it. The parameters for the function are as follows: \n- `pipeline`: A string representing the pipeline... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert createAndConfigureCamera('main_pipeline', 0, 'left', '1920x1080', True) == {'index': 0, 'position': 'left', 'resolution': '1920x1080', 'control_input': True}\", \"assert createAndConfigureCamera('main_pipeline', 1, 'right', '1280x720', False) == {'index': 1,... | {
"split": "train",
"index": 71122,
"acecode_id": "oss_18648",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing the names of different parasites. Your task is to assign a random type to each parasite, similar to how types are assigned to Pokémon. The types available are 'fire', 'water', and 'grass'. Implement a function `assign_types(parasites... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_types(['worm', 'fly', 'spider']) == [(1, 'worm', 'fire'), (2, 'fly', 'water'), (3, 'spider', 'grass')]\", \"assert assign_types(['ant', 'bee', 'beetle', 'dragonfly']) == [(1, 'ant', 'fire'), (2, 'bee', 'water'), (3, 'beetle', 'grass'), (4, 'dragonfly'... | {
"split": "train",
"index": 71123,
"acecode_id": "bigcode_python_fns_40948",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two objects, Conf and Process, which represent configuration settings and data processing parameters respectively. Your task is to implement a function called `analyze_data(conf: Conf, process: Process) -> str` that takes these two objects as input and returns a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_data(Conf('ConfigA'), Process('Process1')) == 'Data analysis summary for ConfigA and Process1'\", \"assert analyze_data(Conf('ConfigB'), Process('Process2')) == 'Data analysis summary for ConfigB and Process2'\", \"assert analyze_data(Conf('DefaultCo... | {
"split": "train",
"index": 71124,
"acecode_id": "oss_19752",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to extract an integer from a given sequence of raw bits represented as a list of integers (0 or 1). Each integer in the list corresponds to a single bit, where the first integer is the most significant bit. The function should take th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_int_from_raw_bits([1, 0, 0, 0, 0, 0, 0, 0], 0, 0, 1) == 1\", \"assert extract_int_from_raw_bits([1, 1, 1, 1, 1, 1, 1, 1], 0, 0, 8) == 255\", \"assert extract_int_from_raw_bits([0, 0, 0, 0, 0, 0, 0, 0], 0, 0, 8) == 0\", \"assert extract_int_from_raw_b... | {
"split": "train",
"index": 71125,
"acecode_id": "oss_31741",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of plugin data represented as dictionaries. Each dictionary contains information about a plugin, including its name, version, and a list of commands it provides. Your task is to implement the `load_plugins` function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_plugins([{'name': 'PluginA', 'version': '1.0', 'commands': ['cmd1', 'cmd2']}, {'name': 'PluginB', 'version': '1.1', 'commands': ['cmd3', 'cmd4']}]) == {'PluginA': {'version': '1.0', 'commands': ['cmd1', 'cmd2']}, 'PluginB': {'version': '1.1', 'commands'... | {
"split": "train",
"index": 71126,
"acecode_id": "oss_33056",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a byte string that represents encoded text in UTF-8 format. Your task is to decode this byte string and return the original text it represents. Write a Python function `decode_byte_string(byte_string)` that takes the byte string as input and returns the decoded in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_byte_string(b'Hello, World!') == 'Hello, World!'\", \"assert decode_byte_string(b'Python is great!') == 'Python is great!'\", \"assert decode_byte_string(b'\\\\xe2\\\\x98\\\\x83') == '\\u2603'\", \"assert decode_byte_string(b'') == ''\", \"assert deco... | {
"split": "train",
"index": 71127,
"acecode_id": "oss_33755",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a document management system for a company's document repository. Each document is represented as an object with a unique identifier and content. Your goal is to implement a method that updates the content of a document and simulates the saving ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert (doc := Document(1, 'Old content')).content == 'Old content'\", \"assert (doc := Document(2, 'Initial')).content == 'Initial'\", \"assert (doc := Document(3, '')).content == ''\", \"assert (doc := Document(4, 'Test')).content == 'Test'\", \"assert (doc := Do... | {
"split": "train",
"index": 71128,
"acecode_id": "oss_18944",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of products where each product is represented as a list containing details such as name, category, price, and language. Your task is to write a function that takes this list of products and an index `num` as input. The function should return the language of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_product_language([['Product1', 'Category1', '10', 'Description', 'Available', 'In Stock', '2023', 'English'], ['Product2', 'Category2', '20', 'Description', 'Available', 'In Stock', '2023', 'Spanish']], 0) == 'English'\", \"assert get_product_language([[... | {
"split": "train",
"index": 71129,
"acecode_id": "oss_14736",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of processes represented as strings. Each process is defined by a name and a color in the format 'ProcessName:Color'. Write a function `processes_ps(process_list: List[str], color: str) -> List[str]` that filters and returns a list of process names that mat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert processes_ps(['ProcessA:Red', 'ProcessB:Blue', 'ProcessC:Red'], 'Red') == ['ProcessA', 'ProcessC']\", \"assert processes_ps(['ProcessX:Green', 'ProcessY:Yellow', 'ProcessZ:Green'], 'Blue') == []\", \"assert processes_ps(['Process1:Blue', 'Process2:Blue', 'Pr... | {
"split": "train",
"index": 71130,
"acecode_id": "bigcode_python_fns_42763",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that creates a representation of a 3D body in a specific format. The function takes in the name of the body, its 3D position, and any additional specified attributes as key-value pairs. It should return a dictionary that repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_body_representation('sphere', (1.0, 2.0, 3.0), radius=5.0, color='red') == {'name': 'sphere', 'position': (1.0, 2.0, 3.0), 'attributes': {'radius': 5.0, 'color': 'red'}}\", \"assert create_body_representation('cube', (0.0, 0.0, 0.0), side=2.0) == {'na... | {
"split": "train",
"index": 71131,
"acecode_id": "oss_32070",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of pairs containing person names and corresponding cloth names. Your task is to implement a function that returns a dictionary mapping each person to a list of their associated cloth names. If a person has multiple cloth items, they should all be included i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_cloth_mapping([('Alice', 'Shirt'), ('Bob', 'Pants'), ('Alice', 'Hat'), ('Bob', 'Jacket')]) == {'Alice': ['Shirt', 'Hat'], 'Bob': ['Pants', 'Jacket']}\", \"assert get_cloth_mapping([('Charlie', 'Coat'), ('Alice', 'Shirt'), ('Charlie', 'Scarf')]) == {'Char... | {
"split": "train",
"index": 71132,
"acecode_id": "oss_14020",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that takes this list as input and returns a new list containing only the even numbers from the original list, preserving the order of their first appearance. If there are no even numbers, return an empty lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_numbers([-1, -2, -3, -4]) == [-2, -4]\", \"assert filter_even_numbe... | {
"split": "train",
"index": 71133,
"acecode_id": "oss_9501",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are required to implement a function that takes in two integers, `a` and `b`, and returns their sum. However, if the sum is greater than 100, the function should return 'Too large'. Implement this function to handle the specified conditions correctly.\nPlease reason step by... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_or_too_large(10, 20) == 30\", \"assert sum_or_too_large(0, 0) == 0\", \"assert sum_or_too_large(99, 2) == 'Too large'\", \"assert sum_or_too_large(25, 25) == 50\", \"assert sum_or_too_large(1, 99) == 100\", \"assert sum_or_too_large(30, 40) == 70\", \"as... | {
"split": "train",
"index": 71134,
"acecode_id": "evol_33188",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified version of a dictionary. Your goal is to write a function `dictionary_lookup(entries: List[Tuple[str, str]], queries: List[str]) -> List[str]` that processes a list of key-value pairs and a list of queries. The function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dictionary_lookup([], ['apple']) == [\\\"Can't find entry for apple\\\"]\", \"assert dictionary_lookup([('apple', 'a fruit')], ['apple']) == ['a fruit']\", \"assert dictionary_lookup([('apple', 'a fruit'), ('banana', 'an elongated fruit')], ['banana']) == ['... | {
"split": "train",
"index": 71135,
"acecode_id": "oss_24989",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that checks if all elements in the list are non-null (i.e., not None in Python). The function should return True if all elements are non-null, and False otherwise. The input will be a list of integers that can include None values. For ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_non_null([1, 2, 3, 4]) == True\", \"assert check_non_null([1, 2, None, 4]) == False\", \"assert check_non_null([None, None, None]) == False\", \"assert check_non_null([0, 1, 2]) == True\", \"assert check_non_null([]) == True\", \"assert check_non_null(... | {
"split": "train",
"index": 71136,
"acecode_id": "bigcode_python_fns_34159",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a python function that calculates the mode of a list of numbers. This function should be able to handle any size of input data and gracefully handle errors. If there is a tie in the most frequent element, the function should return the smallest number. Additionally, the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_mode([9, 5, 6, 9, 5, 3, 2, 5]) == 5\", \"assert calculate_mode([1, 2, 2, 3, 3]) == 2\", \"assert calculate_mode([1, 1, 2, 2, 3, 3]) == 1\", \"assert calculate_mode([7, 8, 8, 7, 9, 9]) == 7\", \"assert calculate_mode([]) == None\", \"assert calculat... | {
"split": "train",
"index": 71137,
"acecode_id": "evol_6345",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of job IDs and their corresponding statuses in the form of a dictionary. Each job can either be 'SUCCEEDED' or 'FAILED'. Your task is to implement a function that takes the job IDs and their statuses, and returns a list of dictionaries where each dictionary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_job_status({'job1': 'SUCCEEDED', 'job2': 'FAILED'}) == [{'jobId': 'job1', 'status': 'SUCCEEDED'}, {'jobId': 'job2', 'status': 'FAILED'}]\", \"assert get_job_status({'jobA': 'FAILED', 'jobB': 'SUCCEEDED', 'jobC': 'SUCCEEDED'}) == [{'jobId': 'jobA', 'statu... | {
"split": "train",
"index": 71138,
"acecode_id": "bigcode_python_fns_9422",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of academic paper citations in the format 'pp.startPage-endPage, year.' Each citation represents a paper's publication details, including the page range and the year of publication. Your task is to write a function that takes this list of citations as input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_page_citation(['pp.1-10, 2000', 'pp.5-15, 2001']) == 'pp.5-15, 2001'\", \"assert find_max_page_citation(['pp.1-20, 2005', 'pp.1-20, 2003']) == 'pp.1-20, 2003'\", \"assert find_max_page_citation(['pp.10-20, 1997', 'pp.30-40, 1997']) == 'pp.10-20, 199... | {
"split": "train",
"index": 71139,
"acecode_id": "oss_2622",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to calculate the precision and recall scores of a binary classification model based on provided true labels and predicted labels. The function should take two lists as input: the first list contains the true labels and the second list con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_model([1, 0, 1, 1], [0, 0, 0, 0]) == (0, 0)\", \"assert evaluate_model([1, 1, 1, 1], [1, 1, 1, 1]) == (1.0, 1.0)\", \"assert evaluate_model([0, 0, 0, 0], [0, 0, 0, 0]) == (0, 0)\", \"assert evaluate_model([1, 0, 1], [1, 1, 1]) == (0.6666666666666666... | {
"split": "train",
"index": 71140,
"acecode_id": "oss_10806",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a video player command. The function `simulate_video_player` takes a string representing the source of the video and several optional parameters that affect how the video is played. Your function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_video_player('video.mp4') == 'play video.mp4'\", \"assert simulate_video_player('video.mp4', x=100, y=200) == 'play video.mp4 -x 100 -y 200'\", \"assert simulate_video_player('video.mp4', pixel_format='yuv420p') == 'play video.mp4 -pixel_format yuv4... | {
"split": "train",
"index": 71141,
"acecode_id": "bigcode_python_fns_36342",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a gene filtering algorithm that filters out specific genes from a list based on a reference list of gene names. Given two lists, one containing gene names and the other containing reference gene names, your goal is to return a new list containin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_genes(['geneA', 'geneB', 'geneC'], ['geneD', 'geneE']) == []\", \"assert filter_genes(['geneA', 'geneA', 'geneA'], ['geneA']) == ['geneA']\", \"assert filter_genes([], ['geneA', 'geneB']) == []\", \"assert filter_genes(['geneX', 'geneY'], []) == []\",... | {
"split": "train",
"index": 71142,
"acecode_id": "oss_17348",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts an ECHONET property defined by its EPC (ECHONET Property Code) and EDT (Echonet Data) into a hexadecimal string representation. The EPC is an integer representing the property code, and the EDT is a byte string represent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_hex_string(1, b'\\\\x00\\\\x01') == '01:00 01'\", \"assert to_hex_string(255, b'\\\\x02') == 'FF:02'\", \"assert to_hex_string(16, b'') == '10:00'\", \"assert to_hex_string(0, b'\\\\x0A\\\\x0B\\\\x0C') == '00:0A 0B 0C'\", \"assert to_hex_string(100, b'\\\... | {
"split": "train",
"index": 71143,
"acecode_id": "oss_23428",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that computes the Harmonic mean of a given list of non-negative integers. The Harmonic mean is calculated as the reciprocal of the arithmetic mean of the reciprocals. If the input list is empty or contains non-numeric or negative entries, the function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert harmonic_mean([1, 2, 3, 4, 5]) == 2.18978102189781\", \"assert harmonic_mean([0, 2, 4]) == None\", \"assert harmonic_mean([]) == None\", \"assert harmonic_mean([-1, 2, 3]) == None\", \"assert harmonic_mean([1, 1, 1, 1]) == 1.0\", \"assert harmonic_mean([10, ... | {
"split": "train",
"index": 71144,
"acecode_id": "evol_9741",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a string `line` representing a SQL ALTER TABLE statement and a string `alter_expr` representing the keyword that indicates the start of the table name. Your task is to extract the table name from the `line`. The table name may be prefixed with a schema name, separ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_table_name('ALTER TABLE users', 'ALTER TABLE') == 'users'\", \"assert get_table_name('ALTER TABLE schema.customers', 'ALTER TABLE') == 'customers'\", \"assert get_table_name('ALTER TABLE schema.\\\"special.table\\\"', 'ALTER TABLE') == 'special.table'\",... | {
"split": "train",
"index": 71145,
"acecode_id": "bigcode_python_fns_30079",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given two integers, `atom1` and `atom2`, along with a list of tuples representing three types of interactions: `inter1` for 1-2 interactions, `inter2` for 1-3 interactions, and `inter3` for 1-4 interactions. Your task is to write a function `assign_weight(atom1: int, at... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_weight(1, 1, [(1, 2), (1, 3), (1, 4)]) == 0.0\", \"assert assign_weight(1, 2, [(1, 2), (1, 3), (1, 4)]) == 0.5\", \"assert assign_weight(1, 3, [(2, 3), (1, 3), (1, 4)]) == 1.0\", \"assert assign_weight(1, 4, [(2, 3), (3, 4), (1, 4)]) == 1.5\", \"asser... | {
"split": "train",
"index": 71146,
"acecode_id": "bigcode_python_fns_38965",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages aperture templates used for PCB design in Gerber files. The function should support adding new aperture templates based on their shape and size, as well as retrieving the shape of a specific template. Implement a function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_apertures([('add', 'ap1', ('C', 1.0)), ('get', 'ap1', None)]) == ['circle']\", \"assert manage_apertures([('add', 'ap1', ('R', 1.0)), ('get', 'ap1', None)]) == ['rectangle']\", \"assert manage_apertures([('add', 'ap1', ('C', 1.0)), ('add', 'ap2', ('R'... | {
"split": "train",
"index": 71147,
"acecode_id": "oss_13864",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the sum of all integers in an array. Implement a function named `sum_of_array` that takes a list of integers as input and returns the sum of the integers in that list. If the input list is empty, the function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_array([1, 2, 3, 4, 5]) == 15\", \"assert sum_of_array([-1, -2, -3]) == -6\", \"assert sum_of_array([0, 0, 0]) == 0\", \"assert sum_of_array([]) == 0\", \"assert sum_of_array([10, 20, 30]) == 60\", \"assert sum_of_array([-5, 5]) == 0\", \"assert sum_of... | {
"split": "train",
"index": 71148,
"acecode_id": "oss_34837",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where keys represent categories and values represent numerical data points. Your task is to implement a function called `charts` that takes this input data and a string indicating the chart type, and returns a string representation of the chart type g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert charts({'Category A': 25, 'Category B': 40, 'Category C': 30, 'Category D': 20}, 'bar') == 'Bar Chart Generated'\", \"assert charts({'Category A': 25, 'Category B': 40, 'Category C': 30, 'Category D': 20}, 'line') == 'Line Chart Generated'\", \"assert charts... | {
"split": "train",
"index": 71149,
"acecode_id": "oss_32096",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats an email message. The function should take three parameters: 'to' (the recipient's email address), 'subject' (the subject of the email), and 'html_content' (the body of the email in HTML format). The function should return a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_email('recipient@example.com', 'Test Subject', '<h1>Hello</h1>') == 'From: Sender Name <user@example.com>\\\\nTo: recipient@example.com\\\\nSubject: Test Subject\\\\n\\\\n<h1>Hello</h1>'\", \"assert format_email('test@example.com', 'Welcome', '<p>Welc... | {
"split": "train",
"index": 71150,
"acecode_id": "bigcode_python_fns_37544",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers a and b, implement a function g(a, b) that calculates the value of the expression 2*a^2 + 3*b^3. The function should return the computed result based on the provided values of a and b.\nPlease reason step by step, then write a self-contained Python solution. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert g(0, 0) == 0\", \"assert g(1, 1) == 5\", \"assert g(3, 3) == 99\", \"assert g(1, -1) == -1\", \"assert g(10, 1) == 203\", \"assert g(5, 0) == 50\", \"assert g(0, 3) == 81\", \"assert g(3, 0) == 18\"]}"
} | {
"split": "train",
"index": 71151,
"acecode_id": "evol_10848",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that simulates a simple key-value store. The function should accept the following parameters: a dictionary representing the current store, a string representing the key to be inserted or updated, and a value representing the value to be associated with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_store({}, 'name', 'Alice') == {'name': 'Alice'}\", \"assert update_store({'name': 'Alice'}, 'age', 30) == {'name': 'Alice', 'age': 30}\", \"assert update_store({'name': 'Alice'}, 'name', 'Bob') == {'name': 'Bob'}\", \"assert update_store({'city': 'New... | {
"split": "train",
"index": 71152,
"acecode_id": "evol_15297",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tokens, where each token is a string. Your task is to implement a function that processes the tokens based on the following rules: 1. If a token contains a '(' or ')' and has a length greater than 1, split the token into two parts: the left side and the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_tokens(['single', 'token']) == ['single', 'token']\", \"assert process_tokens(['a(bc', 'def)gh', 'ij']) == ['a', 'bc', 'def', 'gh', 'ij']\", \"assert process_tokens(['(abc', 'def)', 'ghi']) == ['abc', 'def', 'ghi']\", \"assert process_tokens(['no_par... | {
"split": "train",
"index": 71153,
"acecode_id": "oss_33614",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates and sets a server name based on certain constraints. The function `set_server_name` should take a string as input and return the server name if it meets the following criteria: the name must contain only alphanumeric charac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_server_name('valid_name') == 'valid_name'\", \"assert set_server_name('another_valid_name123') == 'another_valid_name123'\", \"assert set_server_name('name_with_underscore') == 'name_with_underscore'\", \"assert set_server_name('Server123') == 'Server123... | {
"split": "train",
"index": 71154,
"acecode_id": "oss_10797",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_parity(number: int) -> str` that takes an integer as input and returns 'Even' if the number is even, and 'Odd' if the number is odd.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```pyth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_parity(0) == 'Even'\", \"assert check_parity(1) == 'Odd'\", \"assert check_parity(2) == 'Even'\", \"assert check_parity(-1) == 'Odd'\", \"assert check_parity(-2) == 'Even'\", \"assert check_parity(3) == 'Odd'\", \"assert check_parity(4) == 'Even'\", \"... | {
"split": "train",
"index": 71155,
"acecode_id": "evol_1320",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `decompress_3d_array(array)` that takes a three-dimensional array filled with floating point numbers and returns a new three-dimensional array where each floating point number is rounded to 5 decimal places. The input array may contain any number of sub-arr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decompress_3d_array([[[1.123456, 2.123456], [3.123456, 4.123456]], [[5.123456, 6.123456], [7.123456, 8.123456]]]) == [[[1.12346, 2.12346], [3.12346, 4.12346]], [[5.12346, 6.12346], [7.12346, 8.12346]]]\", \"assert decompress_3d_array([[[0.123456789], [0.9876... | {
"split": "train",
"index": 71156,
"acecode_id": "evol_17370",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers that may contain duplicates. Write a function that takes this list as input and returns a new list that contains only the unique integers from the original list, preserving the order of their first appearance. The returned list should not contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([5, 5, 5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([1, 2, 3, 1, 2]) == [1, 2, ... | {
"split": "train",
"index": 71157,
"acecode_id": "bigcode_python_fns_25827",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a boolean value indicating whether it is possible to unload all specified resources. Each resource can be represented as an integer, and unloading a resource is successful if all the resources can... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_unload_resources([1, 2, 3, 1, 2]) == True\", \"assert can_unload_resources([1, 2, 2, 3, 1]) == True\", \"assert can_unload_resources([]) == True\", \"assert can_unload_resources([5]) == True\", \"assert can_unload_resources([1, 2, 1, 2]) == True\", \"ass... | {
"split": "train",
"index": 71158,
"acecode_id": "bigcode_python_fns_44698",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of strings as input and returns a frozen set of unique tokens. Each string in the list can contain multiple words separated by spaces. Your function should process each string, split it into tokens, and strip any lea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_tokens_from_strings(['hello world', 'hello', 'world hello']) == frozenset(['hello', 'world'])\", \"assert unique_tokens_from_strings(['apple orange', 'banana apple', 'orange banana']) == frozenset(['apple', 'orange', 'banana'])\", \"assert unique_toke... | {
"split": "train",
"index": 71159,
"acecode_id": "oss_25520",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of Function objects, implement a function `count_return_types(functions)` that returns a dictionary containing the count of functions for each return type. Each Function object has attributes: `name`, `return_type`, `parameters`, and `body`. The keys of the diction... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_return_types([]) == {}\", \"assert count_return_types([Function('func1', 'int', [], '')]) == {'int': 1}\", \"assert count_return_types([Function('func1', 'int', [], ''), Function('func2', 'int', [], '')]) == {'int': 2}\", \"assert count_return_types([F... | {
"split": "train",
"index": 71160,
"acecode_id": "oss_6614",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a dictionary containing standard arguments for a subprocess call based on the operating system. If the operating system is Windows, the function should include a 'startupinfo' key with a value of 'True' and an 'env' key rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_subprocess_args('win32') == {'stdout': 'PIPE', 'stdin': 'PIPE', 'stderr': 'PIPE', 'startupinfo': True, 'env': 'Windows_Environment'}\", \"assert generate_subprocess_args('linux') == {'stdout': 'PIPE', 'stdin': 'PIPE', 'stderr': 'PIPE', 'startupinfo'... | {
"split": "train",
"index": 71161,
"acecode_id": "bigcode_python_fns_25602",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function to remove all special characters and numbers from a given string, while preserving the order of the original alphabets. Your function should also convert all uppercase letters to lowercase. The function should take a single string as input and return the modifi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_special_characters_and_numbers('A1b2C3!@#') == 'abc'\", \"assert remove_special_characters_and_numbers('12345') == ''\", \"assert remove_special_characters_and_numbers('Python3.8') == 'python'\", \"assert remove_special_characters_and_numbers('Special... | {
"split": "train",
"index": 71162,
"acecode_id": "evol_33888",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats exam information. The function should take three parameters: `topic` (a string representing the exam topic, maximum length 60 characters), `clazz` (a string representing the class for which the exam is scheduled), and `date` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_exam_info('Math', '10A', '2023-10-15') == 'Math - 10A (2023-10-15)'\", \"assert format_exam_info('Science', '9B', '2023-11-01') == 'Science - 9B (2023-11-01)'\", \"assert format_exam_info('History', '12C', '2023-12-20') == 'History - 12C (2023-12-20)'... | {
"split": "train",
"index": 71163,
"acecode_id": "oss_24286",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of resource permissions for a user and returns a dictionary mapping each resource ID to its corresponding permissions. Each permission is represented as a string. If a user has no permissions for a resource, that res... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_user_permissions_to_resources([(1, 'read'), (2, 'write'), (1, 'read'), (3, 'execute')]) == {1: ['read'], 2: ['write'], 3: ['execute']}\", \"assert map_user_permissions_to_resources([(2, 'write'), (2, 'write'), (3, 'execute')]) == {2: ['write'], 3: ['exec... | {
"split": "train",
"index": 71164,
"acecode_id": "bigcode_python_fns_40062",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `set_flash_voltage` that determines the appropriate flash voltage based on efuse values provided in a dictionary. The function takes three parameters: `efuses` (a dictionary containing efuse values), and `args` (additional parameters). The efuse... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_flash_voltage({'XPD_SDIO_FORCE': 1, 'XPD_SDIO_TIEH': 0, 'XPD_SDIO_REG': 1}, None) == 3.3\", \"assert set_flash_voltage({'XPD_SDIO_FORCE': 0, 'XPD_SDIO_TIEH': 1, 'XPD_SDIO_REG': 0}, None) == 2.8\", \"assert set_flash_voltage({'XPD_SDIO_FORCE': 0, 'XPD_SDI... | {
"split": "train",
"index": 71165,
"acecode_id": "oss_12430",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists called 'vectors', write a function 'sameSize' that takes a list of indices (arguments) and checks whether all the lists at those indices within 'vectors' have the same length. The function should return True if all the selected lists are of the same size, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sameSize([0, 1, 2], [[1, 2], [3, 4], [5, 6]]) == True\", \"assert sameSize([0, 2], [[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == True\", \"assert sameSize([1, 2], [[1, 2], [3, 4, 5], [6]]) == False\", \"assert sameSize([0], [[1, 2, 3, 4]]) == True\", \"assert sameSi... | {
"split": "train",
"index": 71166,
"acecode_id": "bigcode_python_fns_16373",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing CPU utilization data represented as a list of integers. Each integer represents the CPU utilization percentage at a specific time point. Your goal is to create a function that takes this list as input and returns a new list containing only the CPU ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_cpu_utilization([10, 20, 30, 40], 25) == [30, 40]\", \"assert filter_cpu_utilization([0, 15, 25, 35, 50], 20) == [25, 35, 50]\", \"assert filter_cpu_utilization([5, 15, 10, 20], 15) == [15, 20]\", \"assert filter_cpu_utilization([100, 90, 80], 85) == ... | {
"split": "train",
"index": 71167,
"acecode_id": "oss_31136",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_cyclic_linked_list(data: List[int]) -> Optional[Node]` that creates a singly linked list where the first and last nodes have the same value. The function takes a list of integers as input and returns the head of the linked list. If the input list is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_cyclic_linked_list([]) is None\", \"assert create_cyclic_linked_list([1]).data == 1\", \"assert create_cyclic_linked_list([2, 3]).data == 2\", \"assert create_cyclic_linked_list([2, 3]).next.data == 3\", \"assert create_cyclic_linked_list([5, 10, 5]).... | {
"split": "train",
"index": 71168,
"acecode_id": "evol_18166",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a text formatting system that supports various text attributes such as underline, reverse, and custom RGB color. Your goal is to create a function named `format_text` that takes an input command as a string and returns the corresponding text for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_text('#under') == 'underline'\", \"assert format_text('#nounder') == 'no underline'\", \"assert format_text('#reverse') == 'reverse'\", \"assert format_text('#noreverse') == 'no reverse'\", \"assert format_text('#FFA500') == 'custom RGB: (255, 165, 0)... | {
"split": "train",
"index": 71169,
"acecode_id": "oss_32128",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of feature names representing various metrics in a machine learning model. Your task is to implement a function that takes this list and returns a dictionary where each feature name is mapped to a default value of 0. The input list will always contain uniqu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_features(['score', 'eval', 'evala', 'evalb']) == {'score': 0, 'eval': 0, 'evala': 0, 'evalb': 0}\", \"assert initialize_features(['ionmatch', 'conionmatch', 'ionmatcha']) == {'ionmatch': 0, 'conionmatch': 0, 'ionmatcha': 0}\", \"assert initialize_... | {
"split": "train",
"index": 71170,
"acecode_id": "bigcode_python_fns_12269",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `contains` that takes a list of integers and an integer `target`. The function should return `True` if `target` exists in the list and `False` otherwise.\nPlease reason step by step, then write a self-contained Python solution. Give your final program... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains([1, 2, 3, 4], 2) == True\", \"assert contains([1, 2, 3, 4], 5) == False\", \"assert contains([], 1) == False\", \"assert contains([0, 0, 0], 0) == True\", \"assert contains([-1, -2, -3], -2) == True\", \"assert contains([-1, -2, -3], 1) == False\", ... | {
"split": "train",
"index": 71171,
"acecode_id": "evol_21593",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of epitopes, you need to categorize them based on their association strength, which can be either 'High', 'Medium', or 'Low'. Each epitope will have a corresponding strength value. Implement a function `categorize_epitopes(epitopes: List[Tuple[str, int]]) -> Dict[s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_epitopes([('E1', 80), ('E2', 60), ('E3', 30)]) == {'E1': 'High', 'E2': 'Medium', 'E3': 'Low'}\", \"assert categorize_epitopes([('E4', 90), ('E5', 45), ('E6', 70)]) == {'E4': 'High', 'E5': 'Low', 'E6': 'Medium'}\", \"assert categorize_epitopes([('E... | {
"split": "train",
"index": 71172,
"acecode_id": "bigcode_python_fns_37369",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that removes a Connect link for a user identified by their unique user ID. The function should take a string parameter representing the user ID. If the user ID is valid (i.e., it exists in the system), the function should return a suc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_connect_link_for_user('user123') == 'Connect link removed successfully.'\", \"assert delete_connect_link_for_user('user456') == 'Connect link removed successfully.'\", \"assert delete_connect_link_for_user('user789') == 'Connect link removed successfu... | {
"split": "train",
"index": 71173,
"acecode_id": "oss_30282",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function `create_employee` that takes two parameters, `name` (a string) and `age` (an integer). The function should return a dictionary representation of an employee with keys 'name' and 'age'. If the `age` is not a non-negative integer, the function should raise a `Val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_employee('Alice', 30) == {'name': 'Alice', 'age': 30}\", \"assert create_employee('Bob', 25) == {'name': 'Bob', 'age': 25}\", \"assert create_employee('Charlie', 0) == {'name': 'Charlie', 'age': 0}\", \"assert create_employee('Diana', 45) == {'name': ... | {
"split": "train",
"index": 71174,
"acecode_id": "evol_32015",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `x` and `y`, representing two sets of values. Your task is to implement a function `contextual_loss(x: List[int], y: List[int], reduction: str) -> float` that calculates the contextual loss between these two lists. The contextual loss is def... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(contextual_loss([1, 2, 3], [1, 2, 3], 'mean') - 0.0) < 1e-9\", \"assert abs(contextual_loss([1, 1, 1], [1, 1, 1], 'sum') - 0.0) < 1e-9\", \"assert abs(contextual_loss([1, 2, 3], [1, 2, 3], 'sum') - 0.0) < 1e-9\", \"assert abs(contextual_loss([], [], 'mea... | {
"split": "train",
"index": 71175,
"acecode_id": "bigcode_python_fns_17454",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are working on a reinforcement learning project and need to implement a function to set a threshold policy for an agent based on the number of burn-in steps. Your task is to create a function named `set_threshold_policy` that takes two parameters: a string `new_policy` repr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_threshold_policy('MINIMIZE_COST', 60) == 'MINIMIZE_COST'\", \"assert set_threshold_policy('MAXIMIZE_REWARD', 50) == 'MAXIMIZE_REWARD'\", \"assert set_threshold_policy('MINIMIZE_RISK', 51) == 'MINIMIZE_RISK'\", \"assert set_threshold_policy('MAXIMIZE_SAFE... | {
"split": "train",
"index": 71176,
"acecode_id": "oss_29186",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that updates the status of a technical note and returns an appropriate message based on whether the operation was successful or not. The function should take in four parameters: 'note_id' (an integer representing the ID of the technic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_note_status(1, 2, 'Technical note description', 'No comments') == 'The status of the technical note has been updated successfully.'\", \"assert update_note_status(1001, 2, 'Technical note description', 'No comments') == 'Error: Invalid note ID or stat... | {
"split": "train",
"index": 71177,
"acecode_id": "bigcode_python_fns_19561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string s, write a function clean_string that removes any leading or trailing whitespace from the string and converts all characters in the string to uppercase. The function should return the cleaned string. For example, if the input string is ' hello world ', the output... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_string(' xYz ') == 'XYZ'\", \"assert clean_string(' hello world ') == 'HELLO WORLD'\", \"assert clean_string(' leetcode ') == 'LEETCODE'\", \"assert clean_string(' Python ') == 'PYTHON'\", \"assert clean_string(' ') == ''\", \"assert clean_stri... | {
"split": "train",
"index": 71178,
"acecode_id": "bigcode_python_fns_842",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `product_of_elements` that returns the product of all the elements in the list. If the list is empty, the function should return 1. The input list may contain negative numbers, zeros, and positive numbers. Your function should handle a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_elements([1, 2, 3]) == 6\", \"assert product_of_elements([1, 0, 3]) == 0\", \"assert product_of_elements([-1, -2, -3]) == -6\", \"assert product_of_elements([-1, 2, 3]) == -6\", \"assert product_of_elements([0, 0, 0]) == 0\", \"assert product_of_e... | {
"split": "train",
"index": 71179,
"acecode_id": "bigcode_python_fns_35126",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a decimal number and converts it into a currency format string that adheres to United States Dollar (USD) standards. The output should be a string that begins with a dollar sign '$', includes commas as thousands separators, and rounds to two deci... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert usd_format(68.34567) == '$68.35'\", \"assert usd_format(1234.5) == '$1,234.50'\", \"assert usd_format(1000000) == '$1,000,000.00'\", \"assert usd_format(0) == '$0.00'\", \"assert usd_format(999.999) == '$1,000.00'\", \"assert usd_format(123456789.123) == '$1... | {
"split": "train",
"index": 71180,
"acecode_id": "evol_1940",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a string containing HTML code and checks if the closing tags for all the div elements are present and correctly formatted. Write a function `checkDivTags(html: str) -> bool` that takes a string `html` representing HTML ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert checkDivTags('<div><span>Content</span></div>') == True\", \"assert checkDivTags('<div><div></div></div>') == True\", \"assert checkDivTags('<div><div><div></div></div></div>') == True\", \"assert checkDivTags('<div>Unclosed div') == False\", \"assert checkD... | {
"split": "train",
"index": 71181,
"acecode_id": "oss_31646",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_distance` that calculates the Euclidean distance between two 3D vectors. Each vector is represented as a list of three numerical values, corresponding to the x, y, and z coordinates. The function should take two such vectors as i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_distance([0, 0, 0], [1, 0, 0]) == 1.0\", \"assert get_distance([3, 3, 3], [3, 3, 3]) == 0.0\", \"assert get_distance([0, 0, 0], [0, 0, 0]) == 0.0\", \"assert get_distance([1, 2, 3], [1, 2, 3]) == 0.0\", \"assert get_distance([1, 2, 3], [4, 2, 3]) == 3.0\... | {
"split": "train",
"index": 71182,
"acecode_id": "oss_25891",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the translation of frontend strings based on a given language code. The function should take a string parameter `language_code` which can be either 'de' for German or 'en' for English. The function should return a list of s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert translateFrontendStrings('de') == ['Willkommen', 'Benutzername', 'Passwort', 'Einloggen', 'Abmelden']\", \"assert translateFrontendStrings('en') == ['Welcome', 'Username', 'Password', 'Login', 'Logout']\", \"assert translateFrontendStrings('fr') == []\", \"a... | {
"split": "train",
"index": 71183,
"acecode_id": "bigcode_python_fns_33944",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_shipping_charge(weight: Union[int, float]) -> float` that calculates the shipping charge based on the weight of a package. The charge is defined as follows: for weights less than or equal to 0, return 0.0; for weights between 1 and 30 inclusive, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_shipping_charge(-1) == -1.0\", \"assert calculate_shipping_charge(0) == 0.0\", \"assert calculate_shipping_charge(1) == 5.0\", \"assert calculate_shipping_charge(10) == 5.0\", \"assert calculate_shipping_charge(29) == 5.0\", \"assert calculate_ship... | {
"split": "train",
"index": 71184,
"acecode_id": "evol_17505",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of clients available for training in each round. Your task is to implement a function `max_clients_per_round(clients: List[int]) -> int` that returns the maximum number of clients available in a single round. If the list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_clients_per_round([1, 2, 3, 4, 5]) == 5\", \"assert max_clients_per_round([5, 4, 3, 2, 1]) == 5\", \"assert max_clients_per_round([-1, -2, -3, -4]) == -1\", \"assert max_clients_per_round([-1, 2, 3, -4]) == 3\", \"assert max_clients_per_round([0, -1, 1])... | {
"split": "train",
"index": 71185,
"acecode_id": "bigcode_python_fns_44273",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a parser for a simple hardware description language (HDL). The HDL is used to describe the behavior of digital circuits, and your function should extract input signals defined in the code snippet. Each input signal is defined by a line of code i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_hdl_code('i_SIGNAL1 = 1,') == [('SIGNAL1', 1)]\", \"assert parse_hdl_code('i_SIGNAL2 = 0, i_SIGNAL3 = 100,') == [('SIGNAL2', 0), ('SIGNAL3', 100)]\", \"assert parse_hdl_code('i_SIGNAL8 = 500, i_SIGNAL9 = 0,') == [('SIGNAL8', 500), ('SIGNAL9', 0)]\", \"... | {
"split": "train",
"index": 71186,
"acecode_id": "oss_20796",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names and a list of required file names. Your task is to write a function that checks whether all required files are present in the list of available files. If any required file is missing, the function should return a list of the missing files. If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_missing_files(['file1.txt', 'file2.txt', 'file3.txt'], ['file1.txt', 'file2.txt']) == []\", \"assert find_missing_files(['file1.txt', 'file2.txt'], ['file1.txt', 'file2.txt', 'file3.txt']) == ['file3.txt']\", \"assert find_missing_files(['fileA.txt', 'f... | {
"split": "train",
"index": 71187,
"acecode_id": "bigcode_python_fns_25257",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that updates a linked report based on a master report represented in JSON format. The function should take in two parameters: `master_report_json` which is a string containing the JSON representation of the master report, and `linked_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert _update_linked_report('{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30}', '{\\\"name\\\": \\\"Doe\\\", \\\"age\\\": 25}') == '{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30}'\", \"assert _update_linked_report('{\\\"data\\\": [1, 2, 3]}', '{\\\"data\\\": [4, 5]}')... | {
"split": "train",
"index": 71188,
"acecode_id": "oss_30826",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting the content of a POST request body from given headers and a simulated request body. Write a function `extract_post_body(headers: dict, body: str) -> str` that takes in two parameters: a dictionary `headers`, which contains a key 'Content-Length' i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_post_body({'Content-Length': '5'}, 'Hello World') == 'Hello'\", \"assert extract_post_body({'Content-Length': '11'}, 'Hello World') == 'Hello World'\", \"assert extract_post_body({'Content-Length': '0'}, 'Hello World') == ''\", \"assert extract_post_... | {
"split": "train",
"index": 71189,
"acecode_id": "oss_36971",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `running_total_actions(values: List[int]) -> List[str]` that takes a list of integers and maintains a running total of numbers passed in. The function should return a list of strings where each string corresponds to specific actions based on the running tot... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert running_total_actions([2, 3]) == ['Halfway there']\", \"assert running_total_actions([2, 3, 5]) == ['Halfway there', 'Endless fun']\", \"assert running_total_actions([6, 10]) == ['Over Limit']\", \"assert running_total_actions([5]) == ['Halfway there']\", \"... | {
"split": "train",
"index": 71190,
"acecode_id": "evol_4578",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total toll cost for a month based on the number of passes used. The cost of a single pass is given, along with a flag indicating whether the passes are used only on working days. If the flag is true, calculate the number of working days in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_cost(10, True, 1, 5) == 50.0\", \"assert calculate_total_cost(10, False, 1, 5) == 50.0\", \"assert calculate_total_cost(10, True, 2, 5) == 50.0\", \"assert calculate_total_cost(10, False, 2, 5) == 50.0\", \"assert calculate_total_cost(10, Tru... | {
"split": "train",
"index": 71191,
"acecode_id": "bigcode_python_fns_13762",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of time durations represented as strings and returns the total duration in seconds. Each time duration string is in the format \"HH:MM:SS\" (hours, minutes, seconds). If any of the time duration strings ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_duration(['00:00:00', '00:01:00', '00:02:00']) == 180\", \"assert calculate_total_duration(['00:00:01', '00:00:01', '00:00:01']) == 3\", \"assert calculate_total_duration(['01:00:00', '01:00:00', '01:00:00']) == 10800\", \"assert calculate_to... | {
"split": "train",
"index": 71192,
"acecode_id": "oss_31028",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string `s` and a positive integer `n`. Your task is to create a new string by repeating the original string `s` exactly `n` times. Return the newly formed string. If `n` is 0, return an empty string. Write a function `repeat_string(s: str, n: int) -> str` to ach... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert repeat_string('hello', 3) == 'hellohellohello'\", \"assert repeat_string('abc', 0) == ''\", \"assert repeat_string('test', 1) == 'test'\", \"assert repeat_string('!', 5) == '!!!!!'\", \"assert repeat_string('Python', 2) == 'PythonPython'\", \"assert repeat_s... | {
"split": "train",
"index": 71193,
"acecode_id": "bigcode_python_fns_30759",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to process a list of strings representing CSV file content and generate a summary report. The function should read the data from these strings, perform a count of occurrences of each unique value in the first column of the CSV data... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_summary(['value1,100','value2,200','value1,300']) == [('value1', 2), ('value2', 1)]\", \"assert generate_summary(['a,1','b,2','a,3','b,4','c,5']) == [('a', 2), ('b', 2), ('c', 1)]\", \"assert generate_summary(['x,10','y,15','x,5','y,10','z,20']) == ... | {
"split": "train",
"index": 71194,
"acecode_id": "oss_33602",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing scores from various tests conducted by a judge. Your task is to implement a function that calculates the average score from the given list of scores and returns it. The average score should be rounded to two decimal places. If the l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_score([100, 90, 80]) == 90.00\", \"assert calculate_average_score([75, 85, 95]) == 85.00\", \"assert calculate_average_score([50, 60]) == 55.00\", \"assert calculate_average_score([100]) == 100.00\", \"assert calculate_average_score([]) == ... | {
"split": "train",
"index": 71195,
"acecode_id": "bigcode_python_fns_49772",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_thaana_character(code: str) -> bool` that checks whether a given character is part of the Thaana Unicode block. The Thaana Unicode block includes characters from U+0780 to U+07BF. The function should return True if the character falls within this range,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_thaana_character('\\\\u0780') == True\", \"assert is_thaana_character('\\\\u07BF') == True\", \"assert is_thaana_character('\\\\u0781') == True\", \"assert is_thaana_character('\\\\u07C0') == False\", \"assert is_thaana_character('a') == False\", \"assert... | {
"split": "train",
"index": 71196,
"acecode_id": "bigcode_python_fns_26796",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `classify_sentiment(text: str) -> str` that classifies a given text into one of three sentiment categories: 'positive', 'neutral', or 'negative'. The function should be able to analyze the sentiment of various statements, including those containing sarcasm ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_sentiment('This product is terrible.') == 'negative'\", \"assert classify_sentiment('Oh, great! My vacations are cancelled.') == 'negative'\", \"assert classify_sentiment('This is great! My vacations just got extended.') == 'positive'\", \"assert cl... | {
"split": "train",
"index": 71197,
"acecode_id": "evol_8413",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a function `match_sentence(sentence: str) -> bool` that checks if a given sentence contains the word 'dog', followed by any number of characters except the letters 'x' and 'y'. The sentence must end with the word 'cat', followed by a number between 1 and 10 inclusive, tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_sentence('dogxyz cat6') == False\", \"assert match_sentence('dog is great and cat9') == True\", \"assert match_sentence('dog and cat11') == False\", \"assert match_sentence('doggy cat4') == False\", \"assert match_sentence('dogx cat3') == False\", \"as... | {
"split": "train",
"index": 71198,
"acecode_id": "evol_21726",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers called `ori`. Your task is to implement a function `custom_dfs(ori)` that takes this list as input and returns the result of calling a recursive function `dfs` on the first element of the list. The `dfs` function should compute the sum of the fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_dfs([1, 2, 3]) == 6\", \"assert custom_dfs([5]) == 5\", \"assert custom_dfs([0, 0, 0]) == 0\", \"assert custom_dfs([10, 20, 30, 40]) == 100\", \"assert custom_dfs([-1, -2, -3]) == -6\", \"assert custom_dfs([]) == 0\", \"assert custom_dfs([100, 200]) =... | {
"split": "train",
"index": 71199,
"acecode_id": "oss_22900",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.