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": "Given a list of integers, implement a function that calculates the cumulative sum of its elements and returns a new list containing these cumulative sums. The cumulative sum at each index is the sum of all previous elements up to that index, inclusive. For example, for the inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cumulative_sum([1, 2, 3, 4, 5]) == [1, 3, 6, 10, 15]\", \"assert cumulative_sum([0, 0, 0]) == [0, 0, 0]\", \"assert cumulative_sum([-1, -2, -3]) == [-1, -3, -6]\", \"assert cumulative_sum([5]) == [5]\", \"assert cumulative_sum([]) == []\", \"assert cumulativ... | {
"split": "train",
"index": 84100,
"acecode_id": "evol_26273",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that validates if a given string is a non-empty string. The function should raise a ValueError if the string is either None, the string 'None', not of type str, or has a length of zero. Write a function `validate_string(value: str) -> None` that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_string('Hello') is None\", \"assert validate_string('World') is None\", \"assert validate_string('Python') is None\", \"assert validate_string('Test') is None\", \"assert validate_string('Valid String') is None\", \"assert validate_string('abcdef') ... | {
"split": "train",
"index": 84101,
"acecode_id": "bigcode_python_fns_39620",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a one-dimensional array of non-negative integers, implement a function that calculates the factorial of each element in the array. The function should efficiently handle arrays with up to 1000 elements and return a new array containing the factorials of the corresponding ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert array_factorial([0]) == [1]\", \"assert array_factorial([1]) == [1]\", \"assert array_factorial([2]) == [2]\", \"assert array_factorial([3]) == [6]\", \"assert array_factorial([4]) == [24]\", \"assert array_factorial([5]) == [120]\", \"assert array_factorial... | {
"split": "train",
"index": 84102,
"acecode_id": "evol_17012",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of image formats and a list of supported image extensions. Your task is to implement a function `validate_image_format` that checks if each image format in the list is supported or not. The function should return a list of boolean values, where each boolean... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_image_format(['jpeg', 'jpg', 'png']) == [True, True, True]\", \"assert validate_image_format(['gif', 'bmp', 'tiff']) == [False, False, False]\", \"assert validate_image_format(['jpeg', 'bmp', 'jpg', 'png']) == [True, False, True, True]\", \"assert v... | {
"split": "train",
"index": 84103,
"acecode_id": "bigcode_python_fns_8136",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with tracking and analyzing rewards obtained in a reinforcement learning environment. Implement a function `reward_statistics(rewards: List[int]) -> Tuple[int, float]` that takes a list of integer rewards and returns a tuple containing the total sum of rewards an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reward_statistics([1, 2, 3, 4, 5]) == (15, 3.0)\", \"assert reward_statistics([10, 20, 30]) == (60, 20.0)\", \"assert reward_statistics([-1, -2, -3]) == (-6, -2.0)\", \"assert reward_statistics([0]) == (0, 0.0)\", \"assert reward_statistics([]) == (0, 0.0)\"... | {
"split": "train",
"index": 84104,
"acecode_id": "oss_17022",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that checks if the array represents a min heap. If the array does not represent a min heap, modify the array in place to convert it into a valid min heap. The function should handle duplicate values and can also include negative numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_array_heap([3, 9, 2, 1, 4, 5]) == ([1, 3, 2, 9, 4, 5], 1)\", \"assert check_array_heap([10, 15, 20, 17]) == ([10, 15, 20, 17], 10)\", \"assert check_array_heap([1, 1, 1]) == ([1, 1, 1], 1)\", \"assert check_array_heap([5, 3, 8, 4, 7, 6]) == ([3, 4, 6, ... | {
"split": "train",
"index": 84105,
"acecode_id": "evol_17440",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, return a new list containing the first `n` strings from the input list. If the input list has fewer than `n` strings, return all strings in the list. Implement a function `get_first_n_strings(strings: List[str], n: int) -> List[str]` that takes a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_first_n_strings(['apple', 'banana', 'cherry', 'date'], 2) == ['apple', 'banana']\", \"assert get_first_n_strings(['apple', 'banana', 'cherry', 'date'], 4) == ['apple', 'banana', 'cherry', 'date']\", \"assert get_first_n_strings(['apple', 'banana', 'cherr... | {
"split": "train",
"index": 84106,
"acecode_id": "bigcode_python_fns_35920",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of repositories, each represented as a string. Your task is to implement a function that finds the target equivalent repository based on a given source repository and a specific identifier (pesid). If no exact match for the source repository is found, the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_repository_target_equivalent(['repo1', 'repo2', 'repo3', 'repo4', 'repo5', 'repo6'], 'repo4', 'pesid2') == None\", \"assert find_repository_target_equivalent(['repoX', 'repoY', 'repoZ'], 'repoY', 'pesid6') == None\", \"assert find_repository_target_equi... | {
"split": "train",
"index": 84107,
"acecode_id": "bigcode_python_fns_39090",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that retrieves the name of a class based on the given class period. The mapping of class periods to class names is predefined in a dictionary. Your function should take a string input representing the class period and return the co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_class_name('1st Period') == 'Mathematics'\", \"assert get_class_name('2nd Period') == 'Science'\", \"assert get_class_name('6th Period') == 'Class period not found'\", \"assert get_class_name('1st Period') == 'Mathematics'\", \"assert get_class_name('2nd... | {
"split": "train",
"index": 84108,
"acecode_id": "oss_34560",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks if a virtual environment is active and returns a message based on the status. If the virtual environment is active, the function should return the message 'Virtual environment is active.' If it is not active, the functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_virtual_env() == 'Not in a virtualenv. You probably don\\u2019t want to do this.'\", \"assert check_virtual_env() == 'Not in a virtualenv. You probably don\\u2019t want to do this.'\", \"assert check_virtual_env() == 'Not in a virtualenv. You probably ... | {
"split": "train",
"index": 84109,
"acecode_id": "oss_11947",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function `make_palindrome(string: str) -> str` that generates the minimally lengthy palindrome that starts with the input string. The function should disregard case and non-alphabetical symbols. The algorithm should follow these steps: 1. Identify th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_palindrome('') == ''\", \"assert make_palindrome('cat') == 'catac'\", \"assert make_palindrome('cata') == 'catac'\", \"assert make_palindrome('race') == 'racecar'\", \"assert make_palindrome('noon') == 'noon'\", \"assert make_palindrome('hello') == 'hel... | {
"split": "train",
"index": 84110,
"acecode_id": "evol_3441",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a dictionary containing metadata for a Python package. Write a Python function called `extract_package_info` that takes a dictionary `package_metadata` as input. The `package_metadata` dictionary contains the followi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_package_info({'author_email': 'author@example.com', 'url': 'https://github.com/example/package.git', 'download_url': 'https://github.com/example/package/archive/1.0.tar.gz', 'keywords': ['example', 'testing', 'library'], 'install_requires': ['numpy',... | {
"split": "train",
"index": 84111,
"acecode_id": "oss_22450",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines if the sum of the elements in a given list is within specified lower and upper bounds (inclusive). The function should return True if the sum is within the bounds and False otherwise. The function signature should be: def sum_within_bounds(l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_within_bounds([1, 2, 4, 10], 15, 25) == True\", \"assert sum_within_bounds([1, 5, 10], 5, 15) == False\", \"assert sum_within_bounds([], 0, 0) == True\", \"assert sum_within_bounds([10, 20, 30], 50, 70) == True\", \"assert sum_within_bounds([5, 5, 5], 10... | {
"split": "train",
"index": 84112,
"acecode_id": "evol_7952",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two lists of integers and returns a list of elements that are present in either of the two lists but not in both. The order of the elements in the output list should match their first appearance in the input lists. For example, given arr1 = [2, 9... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert identify_non_intersect([2, 9, 14, 6], [8, 10, 7, 9]) == [2, 14, 6, 8, 10, 7]\", \"assert identify_non_intersect([1, 2, 3], [3, 4, 5]) == [1, 2, 4, 5]\", \"assert identify_non_intersect([10, 20, 30], [30, 40, 50]) == [10, 20, 40, 50]\", \"assert identify_non_... | {
"split": "train",
"index": 84113,
"acecode_id": "evol_24005",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the survival durations in days for patients with brain metastases. Write a function that calculates the average survival duration from this list. If the list is empty, the function should return 0.0. Your function should have the fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_survival([10, 20, 30]) == 20.0\", \"assert calculate_average_survival([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average_survival([0, 0, 0]) == 0.0\", \"assert calculate_average_survival([5]) == 5.0\", \"assert calculate_average_survival... | {
"split": "train",
"index": 84114,
"acecode_id": "oss_20142",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequences of characters which reads the same backward as forward, ignoring spaces, punctuation, and capitalization. Your function should t... | 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('hello') == False\", \"assert is_palindrome('') == True\", \"assert is_palindrome('Able was I ere I saw Elba') == True\", \"assert ... | {
"split": "train",
"index": 84115,
"acecode_id": "oss_6680",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing candidate centerlines and a list of tuples representing agent coordinates on a map. Write a function `visualize_map_features` that takes in these two lists and returns a string that summarizes the visualization information. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert visualize_map_features([1, 2, 3], [(0, 0), (1, 1)]) == 'Num candidates = 3, Track Len = 2'\", \"assert visualize_map_features([], [(0, 0), (1, 1), (2, 2)]) == 'Num candidates = 0, Track Len = 3'\", \"assert visualize_map_features([5, 6, 7, 8], []) == 'Num ca... | {
"split": "train",
"index": 84116,
"acecode_id": "bigcode_python_fns_23506",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that simulates downloading a file from a given URL. The function should take two parameters: a string `url`, representing the file's URL, and a string `target`, representing the name of the file to save the content to. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_file_download('http://example.com/file.txt', 'file.txt') == 10\", \"assert simulate_file_download('http://another-example.com/image.png', 'image.png') == 10\", \"assert simulate_file_download('http://example.com/data.csv', 'data.csv') == 10\", \"ass... | {
"split": "train",
"index": 84117,
"acecode_id": "bigcode_python_fns_9048",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple HTTP request and response interaction. Your goal is to implement a function that takes a request object with specific attributes and returns a response object. The request object should contain the following attributes: a string `method`,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_request({'method': 'GET', 'scheme': 'https', 'authority': 'localhost', 'path': '/'} ) == {'status': '200 OK', 'body': 'Hello, World!'}\", \"assert handle_request({'method': 'POST', 'scheme': 'https', 'authority': 'localhost', 'path': '/'} ) == {'statu... | {
"split": "train",
"index": 84118,
"acecode_id": "oss_29935",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 1D array 'profile' representing some measurements, a 1D array 'frequency_range' indicating the range of frequencies, and a 'gain_factor' which represents the power gain to be applied. Your task is to implement a function `calculate_power_gain(profile, frequency_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_power_gain([1, 2, 3], [1, 2, 3], 1) == [1, 4, 9]\", \"assert calculate_power_gain([0, 0, 0], [1, 2, 3], 2) == [0, 0, 0]\", \"assert calculate_power_gain([1, 2, 3], [2, 2, 2], 2) == [4, 8, 12]\", \"assert calculate_power_gain([-1, -2, -3], [1, 2, 3]... | {
"split": "train",
"index": 84119,
"acecode_id": "oss_13277",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a list of integers using the quicksort algorithm. The function should take a list of integers as input and return a new list that contains the same integers sorted in ascending order.\nPlease reason step by step, then write a self-contained Pytho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quicksort([3, 2, 1]) == [1, 2, 3]\", \"assert quicksort([5, 1, 4, 2, 8]) == [1, 2, 4, 5, 8]\", \"assert quicksort([]) == []\", \"assert quicksort([1]) == [1]\", \"assert quicksort([2, 2, 2]) == [2, 2, 2]\", \"assert quicksort([4, 3, 2, 1, 0]) == [0, 1, 2, 3,... | {
"split": "train",
"index": 84120,
"acecode_id": "evol_23616",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a simple storage of Digital Object Identifiers (DOIs). Your function should be named `manage_doi` and it should take a list of operations to perform on the DOI storage. The operations can be one of the following: 'add', '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_doi(['add', '10.123/456']) == []\", \"assert manage_doi(['add', '10.123/456', 'get', '10.123/456']) == [True]\", \"assert manage_doi(['get', '10.123/789']) == [False]\", \"assert manage_doi(['add', '10.123/789', 'get', '10.123/789']) == [True]\", \"as... | {
"split": "train",
"index": 84121,
"acecode_id": "oss_22147",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given three integer values: `time`, `timestamp`, and `binary`. Your task is to implement a function `convert_values(time: int, timestamp: int, binary: int) -> Tuple[str, str, str]` that converts these integer values into their respective formats. The function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_values(92, 93, -2) == ('00:01:32', '1970-01-01 00:01:33', '10')\", \"assert convert_values(0, 0, 0) == ('00:00:00', '1970-01-01 00:00:00', '0')\", \"assert convert_values(3600, 1609459200, 10) == ('01:00:00', '2021-01-01 00:00:00', '1010')\", \"asser... | {
"split": "train",
"index": 84122,
"acecode_id": "oss_31754",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_vsphere_args(host: str, port: int, user: str, password: str, name: str, workdir: str) -> Dict[str, Union[str, int]]` that simulates the retrieval of command line arguments for connecting to a vSphere service. The function takes t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_vsphere_args('192.168.1.1', 443, 'admin', 'secret', 'MyVM', '/tmp') == {'host': '192.168.1.1', 'port': 443, 'user': 'admin', 'password': 'secret', 'name': 'MyVM', 'workdir': '/tmp'}\", \"assert get_vsphere_args('192.168.1.1', 80, 'admin', '', 'MyVM', '/t... | {
"split": "train",
"index": 84123,
"acecode_id": "bigcode_python_fns_45009",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of positive integers, implement a function `isSpecialSumSet` that determines whether the list is a special sum set. A special sum set is defined as a set of positive integers for which there exists a subset such that the sum of the elements in that subset is equal ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isSpecialSumSet([1, 2, 3, 4, 5, 7]) == True\", \"assert isSpecialSumSet([1, 2, 3, 4, 5]) == False\", \"assert isSpecialSumSet([3, 3, 3, 3]) == True\", \"assert isSpecialSumSet([1, 1, 1, 1, 1]) == False\", \"assert isSpecialSumSet([10, 15, 5, 20]) == True\", ... | {
"split": "train",
"index": 84124,
"acecode_id": "oss_8271",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple data storage function. Your function, named `data_storage`, should have the following functionalities: 1. It takes an initial stored value and a list of operations. Each operation is a tuple where the first element is a string ('increme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert data_storage(10, [('increment', 5), ('decrement', 3)]) == 12\", \"assert data_storage(0, [('increment', 10), ('decrement', 5)]) == 5\", \"assert data_storage(20, [('decrement', 10), ('increment', 5)]) == 15\", \"assert data_storage(5, [('increment', 0), ('de... | {
"split": "train",
"index": 84125,
"acecode_id": "oss_24038",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two time series representing the daily returns of a stock market index and the monthly risk-free returns of treasury bills. Your task is to calculate the excess market returns over the risk-free returns for a specified starting date. The inputs are the starting da... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert excess_market_returns('2023-01-01', [], [0.005]) == []\", \"assert excess_market_returns('2023-01-01', [0.01, 0.01, 0.01], [0.01, 0.01, 0.01]) == [0.0, 0.0, 0.0]\", \"assert excess_market_returns('2023-01-01', [0.02, 0.04], [0.01, 0.02]) == [0.01, 0.02]\", \... | {
"split": "train",
"index": 84126,
"acecode_id": "bigcode_python_fns_1436",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the number of capitalized vowel letters (A, E, I, O, U) located at even indices of a given string. The input string will have a length ranging from 1 to 1000 characters. The function should return the count of these capitalized vowels. Pleas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_upper('AEIOU') == 3\", \"assert count_upper('abcdefg') == 0\", \"assert count_upper('dBBE') == 0\", \"assert count_upper('UeIoaAe') == 2\", \"assert count_upper('AaBbCcDdEeFfGg') == 2\", \"assert count_upper('AEIOUaeiou') == 3\", \"assert count_upper('... | {
"split": "train",
"index": 84127,
"acecode_id": "evol_28918",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates receiving step count data from a client in a step counting system. The function should take a list of integers representing step counts and return a list of strings formatted as 'Received step count: X' for each count in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_steps([100, 200, 'exit', 300]) == ['Received step count: 100', 'Received step count: 200']\", \"assert process_steps([50, 75, 100]) == ['Received step count: 50', 'Received step count: 75', 'Received step count: 100']\", \"assert process_steps([]) ==... | {
"split": "train",
"index": 84128,
"acecode_id": "oss_5705",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a BMI (Body Mass Index) calculator. The BMI is a measure of body fat based on an individual's weight and height. The formula to calculate BMI is weight (in kilograms) divided by the square of height (in meters). Your task is to implement a function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_bmi(50, 1.70) == 'Your BMI is: 17.30\\\\nYou are underweight.'\", \"assert calculate_bmi(70, 1.75) == 'Your BMI is: 22.86\\\\nYour weight is normal.'\", \"assert calculate_bmi(85, 1.80) == 'Your BMI is: 26.23\\\\nYou are overweight.'\", \"assert ca... | {
"split": "train",
"index": 84129,
"acecode_id": "oss_34732",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if two given strings are anagrams of each other. An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. The function should ignore spaces and be case... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'pale') == False\", \"assert are_anagrams('Astronomer', 'Moon starer') == True\", \"assert are_anagrams('The Morse Code', 'Her... | {
"split": "train",
"index": 84130,
"acecode_id": "evol_32797",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a user information dictionary and returns a modified version of that dictionary with the 'user_id' and 'client_id' fields removed. The function should handle cases where these fields might not be present in the dictionary. Impl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_user_info({'user_id': '123', 'client_id': 'abc', 'name': 'John'}) == {'name': 'John'}\", \"assert remove_user_info({'name': 'Jane'}) == {'name': 'Jane'}\", \"assert remove_user_info({'user_id': '456'}) == {}\", \"assert remove_user_info({'client_id': ... | {
"split": "train",
"index": 84131,
"acecode_id": "bigcode_python_fns_38197",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of integers and returns a new list containing only the unique integers from the original list, maintaining the order of their first appearance. The function should ignore any duplicates and should not modi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 3, 2, 1, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([5, 5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([10, 20, 10, 30, 20, 40]) == [10, 20, 30, 40]\", \"assert unique_integers([1, -1, 0, 1, -1,... | {
"split": "train",
"index": 84132,
"acecode_id": "oss_7210",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D matrix where the elements are organized in a non-ascending or non-descending order both row-wise and column-wise. Your task is to find the smallest positive integer that does not exist in the matrix. The matrix may contain negative numbers, zeros, and repeate... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_missing_positive([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 10\", \"assert find_missing_positive([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == 1\", \"assert find_missing_positive([[1, 1, 1], [1, 1, 1], [1, 1, 1]]) == 2\", \"assert find_missing_positive([[1, 2, 3], [... | {
"split": "train",
"index": 84133,
"acecode_id": "evol_2940",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `id2line` where each key is a unique identifier (integer), and the value is a string representing a line of text. You are also given a list of conversations, where each conversation is a list of identifiers representing a sequence of dialogue. Your ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_questions_answers({1: 'Hello?', 2: 'Hi there!', 3: 'How are you?', 4: 'I am good, thanks!'}, [[1, 2], [3, 4]]) == (['Hello?', 'How are you?'], ['Hi there!', 'I am good, thanks!'])\", \"assert extract_questions_answers({1: 'What is your name?', 2: 'My... | {
"split": "train",
"index": 84134,
"acecode_id": "bigcode_python_fns_37007",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of pressure readings from a downstream sensor in a research facility. Each reading is represented as a float in Pascals. Your task is to write a function that calculates the average pressure from all the readings and identifies the maximum pressure recorded... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_pressure_statistics([150000.0, 155000.0]) == (152500.0, 155000.0)\", \"assert calculate_pressure_statistics([0.0, 0.0, 0.0]) == (0.0, 0.0)\", \"assert calculate_pressure_statistics([50000.0]) == (50000.0, 50000.0)\", \"assert calculate_pressure_sta... | {
"split": "train",
"index": 84135,
"acecode_id": "oss_20456",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing coefficients of a polynomial in decreasing order, write a function `leading_degree(coefficients: List[int]) -> int` that returns the degree of the polynomial. The degree of a polynomial is defined as the highest power of the variable that h... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert leading_degree([0, 0, 0]) == -1\", \"assert leading_degree([1, 0, 0]) == 2\", \"assert leading_degree([2, 3, 5, 0]) == 3\", \"assert leading_degree([0, 0, 0, 0, 0]) == -1\", \"assert leading_degree([4]) == 0\", \"assert leading_degree([-1, 0, 2]) == 2\", \"a... | {
"split": "train",
"index": 84136,
"acecode_id": "bigcode_python_fns_33348",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `encrypt_message(text: str, key: int) -> str` that encrypts the given message using the Caesar cipher method, where each letter in the text is shifted by the specified key. The function should maintain the case of the letters and leave non-alphabetic charac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encrypt_message('Hello world!', 3) == 'Khoor zruog!'\", \"assert encrypt_message('abc', 1) == 'bcd'\", \"assert encrypt_message('xyz', 2) == 'zab'\", \"assert encrypt_message('A B C', 1) == 'B C D'\", \"assert encrypt_message('Python 3.8', 5) == 'Udymts 3.8'... | {
"split": "train",
"index": 84137,
"acecode_id": "evol_8321",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that generates the first n numerical values of the Fibonacci sequence and returns them as a list. The function should take a single integer parameter n (1 <= n <= 100) and output a list containing the first n Fibonacci numbers.\nPlease reason step by ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1... | {
"split": "train",
"index": 84138,
"acecode_id": "evol_6082",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists where each inner list contains integers, write a function that concatenates these inner lists into a single list. The function should take two parameters: `arrays`, a list of lists of integers, and `axis`, an integer that indicates the position where the i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate([[1, 2], [3, 4]], axis=0) == [1, 2, 3, 4]\", \"assert concatenate([[1, 2]], axis=0) == [1, 2]\", \"assert concatenate([[], []], axis=0) == []\", \"assert concatenate([[1], [2], [3]], axis=0) == [1, 2, 3]\", \"assert concatenate([], axis=0) == []\... | {
"split": "train",
"index": 84139,
"acecode_id": "bigcode_python_fns_11102",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a load balancer ID as input and simulates the recovery of a distributor object based on predefined properties. The function should return a dictionary containing the properties of the distributor, such as 'dist-lb-id', 'dist-vi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recover_distributor('lb1') == {'dist-lb-id': 'lb1', 'dist-vip': '192.168.1.1', 'dist-size': 2, 'dist-status': 'ONLINE', 'dist-mac': '00:11:22:33:44:55', 'dist-hash-fields': 'field1,field2', 'dist-ofport': 80}\", \"assert recover_distributor('lb2') == {'dist-... | {
"split": "train",
"index": 84140,
"acecode_id": "bigcode_python_fns_2183",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the clearing of specific environment variables in a given dictionary. The function should remove all key-value pairs from the input dictionary where the keys start with either 'OMPI_' or 'PMI_'. After the removal, the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clear_mpi_env_vars({'OMPI_VAR1': 'value1', 'PMI_VAR1': 'value2', 'OTHER_VAR': 'value3'}) == {'OTHER_VAR': 'value3'}\", \"assert clear_mpi_env_vars({'VAR1': 'value1', 'VAR2': 'value2'}) == {'VAR1': 'value1', 'VAR2': 'value2'}\", \"assert clear_mpi_env_vars({'... | {
"split": "train",
"index": 84141,
"acecode_id": "bigcode_python_fns_43766",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers `nums`, write a function `sum_even_numbers(nums)` that returns the sum of all even numbers in the list. If there are no even numbers, return 0. The input list will have at most 100 integers and each integer will be within the range of -10^4 to 10^4.\nPl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_even_numbers([10, 15, 20, 25]) == 30\", \"assert sum_even_numbers([-2, -4, -6, 1, 3]) == -12\", \"assert sum_even_numbers([0, 1, 2, 3]) == 2\", \"assert sum_even_numbers([7, 9, 11]) == 0\", \"assert sum_... | {
"split": "train",
"index": 84142,
"acecode_id": "bigcode_python_fns_15076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are working on a game development project that involves mapping game coordinates to a grid. The game coordinates are 0-based, and you need to implement a function to adjust the sector coordinates based on the given rules. You are given the original sector coordinates and th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjustCoordinates(2, 3, 5) == (2, 1)\", \"assert adjustCoordinates(0, 0, 10) == (0, 9)\", \"assert adjustCoordinates(1, 1, 7) == (1, 5)\", \"assert adjustCoordinates(4, 4, 6) == (4, 1)\", \"assert adjustCoordinates(3, 2, 8) == (3, 5)\", \"assert adjustCoordi... | {
"split": "train",
"index": 84143,
"acecode_id": "oss_35266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a 3D representation of a grid system. The grid is divided into cells, and each cell can contain a specific number of boxes. Write a function that takes the dimensions of the grid (cell_size) and the number of boxes per cell (boxes_per_cell) as input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_tensor(1, 1) == [[[0]]]\", \"assert calculate_tensor(2, 1) == [[[0], [0]], [[0], [0]]]\", \"assert calculate_tensor(2, 2) == [[[0, 0], [0, 0]], [[0, 0], [0, 0]]]\", \"assert calculate_tensor(3, 1) == [[[0], [0], [0]], [[0], [0], [0]], [[0], [0], [0... | {
"split": "train",
"index": 84144,
"acecode_id": "oss_21828",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string as input and returns a new string that is the reverse of the input string. Your function should handle both uppercase and lowercase letters, and it should maintain the original casing of the letters in the reversed str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('Hello') == 'olleH'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('') == ''\", \"assert reverse_string('A man a plan a canal Panama') == 'amanaP lanac a nalp a nam A'... | {
"split": "train",
"index": 84145,
"acecode_id": "oss_485",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a sequence of numerical values representing a time series data, a sampling frequency, a function that computes a metric on a window of data, a window length, and a window stride. Your task is to implement a function `compute_windowed_metrics` that applies the give... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_windowed_metrics([1, 2, 3, 4, 5], 1.0, lambda x, fs: sum(x)/len(x), 2.0, 1.0) == [1.5, 2.5, 3.5, 4.5]\", \"assert compute_windowed_metrics([1], 1.0, lambda x, fs: sum(x)/len(x), 1.0, 1.0) == [1.0]\", \"assert compute_windowed_metrics([5, 10, 15, 20, ... | {
"split": "train",
"index": 84146,
"acecode_id": "bigcode_python_fns_37169",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a string `S` and a character `C`. Your task is to write a function `shortestToChar(S, C)` that returns a list of integers representing the shortest distance from each character in the string `S` to the character `C`. For each character `S[i]` in the string `S`, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortestToChar('loveleetcode', 'e') == [3, 2, 1, 0, 1, 0, 0, 1, 2, 2, 1, 0]\", \"assert shortestToChar('abcd', 'a') == [0, 1, 2, 3]\", \"assert shortestToChar('aaa', 'a') == [0, 0, 0]\", \"assert shortestToChar('abcdefg', 'd') == [3, 2, 1, 0, 1, 2, 3]\", \"a... | {
"split": "train",
"index": 84147,
"acecode_id": "oss_21481",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list or tuple of numbers, implement a function `sum_of_elements` that returns the sum of all the elements. The input can be a list or a tuple, and it is guaranteed that the input will contain only numeric values (integers or floats). If an empty list or tuple is provide... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_elements([1, 2, 3]) == 6\", \"assert sum_of_elements((1, 2, 3.5)) == 6.5\", \"assert sum_of_elements([]) == 0\", \"assert sum_of_elements([0, 0, 0]) == 0\", \"assert sum_of_elements((5, 5, 5)) == 15\", \"assert sum_of_elements((3.1, 2.2, 5.7)) == 11.0... | {
"split": "train",
"index": 84148,
"acecode_id": "bigcode_python_fns_31104",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that generates the Fibonacci sequence up to the nth ordinal number position. The function should take an integer n (n >= 0) as input and return a list containing the Fibonacci sequence starting from 0 to the nth number. If n is 0, return an empty list.\nPlease ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\",... | {
"split": "train",
"index": 84149,
"acecode_id": "evol_26177",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of chat messages between two users. Each chat message is represented as a dictionary with the following keys: 'sender', 'receiver', and 'date_posted'. Your task is to implement a function that returns a list of chat messages between two specified users, sor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_chats_between_users([{'sender': 'Alice', 'receiver': 'Bob', 'date_posted': '2023-10-01'}, {'sender': 'Bob', 'receiver': 'Alice', 'date_posted': '2023-10-02'}], 'Alice', 'Bob') == [{'sender': 'Bob', 'receiver': 'Alice', 'date_posted': '2023-10-02'}, {'sen... | {
"split": "train",
"index": 84150,
"acecode_id": "bigcode_python_fns_42849",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing GPS data provided as a string in the format 'latitude,longitude'. Your task is to implement a function called 'process_gps_data' that takes this GPS data as input and returns a formatted string containing the latitude and longitude information. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_gps_data('34.052235,-118.243683') == 'Latitude: 34.052235, Longitude: -118.243683'\", \"assert process_gps_data('40.712776,-74.005974') == 'Latitude: 40.712776, Longitude: -74.005974'\", \"assert process_gps_data('-22.906847,-43.172896') == 'Latitude... | {
"split": "train",
"index": 84151,
"acecode_id": "oss_1964",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the average miss rate for a set of input data based on provided false positive rates and corresponding miss rates. The function should take in two lists: one for false positive rates and one for miss rates. Your tas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_miss_rate([0.0, 0.5, 1.0], [0.0, 0.5, 1.0]) == 0.5\", \"assert average_miss_rate([0.1], [0.1]) == 0.1\", \"assert average_miss_rate([0.25, 0.75], [0.1, 0.4]) == 0.25\", \"assert average_miss_rate([0.2, 0.3, 0.4, 0.5], [0.1, 0.2, 0.3, 0.4]) == 0.25\",... | {
"split": "train",
"index": 84152,
"acecode_id": "oss_34921",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a string representing an ISBN-13, write a function that converts it to an ISBN-10 format. The input ISBN-13 string may contain dashes and leading/trailing whitespace, which should be stripped before processing. The function should return the ISBN-10 string if the ISBN-13 ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isbn13_to_isbn10('978-0-940016-73-6') == '0940016737'\", \"assert isbn13_to_isbn10('9780940016736') == '0940016737'\", \"assert isbn13_to_isbn10('979-1-234-56789-6') == None\", \"assert isbn13_to_isbn10('978-1-56619-909-4') == '1566199093'\", \"assert isbn13... | {
"split": "train",
"index": 84153,
"acecode_id": "bigcode_python_fns_41650",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given user account ID exists in a predefined list of account IDs. If the account ID exists, the function should return 'User exists'; otherwise, it should return 'User does not exist'. Write a function `check_user_exists(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_user_exists(101) == 'User exists'\", \"assert check_user_exists(202) == 'User exists'\", \"assert check_user_exists(303) == 'User exists'\", \"assert check_user_exists(404) == 'User exists'\", \"assert check_user_exists(505) == 'User exists'\", \"asser... | {
"split": "train",
"index": 84154,
"acecode_id": "bigcode_python_fns_18504",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a sequence of transformations, each consisting of a linear transformation followed by a non-linear transformation, you need to create a function that builds a composite transformation. The function should accept the number of flow steps, the dimensionality of the paramete... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_transform(1, 2, 3, {'param1': 1, 'param2': 2}) is not None\", \"assert create_transform(2, 2, 3, {'param1': 5}) is not None\", \"assert create_transform(3, 4, 2, {'type': 'NSF'}) is not None\", \"assert create_transform(0, 2, 3, {}) is not None\", \"a... | {
"split": "train",
"index": 84155,
"acecode_id": "bigcode_python_fns_32904",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings and a list of file names, you need to extract unique URLs and email addresses from the strings. Each string may contain multiple URLs and email addresses. Your task is to implement a function that returns a dictionary containing the unique URLs, the emai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_urls_and_emails(['Visit us at http://example.com or contact us at info@example.com', 'No URLs here'], ['file1.txt', 'file2.txt']) == {'unique_urls': ['http://example.com'], 'emails': ['info@example.com'], 'url_count': 1, 'email_count': 1}\", \"assert... | {
"split": "train",
"index": 84156,
"acecode_id": "bigcode_python_fns_45681",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_of_squares(numbers)` that returns the sum of the squares of all the even numbers in the list. If there are no even numbers, return 0. The input list will contain integers ranging from -1000 to 1000. \n\nFunction Signature: `def su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares([1, 2, 3, 4]) == 20\", \"assert sum_of_squares([0, -2, -4, -6]) == 56\", \"assert sum_of_squares([1, 3, 5, 7]) == 0\", \"assert sum_of_squares([-1, -2, -3, -4]) == 20\", \"assert sum_of_squares([2, 4, 6, 8]) == 120\", \"assert sum_of_squares([... | {
"split": "train",
"index": 84157,
"acecode_id": "bigcode_python_fns_20824",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that returns the length of the longest consecutive elements sequence. The sequence should consist of numbers that are consecutive integers. For example, in the array [1, 9, 3, 10, 4, 20, 2], the longest consecutive sequence is [1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findLongestConseqSubseq([1, 9, 3, 10, 4, 20, 2]) == 4\", \"assert findLongestConseqSubseq([100, 4, 200, 1, 3, 2]) == 4\", \"assert findLongestConseqSubseq([0, 0, 1, 1, 2, 2, 3, 3]) == 4\", \"assert findLongestConseqSubseq([]) == 0\", \"assert findLongestCons... | {
"split": "train",
"index": 84158,
"acecode_id": "evol_4616",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of integers, where each sub-list represents a row in a grid. Your task is to implement a function `calculate_average_and_std(grid)` that takes this grid as input and returns a tuple containing the average and standard deviation of all the integers in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_and_std([[1, 2, 3], [4, 5]]) == (3.0, 1.4142135623730951)\", \"assert calculate_average_and_std([[1]]) == (1.0, 0.0)\", \"assert calculate_average_and_std([[]]) == (0.0, 0.0)\", \"assert calculate_average_and_std([[0, 0], [0, 0]]) == (0.0, ... | {
"split": "train",
"index": 84159,
"acecode_id": "oss_10617",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `max_sum_subarray(arr: List[int]) -> int` that returns the maximum sum of any contiguous subarray within the list. A subarray is defined as a contiguous part of the array. If the input list is empty, return 0.\nPlease reason step by st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_sum_subarray([-2, -3, -1]) == -1\", \"assert max_sum_subarray([5, 4, -1, 7, 8]) == 23\", \"assert max_sum_subarray([]) == 0\", \"assert max_sum_subarray([-1, -2, -3, -4]) == -1\", \"assert max_sum_subarray([2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert... | {
"split": "train",
"index": 84160,
"acecode_id": "bigcode_python_fns_11618",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer representing the current epoch in a training process, implement a function `get_learning_rate(epoch: int) -> float` that returns the corresponding learning rate value based on the following rules: If the epoch is less than 100, return 0.001 (1e-3). If the epoch... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_learning_rate(0) == 0.001\", \"assert get_learning_rate(50) == 0.001\", \"assert get_learning_rate(99) == 0.001\", \"assert get_learning_rate(100) == 0.0001\", \"assert get_learning_rate(110) == 0.0001\", \"assert get_learning_rate(124) == 0.0001\", \"as... | {
"split": "train",
"index": 84161,
"acecode_id": "bigcode_python_fns_15645",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings representing verses, write a function `count_words(verse1: str, verse2: str) -> dict` that returns a dictionary where the keys are the distinct words from both verses (case insensitive), and the values are lists containing the counts of the word in the first v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_words('Hello World', 'Hello Python') == {'hello': [1, 1], 'world': [1, 0], 'python': [0, 1]}\", \"assert count_words('A B C', 'a b c') == {'a': [1, 1], 'b': [1, 1], 'c': [1, 1]}\", \"assert count_words('One fish two fish', 'red fish blue fish') == {'on... | {
"split": "train",
"index": 84162,
"acecode_id": "evol_3582",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given two matrices A and B, both of dimensions m x n, write a function `compare_matrices(A: List[List[int]], B: List[List[int]]) -> bool` that checks if the two matrices are equal. Two matrices are considered equal if they have the same dimensions and all corresponding elements... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_matrices([[1, 2], [3, 4]], [[1, 2], [3, 4]]) == True\", \"assert compare_matrices([[1, 2], [3, 4]], [[1, 2], [3, 5]]) == False\", \"assert compare_matrices([[1, 2], [3, 4]], [[1, 2, 3], [3, 4]]) == False\", \"assert compare_matrices([[1]], [[1]]) == ... | {
"split": "train",
"index": 84163,
"acecode_id": "bigcode_python_fns_4271",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the configuration of a Cisco IOS Layer 3 interface. The function should return a dictionary representation of the interface configuration based on the following parameters: the interface name (a string), a description (a st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cisco_ios_l3_acl_parsed('FastEthernet0/0.300', 'Test logical subinterface 3', '300', 'dot1Q', '10.3.3.13', '255.255.255.128', 'Common_Client_IN', 'TEST_ACL_03') == {'name': 'FastEthernet0/0.300', 'description': 'Test logical subinterface 3', 'vlans': [{'id':... | {
"split": "train",
"index": 84164,
"acecode_id": "bigcode_python_fns_19826",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking system. Write a function `bank_operations(operations: List[Tuple[str, Union[str, int]]]) -> Dict[str, Union[str, Dict[str, int]]]` that takes a list of operations on bank accounts and returns the final state of the accounts. Each ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_operations([('create', '12345', 1000), ('create', '67890', 500)]) == {}\", \"assert bank_operations([('create', '12345', 1000), ('deposit', '12345', 500), ('check_balance', '12345')]) == {'12345': 1500}\", \"assert bank_operations([('create', '12345', 1... | {
"split": "train",
"index": 84165,
"acecode_id": "oss_29053",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a directed or undirected graph represented by a list of edges and their corresponding weights. Your task is to compute scores for each edge based on the given condition. The condition can be 'out', 'in', 'both', or 'or'. The edge scores are calculated using the fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert edge_scores(3, [(0, 1), (1, 2)], [1.0, 2.0], 'out') == [1.0, 2.0]\", \"assert edge_scores(3, [(0, 1), (1, 2)], [1.0, 2.0], 'both') == [1.0, 2.0]\", \"assert edge_scores(4, [(0, 1), (1, 2), (2, 3)], [1.5, 2.5, 3.5], 'out') == [1.5, 2.5, 3.5]\", \"assert edge_... | {
"split": "train",
"index": 84166,
"acecode_id": "bigcode_python_fns_5334",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a semantic graph represented as an adjacency matrix. Your goal is to implement a function `get_concept_embedding(adjacency_matrix: List[List[int]], concept_index: int) -> List[int]` that returns the weighted adjacency embedding of a concept from th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_concept_embedding([[0, 1], [1, 0]], 0) == [0, 1]\", \"assert get_concept_embedding([[0, 2, 0], [2, 0, 1], [0, 1, 0]], 1) == [2, 0, 1]\", \"assert get_concept_embedding([[1]], 0) == [1]\", \"assert get_concept_embedding([[0, 0], [0, 0]], 0) == [0, 0]\", \... | {
"split": "train",
"index": 84167,
"acecode_id": "oss_7997",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two distinct strings 'string1' and 'string2', and a string 'context', write a function to replace every occurrence of 'string1' in 'context' with 'string2'. Your function should return the modified 'context' string after all replacements have been made. Note that 'string1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_sequence('Hello world', 'world', 'Python') == 'Hello Python'\", \"assert replace_sequence('abc abc abc', 'abc', 'xyz') == 'xyz xyz xyz'\", \"assert replace_sequence('To be or not to be', 'be', 'see') == 'To see or not to see'\", \"assert replace_sequ... | {
"split": "train",
"index": 84168,
"acecode_id": "evol_21942",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a stack system that supports multiple stacks. Implement a class called `DinnerPlates` that supports the following operations: 1. `push(val: int) -> None`: Pushes a value onto the rightmost stack. If the rightmost stack reaches its capacity, a new stack is created. 2. `po... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert DinnerPlates(2).push(1) is None\", \"assert DinnerPlates(2).push(2) is None\", \"assert DinnerPlates(2).push(3) is None\", \"assert DinnerPlates(2).pop() == -1\", \"assert DinnerPlates(2).push(4) is None\", \"assert DinnerPlates(2).push(5) is None\", \"asser... | {
"split": "train",
"index": 84169,
"acecode_id": "evol_30666",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple banking transaction system. The function should take an account holder's name and a list of transactions. Each transaction is a tuple consisting of a transaction type ('deposit' or 'withdraw') and an amount. Yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_final_balance('Alice', [('deposit', 1000), ('withdraw', 500)]) == 500\", \"assert calculate_final_balance('Bob', [('deposit', 200), ('withdraw', 300)]) == 200\", \"assert calculate_final_balance('Charlie', [('withdraw', 100), ('deposit', 50)]) == 5... | {
"split": "train",
"index": 84170,
"acecode_id": "oss_5870",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of user activity events from a music streaming application, where each event is represented as a dictionary containing the keys 'userId', 'songName', 'artistName', and 'listeningTime', write a function called `categorize_user_preferences(events: List[Dict[str, Unio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_user_preferences([]) == {}\", \"assert categorize_user_preferences([{'userId': 'user1', 'songName': 'Song A', 'artistName': 'Artist A', 'listeningTime': 3.0}]) == {'user1': ['Song A']}\", \"assert categorize_user_preferences([{'userId': 'user1', '... | {
"split": "train",
"index": 84171,
"acecode_id": "evol_21510",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a string that may represent a path-like structure with environment variable placeholders. The placeholders are formatted as '${VAR_NAME}', where VAR_NAME is the name of the environment variable. Your task is to implement a function that replaces all occurrences of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_env_variables('Hello, ${USER}!', {'USER': 'Alice'}) == 'Hello, Alice!'\", \"assert replace_env_variables('/home/${USER}/projects', {'USER': 'Bob'}) == '/home/Bob/projects'\", \"assert replace_env_variables('Path: ${CONFIG}/settings', {'CONFIG': '/etc... | {
"split": "train",
"index": 84172,
"acecode_id": "bigcode_python_fns_43566",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a neighbor object by its unique identifier. The function should take an integer `obj_id` as input and return a string representation of the neighbor object if it exists. If the neighbor object does not exist, the function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_neighbor_by_id(1) == 'Neighbor 1'\", \"assert get_neighbor_by_id(2) == 'Neighbor 2'\", \"assert get_neighbor_by_id(11) == 'Neighbor does not exist'\", \"assert get_neighbor_by_id(12) == 'Neighbor does not exist'\", \"assert get_neighbor_by_id(13) == 'Nei... | {
"split": "train",
"index": 84173,
"acecode_id": "bigcode_python_fns_17791",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of a game. Your task is to write a function that takes this list as input and returns the average score rounded to the nearest integer. If there are no scores in the list, the function should return 0. Write a function `c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_score([85, 92, 78, 90, 89]) == 87\", \"assert calculate_average_score([100, 90, 80]) == 90\", \"assert calculate_average_score([70]) == 70\", \"assert calculate_average_score([]) == 0\", \"assert calculate_average_score([50, 50, 50]) == 50\... | {
"split": "train",
"index": 84174,
"acecode_id": "oss_24066",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a series of buildings. Your task is to implement a function that calculates the amount of rainwater that can be trapped between these buildings after it rains. The function should take a list of integers as input and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert trap_water([0,1,0,2,1,0,1,3,2,1,2,1]) == 6\", \"assert trap_water([4,2,0,3,2,5]) == 9\", \"assert trap_water([1,0,2]) == 1\", \"assert trap_water([1,1,1,1]) == 0\", \"assert trap_water([2,0,2]) == 2\", \"assert trap_water([0,2,0]) == 0\", \"assert trap_water... | {
"split": "train",
"index": 84175,
"acecode_id": "oss_1221",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple dice game. Create a function `dice_game(dice_rolls: List[int], combination: List[int]) -> Tuple[int, bool]` that takes in a list of integers representing the results of rolling 5 six-sided dice and a list of integers representing a specif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dice_game([1, 2, 3, 4, 5], [1, 2, 3, 4, 5]) == (15, True)\", \"assert dice_game([6, 6, 6, 6, 6], [6, 6, 6, 6, 6]) == (30, True)\", \"assert dice_game([1, 1, 1, 1, 1], [1, 1, 1, 1, 1]) == (5, True)\", \"assert dice_game([2, 3, 4, 5, 6], [3, 4, 5, 2, 6]) == (2... | {
"split": "train",
"index": 84176,
"acecode_id": "oss_27333",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a tree represented as a list of lists, where each element is a node and its children are represented in sublists, implement a function that evaluates the tree recursively. The function should take two parameters: the tree structure `g`, and an integer `K`. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_tree([], 5) == 0\", \"assert evaluate_tree([[1]], 5) == 1\", \"assert evaluate_tree([[5], [6, [7]]], 5) == 5\", \"assert evaluate_tree([[0]], 5) == 0\", \"assert evaluate_tree([[4], [3, [2]], [1]], 5) == 4\"]}"
} | {
"split": "train",
"index": 84177,
"acecode_id": "bigcode_python_fns_38686",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a shopping cart based on a user's IP address. Your function should take an IP address as input and return a list of items in the cart for that IP address. If no items are found for the given IP address, the function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_cart_items('192.168.0.2') == []\", \"assert get_cart_items('255.255.255.255') == []\", \"assert get_cart_items('127.0.0.1') == []\", \"assert get_cart_items('192.168.1.2') == []\", \"assert get_cart_items('10.0.0.2') == []\", \"assert get_cart_items('192... | {
"split": "train",
"index": 84178,
"acecode_id": "oss_20315",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that calculates the product of all the numbers in a given list. The function should take a list of integers as input and return an integer representing the product of the numbers. If the list is empty, return 1.\nPlease reason step by step, then write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product([1, 2, 3, 4, 5]) == 120\", \"assert product([0, 1, 2, 3]) == 0\", \"assert product([-1, -2, -3]) == -6\", \"assert product([1, 2, -3]) == -6\", \"assert product([]) == 1\", \"assert product([5, 5, 5]) == 125\", \"assert product([10, 0, 2]) == 0\", \"... | {
"split": "train",
"index": 84179,
"acecode_id": "evol_22609",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a procedure declaration in a programming language, implement a function `parse_procedure` that checks whether the declaration is correctly formatted. The procedure declaration follows these rules: it starts with an identifier (ID), followed by an ope... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_procedure('myProc()') == True\", \"assert parse_procedure('1myProc(a)') == False\", \"assert parse_procedure('myProc(a,)') == False\", \"assert parse_procedure('myProc(a,,b)') == False\", \"assert parse_procedure('valid_Proc_name()') == True\", \"asser... | {
"split": "train",
"index": 84180,
"acecode_id": "bigcode_python_fns_10135",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a given octal permission string to a human-readable format. The octal permission string is a three-digit number where each digit corresponds to the permissions for the owner, group, and others respectively. Each digit can be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_permissions('777') == {'owner': 'read, write and execute', 'group': 'read, write and execute', 'others': 'read, write and execute'}\", \"assert convert_permissions('640') == {'owner': 'read and write', 'group': 'read', 'others': 'no permission'}\", \... | {
"split": "train",
"index": 84181,
"acecode_id": "bigcode_python_fns_44108",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers called `numbers_left`. Your task is to implement a function that compares the first and the last elements of the list. If the first element is greater than the last element, return a tuple containing the index of the first element (which is alwa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert choose_first_or_last([3, 2, 1]) == (0, 3)\", \"assert choose_first_or_last([1, 2, 3]) == (-1, 3)\", \"assert choose_first_or_last([5]) == (0, 5)\", \"assert choose_first_or_last([7, 5, 2]) == (0, 7)\", \"assert choose_first_or_last([4, 4, 4, 4]) == (0, 4)\",... | {
"split": "train",
"index": 84182,
"acecode_id": "bigcode_python_fns_20636",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the factorial of a given non-negative integer n. The factorial of n (denoted as n!) is the product of all positive integers less than or equal to n. For example, the factorial of 5 is 5 * 4 * 3 * 2 * 1 = 120. Your function should return 1 if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 84183,
"acecode_id": "evol_29761",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates the first n numbers of the Fibonacci series. The Fibonacci series is a sequence where each number is the sum of the two preceding ones, starting from 0 and 1. Your function should take an integer n as input and return a list containing the fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\",... | {
"split": "train",
"index": 84184,
"acecode_id": "evol_1190",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string of text and a list of words, write a function `count_word_occurrences(text: str, words_to_count: List[str]) -> Dict[str, int]` that counts the occurrences of each word in the provided text. The function should ignore case sensitivity and should disregard any punc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_word_occurrences('Hello, world! Hello everyone.', ['hello', 'world']) == {'hello': 2, 'world': 1}\", \"assert count_word_occurrences('The quick brown fox jumps over the lazy dog.', ['the', 'fox', 'cat']) == {'the': 2, 'fox': 1, 'cat': 0}\", \"assert co... | {
"split": "train",
"index": 84185,
"acecode_id": "oss_4784",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that processes a list of icon resources and extracts specific information from each entry. Each entry in the list is represented as a tuple containing two elements: a numerical identifier and a string representing the icon file name. Write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_icon_resources([(0, 'cal.ico'), (1, 'folder.ico'), (2, 'settings.ico')]) == {0: 'cal.ico', 1: 'folder.ico', 2: 'settings.ico'}\", \"assert process_icon_resources([(3, 'icon1.png'), (4, 'icon2.png')]) == {3: 'icon1.png', 4: 'icon2.png'}\", \"assert pr... | {
"split": "train",
"index": 84186,
"acecode_id": "oss_847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a Python dictionary representing a configuration object that may contain references to other parts of the configuration. References are represented using a special syntax: `{{reference}}`, where `reference` is a string pointing to another part of the configuration... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dereference_config({'name': 'Alice', 'age': 25, 'location': '{{city}}', 'city': 'Wonderland'}) == {'name': 'Alice', 'age': 25, 'location': 'Wonderland', 'city': 'Wonderland'}\", \"assert dereference_config({'host': '{{server}}', 'server': 'localhost'}) == {'... | {
"split": "train",
"index": 84187,
"acecode_id": "oss_23915",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a log file size tracker that monitors the size of multiple log files. Create a function `track_log_file(file_sizes: List[Tuple[str, int]], file_to_track: str) -> Union[int, str]` that takes in a list of tuples where each tuple contains a file pa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert track_log_file([('file1.log', 100), ('file2.log', 200)], 'file1.log') == 100\", \"assert track_log_file([('file1.log', 100), ('file2.log', 200)], 'file2.log') == 200\", \"assert track_log_file([('file1.log', -50), ('file2.log', 200)], 'file1.log') == 'Invali... | {
"split": "train",
"index": 84188,
"acecode_id": "oss_23571",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function called `sum_of_factorials` that takes no arguments and returns the sum of factorials of numbers from 1 to 20. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. For example, 5! = 5 × 4 × 3 × 2 × 1 =... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_factorials() == 2561327494111820313\", \"assert sum_of_factorials() == 2561327494111820313\", \"assert sum_of_factorials() == 2561327494111820313\", \"assert sum_of_factorials() == 2561327494111820313\", \"assert sum_of_factorials() == 256132749411182... | {
"split": "train",
"index": 84189,
"acecode_id": "oss_3535",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a basic server listening for incoming connections. The function, `start_server`, should accept a server address (represented as a string) and a port number (an integer). The function should return a string indicating th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert start_server('localhost', 8080) == '[SERVER_LISTENING] Server up and running on localhost:8080 waiting for connections.'\", \"assert start_server('192.168.1.1', 3000) == '[SERVER_LISTENING] Server up and running on 192.168.1.1:3000 waiting for connections.'\... | {
"split": "train",
"index": 84190,
"acecode_id": "bigcode_python_fns_26992",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sum_of_two_values(a, b)` that takes two arguments, `a` and `b`. The function should check if both arguments are of type `int` or `float`. If either argument is not of the correct type, it should raise a `TypeError`. If the sum of `a` and `b` exceeds 10^18,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_two_values(1, 2) == 3\", \"assert sum_of_two_values(10**18, 0) == 10**18\", \"assert sum_of_two_values(5.5, 4.5) == 10.0\", \"assert sum_of_two_values(1.5, 2.5) == 4.0\", \"assert sum_of_two_values(-1, -2) == -3\", \"assert sum_of_two_values(0, 0) == ... | {
"split": "train",
"index": 84191,
"acecode_id": "evol_4956",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a function `f` that may or may not call itself recursively, implement a wrapper function `no_recurse(f)` that returns `True` if `f` is called recursively and `False` otherwise. Your implementation should not use any external libraries and should only involve the direct fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert no_recurse(lambda x: x)(5) == False\", \"assert no_recurse(lambda x: x + 1 if x > 0 else 0)(5) == False\", \"assert no_recurse(lambda x: x + no_recurse(lambda y: y + 1)(x))(5) == False\", \"assert no_recurse(lambda x: (lambda y: y)(x))(5) == False\", \"asser... | {
"split": "train",
"index": 84192,
"acecode_id": "bigcode_python_fns_28668",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of complex numbers represented as tuples (real, imag), implement a function that calculates the modulus of each complex number. The modulus of a complex number is defined as the square root of the sum of the squares of its real and imaginary parts. Your function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_modulus([(3, 4), (1, 2)]) == [5.0, 2.23606797749979]\", \"assert calculate_modulus([(0, 0), (0, 1), (1, 0)]) == [0.0, 1.0, 1.0]\", \"assert calculate_modulus([(1, 1), (2, 2), (3, 3)]) == [1.4142135623730951, 2.8284271247461903, 4.242640687119285]\"... | {
"split": "train",
"index": 84193,
"acecode_id": "bigcode_python_fns_29995",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings representing names and a list of lists of numerical values, implement a function that processes these inputs to create a new list of tuples. Each tuple should consist of a name and the average of the corresponding numerical values. The function should ig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_names_and_values(['Alice', 'Bob', 'Charlie'], [[1.0, 2.0, 3.0], [], [4.0, 5.0]]) == [('Alice', 2.0), ('Charlie', 4.5)]\", \"assert process_names_and_values(['Zoe', 'Alice', 'Bob'], [[3.5, 4.5], [2.0], [5.0, 6.0]]) == [('Alice', 2.0), ('Bob', 5.5), ('... | {
"split": "train",
"index": 84194,
"acecode_id": "bigcode_python_fns_6268",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Your task is to implement ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal, Panama') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('12321') == True\", \"assert is_palindrome('Hello, Wor... | {
"split": "train",
"index": 84195,
"acecode_id": "oss_20046",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the IDs of processes. Each process can have child processes, represented as a nested list. Your task is to implement a function that takes the list of processes and their child processes and returns a flattened list of all process I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert terminate_processes([1, [2, 3], 4, [5, [6]]]) == [1, 2, 3, 4, 5, 6]\", \"assert terminate_processes([[1, 2], 3, [4, [5, 6]]]) == [1, 2, 3, 4, 5, 6]\", \"assert terminate_processes([1, [2, [3, 4]], 5]) == [1, 2, 3, 4, 5]\", \"assert terminate_processes([]) ==... | {
"split": "train",
"index": 84196,
"acecode_id": "bigcode_python_fns_1463",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_prime_sequence(n: int) -> List[int]` that generates a list of all prime numbers up to and including the given integer n. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_prime_sequence(1) == []\", \"assert generate_prime_sequence(2) == [2]\", \"assert generate_prime_sequence(3) == [2, 3]\", \"assert generate_prime_sequence(10) == [2, 3, 5, 7]\", \"assert generate_prime_sequence(20) == [2, 3, 5, 7, 11, 13, 17, 19]\",... | {
"split": "train",
"index": 84197,
"acecode_id": "evol_18540",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that finds all unique anagram groups from a list of words. The function should handle case insensitivity and ignore non-alphabetic strings. Each anagram group should be represented in the output as a list of words that are anagrams of each other, with the orig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_anagrams([\\\"abc\\\", \\\"cba\\\", \\\"bca\\\", \\\"xyz\\\", \\\"zyx\\\", \\\"!@#$%\\\", \\\"123\\\"]) == {\\\"abc\\\": [\\\"abc\\\", \\\"cba\\\", \\\"bca\\\"], \\\"xyz\\\": [\\\"xyz\\\", \\\"zyx\\\"]}\", \"assert find_anagrams([\\\"Listen\\\", \\\"Sil... | {
"split": "train",
"index": 84198,
"acecode_id": "evol_12200",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates user registration inputs based on specified constraints. The function should take the following parameters: password, last_login, name, email, region_type, interest_type1, interest_type2, interest_type3, nickname, phone... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_registration('password123', None, 'John', 'john@example.com', 'first_region', 'Computer', 'English', 'None', 'johnny', '1234567890', None, '1990-01-01', False, False, False) == True\", \"assert validate_user_registration('short', None, 'A', 'in... | {
"split": "train",
"index": 84199,
"acecode_id": "oss_21466",
"num_tests": 13
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.