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 tasked with creating a function that simulates the settings for a vehicle movement simulation. The function should allow setting various parameters for the vehicles' movement speeds. Write a function named `set_vehicle_speeds` that takes three parameters: `min_speed`, `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_vehicle_speeds(10, 20, 30) == {'min_move_speed': 10, 'max_move_speed': 20, 'max_walk_speed': 30}\", \"assert set_vehicle_speeds(0, 0, 0) == {'min_move_speed': 0, 'max_move_speed': 0, 'max_walk_speed': 0}\", \"assert set_vehicle_speeds(25, 50, 75) == {'mi...
{ "split": "train", "index": 4500, "acecode_id": "oss_14530", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the growth of a population over a number of generations. The population size is initially set to 20. Each generation, the population size increases based on a growth rate percentage. Write a function `simulate_population_growth(generations, growth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_population_growth(0, 0) == 20.0\", \"assert simulate_population_growth(1, 0) == 20.0\", \"assert simulate_population_growth(1, 100) == 40.0\", \"assert simulate_population_growth(3, 25) == 39.0625\", \"assert simulate_population_growth(1, 25) == 25....
{ "split": "train", "index": 4501, "acecode_id": "oss_14279", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given an array containing only 0s and 1s, write a function that sorts the array in such a way that all the 0s come before all the 1s. Implement a function called `sort_binary_array(arr)` that takes in a list of integers (0s and 1s) and returns the sorted list.\nPlease reason st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_binary_array([0, 1, 1, 0, 0, 0, 1, 1]) == [0, 0, 0, 0, 1, 1, 1, 1]\", \"assert sort_binary_array([1, 0, 1, 0, 1, 0]) == [0, 0, 0, 1, 1, 1]\", \"assert sort_binary_array([0, 0, 0, 0]) == [0, 0, 0, 0]\", \"assert sort_binary_array([1, 1, 1, 1]) == [1, 1, ...
{ "split": "train", "index": 4502, "acecode_id": "evol_32231", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an integer n. Your task is to implement a function that returns the sum of all integers from 1 to n (inclusive). For example, if n is 5, the output should be 15, since 1 + 2 + 3 + 4 + 5 = 15. Implement the function called `sum_to_n(n)` that takes an integer n as i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_to_n(1) == 1\", \"assert sum_to_n(2) == 3\", \"assert sum_to_n(3) == 6\", \"assert sum_to_n(4) == 10\", \"assert sum_to_n(5) == 15\", \"assert sum_to_n(6) == 21\", \"assert sum_to_n(7) == 28\", \"assert sum_to_n(8) == 36\", \"assert sum_to_n(9) == 45\", ...
{ "split": "train", "index": 4503, "acecode_id": "oss_31632", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D list representing a matrix and an integer stride. Implement a function `put_row_stride(matrix: List[List[Union[int, float]]], stride: int) -> List[List[Union[int, float]]]` that modifies the matrix such that each row is adjusted to have the specified stride. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert put_row_stride([[1, 2, 3]], 1) == [[1, 2, 3]]\", \"assert put_row_stride([[1]], 1) == [[1]]\", \"assert put_row_stride([[1, 2], [3, 4, 5]], 1) == [[1, 2], [3, 4, 5]]\", \"assert put_row_stride([], 2) == []\", \"assert put_row_stride([[1, 2, 3], [4]], 1) == [...
{ "split": "train", "index": 4504, "acecode_id": "bigcode_python_fns_18366", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to calculate the sum of all odd numbers that are multiples of three within a given range. Your program should take two integers, `start` and `end`, as input and calculate the sum of all odd numbers between `start` and `end` (inclusive) tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_odd_multiples_of_three(1, 20) == 27\", \"assert sum_odd_multiples_of_three(10, 30) == 63\", \"assert sum_odd_multiples_of_three(15, 45) == 180\", \"assert sum_odd_multiples_of_three(1, 1) == 0\", \"assert sum_odd_multiples_of_three(3, 3) == 3\", \"assert...
{ "split": "train", "index": 4505, "acecode_id": "oss_16678", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given an array called `prices` where `prices[i]` represents the cost of a specific stock on the `i-th` day. Your task is to determine the maximum profit you can achieve by executing an unlimited number of transactions, where you must sell the stock before buying it agai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxProfit([7,1,5,3,6,4]) == 7\", \"assert maxProfit([1,2,3,4,5]) == 4\", \"assert maxProfit([7,6,4,3,1]) == 0\", \"assert maxProfit([1,2,3,2,1,4]) == 5\", \"assert maxProfit([3,2,6,5,0,3]) == 7\", \"assert maxProfit([1,2]) == 1\", \"assert maxProfit([2,1]) =...
{ "split": "train", "index": 4506, "acecode_id": "evol_25773", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a guessing game. The function will accept a list of user inputs and should return the total number of attempts made until a specific termination input is encountered. The function should follow these rules: 1. If the input ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_attempts(['guess1', 'guess2', 'despedida']) == 2\", \"assert count_attempts(['guess1', 'termina']) == 0\", \"assert count_attempts(['guess1', 'guess2', 'guess3', 'despedida']) == 3\", \"assert count_attempts(['termina', 'guess1']) == 0\", \"assert coun...
{ "split": "train", "index": 4507, "acecode_id": "oss_35517", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `connect_to_mail_server(user: str, password: str) -> MailServer` that accepts a username and a password as input parameters. This function should return an instance of a `MailServer` class initialized with the provided username and passwo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert connect_to_mail_server('user@example.com', 'password123') is not None\", \"assert connect_to_mail_server('valid.user', 'securePass!') is not None\", \"assert connect_to_mail_server('sample_user', 'mypassword') is not None\", \"assert connect_to_mail_server('...
{ "split": "train", "index": 4508, "acecode_id": "bigcode_python_fns_34569", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `process_message` that simulates the processing of a message in a chat application. The function takes a message string as input and returns a response string based on the validity of the input. If the input message contains the word 'inv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_message('Hello, how are you?') == 'Message processed successfully.'\", \"assert process_message('This is a test message.') == 'Message processed successfully.'\", \"assert process_message('invalid') == 'Error: Invalid input received.'\", \"assert pro...
{ "split": "train", "index": 4509, "acecode_id": "bigcode_python_fns_16568", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with validating a JSON payload that contains configuration data. Write a function named `validate_configuration` that takes a string representing a JSON object as input and checks if it meets the following criteria: 1. The JSON must contain the keys \"api_version...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_configuration('{\\\"api_version\\\": 1, \\\"commit\\\": \\\"abc123\\\", \\\"modules\\\": {}}') == True\", \"assert validate_configuration('{\\\"api_version\\\": 1, \\\"commit\\\": \\\"abc123\\\", \\\"modules\\\": {\\\"module1\\\": \\\"v1\\\"}}') == ...
{ "split": "train", "index": 4510, "acecode_id": "oss_7565", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the minimum cost to supply water to a given number of houses using a combination of wells and pipes. You need to implement a function `minCostToSupplyWater(n: int, wells: List[int], pipes: List[List[int]]) -> int`. The function takes three parame...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minCostToSupplyWater(3, [1, 2, 2], [[1, 2, 1], [2, 3, 1]]) == 3\", \"assert minCostToSupplyWater(2, [1, 1], [[1, 2, 1]]) == 2\", \"assert minCostToSupplyWater(1, [1], []) == 1\", \"assert minCostToSupplyWater(2, [1, 2], [[1, 2, 3], [1, 2, 4]]) == 3\", \"asse...
{ "split": "train", "index": 4511, "acecode_id": "evol_35615", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a user profile system. The function should take a string representing a username and return a dictionary containing the username and the user's age. The age should be a fixed value of 25. The function si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert user_profile('Testing-123456') == {'username': 'Testing-123456', 'age': 25}\", \"assert user_profile('User1') == {'username': 'User1', 'age': 25}\", \"assert user_profile('Alice') == {'username': 'Alice', 'age': 25}\", \"assert user_profile('Bob') == {'usern...
{ "split": "train", "index": 4512, "acecode_id": "oss_10996", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string and an array of words, implement a function that returns a dictionary containing the count of each word's occurrence in the string. The function should be case-insensitive, meaning that 'This' and 'this' should be treated as the same word. The output dictionary s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_occurrences('This is a test string to check the frequency of words', ['this', 'is', 'test', 'string']) == {'this': 1, 'is': 1, 'test': 1, 'string': 1}\", \"assert word_occurrences('Hello world', ['hello', 'world', 'test']) == {'hello': 1, 'world': 1, 't...
{ "split": "train", "index": 4513, "acecode_id": "evol_20379", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating a security requirement object represented as a dictionary in Python. The security requirement object contains keys that represent different security requirements and their associated values. Your job is to implement a function that checks if all r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_security_requirement_object({'encryption': True, 'authentication': 'password', 'authorization': ['admin', 'user']}) == True\", \"assert validate_security_requirement_object({'encryption': False, 'authentication': 'token', 'authorization': ['user']})...
{ "split": "train", "index": 4514, "acecode_id": "bigcode_python_fns_30258", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function called `create_email_address` that constructs an email address using the provided name, domain, and a dictionary of mail parameters. The email address should follow the format: `name@domain.com?param1=value1&param2=value2...&paramN=valueN`. The function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_email_address('johnsmith', 'yahoo', {'subject': 'Meeting Update', 'body': 'Discussing the agenda'}) == 'johnsmith@yahoo.com?subject=Meeting Update&body=Discussing the agenda'\", \"assert create_email_address('alice', 'gmail', {'subject': 'Hello', 'bod...
{ "split": "train", "index": 4515, "acecode_id": "evol_31410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the initialization and management of a molecular dynamics simulation. The function should take in a dictionary of input parameters that include 'filename' (a string representing the input file name), 'run_md' (a boolean ind...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_molecular_dynamics({'filename': 'input.txt', 'run_md': False}) == ('ll_wrapper_instance', 'qmmm_wrapper_instance')\", \"assert simulate_molecular_dynamics({'filename': 'config.json', 'run_md': False}) == ('ll_wrapper_instance', 'qmmm_wrapper_instanc...
{ "split": "train", "index": 4516, "acecode_id": "oss_1444", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `handle_input(x)` that takes a single argument `x` and categorizes it based on its type. The function should return the following strings based on the input type: 'Input is null' if `x` is None, 'Positive integer' if `x` is a positive integer, 'Negative int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_input(None) == 'Input is null'\", \"assert handle_input(5) == 'Positive integer'\", \"assert handle_input(-3) == 'Negative integer'\", \"assert handle_input(0) == 'Zero'\", \"assert handle_input(2.5) == 'Floating point number'\", \"assert handle_input...
{ "split": "train", "index": 4517, "acecode_id": "evol_1174", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a given sequence of numerical data and a corresponding list of cluster IDs. Your function should take two inputs: a list of sequences, where each sequence is a list of floats, and a list of cluster IDs, where each clust...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert adjust_sequences([[1.0, 2.0], [3.0]], ['cluster1', 'cluster2']) == [[1.00001, 2.00001], [3.00001]]\", \"assert adjust_sequences([[0.0]], ['single_cluster']) == [[0.00001]]\", \"assert adjust_sequences([[1.5, 2.5, 3.5]], ['clusterA']) == [[1.50001, 2.50001, 3...
{ "split": "train", "index": 4518, "acecode_id": "bigcode_python_fns_16229", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a dotted key, you need to replace any segments of the string that are integers with asterisks ('*'). Each segment is separated by a dot ('.'). Write a function `starify(name: str) -> str` that takes this input string and returns a new string where al...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert starify('user.1.profile') == 'user.*.profile'\", \"assert starify('account.3.details.4') == 'account.*.details.*'\", \"assert starify('name.5') == 'name.*'\", \"assert starify('test.0.test') == 'test.*.test'\", \"assert starify('user.abc.123.def') == 'user.a...
{ "split": "train", "index": 4519, "acecode_id": "bigcode_python_fns_3187", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates clearing a text console screen. The function should take a single optional argument `tty`, which is a string representing the terminal device. If `tty` is an empty string or not provided, the function should return the stri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clear_screen() == 'Screen cleared using shell command'\", \"assert clear_screen('') == 'Screen cleared using shell command'\", \"assert clear_screen('tty1') == 'Screen cleared for device: tty1'\", \"assert clear_screen('tty2') == 'Screen cleared for device: ...
{ "split": "train", "index": 4520, "acecode_id": "bigcode_python_fns_34873", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a user access management system for a project management application. You have a dictionary called `_user_access_matrix` which stores user access information for each project. The keys are project IDs (strings), and the values are lists of user ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_user('user1', 'projectA') is None\", \"assert remove_user('user2', 'projectB') is None\", \"assert remove_user('user3', 'projectC') is None\", \"assert remove_user('user4', 'projectD') is None\", \"assert remove_user('user5', 'projectE') is None\", \"...
{ "split": "train", "index": 4521, "acecode_id": "oss_28078", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the even integers from the input list. The order of the even integers in the output list should be the same as their order in the input list. Write a function `filte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_numbers([0,...
{ "split": "train", "index": 4522, "acecode_id": "oss_31081", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing bond currents. Implement a function that calculates the average bond current for a given list of current values. The function should take a list of integers and return the average as a float. If the input list is empty, return 0.0.\...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_bond_current([10, 20, 30]) == 20.0\", \"assert average_bond_current([-10, -20, -30]) == -20.0\", \"assert average_bond_current([0, 0, 0]) == 0.0\", \"assert average_bond_current([5]) == 5.0\", \"assert average_bond_current([]) == 0.0\", \"assert aver...
{ "split": "train", "index": 4523, "acecode_id": "bigcode_python_fns_41331", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that compares two sets of log entries and returns the new log entries that were not present in the previous log. The function should take two inputs: a list of strings `previous_log` representing the previous log entries and a list of str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_new_logs(['error', 'warning', 'info'], ['info', 'error', 'debug']) == ['debug']\", \"assert find_new_logs(['apple', 'banana'], ['banana', 'cherry', 'apple']) == ['cherry']\", \"assert find_new_logs(['a', 'b', 'c'], ['b', 'c', 'd', 'e']) == ['d', 'e']\",...
{ "split": "train", "index": 4524, "acecode_id": "bigcode_python_fns_38275", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a string as input and returns a new string where the casing of each letter is randomly altered. Each letter in the input string should be transformed to either uppercase or lowercase with equal probability. The non-letter charac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert randomize_case('abc') != 'abc'\", \"assert randomize_case('ABC') != 'ABC'\", \"assert randomize_case('Hello, World!') != 'Hello, World!'\", \"assert randomize_case('Python123') != 'Python123'\", \"assert randomize_case('a') != 'a'\", \"assert randomize_case(...
{ "split": "train", "index": 4525, "acecode_id": "bigcode_python_fns_12752", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given list of integers contains any duplicates. The function should return True if there are any duplicates, and False otherwise. Implement a function `contains_duplicates(nums: List[int]) -> bool`, where `nums` is a list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contains_duplicates([1, 2, 3, 4]) == False\", \"assert contains_duplicates([1, 2, 3, 1]) == True\", \"assert contains_duplicates([]) == False\", \"assert contains_duplicates([5, 5, 5, 5]) == True\", \"assert contains_duplicates([1]) == False\", \"assert cont...
{ "split": "train", "index": 4526, "acecode_id": "bigcode_python_fns_36409", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks if two given strings are lexical anagrams while ignoring spaces and punctuation. The function should be case sensitive and should consider both uppercase and lowercase letters, numbers, and special characters. It should return True if they are a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_lexical_anagrams('Hello, World!', 'dlroW ,olleH') == True\", \"assert are_lexical_anagrams('12345', '54321') == True\", \"assert are_lexical_anagrams('abc def!', 'fed cba') == True\", \"assert are_lexical_anagrams('A man, a plan, a canal, Panama!', 'A ca...
{ "split": "train", "index": 4527, "acecode_id": "evol_25002", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a permission check in a web application. You need to ensure that only the owner of an object can access it. Write a function `check_permission(request, obj)` that takes in two parameters: `request` and `obj`. The `request` object represents the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_permission({'user': {'id': 1}}, {'user': {'id': 1}}) == True\", \"assert check_permission({'user': {'id': 2}}, {'user': {'id': 2}}) == True\", \"assert check_permission({'user': {'id': 3}}, {'user': {'id': 4}}) == False\", \"assert check_permission({'u...
{ "split": "train", "index": 4528, "acecode_id": "oss_15698", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two strings, `string_1` and `string_2`, and returns a list of starting indices where `string_1` is found as a substring in `string_2`. If `string_1` is not a substring of `string_2`, return an empty list.\nPlease reason step by step, then write a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert substring_indexes('hello', 'hello world') == [0]\", \"assert substring_indexes('world', 'hello world') == [6]\", \"assert substring_indexes('x', 'hello world') == []\", \"assert substring_indexes(' ', 'hello world') == [5]\", \"assert substring_indexes('hell...
{ "split": "train", "index": 4529, "acecode_id": "evol_29410", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `currency_conversion(name1, value1, name2, value2)` that takes in the names and values in USD of two currencies. The function should return the conversion rate from the first currency to the second. If either currency has a value less than or equal to zero,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert currency_conversion('USD', 1, 'EUR', 0.85) == 1.1764705882352942\", \"assert currency_conversion('GBP', 0.75, 'JPY', 110) == 0.006818181818181818\", \"assert currency_conversion('INR', 75, 'USD', 1) == 75.0\", \"assert currency_conversion('CHF', 0.93, 'EUR',...
{ "split": "train", "index": 4530, "acecode_id": "evol_1655", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that partitions the list into two nested lists: the first containing only the prime numbers and the second containing only the Fibonacci numbers. Exclude any integers that do not meet these criteria. The function should return a ne...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert partition([10, 15, 23, 34, 5, 8]) == [[23, 5], [34, 5, 8]]\", \"assert partition([14, 15, 16, 17]) == [[17], []]\", \"assert partition([]) == [[], []]\", \"assert partition([19, 23, 29, 31]) == [[19, 23, 29, 31], []]\", \"assert partition([-1, -2, -3, -5]) =...
{ "split": "train", "index": 4531, "acecode_id": "evol_15069", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates if a given string is a valid IPv4 address. A valid IPv4 address consists of four decimal numbers, each ranging from 0 to 255, separated by dots. Leading zeros are not allowed unless the number is '0' itself. Write a functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_ip_address('192.168.1.1') == True\", \"assert is_valid_ip_address('0.0.0.0') == True\", \"assert is_valid_ip_address('255.255.255.255') == True\", \"assert is_valid_ip_address('256.100.50.25') == False\", \"assert is_valid_ip_address('192.168.1.256'...
{ "split": "train", "index": 4532, "acecode_id": "bigcode_python_fns_42765", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `remove_old_backup(bkp_location: str, bkp_filename: str) -> str` that simulates the process of removing an old backup file from a specified directory. The function should take two parameters: `bkp_location`, which is a string representing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_old_backup('/backups', 'backup1.zip') == 'Backup file not found: /backups/backup1.zip'\", \"assert remove_old_backup('/backups', 'backup2.zip') == 'Backup file not found: /backups/backup2.zip'\", \"assert remove_old_backup('/documents', 'doc_backup.do...
{ "split": "train", "index": 4533, "acecode_id": "bigcode_python_fns_46457", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string representing a URL and returns a dictionary with a single key-value pair. The key should be 'BASE_URL' and the value should be the provided URL. Implement a function named `create_url_dict(url: str) -> dict`. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_url_dict('http://example.com') == {'BASE_URL': 'http://example.com'}\", \"assert create_url_dict('https://mywebsite.org') == {'BASE_URL': 'https://mywebsite.org'}\", \"assert create_url_dict('ftp://fileserver.com') == {'BASE_URL': 'ftp://fileserver.co...
{ "split": "train", "index": 4534, "acecode_id": "bigcode_python_fns_8705", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a sensor system that updates its state based on a series of requests. The sensor can either be in a valid state represented by a string of digits or in an 'UNAVAILABLE' state. You need to implement a function `update_sensor_state` that takes a lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_sensor_state([False, False, False]) == 'UNAVAILABLE'\", \"assert update_sensor_state([True, False, False]) == 'UNAVAILABLE'\", \"assert update_sensor_state([False, True, False]) == 'UNAVAILABLE'\", \"assert update_sensor_state([False, True, False, Fal...
{ "split": "train", "index": 4535, "acecode_id": "bigcode_python_fns_21612", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given password is considered 'bad' based on its occurrence in a simulated database of breached passwords. Your function should take a string password as input and return an integer indicating how many times this password ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_password('password123') == 5\", \"assert check_password('123456') == 10\", \"assert check_password('welcome') == 0\", \"assert check_password('user1234') == 0\", \"assert check_password('mysecurepassword') == 0\", \"assert check_password('letmein123') ...
{ "split": "train", "index": 4536, "acecode_id": "bigcode_python_fns_25218", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `find_rare_integer(lst)` that takes a unique, non-empty list of natural numbers and returns the smallest integer greater than zero whose frequency in the list is less than or equal to half of its own value. If no such integer exists, return -1.\nPlease reas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_rare_integer([5, 5, 4, 4, 4]) == 5\", \"assert find_rare_integer([10, 10, 10, 1, 2]) == 2\", \"assert find_rare_integer([6, 1, 1, 2, 2, 3, 3]) == 6\", \"assert find_rare_integer([7, 8, 8, 9, 9]) == 7\", \"assert find_rare_integer([3, 3, 3, 4, 4, 4]) == ...
{ "split": "train", "index": 4537, "acecode_id": "evol_20246", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given two dictionaries: 'mesh' and 'Dict'. The 'mesh' dictionary contains information about a geometric mesh with the following keys: 'elements', 'points', 'edges', and 'faces'. The 'Dict' dictionary contains corresponding information that you need to compare against. E...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_mesh({'elements': [1, 2, 3], 'points': [1, 2, 3], 'edges': [1, 2], 'faces': [1, 2]}, {'elements': [1, 2, 3], 'points': [1, 2, 3], 'edges': [1, 2], 'faces': [1, 2]}) == True\", \"assert check_mesh({'elements': [1, 2], 'points': [1, 2], 'edges': [1, 2], ...
{ "split": "train", "index": 4538, "acecode_id": "bigcode_python_fns_24206", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to manage conference seat availability. Write a function `generate_announcement(conferences)` that takes a list of tuples, where each tuple contains the name of a conference (a string) and the number of available seats (an integer). Your f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_announcement([('Conference A', 3), ('Conference B', 6), ('Conference C', 1)]) == 'Last chance to attend! The following conferences are nearly sold out: Conference A, Conference C'\", \"assert generate_announcement([('Conference D', 5), ('Conference ...
{ "split": "train", "index": 4539, "acecode_id": "oss_6946", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `median(l: list) -> float` that returns the median of the elements in the list without sorting it or using built-in functions. The function should handle lists with both even and odd numbers of elements, including duplicates.\nPlease reason step by step, th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median([3, 1, 2, 4, 5]) == 3\", \"assert median([1, 3, 3, 6, 7, 8, 9]) == 6\", \"assert median([3, 5, 1, 2, 4]) == 3\", \"assert median([1, 2]) == 1.5\", \"assert median([1]) == 1\", \"assert median([5, 3, 2, 8, 7]) == 5\", \"assert median([10, 20, 30, 40]) ...
{ "split": "train", "index": 4540, "acecode_id": "evol_31949", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D array of integers with dimensions n x m (where 1 ≤ n, m ≤ 1000), write a function that calculates and returns the sum of all prime numbers in the array. The 2D array can contain both positive and negative integers.\nPlease reason step by step, then write a self-conta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_primes([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 17\", \"assert sum_of_primes([[10, 15, 20], [21, 22, 23], [24, 25, 26]]) == 23\", \"assert sum_of_primes([[0, -1, -2], [-3, -4, -5], [-6, -7, -8]]) == 0\", \"assert sum_of_primes([[2, 4, 6], [8, 10, 12], [1...
{ "split": "train", "index": 4541, "acecode_id": "evol_1061", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given two lists of logits representing two categorical distributions, compute the Kullback-Leibler (KL) divergence between them. The KL divergence is a measure of how one probability distribution diverges from a second expected probability distribution. The input consists of tw...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert kl_divergence_with_logits([1.0, 2.0], [2.0, 1.0], 1.0) > 0.0\", \"assert kl_divergence_with_logits([1.0, 1.0], [1.0, 1.0], 1.0) == 0.0\", \"assert kl_divergence_with_logits([1.0, 2.0, 3.0], [1.0, 2.0, 3.0], 1.0) == 0.0\", \"assert kl_divergence_with_logits([...
{ "split": "train", "index": 4542, "acecode_id": "bigcode_python_fns_19822", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the even integers from the original list. The order of the even integers in the new list should be the same as they appeared in the input list. If there are no even ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6,...
{ "split": "train", "index": 4543, "acecode_id": "oss_4267", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `add_entry(entries: Dict[str, str], key: str, value: str) -> None` that takes a dictionary `entries` representing subject entries as key-value pairs, a `key` and a `value`. The function should add the given key-value pair to the dictionary if the key does n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_entry({}, 'Math', 'Algebra') == None\", \"assert add_entry({'Math': 'Algebra'}, 'Science', 'Biology') == None\", \"assert add_entry({'Math': 'Algebra', 'Science': 'Biology'}, 'Math', 'Calculus') == None\", \"assert add_entry({'History': 'Ancient'}, 'Hist...
{ "split": "train", "index": 4544, "acecode_id": "evol_26234", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists: `labels` and `lrs`, where `labels` contains a list of strings representing different categories and `lrs` contains a list of strings that can only be 'l' or 'r', indicating the left or right orientation corresponding to each label. Your task is to imple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_consistency(['a', 'b', 'c'], ['l', 'r', 'l']) == True\", \"assert check_consistency(['a', 'b', 'a'], ['l', 'l', 'r']) == True\", \"assert check_consistency(['x', 'y'], ['r', 'r']) == True\", \"assert check_consistency(['p'], ['l']) == True\", \"assert ...
{ "split": "train", "index": 4545, "acecode_id": "bigcode_python_fns_46857", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes in a list of strings, where each string represents a sentence. Your function should return a dictionary containing the frequency of unique words found in these sentences. The function should ignore case sensitivity and c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_frequency(['Hello world!', 'This is a test.', 'Hello again.']) == {'hello': 2, 'world': 1, 'this': 1, 'is': 1, 'a': 1, 'test': 1, 'again': 1}\", \"assert word_frequency(['']) == {}\", \"assert word_frequency(['One word.', 'Another word.']) == {'one': 1,...
{ "split": "train", "index": 4546, "acecode_id": "oss_5355", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array and a number. Your task is to rotate the array to the left by the given number of positions, and then sort the rotated portion of the array in descending order. Implement the function `rotate_and_sort(arr: List[Union[int, str, list, dict, complex]], num: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_and_sort([], 3) == []\", \"assert rotate_and_sort([1], 2) == [1]\", \"assert rotate_and_sort([1, 2, 3], 0) == [1, 2, 3]\", \"assert rotate_and_sort([1, 2, 3], 3) == [1, 2, 3]\", \"assert rotate_and_sort([1, 2, 3, 4, 5], 5) == [1, 2, 3, 4, 5]\", \"asse...
{ "split": "train", "index": 4547, "acecode_id": "evol_34663", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Develop a function to compute the geometric mean of a list of positive numbers. The function should take a single parameter, a list of positive integers, and return the geometric mean as a float.\nPlease reason step by step, then write a self-contained Python solution. Give you...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(geo_mean([1, 1, 1]) - 1.0) < 0.0001\", \"assert abs(geo_mean([2, 8]) - 4.0) < 0.0001\", \"assert abs(geo_mean([3, 3, 3, 3]) - 3.0) < 0.0001\", \"assert abs(geo_mean([5, 5, 5, 5]) - 5.0) < 0.0001\", \"assert abs(geo_mean([100, 200]) - 141.4214) < 0.0001\"...
{ "split": "train", "index": 4548, "acecode_id": "evol_27600", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of 2D points and determines whether they can form a closed polygon. A closed polygon is defined as a shape where the last point connects back to the first point. The function should return True if the points can form a c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_form_closed_polygon([(0, 0), (1, 1), (1, 0), (0, 0)]) == True\", \"assert can_form_closed_polygon([(0, 0), (1, 1), (1, 0)]) == False\", \"assert can_form_closed_polygon([(0, 0)]) == False\", \"assert can_form_closed_polygon([]) == False\", \"assert can_f...
{ "split": "train", "index": 4549, "acecode_id": "oss_9852", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in a list of integers and returns a new list containing only the unique elements from the original list, preserving the original order. The function should eliminate any duplicate values while maintaining the first occurrence o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3, 2, 1, 4]) == [1, 2, 3, 4]\", \"assert unique_elements([5, 5, 5, 5]) == [5]\", \"assert unique_elements([]) == []\", \"assert unique_elements([10, 20, 10, 30, 40, 20]) == [10, 20, 30, 40]\", \"assert unique_elements([1, 2, 2, 3, 1, 4...
{ "split": "train", "index": 4550, "acecode_id": "bigcode_python_fns_9398", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of strings, implement a function that rearranges the strings in a pendulum style, such that the first half of distinct strings appears on the left side in their original order, and the second half appears on the right side in reverse order. The function should ma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pendulum_sort(['x', 'y', 'z']) == ['x', 'y'] + ['z']\", \"assert pendulum_sort(['hello', 'world', 'hello', 'python']) == ['hello', 'world', 'python'] + []\", \"assert pendulum_sort(['test', 'test', 'test']) == ['test'] + []\", \"assert pendulum_sort(['apple'...
{ "split": "train", "index": 4551, "acecode_id": "evol_10129", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a string input representing a file path, write a function `is_valid_furl_or_file(furl_or_file: str) -> bool` that checks if the input is a valid FURL or a valid FURL file. A valid FURL must start with 'furl://' and have a valid path following it. A valid FURL file must en...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_furl_or_file('furl://example/path') == True\", \"assert is_valid_furl_or_file('furl://another/path') == True\", \"assert is_valid_furl_or_file('invalid_path') == False\", \"assert is_valid_furl_or_file('furl://') == False\", \"assert is_valid_furl_o...
{ "split": "train", "index": 4552, "acecode_id": "bigcode_python_fns_39619", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of swaps in the format of tuples where each tuple consists of three elements: (amount_in, token_in, token_out), return a tuple representing the trade consisting of the base asset, quote asset, amount, and rate. The base asset is determined by the last token_out of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_trade_from_swaps([(100, 'USDC', 'AMPL'), (50, 'AMPL', 'WETH')]) == ('WETH', 'USDC', 50, 2.0)\", \"assert calculate_trade_from_swaps([(200, 'USDC', 'AMPL'), (150, 'AMPL', 'WETH')]) == ('WETH', 'USDC', 150, 1.3333333333333333)\", \"assert calculate_t...
{ "split": "train", "index": 4553, "acecode_id": "bigcode_python_fns_6884", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a string representing a file name, implement a function `give_name(fname: str) -> str` that processes the file name according to the following rules: \n1. If the file name starts with the string 'AUX_FILE', it should append the extension '.csv' to the file name. \n2. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert give_name('file.txt') == 'file.csv'\", \"assert give_name('data') == 'data.csv'\", \"assert give_name('report.pdf') == 'report.csv'\", \"assert give_name('AUX_FILE_data') == 'AUX_FILE_data.csv'\", \"assert give_name('AUX_FILE_report') == 'AUX_FILE_report.csv...
{ "split": "train", "index": 4554, "acecode_id": "bigcode_python_fns_46760", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that counts the total number of prime numbers within a given inclusive range defined by two input parameters, `start` and `end`. The function should return the count of prime numbers starting from `start` to `end`, including both `start` and `end`.\nPlea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_prime_quantity(10, 20) == 4\", \"assert calculate_prime_quantity(1, 10) == 4\", \"assert calculate_prime_quantity(2, 2) == 1\", \"assert calculate_prime_quantity(5, 5) == 1\", \"assert calculate_prime_quantity(10, 10) == 0\", \"assert calculate_pri...
{ "split": "train", "index": 4555, "acecode_id": "evol_7556", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s`, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in these substrings are grouped consecutively. Additionally, the substrings should not contain any repeating sequence of 0's or 1'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert countBinarySubstrings('10101') == 4\", \"assert countBinarySubstrings('101010') == 5\", \"assert countBinarySubstrings('1111') == 0\", \"assert countBinarySubstrings('000') == 0\", \"assert countBinarySubstrings('111') == 0\", \"assert countBinarySubstrings(...
{ "split": "train", "index": 4556, "acecode_id": "evol_13111", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a dictionary of clusters, where each cluster is represented by a list of indices that point to entries in a given list of texts. Your task is to implement a function `generate_wordclouds(clusters: Dict[str, List[int]], texts: List[str]) -> Dict[str, List[str]]` th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_wordclouds({'cluster1': [0, 1], 'cluster2': [2]}, ['hello world', 'hello python', 'python code']) == {'cluster1': ['hello', 'python', 'world'], 'cluster2': ['code', 'python']}\", \"assert generate_wordclouds({'a': [0]}, ['cat', 'dog', 'fish']) == {'...
{ "split": "train", "index": 4557, "acecode_id": "bigcode_python_fns_19501", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of strings called 'corpus' and an integer 'n', your task is to implement a function 'get_ngrams(corpus: List[str], n: int) -> Dict[str, int]' that returns a dictionary containing all n-grams of length 'n' found in the corpus, along with their frequencies. An n-gram...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_ngrams(['a b c', 'b c d', 'c d e'], 3) == {'a b c': 1, 'b c d': 1, 'c d e': 1}\", \"assert get_ngrams(['python is great', 'python is fun'], 2) == {'python is': 2, 'is great': 1, 'is fun': 1}\", \"assert get_ngrams(['one two three', 'two three four', 'thr...
{ "split": "train", "index": 4558, "acecode_id": "bigcode_python_fns_634", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with validating the month of a stocking event based on the provided year, month, and day. Write a function `is_valid_month(year: int, month: int, day: int) -> bool` that checks if the given month is valid. A month is considered valid if it is an integer between 1...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_month(2023, 1, 15) == True\", \"assert is_valid_month(2023, 12, 31) == True\", \"assert is_valid_month(2023, 0, 15) == False\", \"assert is_valid_month(2023, 13, 10) == False\", \"assert is_valid_month(2023, 6, 30) == True\", \"assert is_valid_month...
{ "split": "train", "index": 4559, "acecode_id": "bigcode_python_fns_32626", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines whether a given string is a palindrome. A palindrome is a word, phrase, number, or other sequences of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Write a func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man a plan a canal Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('12321') == True\", \"assert is_palindrome('No lemon no melon') == True\", \"assert is_palindrome('Hello') == False\", \"assert is_pal...
{ "split": "train", "index": 4560, "acecode_id": "bigcode_python_fns_21202", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simplifying a Unix-style file path. The function should remove any unnecessary or redundant elements from the path and return the simplified version. Implement a Python function `clean_path(path)` that takes a string `path` as input and returns the simplifie...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_path('/home//user/../././documents/') == '/home/documents'\", \"assert clean_path('/a/./b/../../c/') == '/c'\", \"assert clean_path('/../') == '/'\", \"assert clean_path('/a/b/c/d/') == '/a/b/c/d'\", \"assert clean_path('/a/b/c/../../d/') == '/a/d'\", ...
{ "split": "train", "index": 4561, "acecode_id": "oss_35051", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple equity screening process. The function `simulate_equity_screening(screen, asof=None, typ='PRIVATE', group='General')` takes the following parameters: \n- `screen`: A string representing the name of the equity scree...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_equity_screening('TechStocks') == {'screen_name': 'TechStocks', 'date': 'No Date Provided', 'type': 'PRIVATE', 'group': 'General'}\", \"assert simulate_equity_screening('TechStocks', '20230101') == {'screen_name': 'TechStocks', 'date': '20230101', '...
{ "split": "train", "index": 4562, "acecode_id": "bigcode_python_fns_900", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `extract_person_names(text: str) -> List[str]` that takes a string of text as input and identifies all person names within the text. The person names are defined as proper nouns (capitalized words) that may be separated by commas or conjunctions. The function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_person_names('John, Paul, and George went to the park.') == ['John', 'Paul', 'George']\", \"assert extract_person_names('Alice, Bob, and Charlie are friends.') == ['Alice', 'Bob', 'Charlie']\", \"assert extract_person_names('Lily and James went shopp...
{ "split": "train", "index": 4563, "acecode_id": "evol_5546", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing pixel values of a grayscale image, where each value ranges from 0 to 255. Your task is to equalize the histogram of this image. Write a function `equalize_histogram(pixels: List[int]) -> List[int]` that takes in the list of pixel va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert equalize_histogram([0, 255]) == [0, 255]\", \"assert equalize_histogram([50, 100, 150, 200]) == [0, 85, 170, 255]\", \"assert equalize_histogram([10, 20, 30, 40, 50, 60]) == [0, 51, 102, 153, 204, 255]\", \"assert equalize_histogram([]) == []\", \"assert equ...
{ "split": "train", "index": 4564, "acecode_id": "bigcode_python_fns_18720", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given sentence contains any offensive or vulgar words from a predefined list. The function should return True if any offensive words are found in the sentence, and False otherwise. The list of offensive words includes: ['stupid', 'jerk', 'm...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert offensive_word_identifier('This stupid jerk is a complete moron!') == True\", \"assert offensive_word_identifier('You are a smart person.') == False\", \"assert offensive_word_identifier('What a jerk you are!') == True\", \"assert offensive_word_identifier('...
{ "split": "train", "index": 4565, "acecode_id": "evol_17047", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that concatenates two lists of integers. The function should take three parameters: two lists `dest` and `src`, and an integer `stride`. If `stride` is greater than 1, the function should modify the `src` list by multiplying each elem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concat_lists([1, 2], [3, 4], 1) == [1, 2, 3, 4]\", \"assert concat_lists([1, 2], [3, 4], 2) == [1, 2, 6, 8]\", \"assert concat_lists([], [1, 2, 3], 3) == [3, 6, 9]\", \"assert concat_lists([5, 6], [], 0) == [5, 6]\", \"assert concat_lists([1, 2, 3], [4, 5], ...
{ "split": "train", "index": 4566, "acecode_id": "oss_22062", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that counts the number of prime numbers in a given list of integers. A prime number is defined as a natural number greater than 1 that has no positive divisors other than 1 and itself. Your function should be named `count_prime...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_primes([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 4\", \"assert count_primes([11, 12, 13, 14, 15, 16]) == 2\", \"assert count_primes([0, 1, 4, 6, 8, 9]) == 0\", \"assert count_primes([17, 19, 23, 29]) == 4\", \"assert count_primes([25, 27, 33, 35]) == 0\", \"...
{ "split": "train", "index": 4567, "acecode_id": "oss_17588", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the coefficients of a polynomial. Write a function `evaluate_polynomial(coefficients: List[int], x: int) -> int` that evaluates the polynomial at a given integer x. The polynomial is defined as: P(x) = a_n * x^n + a_(n-1) * x^(n-1) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_polynomial([3, 2, 1], 1) == 6\", \"assert evaluate_polynomial([0, 0, 0], 3) == 0\", \"assert evaluate_polynomial([1], 0) == 1\", \"assert evaluate_polynomial([1, 1, 1, 1], 1) == 4\", \"assert evaluate_polynomial([0], 10) == 0\", \"assert evaluate_po...
{ "split": "train", "index": 4568, "acecode_id": "bigcode_python_fns_45904", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the exponential of a given number. The exponential function is defined as e^x, where e is Euler's number (approximately 2.71828). Write a function `calculate_exponential(x: float) -> float` that takes a single floating...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(calculate_exponential(0) - 1.0) < 1e-9\", \"assert abs(calculate_exponential(1) - 2.718281828459045) < 1e-9\", \"assert abs(calculate_exponential(-1) - 0.36787944117144233) < 1e-9\", \"assert abs(calculate_exponential(2) - 7.3890560989306495) < 1e-9\", \...
{ "split": "train", "index": 4569, "acecode_id": "bigcode_python_fns_19146", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a family that can have a limited number of children. You need to implement a function `add_child_to_family(family, child_name)` that adds a child to the family. If the family already has 2 children, your function should raise a `ChildLimitError` e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_child_to_family([], 'Alice') == 'Child added successfully'\", \"assert add_child_to_family(['Alice'], 'Bob') == 'Child added successfully'\", \"assert add_child_to_family([], 'John') == 'Child added successfully'\", \"assert add_child_to_family(['John'],...
{ "split": "train", "index": 4570, "acecode_id": "oss_26027", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that counts the number of newline characters in a given text string efficiently. The function should read the string in chunks of a specified size and count the number of newline characters to determine the total number of line...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_lines_in_string('Hello\\\\nWorld\\\\n', 5) == 2\", \"assert count_lines_in_string('No newlines here', 5) == 0\", \"assert count_lines_in_string('\\\\n', 1) == 1\", \"assert count_lines_in_string('\\\\n\\\\n\\\\n', 1) == 3\", \"assert count_lines_in_str...
{ "split": "train", "index": 4571, "acecode_id": "oss_4130", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of words and a dictionary that maps each word to its corresponding embedding vector. Your task is to create a function `copy_embeddings` that takes in the following parameters: a list of `idx2word` representing the words in your vocabulary, a dictionary `em...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert copy_embeddings(['hello', 'world'], {'hello': 0, 'world': 1}, [[0.1, 0.2], [0.3, 0.4]]) == [[0.1, 0.2], [0.3, 0.4]]\", \"assert copy_embeddings(['hello', 'unknown'], {'hello': 0}, [[0.1, 0.2], [0.3, 0.4]]) == [[0.1, 0.2], [0.0, 0.0]]\", \"assert copy_embeddi...
{ "split": "train", "index": 4572, "acecode_id": "bigcode_python_fns_45966", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a dictionary representing font configurations and returns a modified dictionary with a new font added to the 'font.sans-serif' key. The input dictionary will contain various font configurations, and the output dictio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_font({'font.sans-serif': ['Linux Libertine'], 'font.serif': ['Times New Roman'], 'font.size': 12}) == {'font.sans-serif': ['Linux Libertine', 'Arial'], 'font.serif': ['Times New Roman'], 'font.size': 12}\", \"assert add_font({'font.sans-serif': ['Arial']...
{ "split": "train", "index": 4573, "acecode_id": "oss_30132", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple function that takes a list of integers as input and returns a new list containing only the unique integers from the original list, preserving the order of their first occurrence. Your function should remove any duplicate integers, ensur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 3]) == [1, 2, 3, 4]\", \"assert unique_integers([5, 5, 5, 5]) == [5]\", \"assert unique_integers([7, 8, 9, 7, 8]) == [7, 8, 9]\", \"assert unique_integers([]) == []\", \"assert unique_integers([10, -10, 10, 5]) == [10, -10, 5]...
{ "split": "train", "index": 4574, "acecode_id": "oss_12420", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `test_missing_key` that simulates loading objects into a database engine. The function takes an object as input and raises a `MissingKey` exception if the object is missing any required keys. Define the `MissingKey` exception and implemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert test_missing_key({'id': 1, 'name': 'test'}) == 'Object loaded successfully'\", \"assert test_missing_key({'id': None, 'name': 'test'}) == 'Object loaded successfully'\", \"assert test_missing_key({'id': 2, 'name': None}) == 'Object loaded successfully'\", \"...
{ "split": "train", "index": 4575, "acecode_id": "bigcode_python_fns_25890", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that generates a statistical dispersion table, which illustrates the count of occurrences of each unique integer in the array. The function should return a dictionary where the keys are the unique integers and the values are thei...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_dispersion_table([1, 2, 3, 1, 4, 5, 5, 2]) == {1: 2, 2: 2, 3: 1, 4: 1, 5: 2}\", \"assert generate_dispersion_table([1, 1, 1, 1]) == {1: 4}\", \"assert generate_dispersion_table([5, 5, 5, 5, 5]) == {5: 5}\", \"assert generate_dispersion_table([10, 20...
{ "split": "train", "index": 4576, "acecode_id": "evol_26876", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns a greeting message. Your function should take no parameters and return a string that contains the message 'Hello, World'. Implement the function `get_greeting()` that achieves this. The function should return the exact greeti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_greeting() == 'Hello, World'\", \"assert get_greeting() == 'Hello, World'\", \"assert get_greeting() == 'Hello, World'\", \"assert get_greeting() == 'Hello, World'\", \"assert get_greeting() == 'Hello, World'\", \"assert get_greeting() == 'Hello, World'\...
{ "split": "train", "index": 4577, "acecode_id": "oss_34124", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a float number as input and returns a tuple containing the integer component and the decimal part of the number. The function should also accept a boolean parameter that determines whether to round down (if True) or round up (if False) when extra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dissect_number(0.0) == (0, 0.0)\", \"assert dissect_number(1.5) == (1, 0.5)\", \"assert dissect_number(3.0) == (3, 0.0)\", \"assert dissect_number(5.5) == (5, 0.5)\", \"assert dissect_number(10.0) == (10, 0.0)\"]}" }
{ "split": "train", "index": 4578, "acecode_id": "evol_5083", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing column names for a dataset. Your task is to write a function `column_name_lengths` that takes this list of column names as input and returns a dictionary where the keys are the column names and the values are the lengths of each corr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert column_name_lengths(['col1', 'column2', 'a', 'test_column']) == {'col1': 4, 'column2': 7, 'a': 1, 'test_column': 11}\", \"assert column_name_lengths(['name', 'age', 'gender']) == {'name': 4, 'age': 3, 'gender': 6}\", \"assert column_name_lengths(['id', 'desc...
{ "split": "train", "index": 4579, "acecode_id": "oss_31748", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Create a function that calculates the sum of all the numbers in a list named 'mylist'. The function should check if 'mylist' contains only numerical types (integers or floats). If there are any non-numerical types in the list, the function should return an error message. The fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_list([1, 2, 3, 4, 5]) == 15\", \"assert sum_list([-1, -2, -3, -4, -5]) == -15\", \"assert sum_list([1.5, 2.5, 3.5]) == 7.5\", \"assert sum_list([1, 2, 3, 4.0, 5.0]) == 15.0\", \"assert sum_list([0, 0.0, -1, -1.0]) == -2.0\", \"assert sum_list([2, -2, 0])...
{ "split": "train", "index": 4580, "acecode_id": "evol_24980", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `cumulative_sum_even_numbers(start: int, end: int) -> int` that takes two integers, `start` and `end`, and returns the cumulative sum of all even integers in the inclusive range from `start` to `end`.\nPlease reason step by step, then write a self-contained...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cumulative_sum_even_numbers(1, 10) == 30\", \"assert cumulative_sum_even_numbers(1, 1) == 0\", \"assert cumulative_sum_even_numbers(4, 4) == 4\", \"assert cumulative_sum_even_numbers(0, 10) == 30\", \"assert cumulative_sum_even_numbers(-10, 10) == 0\", \"ass...
{ "split": "train", "index": 4581, "acecode_id": "evol_27337", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes an input which can either be a string representing a filename, a file object with a 'name' attribute, or None. The function should return the filename as a string. If the input is None, the function should raise a ValueError wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_filename('test.txt') == 'test.txt'\", \"assert get_filename(open('test.txt', 'r')) == 'test.txt'\", \"assert get_filename(123) == 'dummy.txt'\", \"assert get_filename(['file1.txt']) == 'dummy.txt'\", \"assert get_filename({'name': None}) == 'dummy.txt'\"...
{ "split": "train", "index": 4582, "acecode_id": "bigcode_python_fns_47510", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating a manifest file schema in a fictional application. The manifest file is represented as a dictionary in JSON format. Your goal is to implement a function `validate_manifest(manifest: dict) -> bool` that checks if the manifest meets the required sch...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_manifest({'name': 'TestApp', 'version': '1.0', 'dependencies': ['lib1', 'lib2']}) == True\", \"assert validate_manifest({'name': 'App', 'version': '2.0'}) == False\", \"assert validate_manifest({'name': 'App', 'version': 2, 'dependencies': ['lib1']}...
{ "split": "train", "index": 4583, "acecode_id": "bigcode_python_fns_21691", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that monitors and reports metrics for a web scraping application. Your function should take a dictionary of statistics and metrics as input, and print out the current timestamp along with the statistics/metrics stored in the dictionary. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert report_metrics({'requests_made': 100, 'errors': 5}) == None\", \"assert report_metrics({'success': 80, 'failures': 20}) == None\", \"assert report_metrics({'pages_scraped': 50, 'time_taken': 120}) == None\", \"assert report_metrics({'users': 10, 'sessions': ...
{ "split": "train", "index": 4584, "acecode_id": "oss_441", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `insert_element(arr, element, index)` that takes in an array `arr`, an `element`, and an `index`. The function should insert the `element` at the specified `index` in the array. If the `index` is negative, it should be treated as an offset from the end of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_element([1, 2, 3], 4, 1) == [1, 4, 2, 3]\", \"assert insert_element([1, 2, 3], 4, 0) == [4, 1, 2, 3]\", \"assert insert_element([1, 2, 3], 4, -1) == [1, 2, 4, 3]\", \"assert insert_element([1, 2, 3], 4, -2) == [1, 4, 2, 3]\", \"assert insert_element([...
{ "split": "train", "index": 4585, "acecode_id": "evol_2659", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that translates a list of characters from a source set to a destination set. The function should take two parameters: a list of characters `tr_src` that need to be translated and a dictionary `translation_map` where the keys are character...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate_characters(['a', 'b', 'c'], {'a': 'x', 'b': 'y'}) == ['x', 'y', 'c']\", \"assert translate_characters(['d', 'e', 'f'], {'d': '1', 'f': '3'}) == ['1', 'e', '3']\", \"assert translate_characters(['g', 'h', 'i'], {'h': '!', 'i': '@'}) == ['g', '!', '@...
{ "split": "train", "index": 4586, "acecode_id": "bigcode_python_fns_12264", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two sequences represented as lists of integers: `input_seq` and `target_seq`. Your task is to evaluate the probabilities of translating `input_seq` into `target_seq`. Each translation has a probability that is determined by the following rules: if the integer at t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_translation_probabilities([1, 2, 3], [1, 2, 3]) == [1.0, 1.0, 1.0]\", \"assert evaluate_translation_probabilities([1, 2, 3], [3, 2, 1]) == [0.0, 1.0, 0.0]\", \"assert evaluate_translation_probabilities([1, 0, 2], [1, 1, 2]) == [1.0, 0.0, 1.0]\", \"a...
{ "split": "train", "index": 4587, "acecode_id": "bigcode_python_fns_38440", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified event listener system. Create a function `event_listener` that simulates registering event handlers and triggering events. The function should maintain a dictionary where the keys are event names and the values are lists of handler ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert event_listener.register_event_handler('click', lambda data: data) is None\", \"assert event_listener.trigger_event('click', 1) is None\", \"assert event_listener.register_event_handler('hover', lambda data: data * 2) is None\", \"assert event_listener.trigge...
{ "split": "train", "index": 4588, "acecode_id": "oss_9641", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a tuple representing a ProtocolVersion, where the first element is the major version and the second element is the minor version, write a function `protocol_version_to_kmip_version(version: Tuple[int, int]) -> Union[str, None]` that converts this ProtocolVersion into its ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert protocol_version_to_kmip_version((1, 0)) == 'KMIP_1_0'\", \"assert protocol_version_to_kmip_version((1, 1)) == 'KMIP_1_1'\", \"assert protocol_version_to_kmip_version((1, 2)) == 'KMIP_1_2'\", \"assert protocol_version_to_kmip_version((1, 3)) == 'KMIP_1_3'\",...
{ "split": "train", "index": 4589, "acecode_id": "bigcode_python_fns_251", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `validate_and_archive_input(user_input: Any, archive: List[int]) -> bool` that takes a user input and a list to archive valid integers. The function should validate if the input is an integer. If it is, append it to the archive list and return True. If it i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_and_archive_input(5, []) == True\", \"assert validate_and_archive_input(-10, []) == True\", \"assert validate_and_archive_input(0, []) == True\", \"assert validate_and_archive_input(3.14, []) == False\", \"assert validate_and_archive_input('hello', ...
{ "split": "train", "index": 4590, "acecode_id": "evol_8436", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a folder path and a variable number of objects, write a function `filepath(folder: str, *args: Any, ext: str = 'pkl') -> str` that constructs a file path string. The function should take a string `folder`, a variable number of objects (which can either be instances of cla...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filepath('/data/results', 'Dataset1', 'ModelX') == '/data/results/Dataset1--ModelX.pkl'\", \"assert filepath('/data/results', 'TextureDataset', 'KNeighborsClassifier', ext='csv') == '/data/results/TextureDataset--KNeighborsClassifier.csv'\", \"assert filepat...
{ "split": "train", "index": 4591, "acecode_id": "bigcode_python_fns_22311", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a primitive represented as a dictionary containing information about its vertices, write a function `num_prim_vertices(prim: Dict[str, int]) -> int` that returns the number of vertices belonging to the primitive. The input dictionary will contain a key 'vertexcount' which...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert num_prim_vertices({'vertexcount': 5}) == 5\", \"assert num_prim_vertices({'vertexcount': 0}) == 0\", \"assert num_prim_vertices({'vertexcount': 10}) == 10\", \"assert num_prim_vertices({'vertexcount': 1}) == 1\", \"assert num_prim_vertices({'vertexcount': 10...
{ "split": "train", "index": 4592, "acecode_id": "bigcode_python_fns_45774", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `quick_sort(arr)` that takes a list of integers `arr` and returns a new list containing the elements of `arr` sorted in ascending order using the Quick Sort algorithm. The input list may contain duplicate values and can be of any length, including empty. Do...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quick_sort([24, 56, 1, 50, 17]) == [1, 17, 24, 50, 56]\", \"assert quick_sort([3, 6, 8, 10, 1, 2, 1]) == [1, 1, 2, 3, 6, 8, 10]\", \"assert quick_sort([5]) == [5]\", \"assert quick_sort([]) == []\", \"assert quick_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", ...
{ "split": "train", "index": 4593, "acecode_id": "evol_30242", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that finds the last index of a specific element in an array, which may contain duplicates. The function should take an array and an element as input and return the index of the last occurrence of the element in the array. If the element is not found, return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_last_instance([1, 2, 3, 4, 2, 1], 2) == 4\", \"assert find_last_instance(['apple', 'banana', 'cherry', 'banana'], 'banana') == 3\", \"assert find_last_instance([10.5, 20.5, 10.5, 30.0], 10.5) == 2\", \"assert find_last_instance([], 1) == 'Element not fo...
{ "split": "train", "index": 4594, "acecode_id": "evol_17779", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `extract_features(data: List[float]) -> List[float]` that takes a list of floating-point numbers as input and returns a new list containing the square of each number. The input list may contain negative numbers, and you should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_features([]) == []\", \"assert extract_features([1.0]) == [1.0]\", \"assert extract_features([-1.0]) == [1.0]\", \"assert extract_features([2.0, 3.0]) == [4.0, 9.0]\", \"assert extract_features([0.0]) == [0.0]\", \"assert extract_features([4.5, -3.5]...
{ "split": "train", "index": 4595, "acecode_id": "oss_25595", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `char_at_index(s: str, index: int) -> str` that takes a string `s` and an integer `index` as input. The function should return the character at the specified index in the string. If the index is out of bounds, the function should return an empty string. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert char_at_index('hello', 1) == 'e'\", \"assert char_at_index('hello', 4) == 'o'\", \"assert char_at_index('hello', 0) == 'h'\", \"assert char_at_index('hello', 5) == ''\", \"assert char_at_index('hello', -1) == 'o'\", \"assert char_at_index('hello', -5) == 'h'...
{ "split": "train", "index": 4596, "acecode_id": "evol_1400", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates and returns the details of a World of Warcraft (WoW) account. The function should take the following parameters: `user_id` (an integer), `wow_id` (an integer), `name` (a string), and `realm_id` (an integer). The function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_wow_account(1, 1001, 'Hero', 200) == {'user_id': 1, 'wow_id': 1001, 'name': 'Hero', 'realm_id': 200}\", \"assert validate_wow_account(2, 1002, 'Warrior', 201) == {'user_id': 2, 'wow_id': 1002, 'name': 'Warrior', 'realm_id': 201}\", \"assert validate...
{ "split": "train", "index": 4597, "acecode_id": "oss_24629", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a restaurant menu management system. The function should manage customer requests, log orders, and track staff presence. The function should take three parameters: a list of customer requests, a list of order logs repre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_restaurant_menu(['Burger', 'Fries'], [(1, 'Burger - 1'), (2, 'Fries - 2')], ['Alice', 'Bob']) == {'Requests': ['Burger', 'Fries'], 'log': {1: 'Burger - 1', 2: 'Fries - 2'}, 'presences': {'Alice', 'Bob'}}\", \"assert manage_restaurant_menu([], [], []) ...
{ "split": "train", "index": 4598, "acecode_id": "oss_7777", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the most recent blog posts from a list of blog posts. Each blog post is represented as a dictionary containing at least the keys 'title', 'content', and 'published_date'. Your function should be called `get_recent_posts` an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_recent_posts([], 5) == []\", \"assert get_recent_posts([{'title': 'Post 1', 'content': 'Content 1', 'published_date': '2023-10-10'}], 5) == [{'title': 'Post 1', 'content': 'Content 1', 'published_date': '2023-10-10'}]\", \"assert get_recent_posts([{'titl...
{ "split": "train", "index": 4599, "acecode_id": "oss_3307", "num_tests": 14 }