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 two matrices represented as lists of lists. Your task is to implement a function `matrix_multiply(matrix_a, matrix_b)` that performs matrix multiplication on the two input matrices. The function should validate that the matrices are compatible for multiplication (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\", \"assert matrix_multiply([[1, 2]], [[3], [4]]) == [[11]]\", \"assert matrix_multiply([[1, 2, 3]], [[4], [5], [6]]) == [[32]]\", \"assert matrix_multiply([[1, 0], [0, 1]], [[5, 6],...
{ "split": "train", "index": 500, "acecode_id": "oss_28192", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_spaceship(model: str, launch_year: int, fuel_type: str) -> dict` that takes in a spaceship's model, launch year, and fuel type as input parameters and returns a dictionary representing the spaceship with keys 'model', 'launch_year', and 'fuel_type'....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_spaceship('Falcon 9', 2010, 'RP-1') == {'model': 'Falcon 9', 'launch_year': 2010, 'fuel_type': 'RP-1'}\", \"assert create_spaceship('Apollo 11', 1969, 'Hydrazine') == {'model': 'Apollo 11', 'launch_year': 1969, 'fuel_type': 'Hydrazine'}\", \"assert cr...
{ "split": "train", "index": 501, "acecode_id": "evol_19451", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the minimum number of operations required to transform one string, s1, into another string, s2. The allowed operations are insertion, deletion, and replacement of a single character. Given s1 = 'cat' and s2 = 'hat', determine the minimum num...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert levenshtein_distance('cat', 'hat') == 1\", \"assert levenshtein_distance('kitten', 'sitting') == 3\", \"assert levenshtein_distance('flaw', 'lawn') == 2\", \"assert levenshtein_distance('intention', 'execution') == 5\", \"assert levenshtein_distance('abc', '...
{ "split": "train", "index": 502, "acecode_id": "evol_18955", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a configuration for a register with the following properties: a count of words, a data type, a scale factor, an offset, and a precision value. Your task is to implement a function that takes in a list of register words (integers) and applies a calculation based on...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_register_value([0, 0, 0, 0], {'count': 4, 'data_type': 'UINT', 'scale': 1.0, 'offset': 0.0, 'precision': 0}) == 0.0\", \"assert calculate_register_value([255], {'count': 1, 'data_type': 'UINT', 'scale': 1.0, 'offset': 0.0, 'precision': 2}) == 255.0...
{ "split": "train", "index": 503, "acecode_id": "bigcode_python_fns_39827", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function called 'largest_smallest_integers' that takes a list of integers as input and returns a tuple (a, b, c, d). Here, 'a' should be the largest negative even integer, 'b' should be the smallest non-negative even integer, 'c' should be the largest negative odd i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largest_smallest_integers([-2, -6, 4, 2]) == (-2, 2, None, None)\", \"assert largest_smallest_integers([-10, -12, 0, 2, 4]) == (-10, 0, None, None)\", \"assert largest_smallest_integers([-2, -4, 2, 3]) == (-2, 2, None, 3)\", \"assert largest_smallest_integer...
{ "split": "train", "index": 504, "acecode_id": "evol_9289", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a string, implement a function `longest_substring(input_string)` that returns the longest contiguous segment of unique characters in the string using iterative loops. The function should correctly handle unicode characters as well. If there are multiple segments of the sa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_substring('abcabcbb') == 'abc'\", \"assert longest_substring('bbbbb') == 'b'\", \"assert longest_substring('pwwkew') == 'wke'\", \"assert longest_substring('') == ''\", \"assert longest_substring('a') == 'a'\", \"assert longest_substring('abcd') == '...
{ "split": "train", "index": 505, "acecode_id": "evol_35157", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of vertices represented as 2D points and a list of edges connecting these vertices, your task is to calculate the gradients at each vertex based on the edges and their corresponding tangent vectors. Each vertex is represented as a tuple (x, y), and each edge is rep...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_grad([(0, 0)], [], [[]]) == [0]\", \"assert build_grad([(0, 0), (1, 1)], [(0, 1)], [[0, 0]]) == [0, 0]\", \"assert build_grad([(0, 0), (1, 1)], [(0, 0)], [[1, 0]]) == [0, 0]\", \"assert build_grad([(0, 0)], [(0, 0)], [[1, 1]]) == [0]\", \"assert build_...
{ "split": "train", "index": 506, "acecode_id": "bigcode_python_fns_10127", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a positive integer n, write a function `calculate_sum(n)` that returns the sum of all integers from 1 to n (inclusive). You need to implement this function correctly without any logical errors. For example, if n = 5, the function should return 15, since 1 + 2 + 3 + 4 + 5 ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum(1) == 1\", \"assert calculate_sum(2) == 3\", \"assert calculate_sum(3) == 6\", \"assert calculate_sum(4) == 10\", \"assert calculate_sum(5) == 15\", \"assert calculate_sum(6) == 21\", \"assert calculate_sum(7) == 28\", \"assert calculate_sum(8)...
{ "split": "train", "index": 507, "acecode_id": "oss_32322", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that performs basic operations on a matrix represented as a 2D list of integers. Your function should support the following operations: \n 1. Initializing a matrix with a given number of rows and columns filled with zeros. \n 2. Setti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matrix_operations([('init', 2, 3), ('set', 0, 0, 1), ('set', 0, 1, 2), ('set', 1, 0, 3), ('get', 0, 0)]) == 1\", \"assert matrix_operations([('init', 2, 2), ('set', 1, 1, 5), ('get', 1, 1)]) == 5\", \"assert matrix_operations([('init', 2, 2), ('set', 0, 0, 1...
{ "split": "train", "index": 508, "acecode_id": "oss_24613", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of probabilities representing a probability mass function (PMF). Implement a function that takes this list of probabilities and returns the cumulative distribution function (CDF) as a list. The CDF is calculated by taking the cumulative sum of the PMF proba...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_cdf([0.2, 0.5, 0.3]) == [0.2, 0.7, 1.0]\", \"assert calculate_cdf([0.0, 0.0, 1.0]) == [0.0, 0.0, 1.0]\", \"assert calculate_cdf([0.25, 0.25, 0.25, 0.25]) == [0.25, 0.5, 0.75, 1.0]\", \"assert calculate_cdf([0.3, 0.1, 0.4, 0.2]) == [0.3, 0.4, 0.8, 1...
{ "split": "train", "index": 509, "acecode_id": "bigcode_python_fns_2772", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing movie IDs that a user has already rated, and a list of all available movie IDs. Your task is to implement a function that recommends the top N movies that the user has not rated yet. The function should take three parameters: a list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert recommend([5, 6, 7, 8], [5, 6, 7], 2) == [8]\", \"assert recommend([11, 12, 13, 14], [11, 12, 13, 14], 3) == []\", \"assert recommend([15], [15], 1) == []\", \"assert recommend([41, 42], [41, 42], 1) == []\", \"assert recommend([80, 81, 82, 83], [80, 81, 82]...
{ "split": "train", "index": 510, "acecode_id": "bigcode_python_fns_23603", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in a dictionary of configuration parameters and returns a standardized configuration object. The function should ensure that all keys in the given dictionary match the expected keys, and if any key is missing, it should use a d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_configuration({'ad_group': 'Test ad group'}) == {'ad_group': 'Test ad group', 'approve_requirement': 95, 'assign_qualifications': True, 'auto_recruit': True, 'aws_access_key_id': 'fake aws key', 'aws_secret_access_key': 'fake aws secret', 'aws_region'...
{ "split": "train", "index": 511, "acecode_id": "bigcode_python_fns_31413", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with counting the number of files that need to be uploaded given a list of UUIDs and a specific file kind. Write a function `count_files_to_upload` that takes the following parameters: a list of UUIDs (`uuids`), a string representing the file kind (`kind`), and a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_files_to_upload(['1234', '5678', 'abcd'], 'txt', '/some/path') == 3\", \"assert count_files_to_upload(['file1', 'file2'], 'jpg', '/other/path') == 2\", \"assert count_files_to_upload([], 'png', '/another/path') == 0\", \"assert count_files_to_upload(['...
{ "split": "train", "index": 512, "acecode_id": "bigcode_python_fns_24624", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a file name, including its extension. Your task is to implement a function that validates whether the file extension is one of the allowed types: '.txt', '.jpg', '.png', '.pdf', or '.docx'. The function should return True if the file extensio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert not validate_extension('file.xml')\", \"assert validate_extension('document.txt')\", \"assert validate_extension('image.jpg')\", \"assert validate_extension('photo.png')\", \"assert validate_extension('report.pdf')\", \"assert validate_extension('summary.doc...
{ "split": "train", "index": 513, "acecode_id": "bigcode_python_fns_24533", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes network and subnet data for a cloud infrastructure management system. The function should take in a dictionary representing a network and a dictionary representing a subnet, and then modify the network dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_subnet_to_network({'id': 'network1', 'name': 'mynetwork1', 'tenant_id': 'tenant1', 'subnets': [], 'enable_dhcp': True, 'gateway_ip': '10.0.0.1', 'ip_version': 4}, {'id': 'subnet1', 'name': 'mysubnet1', 'network_id': 'network1', 'tenant_id': 'tenant1'}) =...
{ "split": "train", "index": 514, "acecode_id": "oss_32611", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of functions, each of which takes a single argument and returns a value. Your task is to implement a function `apply_decorators(func_list, value)` that takes a list of decorators (functions) and a single value. The function should apply each decorator to th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_decorators([], 5) == 5\", \"assert apply_decorators([lambda x: x + 1], 5) == 6\", \"assert apply_decorators([lambda x: x[0], lambda x: x[1]], 'abc') == 'b'\", \"assert apply_decorators([lambda x: x[::-1], lambda x: x + 'A'], 'B') == 'AB'\", \"assert ap...
{ "split": "train", "index": 515, "acecode_id": "bigcode_python_fns_47959", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `left` and `right`, representing two groups of numbers. Your task is to merge these two lists based on the 'left' criteria. This means that you should return a new list that contains all the elements from the `left` list followed by only tho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge([1, 2, 3], [3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert merge([1, 2, 3], [1, 2, 3]) == [1, 2, 3]\", \"assert merge([], [1, 2, 3]) == [1, 2, 3]\", \"assert merge([1, 2, 3], []) == [1, 2, 3]\", \"assert merge([1, 2, 3], [2, 3, 4]) == [1, 2, 3, 4]\", \"asser...
{ "split": "train", "index": 516, "acecode_id": "bigcode_python_fns_28875", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of strings, each representing a protein structure in the format 'PDB_ID,RELEASE_DATE'. Your function should extract the PDB IDs and their corresponding release dates, and return a dictionary where the keys are th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_obsolete_pdbs(['1ABC,2020-01-01', '2XYZ,2019-05-05']) == {'1ABC': '2020-01-01', '2XYZ': '2019-05-05'}\", \"assert parse_obsolete_pdbs(['3DEF,2021-03-15']) == {'3DEF': '2021-03-15'}\", \"assert parse_obsolete_pdbs(['4GHJ,2018-07-20', '5KLM,2020-12-31', ...
{ "split": "train", "index": 517, "acecode_id": "oss_6514", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a list of pages. Given a list of page IDs, your function should return the first page ID if the list is not empty. If the list is empty, return a special value indicating that no pages are available (for example, -1). Imp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_pages([1, 2, 3]) == 1\", \"assert manage_pages([10, 20, 30]) == 10\", \"assert manage_pages([]) == -1\", \"assert manage_pages([5]) == 5\", \"assert manage_pages([0]) == 0\", \"assert manage_pages([7, 8, 9, 10]) == 7\", \"assert manage_pages([-1, -2, ...
{ "split": "train", "index": 518, "acecode_id": "bigcode_python_fns_38453", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function `update_version(version_part)` that simulates updating a version number based on a specified part. The version number is represented as a string in the format 'x.y.z', where x, y, and z are integers corresponding to the major, mino...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_version('major') == '2.0.0'\", \"assert update_version('minor') == '1.3.0'\", \"assert update_version('patch') == '1.2.4'\", \"assert update_version('major') == '2.0.0'\", \"assert update_version('minor') == '1.3.0'\", \"assert update_version('patch')...
{ "split": "train", "index": 519, "acecode_id": "oss_30206", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a file name, write a function that removes the last file extension from the name and returns the modified name. If the file name does not contain an extension, return the name unchanged. A file extension is defined as a dot followed by one or more ch...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert strip_extension('document.txt') == 'document'\", \"assert strip_extension('archive.tar.gz') == 'archive.tar'\", \"assert strip_extension('image.jpeg') == 'image'\", \"assert strip_extension('file') == 'file'\", \"assert strip_extension('music.mp3') == 'music...
{ "split": "train", "index": 520, "acecode_id": "bigcode_python_fns_16410", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that takes in this list and returns a new list that contains only the unique integers from the original list, in the order they first appeared. Implement the function `unique_numbers(arr: List[int]) -> List[...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_numbers([1, 2, 3, 1, 2, 4]) == [1, 2, 3, 4]\", \"assert unique_numbers([5, 5, 5, 5]) == [5]\", \"assert unique_numbers([10, 20, 10, 30, 20, 40]) == [10, 20, 30, 40]\", \"assert unique_numbers([]) == []\", \"assert unique_numbers([1, 2, 3]) == [1, 2, 3...
{ "split": "train", "index": 521, "acecode_id": "bigcode_python_fns_41368", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to create a function that generates a list of lag dimensions for a model based on the input specifications. The function should take the following parameters: \n- `lag_dim`: An integer representing the dimension of each lag block. \n- `output_dim`: An integer represent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_lag_dimensions(2, 3) == [[0, 1], [2, 3], [4, 5]]\", \"assert generate_lag_dimensions(1, 1) == [[0]]\", \"assert generate_lag_dimensions(3, 2) == [[0, 1, 2], [3, 4, 5]]\", \"assert generate_lag_dimensions(4, 0) == []\", \"assert generate_lag_dimensio...
{ "split": "train", "index": 522, "acecode_id": "oss_21854", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the process of reloading SSL certificates for a messaging server. The function, `reload_ssl`, should accept a string parameter `rmq_home` representing the path to the RabbitMQ home directory. The function should return a st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reload_ssl('/path/to/rabbitmq') == 'SSL certificates reloaded successfully'\", \"assert reload_ssl('/another/path') == 'SSL certificates reloaded successfully'\", \"assert reload_ssl('') == 'Error reloading SSL certificates'\", \"assert reload_ssl('/valid/pa...
{ "split": "train", "index": 523, "acecode_id": "bigcode_python_fns_38843", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a filtering function that allows users to filter a list of state cohorts based on a specific attribute. Write a function `filter_state_cohorts(cohorts: List[Dict[str, Any]], start_year: int) -> List[Dict[str, Any]]` that takes in a list of state coh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_state_cohorts([{'state': 'California', 'start_year': 2020}, {'state': 'Texas', 'start_year': 2021}, {'state': 'Florida', 'start_year': 2020}], 2020) == [{'state': 'California', 'start_year': 2020}, {'state': 'Florida', 'start_year': 2020}]\", \"assert...
{ "split": "train", "index": 524, "acecode_id": "oss_21488", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers N and k, create a function that returns a 2D list (array) of shape N x N filled with ones at and below the k-th diagonal. The main diagonal corresponds to k=0, diagonals above it are represented by positive values of k, and diagonals below it are represented ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_diagonal_matrix(3, 0) == [[1, 0, 0], [1, 1, 0], [1, 1, 1]]\", \"assert generate_diagonal_matrix(4, 0) == [[1, 0, 0, 0], [1, 1, 0, 0], [1, 1, 1, 0], [1, 1, 1, 1]]\", \"assert generate_diagonal_matrix(2, 0) == [[1, 0], [1, 1]]\", \"assert generate_dia...
{ "split": "train", "index": 525, "acecode_id": "bigcode_python_fns_43384", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a function `lucas_series(n: int) -> List[int]` that returns the first `n` numbers in the Lucas number series. The Lucas number series starts with 2 and 1, and each subsequent number is the sum of the two preceding ones. Implement the function to generate the series up to ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lucas_series(0) == []\", \"assert lucas_series(1) == [2]\", \"assert lucas_series(2) == [2, 1]\", \"assert lucas_series(3) == [2, 1, 3]\", \"assert lucas_series(4) == [2, 1, 3, 4]\", \"assert lucas_series(5) == [2, 1, 3, 4, 7]\", \"assert lucas_series(6) == ...
{ "split": "train", "index": 526, "acecode_id": "evol_25891", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `pattern` and a string `s`, determine if `s` follows the `pattern`. A string `s` follows a pattern if there exists a one-to-one mapping between characters in `pattern` and non-empty words in `s`. Each character in `pattern` must map to exactly one unique word in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert wordPattern('abba', 'dog cat cat dog') == True\", \"assert wordPattern('abba', 'dog cat cat fish') == False\", \"assert wordPattern('aaaa', 'dog cat cat dog') == False\", \"assert wordPattern('abba', 'dog dog dog dog') == False\", \"assert wordPattern('abc',...
{ "split": "train", "index": 527, "acecode_id": "evol_31840", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string s. Your task is to determine whether the string is considered 'cheerful' based on the following criteria: \n1. The string must contain at least three characters. \n2. Each trio of consecutive characters must be unique (no repeated trios). \n3. Every ch...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_happy('abcde') == False\", \"assert is_happy('aaa') == False\", \"assert is_happy('aabbcc') == True\", \"assert is_happy('abb') == False\", \"assert is_happy('abca') == False\", \"assert is_happy('abccba') == False\", \"assert is_happy('xyzzx') == False\"...
{ "split": "train", "index": 528, "acecode_id": "evol_20153", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of integers and returns a new list that contains only the unique elements from the input list, preserving the order of their first appearance. Implement a function `unique_elements(arr: List[int]) -> List[int]` that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 1]) == [1, 2, 3]\", \"assert unique_elements([5, 5, 5, 5]) == [5]\", \"assert unique_elements([]) == []\", \"assert unique_elements([10, 20, 10, 30, 20]) == [10, 20, 30]\", \"assert unique_elements([1, 2, 3, 4, 5]) == [1, 2, 3, 4...
{ "split": "train", "index": 529, "acecode_id": "bigcode_python_fns_21194", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array representing the lengths of matchsticks. Your task is to determine if it is possible to construct a perfect square using all the matchsticks without breaking any. Each matchstick must be utilized once and only once. Return a boolean value indicating wheth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert makesquare([1,1,2,2,2]) == True\", \"assert makesquare([3,3,3,3,4]) == False\", \"assert makesquare([5,5,5,5]) == True\", \"assert makesquare([2,2,2,2]) == True\", \"assert makesquare([1,2,3,4]) == False\", \"assert makesquare([]) == False\", \"assert makesq...
{ "split": "train", "index": 530, "acecode_id": "evol_30593", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `deep_merge(dict1, dict2)` that merges two dictionaries. The function should handle cases where the values associated with keys may be lists, nested dictionaries, or other complex types. If both dictionaries have the same key and their values are dictionari...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert deep_merge({'a': 1, 'b': 2}, {'b': 3, 'c': 4}) == {'a': 1, 'b': 3, 'c': 4}\", \"assert deep_merge({'a': 1, 'b': {'x': 10}}, {'b': {'y': 20}, 'c': 30}) == {'a': 1, 'b': {'x': 10, 'y': 20}, 'c': 30}\", \"assert deep_merge({}, {'a': 1}) == {'a': 1}\", \"assert ...
{ "split": "train", "index": 531, "acecode_id": "evol_28373", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a version comparison tool. Your program should take two version strings as input and determine which version is greater based on Semantic Versioning (SemVer) format, which consists of three non-negative integers separated by periods (e.g., \"1.2.3\"...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_versions('1.0.0', '1.0.0') == 0\", \"assert compare_versions('1.0.1', '1.0.0') == 1\", \"assert compare_versions('1.0.0', '1.0.1') == -1\", \"assert compare_versions('2.0.0', '1.9.9') == 1\", \"assert compare_versions('1.1.0', '1.0.9') == 1\", \"asse...
{ "split": "train", "index": 532, "acecode_id": "oss_14773", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `sentToDict(paragraph: str) -> Dict[str, List[str]]` that takes a paragraph as input and returns a dictionary where each distinct sentence in the paragraph is a unique key, and the corresponding value is a list of the words in that sentence sorted in ascending ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sentToDict('One. Two. Three.') == {'One': ['One'], 'Two': ['Two'], 'Three': ['Three']}\", \"assert sentToDict('Multiple sentences. Each has words.') == {'Multiple sentences': ['Multiple', 'sentences'], 'Each has words': ['Each', 'has', 'words']}\", \"assert ...
{ "split": "train", "index": 533, "acecode_id": "evol_15596", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a circle defined by its radius and center coordinates (x_center, y_center), and a triangle defined by its three vertices (x1, y1), (x2, y2), and (x3, y3), determine whether the circle and triangle overlap. Return True if they overlap, and False otherwise. Implement the fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert circleAndTriangleOverlapping(1, 0, 0, 1, 1, 2, 1, 1, 0) == True\", \"assert circleAndTriangleOverlapping(5, 0, 0, -3, -3, 3, -3, 0, 3) == True\", \"assert circleAndTriangleOverlapping(3, 1, 1, 5, 5, 6, 5, 5, 6) == False\", \"assert circleAndTriangleOverlappi...
{ "split": "train", "index": 534, "acecode_id": "evol_30137", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a list of angle measurements from degrees to radians. The function should take a list of floats as input, where each float represents an angle in degrees, and return a new list of floats representing the angles converted to radians.\nPlease re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert degrees_to_radians([0]) == [0.0]\", \"assert degrees_to_radians([90]) == [1.5707963267948966]\", \"assert degrees_to_radians([-90]) == [-1.5707963267948966]\", \"assert degrees_to_radians([180]) == [3.141592653589793]\", \"assert degrees_to_radians([360]) ==...
{ "split": "train", "index": 535, "acecode_id": "evol_12636", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a configuration function for a Flask web application that includes settings for SQLAlchemy, Redis, and Flask-Login. Your function should take no parameters and return a dictionary containing the necessary configuration settings for the Flask applica...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_config() == {'SQLALCHEMY_DATABASE_URI': 'sqlite:///app.db', 'SQLALCHEMY_TRACK_MODIFICATIONS': False, 'REDIS': {'host': 'localhost', 'port': 6379}, 'LOGIN_MANAGER': {'login_view': 'login'}}\", \"assert create_config()['SQLALCHEMY_DATABASE_URI'] == 'sql...
{ "split": "train", "index": 536, "acecode_id": "oss_24418", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of conditional statements, where each statement is represented as a tuple. Each tuple starts with a string that indicates the type of condition, followed by any number of parameters. Your task is to implement a function `find_ask_condition(ifs)` that proces...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_ask_condition([('tell', 'info'), ('ask', 'question1')]) == ('ask', 'question1')\", \"assert find_ask_condition([('ask', 'question2'), ('ask', 'question3')]) == ('ask', 'question2')\", \"assert find_ask_condition([('check', 'status'), ('query', 'data')])...
{ "split": "train", "index": 537, "acecode_id": "oss_25941", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of functions and returns a dictionary of their documentation information. Each function has a name, a description, parameters with types and descriptions, and a return value description. Your function should take in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_function_docs([('func1', 'This is func1', [('param1', 'first parameter'), ('param2', 'second parameter')], 'returns description')]) == {'func1': {'description': 'This is func1', 'param:param1': 'first parameter', 'param:param2': 'second parameter', 'retu...
{ "split": "train", "index": 538, "acecode_id": "bigcode_python_fns_8417", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of virtual machine (VM) configurations, represented as a list of strings, implement a function `get_sos_vm_indices(vm_configs: List[str]) -> List[int]` that returns the indices of all VMs that are not labeled as 'SOS_VM'. Each VM configuration can be a simple strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_sos_vm_indices(['VM1', 'SOS_VM', 'VM2', 'VM3', 'SOS_VM']) == [0, 2, 3]\", \"assert get_sos_vm_indices(['SOS_VM', 'SOS_VM', 'VM4']) == [2]\", \"assert get_sos_vm_indices(['VM5', 'VM6', 'VM7']) == [0, 1, 2]\", \"assert get_sos_vm_indices(['SOS_VM', 'VM8', ...
{ "split": "train", "index": 539, "acecode_id": "bigcode_python_fns_29086", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of dictionaries representing fields in a database table and returns a list of field names that have both 'blank' and 'null' set to True. Each dictionary contains the following keys: 'name' (a string representi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_fields_with_blank_and_null([{ 'name': 'field1', 'blank': True, 'null': False }, { 'name': 'field2', 'blank': True, 'null': True }, { 'name': 'field3', 'blank': False, 'null': True }, { 'name': 'field4', 'blank': True, 'null': True }, { 'name': 'field5',...
{ "split": "train", "index": 540, "acecode_id": "oss_36575", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of integers representing temperatures recorded over a week. Write a function `average_temperature(temperatures: List[int]) -> float` that calculates the average temperature for the week. The function should take a list of integers as input ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_temperature([60, 65, 70, 75, 80]) == 70.0\", \"assert average_temperature([-10, -5, 0, 5, 10]) == 0.0\", \"assert average_temperature([100]) == 100.0\", \"assert average_temperature([25, 25, 25, 25, 25, 25, 25]) == 25.0\", \"assert average_temperatur...
{ "split": "train", "index": 541, "acecode_id": "oss_24391", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `AddLastTwoDigits(a: int, b: int) -> int` that accepts two positive integers and returns the sum of their last two digits. The last two digits are obtained by converting the integers to strings, slicing the last two characters, and then converting them back...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert AddLastTwoDigits(1234, 5678) == 12\", \"assert AddLastTwoDigits(1, 2) == 3\", \"assert AddLastTwoDigits(1000, 1000) == 0\", \"assert AddLastTwoDigits(10, 99) == 9\", \"assert AddLastTwoDigits(305, 205) == 10\", \"assert AddLastTwoDigits(2002, 3003) == 5\", \...
{ "split": "train", "index": 542, "acecode_id": "evol_18825", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the behavior of a vehicle's steering control system. Implement a function `simulate_steering_behavior` that checks if an image is available and creates a steering command message if it is. The function should take three parameters: `img`, `steerin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_steering_behavior(None, 30, MockPublisher()) is None\", \"assert simulate_steering_behavior('image_data', 45, MockPublisher()) is None\", \"assert simulate_steering_behavior(None, 0, MockPublisher()) is None\", \"assert simulate_steering_behavior('i...
{ "split": "train", "index": 543, "acecode_id": "oss_12239", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that simulates access control for different types of resources using access control lists (ACLs). Your function should be named `check_access(acl_type: str, user: str, resource: str) -> bool`. The function takes three parameter...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_access('public', 'user1', 'resource1') == True\", \"assert check_access('public', 'user2', 'resource2') == True\", \"assert check_access('public', 'user3', 'resource3') == True\", \"assert check_access('private', 'user1', 'user1') == True\", \"assert c...
{ "split": "train", "index": 544, "acecode_id": "oss_31636", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer array 'arr', write a function 'longest_increasing_subsequence' that returns the length of the longest strictly increasing subsequence in the array. A subsequence is a sequence that can be derived from another sequence by deleting some elements without changing ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_increasing_subsequence([10, 9, 2, 5, 3, 7, 101, 18]) == 4\", \"assert longest_increasing_subsequence([0, 1, 0, 3, 2, 3]) == 4\", \"assert longest_increasing_subsequence([7, 7, 7, 7, 7, 7, 7]) == 1\", \"assert longest_increasing_subsequence([]) == 0\"...
{ "split": "train", "index": 545, "acecode_id": "evol_7475", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of video annotations and extracting specific information from it. Each annotation is represented as a dictionary with the following keys: 'VideoID', 'Start', 'End', 'WorkerID', 'Source', 'AnnotationTime'. Your task is to implement a functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_annotations([{'VideoID':'A', 'Start':1, 'End':2, 'WorkerID':'W1', 'Source':'S1', 'AnnotationTime':'60'}, {'VideoID':'A', 'Start':3, 'End':4, 'WorkerID':'W2', 'Source':'S1', 'AnnotationTime':'120'}, {'VideoID':'B', 'Start':5, 'End':6, 'WorkerID':'W1',...
{ "split": "train", "index": 546, "acecode_id": "oss_33270", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a storage policy for a cloud service. Your function should take the following parameters: cloud_name (a string representing the name of the cloud), zios_id (an integer representing the ZIOS id), policy_name (a string for th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_storage_policy('zadaralab01', 1, 'Backup Policy', 'SSD', 5, 2) == {'name': 'Backup Policy', 'drive_type': 'SSD', 'drive_quantity': 5, 'policy_type_id': 2}\", \"assert create_storage_policy('zadaralab01', 2, 'Archive Policy', 'HDD', 10, 1) == {'name': ...
{ "split": "train", "index": 547, "acecode_id": "bigcode_python_fns_20415", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating a dictionary of named aggregation functions for data processing. Write a function `validate_aggregation_functions` that takes a dictionary `kwargs` as input, where the keys are column names (strings) and the values are either a string representing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_aggregation_functions({'one': 'min', 'two': 'max'}) == (['one', 'two'], ['min', 'max'])\", \"assert validate_aggregation_functions({'a': 'sum', 'b': 'avg'}) == (['a', 'b'], ['sum', 'avg'])\", \"assert validate_aggregation_functions({'x': 'count', 'y...
{ "split": "train", "index": 548, "acecode_id": "bigcode_python_fns_18967", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `find_smallest_product(array: List[int]) -> int` that determines the smallest possible product of a subarray such that no two elements in the subarray are consecutive numbers. You may assume that the input list will contain at leas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_smallest_product([1, 2, 3, 4]) == 3\", \"assert find_smallest_product([1, 1, 1, 1]) == 1\", \"assert find_smallest_product([0, 0, 0]) == 0\", \"assert find_smallest_product([7, 3, 9, 2]) == 6\", \"assert find_smallest_product([1, 4, 5, 2]) == 2\", \"ass...
{ "split": "train", "index": 549, "acecode_id": "evol_28612", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a sorted list of integers, write a function that implements a binary search to find the index of a specified number in the list. If the number is not found, the function should return -1. The list is guaranteed to be sorted in ascending order. The function should have the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert binary_search([1, 2, 3, 4, 5], 1) == 0\", \"assert binary_search([1, 2, 3, 4, 5], 5) == 4\", \"assert binary_search([1, 2, 3, 4, 5], 0) == -1\", \"assert binary_search([1, 2, 3, 4, 5], 6) == -1\", \"assert b...
{ "split": "train", "index": 550, "acecode_id": "evol_20552", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a confusion matrix in the form of a 2D list that represents the performance of a binary classifier. The confusion matrix is structured as follows: [[TP, FP], [FN, TN]], where TP is True Positive, FP is False Positive, FN is False Negative, and TN is True Negative....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_confusion_matrix([[5, 2], [1, 7]]) == {'True Positive': 5, 'True Negative': 7, 'False Positive': 2, 'False Negative': 1, 'Accuracy': 0.8, 'Precision': 0.7142857142857143, 'Recall': 0.8333333333333334}\", \"assert convert_confusion_matrix([[0, 0], [0,...
{ "split": "train", "index": 551, "acecode_id": "oss_18514", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that converts a list of objects into a list of dictionaries, each representing the object in a format suitable for storage in a MongoDB database. Each object has an 'id' method that returns a unique identifier. Your function should take a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_documents([MockObject(1), MockObject(2)]) == [{'id': 1}, {'id': 2}]\", \"assert to_documents([]) == []\", \"assert to_documents([MockObject(10)]) == [{'id': 10}]\", \"assert to_documents([MockObject(3), MockObject(4), MockObject(5)]) == [{'id': 3}, {'id':...
{ "split": "train", "index": 552, "acecode_id": "oss_5017", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of entities and returns the total area occupied by these entities. Each entity is represented by a dictionary with the keys 'x', 'y', 'width', and 'height'. The total area is calculated as the sum of the areas of all...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_area([{'x': 0, 'y': 0, 'width': 10, 'height': 10}]) == 100\", \"assert calculate_total_area([]) == 0\", \"assert calculate_total_area([{'x': 0, 'y': 0, 'width': 1, 'height': 1}, {'x': 0, 'y': 0, 'width': 1, 'height': 1}]) == 2\", \"assert cal...
{ "split": "train", "index": 553, "acecode_id": "oss_31272", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `infixToPostfix(s: str) -> List[str]` that converts an infix expression (containing integers, floats, and operators) into postfix notation. The input will be a string `s` representing the infix expression. If the expression is valid, return a list of string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert infixToPostfix('3 + 4') == ['3', '4', '+']\", \"assert infixToPostfix('10 + 2 * 6') == ['10', '2', '6', '*', '+']\", \"assert infixToPostfix('100 * 2 + 12') == ['100', '2', '*', '12', '+']\", \"assert infixToPostfix('100 * ( 2 + 12 )') == ['100', '2', '12', ...
{ "split": "train", "index": 554, "acecode_id": "evol_21390", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string represents a log message. The log messages may contain some information about a process, including the start of a process, processing status, and completion information. Your task is to implement a function `process_logs(logs: L...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_logs(['Process started', 'Processing...', 'Process finished']) == 'Process started\\\\nProcessing...\\\\nProcess finished'\", \"assert process_logs(['Log entry 1', 'Log entry 2', 'Log entry 3']) == 'Log entry 1\\\\nLog entry 2\\\\nLog entry 3'\", \"a...
{ "split": "train", "index": 555, "acecode_id": "bigcode_python_fns_16368", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `reverse_range` that creates a reversed range of integers starting from a given integer `x` down to a specified integer `y`. The function should return a list of integers in descending order from `x - 1` to `y`. If `y` is not provided, it defaults to `0`. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_range(10, 0) == [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]\", \"assert reverse_range(5) == [4, 3, 2, 1, 0]\", \"assert reverse_range(2, 2) == []\", \"assert reverse_range(0) == []\", \"assert reverse_range(4, 2) == [3, 2]\", \"assert reverse_range(7, 5) == [6, 5...
{ "split": "train", "index": 556, "acecode_id": "bigcode_python_fns_1216", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two non-empty arrays of integers, write a function that combines these two arrays into one, sorts the resultant array in ascending order, and then transforms this array into a string delineated by commas. The function should handle both positive and negative integers, as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine_and_sort([25, 32, 63, 18, 22], [-12, 0, 57, 42, -38]) == '-38,-12,0,18,22,25,32,42,57,63'\", \"assert combine_and_sort([1, 2, 3], [4, 5, 6]) == '1,2,3,4,5,6'\", \"assert combine_and_sort([-1, -2, -3], [-4, -5, -6]) == '-6,-5,-4,-3,-2,-1'\", \"assert ...
{ "split": "train", "index": 557, "acecode_id": "evol_32148", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two distinct strings, your task is to implement a function that identifies the longest common subsequence (LCS) of characters within them. The function should return a string in the format: \"The longest common subsequence is 'XXXXX' and its length is YY\", where 'XXXXX' ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lcs('AGGTAB', 'GXTXAYB') == \\\"The longest common subsequence is 'GTAB' and its length is 4\\\"\", \"assert lcs('ABC', 'AC') == \\\"The longest common subsequence is 'AC' and its length is 2\\\"\", \"assert lcs('ABCDEF', 'FBDAMN') == \\\"The longest common ...
{ "split": "train", "index": 558, "acecode_id": "evol_8683", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that parses a time string in the format 'HH:MM:SS'. The function should take a string input representing the time and return a tuple containing a datetime.time object representing the parsed time and an integer representing nanoseconds, w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_time_string('17:29:43') == (datetime.time(17, 29, 43), 0)\", \"assert parse_time_string('00:00:00') == (datetime.time(0, 0, 0), 0)\", \"assert parse_time_string('12:30:45') == (datetime.time(12, 30, 45), 0)\", \"assert parse_time_string('23:59:59') == ...
{ "split": "train", "index": 559, "acecode_id": "bigcode_python_fns_20808", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_prime(n: int) -> bool` that determines whether a given integer `n` is a prime number. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. The function should return `True` if `n`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser...
{ "split": "train", "index": 560, "acecode_id": "evol_181", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing basic authentication credentials. Write a function `create_basic_auth_config` that takes two parameters: a string `username` and a string `password`. The function should return a dictionary containing the username and password with the keys 'usernam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_basic_auth_config('user1', 'pass1') == {'username': 'user1', 'password': 'pass1'}\", \"assert create_basic_auth_config('admin', '1234') == {'username': 'admin', 'password': '1234'}\", \"assert create_basic_auth_config('guest', 'guest123') == {'usernam...
{ "split": "train", "index": 561, "acecode_id": "oss_9194", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of integers and returns the sum of all the even numbers in the list. Additionally, you need to handle potential errors that may occur during the processing of the list. Write a function called `sum_even_number...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_even_numbers([1, 2, 3, 4, 5, 6]) == 12\", \"assert sum_even_numbers([0, 2, 4, 6]) == 12\", \"assert sum_even_numbers([-2, -4, -6]) == -12\", \"assert sum_even_numbers([1, 3, 5]) == 0\", \"assert sum_even_numbers([]) == 0\", \"assert sum_even_numbers([2, ...
{ "split": "train", "index": 562, "acecode_id": "oss_11667", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given six float parameters: `m8`, `L88`, `d_gap`, `k`, `Cp`, and `h_gap`. Your task is to implement a function that calculates a specific value based on the following formula: \n\n result = 1 / ( (2 * h_gap * L88) / (m8 * Cp) + (2 * k * d_gap) / (m8 * Cp * L88) ) \n\...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_value(1.0, 0.0, 3.0, 4.0, 5.0, 6.0) == None\", \"assert calculate_value(0.0, 2.0, 3.0, 4.0, 5.0, 6.0) == None\", \"assert calculate_value(1.0, 2.0, 3.0, 4.0, 0.0, 6.0) == None\", \"assert calculate_value(1.0, 1.0, 1.0, 1.0, 0.0, 1.0) == None\", \"a...
{ "split": "train", "index": 563, "acecode_id": "bigcode_python_fns_11417", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `retrieve_args_info` that simulates the behavior of parsing command line arguments. The function should accept a list of strings representing command line arguments (similar to `sys.argv`) and return a tuple containing the script name and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_args_info(['script.py']) == ('script.py', {}, None, None)\", \"assert retrieve_args_info(['script.py', 'file.txt']) == ('script.py', {'file.txt': ''}, 'file.txt', '')\", \"assert retrieve_args_info(['script.py', 'data.csv']) == ('script.py', {'data....
{ "split": "train", "index": 564, "acecode_id": "bigcode_python_fns_38212", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string of words and a positive integer n, implement a function that generates the n-grams of the string. An n-gram is a contiguous sequence of n words from the input string. Additionally, the function should return the most frequently occurring n-gram along with its cou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ngrams('Dogs are the best pet', 2) == (['Dogs are', 'are the', 'the best', 'best pet'], 'Dogs are', 1)\", \"assert ngrams('I love programming', 1) == (['I', 'love', 'programming'], 'I', 1)\", \"assert ngrams('Hello world hello world', 2) == (['Hello world', ...
{ "split": "train", "index": 565, "acecode_id": "evol_24182", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a matrix of numeric elements, write a function that sorts the matrix in descending order and determines the number greater than 100 that occurs most frequently within the matrix. If there are multiple numbers with the same highest frequency, return the largest number amon...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve_matrix([[102, 130, 102, 140, 150, 60, 70, 102], [140, 102, 130, 80, 102, 102, 60, 150], [110, 120, 130, 140, 102, 160, 70, 180], [200, 210, 220, 130, 240, 102, 102, 260]]) == 102\", \"assert solve_matrix([[200, 150, 160, 140], [120, 130, 110, 115], [18...
{ "split": "train", "index": 566, "acecode_id": "evol_30383", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python decorator that logs the execution time of a function and prints it to the console. Your decorator should have an option to include the function's docstring in the log output. Implement the function `log_execution_time(include_docstring: boo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_execution_time(False)(lambda x: x + 1)(5) == 6\", \"assert log_execution_time(True)(lambda x: x + 2)(10) == 12\", \"assert log_execution_time(True)(lambda: time.sleep(0.1))() is None\", \"assert log_execution_time(False)(lambda x, y: x * y)(3, 4) == 12\"...
{ "split": "train", "index": 567, "acecode_id": "oss_20165", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a recursive function `find_min_value` that takes a list of integers as input and returns the minimum value found in that list. The function should handle an empty list by returning None. Do not use any built-in functions to find the minimum.\nPlease reason step by ste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_min_value([500, 20, 8, 1000, 1024]) == 8\", \"assert find_min_value([-1, -5, -10, 0, 3]) == -10\", \"assert find_min_value([1]) == 1\", \"assert find_min_value([10, 20, 30, 40]) == 10\", \"assert find_min_value([]) == None\", \"assert find_min_value([7,...
{ "split": "train", "index": 568, "acecode_id": "evol_7494", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two complex numbers represented by their real and imaginary parts, implement a function that computes their addition. Each complex number is defined by two integer parameters, where the first parameter is the real part and the second parameter is the imaginary part. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_complex_numbers(1, 2, 3, 4) == '4 + 6i'\", \"assert add_complex_numbers(-1, -2, -3, -4) == '-4 + -6i'\", \"assert add_complex_numbers(0, 0, 0, 0) == '0 + 0i'\", \"assert add_complex_numbers(5, 6, 10, 7) == '15 + 13i'\", \"assert add_complex_numbers(2, -3...
{ "split": "train", "index": 569, "acecode_id": "evol_18723", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of observation types. Implement a function `get_filtered_observations(observations: List[str], consider_DObs: bool) -> List[str]` that returns a filtered list of observations based on a boolean parameter. If `consider_DObs` is `True`, the fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_filtered_observations(['A', 'B', 'C', 'D'], True) == ['A', 'B', 'C', 'D']\", \"assert get_filtered_observations(['A', 'B', 'C', 'D'], False) == ['A', 'B', 'C']\", \"assert get_filtered_observations(['D', 'D', 'D'], True) == ['D', 'D', 'D']\", \"assert ge...
{ "split": "train", "index": 570, "acecode_id": "oss_15134", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the precision at k (P@k) for a recommendation system. Precision at k is a metric used to evaluate the quality of recommendation systems. The function takes three parameters: a list of items recommended by the system (`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert precision_at_k(['itemA', 'itemB', 'itemC'], ['itemD', 'itemE'], 3) == 0.0\", \"assert precision_at_k(['item1', 'item2', 'item3', 'item4'], ['item1'], 1) == 1.0\", \"assert precision_at_k(['item1', 'item2', 'item3', 'item4', 'item5'], ['item1', 'item6'], 5) =...
{ "split": "train", "index": 571, "acecode_id": "oss_22617", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that translates specific bit-vector operations to a new format based on predefined mappings. You are given a set of bit-vector operations and their corresponding translations to the new format. Your goal is to implement a function `transl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate_bitvector_operation('bx > by') == 'fm.BVUGT(px, py)'\", \"assert translate_bitvector_operation('bx >= by') == 'fm.BVUGE(px, py)'\", \"assert translate_bitvector_operation('bx + by') == 'Translation not found'\", \"assert translate_bitvector_operati...
{ "split": "train", "index": 572, "acecode_id": "oss_4011", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function that checks if a given string is a valid IPv4 address. Implement a function `is_valid_ipv4_address(ip: str) -> bool` that takes a single string parameter `ip`. The function should return True if `ip` is a valid IPv4 address, and False otherwise. A valid...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_ipv4_address('192.168.1.1') == True\", \"assert is_valid_ipv4_address('255.255.255.255') == True\", \"assert is_valid_ipv4_address('0.0.0.0') == True\", \"assert is_valid_ipv4_address('192.168.0.256') == False\", \"assert is_valid_ipv4_address('192....
{ "split": "train", "index": 573, "acecode_id": "bigcode_python_fns_27495", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a rendering function that processes different rendering modes and returns a list of rendered outputs. The function should take a tuple of rendering modes and return a list of corresponding rendered outputs as integers. The rendering modes can be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert render(('rgb',)) == [1]\", \"assert render(('normal',)) == [2]\", \"assert render(('seg',)) == [3]\", \"assert render(('3d',)) == [4]\", \"assert render(('rgb', 'normal')) == [1, 2]\", \"assert render(('rgb', 'seg')) == [1, 3]\", \"assert render(('normal', '...
{ "split": "train", "index": 574, "acecode_id": "oss_8709", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing file names in a directory. Write a function `get_file_names(directory: List[str]) -> List[str]` that returns a list of file names in the same order as they appear in the input list. The list can contain duplicate file names. Your fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_file_names(['file1.txt', 'file2.txt', 'file3.txt']) == ['file1.txt', 'file2.txt', 'file3.txt']\", \"assert get_file_names([]) == []\", \"assert get_file_names(['file1.txt', 'file1.txt', 'file1.txt']) == ['file1.txt', 'file1.txt', 'file1.txt']\", \"assert...
{ "split": "train", "index": 575, "acecode_id": "bigcode_python_fns_26524", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a betting system. Given the odds of a particular event and the amount of money you want to stake, you need to determine the returns from the bet. The odds represent the probability of the event occurring. Write a function `simulate_bet(odds: float...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_bet(3.0, 50) == 200.0\", \"assert simulate_bet(1.5, 200) == 500.0\", \"assert simulate_bet(0.5, 100) == 0.0\", \"assert simulate_bet(4.0, 25) == 125.0\", \"assert simulate_bet(1.0, 150) == 300.0\", \"assert simulate_bet(0.0, 100) == 0.0\", \"assert ...
{ "split": "train", "index": 576, "acecode_id": "bigcode_python_fns_16838", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that performs division of two integers without using the division, multiplication, or modulus operators ('/', '*', '%'). The function should take two integers as input and return the result of dividing the first integer (dividend) by the second integer (div...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert divide(10, 2) == 5\", \"assert divide(7, -3) == -2\", \"assert divide(-8, 2) == -4\", \"assert divide(0, 1) == 0\", \"assert divide(15, 5) == 3\", \"assert divide(-15, -5) == 3\", \"assert divide(-2147483648, -1) == 2147483647\", \"assert divide(2147483647, ...
{ "split": "train", "index": 577, "acecode_id": "evol_3860", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to calculate the cost of a speeding ticket based on a driver's velocity. The function should take the driver's velocity as an input and return a message based on the following rules: If the driver's velocity is less than or equal to the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert speeding_ticket(70) == 'Boa Tarde, cuidado na estrada, siga viagem!'\", \"assert speeding_ticket(80) == 'Boa Tarde, cuidado na estrada, siga viagem!'\", \"assert speeding_ticket(81) == 'Voc\\u00ea ultrapassou o limite de velocidade e foi multado em 7.00 reai...
{ "split": "train", "index": 578, "acecode_id": "oss_18194", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working on a weather monitoring system that collects various environmental data. The system stores this data in a list of dictionaries, where each dictionary represents a specific data point. Each dictionary contains information about a particular weather parameter, suc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert weather_summary([{'driver': 'GV0', 'value': 30, 'uom': 4}, {'driver': 'GV1', 'value': 20, 'uom': 4}]) == {'highest_temperature': 30, 'lowest_temperature': 20, 'average_humidity': 0, 'data_points_count': {'GV0': 1, 'GV1': 1}}\", \"assert weather_summary([{'dr...
{ "split": "train", "index": 579, "acecode_id": "oss_20474", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of file names and their corresponding UUIDs, create a function `verify_file_uuid_mapping(file_mapping: List[Tuple[str, str]]) -> bool` that checks if the UUIDs for each file name are correctly associated. The function should return `True` if every file name matches...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_file_uuid_mapping([('file1.txt', 'uuid1'), ('file2.txt', 'uuid2')]) == True\", \"assert verify_file_uuid_mapping([('file1.txt', 'uuid1'), ('file1.txt', 'uuid1')]) == True\", \"assert verify_file_uuid_mapping([('file3.txt', 'uuid3'), ('file4.txt', 'uui...
{ "split": "train", "index": 580, "acecode_id": "bigcode_python_fns_20495", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `check_jax_usage(enabled: bool = True) -> bool` that manages a configuration setting for checking JAX API usage within Haiku functions. The function should store the previous value of the check setting, update it to the new value prov...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_jax_usage(True) == False\", \"assert check_jax_usage(False) == False\", \"assert check_jax_usage(True) == False\", \"assert check_jax_usage(False) == False\", \"assert check_jax_usage(True) == False\", \"assert check_jax_usage(False) == False\", \"asse...
{ "split": "train", "index": 581, "acecode_id": "bigcode_python_fns_26753", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with processing information about files in a directory. You need to implement a function `accesssizes` that takes a dictionary `data` as input. The keys of the dictionary are strings representing the names of files, and the values are integers representing the si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert accesssizes({'file1.txt': 100, 'file2.txt': 200, 'file3.txt': 300}) == (600, 'file3.txt', 'file1.txt')\", \"assert accesssizes({'a.txt': 50, 'b.txt': 150}) == (200, 'b.txt', 'a.txt')\", \"assert accesssizes({'document.pdf': 400, 'image.png': 200, 'video.mp4'...
{ "split": "train", "index": 582, "acecode_id": "oss_10485", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `print_even_numbers(n)` that takes an integer `n` as input. The function should behave as follows: \n- If `n` is a positive integer, the function should return a string containing the first `n` even numbers in ascending order, separa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_even_numbers(4) == '2 4 6 8'\", \"assert print_even_numbers(0) == 'Invalid input'\", \"assert print_even_numbers(-1) == 'Invalid input'\", \"assert print_even_numbers(1) == '2'\", \"assert print_even_numbers(5) == '2 4 6 8 10'\", \"assert print_even_nu...
{ "split": "train", "index": 583, "acecode_id": "oss_32809", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that finds the longest contiguous sublist where each element is either a Fibonacci number or a prime number. The function should return a list of tuples, where each tuple contains the longest sublist and the start and end indices of th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_sublist([2, 3, 5, 7, 11, 13, 17]) == [([2, 3, 5, 7, 11, 13, 17], 0, 6)]\", \"assert longest_sublist([8, 13, 21, 34, 55]) == [([8, 13, 21, 34, 55], 0, 4)]\", \"assert longest_sublist([15, 16, 17]) == [([17], 2, 2)]\", \"assert longest_sublist([1, 1, 2...
{ "split": "train", "index": 584, "acecode_id": "evol_18886", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given the length of a side of a cube, implement a function that calculates the surface area of the cube. The surface area of a cube can be calculated using the formula: surface_area = 6 * (side ** 2). Your function should take one parameter, the length of the side of the cube, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert surface_area_of_cube(1) == 6\", \"assert surface_area_of_cube(2) == 24\", \"assert surface_area_of_cube(3) == 54\", \"assert surface_area_of_cube(4) == 96\", \"assert surface_area_of_cube(5) == 150\", \"assert surface_area_of_cube(6) == 216\", \"assert surfa...
{ "split": "train", "index": 585, "acecode_id": "evol_11078", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `find_maximum_value(nums)` that returns the maximum value from the list. If the list is empty, return None.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python cod...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_maximum_value([1, 3, 2, 5, 4]) == 5\", \"assert find_maximum_value([-1, -3, -2, -5, -4]) == -1\", \"assert find_maximum_value([10, 20, 30, 40, 50]) == 50\", \"assert find_maximum_value([5]) == 5\", \"assert find_maximum_value([]) == None\", \"assert fin...
{ "split": "train", "index": 586, "acecode_id": "evol_14176", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `delete_resource(api_url: str, resource_id: int) -> dict` that simulates the deletion of a resource identified by `resource_id` from the specified `api_url`. If the operation is successful, the function should return a dictionary representing th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_resource('https://api.example.com/resources', 123) == {'status': 'deleted', 'resource_id': 123}\", \"assert delete_resource('https://api.example.com/resources', 1) == {'status': 'deleted', 'resource_id': 1}\", \"assert delete_resource('https://api.exa...
{ "split": "train", "index": 587, "acecode_id": "oss_33988", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that generates a dictionary with keys from 1 to 10, where each key maps to a list containing the square and cube of the key. The list should have the square at index 0 and the cube at index 1. Implement this function and ensure it can return the list of values...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fetch_value(1) == [1, 1]\", \"assert fetch_value(2) == [4, 8]\", \"assert fetch_value(3) == [9, 27]\", \"assert fetch_value(4) == [16, 64]\", \"assert fetch_value(5) == [25, 125]\", \"assert fetch_value(6) == [36, 216]\", \"assert fetch_value(7) == [49, 343]...
{ "split": "train", "index": 588, "acecode_id": "evol_16985", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the output folder for a specific configuration setting based on given parameters. The function should take four parameters: `ctx` (a context object), `section_name` (a string representing the section name), `option_name` (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_output_folder(ctx1, 'build', 'output', 'default_folder') == 'default_folder'\", \"assert get_output_folder(ctx2, 'build', 'output', 'default_folder') == 'gui_folder'\", \"assert get_output_folder(ctx1, 'config', 'path', 'default_path') == 'default_path'\...
{ "split": "train", "index": 589, "acecode_id": "bigcode_python_fns_23117", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns a dictionary containing the valid keys representing different statistical dispersion measures and their corresponding functions. The valid keys should be 'variance', 'standard_deviation', and 'range'. Each key should map to a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_dispersion_functions()['variance']([1, 2, 3, 4, 5]) == 2.0\", \"assert get_dispersion_functions()['standard_deviation']([1, 2, 3, 4, 5]) == 1.4142135623730951\", \"assert get_dispersion_functions()['range']([1, 2, 3, 4, 5]) == 4\", \"assert get_dispersio...
{ "split": "train", "index": 590, "acecode_id": "bigcode_python_fns_9671", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `encrypt(s: str, shift: int) -> str` that uses a Caesar cipher to encode a given string `s` with a specified shifting factor `shift`. The shifting factor can be any integer, including values greater than the length of the alphabet, and should wrap around ac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encrypt('a', 28) == 'c'\", \"assert encrypt('Abc XY.z', 1) == 'Bcd YZ.a'\", \"assert encrypt('Hello', 3) == 'Khoor'\", \"assert encrypt('xyz', 3) == 'abc'\", \"assert encrypt('ABC', 26) == 'ABC'\", \"assert encrypt('abc', -1) == 'zab'\", \"assert encrypt('Py...
{ "split": "train", "index": 591, "acecode_id": "evol_7900", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates personalized email content based on a list of recipients and a template. The function should take a list of dictionaries representing recipients and an HTML template string as input. Each recipient dictionary contains the k...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_emails([{'email': 'alice@example.com', 'name': 'Alice', 'preference': 'business'}], '<p>Dear {name},</p><p>We have tailored this email specifically for your {preference} needs.</p>') == ['<p>Dear Alice,</p><p>We have tailored this email specifically...
{ "split": "train", "index": 592, "acecode_id": "oss_37179", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `max_length_zero_sum_subarray(arr)` that identifies the length of the longest contiguous subarray whose sum is zero. The function should return the length of this subarray, as well as the start and end indices of the subarray. If there...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_length_zero_sum_subarray([1, -1, 2, -2, 3]) == (4, 0, 3)\", \"assert max_length_zero_sum_subarray([1, 2, 3, 4]) == (0, -1, -1)\", \"assert max_length_zero_sum_subarray([0, 1, -1]) == (3, 0, 2)\", \"assert max_length_zero_sum_subarray([-1, 1, -2, 2, -3, 3...
{ "split": "train", "index": 593, "acecode_id": "evol_24552", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a given utterance string and marks certain words as English based on specific criteria. The function should take the utterance as input and return a list of dictionaries. Each dictionary corresponds to a word in the utt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_utterance('this is a test') == [{'text': 'this', 'is_english': False}, {'text': 'is', 'is_english': False}, {'text': 'a', 'is_english': False}, {'text': 'test', 'is_english': False}]\", \"assert normalize_utterance('|hello |world') == [{'text': '|h...
{ "split": "train", "index": 594, "acecode_id": "oss_5263", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes financial data in the form of a list of dictionaries. Each dictionary represents a single data point and contains the following key-value pairs: 'date', 'open', 'high', 'low', 'close', and 'volume'. Your function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_financial_data([]) == []\", \"assert transform_financial_data([{'date': '2022-01-01', 'open': 100.0, 'high': 110.0, 'low': 95.0, 'close': 105.0, 'volume': 10000}]) == [{'date': '2022-01-01', 'Open': 100.0, 'High': 110.0, 'Low': 95.0, 'Close': 105.0...
{ "split": "train", "index": 595, "acecode_id": "oss_33048", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `count_elements(input_string: str) -> Tuple[int, int, int, int, int, Dict[str, int]]` that takes a string of alphanumeric symbols and returns a tuple containing the count of vowel phonemes, consonants, digits, spaces, special characters, and a dictionary wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_elements('hello world 123') == (3, 7, 3, 2, 0, {'h': 1, 'e': 1, 'l': 3, 'o': 2, ' ': 2, 'w': 1, 'r': 1, 'd': 1, '1': 1, '2': 1, '3': 1})\", \"assert count_elements('AEIOU 6789!@#') == (5, 0, 4, 1, 3, {'A': 1, 'E': 1, 'I': 1, 'O': 1, 'U': 1, ' ': 1, '6'...
{ "split": "train", "index": 596, "acecode_id": "evol_32076", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `cumulative_product(arr)` that returns the cumulative product of the elements in the list. The cumulative product is defined as the result of multiplying all the elements together. For example, for the input list [1, 3, 5, 7], the cumu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cumulative_product([1, 3, 5, 7]) == 105\", \"assert cumulative_product([2, 4, 6]) == 48\", \"assert cumulative_product([1, 1, 1, 1]) == 1\", \"assert cumulative_product([0, 2, 3]) == 0\", \"assert cumulative_product([-1, -2, -3]) == -6\", \"assert cumulative...
{ "split": "train", "index": 597, "acecode_id": "evol_4589", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_happy(s: str, n: int) -> bool` that accepts a string `s` and an integer `n` (with the constraint of 1 <= n <= the length of `s`). The function should determine if the string satisfies the 'happy' condition. The string is considered 'happy' if it meets t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_happy('a', 1) == False\", \"assert is_happy('aa', 1) == False\", \"assert is_happy('abcd', 1) == False\", \"assert is_happy('xyy', 1) == False\", \"assert is_happy('ab', 1) == False\", \"assert is_happy('aabb', 2) == False\", \"assert is_happy('abcabc', 2...
{ "split": "train", "index": 598, "acecode_id": "evol_33851", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries where each dictionary represents a prediction from a parser's output, implement a function that extracts the predicted heads and their corresponding dependency names. The input will be a list of dictionaries, where each dictionary contains two keys:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_predictions([{'predicted_heads': [1, 2], 'predicted_dependencies': ['nsubj', 'dobj']}, {'predicted_heads': [3], 'predicted_dependencies': ['prep']}, {'predicted_heads': [4, 5], 'predicted_dependencies': ['pobj', 'conj']}]) == ([1, 2, 3, 4, 5], ['nsub...
{ "split": "train", "index": 599, "acecode_id": "bigcode_python_fns_39", "num_tests": 16 }