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 implementing a function that simulates a voting classifier. The function takes a list of predictions from multiple classifiers and returns the final predicted class based on majority voting. If there is a tie, return the lowest class label. Each prediction i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert voting_classifier([1, 2, 2, 3]) == 2\", \"assert voting_classifier([1, 1, 2, 2, 3]) == 1\", \"assert voting_classifier([3, 3, 2, 2, 1]) == 2\", \"assert voting_classifier([4, 4, 4, 5, 5, 5, 4]) == 4\", \"assert voting_classifier([1, 1, 1, 2, 2, 2, 3, 3]) == ...
{ "split": "train", "index": 75500, "acecode_id": "bigcode_python_fns_27433", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that generates a list of all prime numbers between a given range, inclusive. The function should take two integers, start and end, as parameters, and return a list of prime numbers within that range. For example, if the input is start = 50 and end = 70, the out...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_primes(50, 70) == [53, 59, 61, 67]\", \"assert generate_primes(10, 20) == [11, 13, 17, 19]\", \"assert generate_primes(1, 10) == [2, 3, 5, 7]\", \"assert generate_primes(30, 40) == [31, 37]\", \"assert generate_primes(15, 30) == [17, 19, 23, 29]\", ...
{ "split": "train", "index": 75501, "acecode_id": "evol_15347", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_pattern(array)` that takes an array of two strings as parameters. The first string is the main string in which you need to search for occurrences of the second string. Your task is to determine if the second string appears consecutively and in identic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pattern(['hello world', 'world']) == (True, [(6, 10)])\", \"assert find_pattern(['a quick brown fox', 'quick']) == (True, [(2, 6)])\", \"assert find_pattern(['abcdefg', 'xyz']) == (False, [])\", \"assert find_pattern(['banana', 'ana']) == (True, [(1, 3)...
{ "split": "train", "index": 75502, "acecode_id": "evol_23804", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, each representing a builder configuration for a Packer template. Your task is to add a new key-value pair to each dictionary in the list under the key 'launch_block_device_mappings'. The new key should be 'kms_key_id' with a value provided ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_kms_key_id([{'launch_block_device_mappings': [{'volume_size': 100}]}], 'my-kms-key-id', 'launch_block_device_mappings not found') == [{'launch_block_device_mappings': [{'volume_size': 100, 'kms_key_id': 'my-kms-key-id'}]}]\", \"assert add_kms_key_id([{'l...
{ "split": "train", "index": 75503, "acecode_id": "bigcode_python_fns_41567", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing cups. Your task is to create a function that formats the list of cups into a string. The first cup in the list should be highlighted with parentheses, while the remaining cups should be separated by spaces. Implement a function `dum...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dump_cups_with_first([1, 2, 3]) == '(1) 2 3'\", \"assert dump_cups_with_first([0, 1, 2, 3]) == '(0) 1 2 3'\", \"assert dump_cups_with_first([]) == ''\", \"assert dump_cups_with_first([10, 20, 30, 40]) == '(10) 20 30 40'\", \"assert dump_cups_with_first([7, 8...
{ "split": "train", "index": 75504, "acecode_id": "bigcode_python_fns_46856", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of integers and a target integer, write a function `find_two_sum` that returns the indices of two distinct elements in the list that sum up to the target integer. If no such pair exists, return an empty list. The input list may contain duplicate numbers, but the tw...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_two_sum([2, 7, 11, 15], 9) == [0, 1]\", \"assert find_two_sum([3, 2, 4], 6) == [1, 2]\", \"assert find_two_sum([1, 2, 3, 4, 5], 8) == [2, 4]\", \"assert find_two_sum([5, 5, 5, 5], 10) == [0, 1]\", \"assert find_two_sum([1, 2, 3, 4, 5], 10) == []\", \"as...
{ "split": "train", "index": 75505, "acecode_id": "oss_31302", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a collection of values, implement a function `any_none_nan(values)` that returns `True` if any value in the collection is `None`, `NaN`, or if the collection is empty. The input can be a single value, a list, a tuple, or a string. If the input is a string, the function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert any_none_nan(None) == True\", \"assert any_none_nan(float('nan')) == True\", \"assert any_none_nan([1, 2, float('nan')]) == True\", \"assert any_none_nan([1, 2, 3]) == False\", \"assert any_none_nan([]) == True\", \"assert any_none_nan([None, 1, 2]) == True\...
{ "split": "train", "index": 75506, "acecode_id": "bigcode_python_fns_32385", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of edges and returns a list of connected components in an undirected graph. Each edge is represented as a tuple of two vertices. A connected component is defined as a subset of vertices such that there exists a path ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_connected_components([]) == []\", \"assert find_connected_components([(1, 2), (2, 3), (4, 5)]) == [{1, 2, 3}, {4, 5}]\", \"assert find_connected_components([(1, 2), (1, 3), (2, 3), (4, 5), (5, 6)]) == [{1, 2, 3}, {4, 5, 6}]\", \"assert find_connected_co...
{ "split": "train", "index": 75507, "acecode_id": "oss_8631", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_palindrome(sentence: str) -> bool` that determines whether a given sentence 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 capitalizat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('A man, a plan, a canal, Panama!') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Hello, World!') == False\", \"assert is_palindrome('...
{ "split": "train", "index": 75508, "acecode_id": "evol_34289", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that compares two version strings, `version1` and `version2`. Each version string may contain multiple components separated by dots (e.g., '1.0.5', '2.1.0'). The version components are non-negative integers. Your function should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_versions('1.0.0', '1.0.0') == 0\", \"assert compare_versions('1.0.1', '1.0.0') == 1\", \"assert compare_versions('1.0.0', '1.0.1') == -1\", \"assert compare_versions('2.0', '1.9.9') == 1\", \"assert compare_versions('1.2.3', '1.2.4') == -1\", \"asser...
{ "split": "train", "index": 75509, "acecode_id": "bigcode_python_fns_37671", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the cumulative purchases made over the years. Write a function `calculate_cumulative_purchases` that takes a list of integers representing purchases made each year and returns a list of cumulative purchases for that year. The cumulative purchase ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_cumulative_purchases([100, 150, 200]) == [100, 250, 450]\", \"assert calculate_cumulative_purchases([50, 50, 50, 50]) == [50, 100, 150, 200]\", \"assert calculate_cumulative_purchases([10, 20, 30, 40, 50]) == [10, 30, 60, 100, 150]\", \"assert calc...
{ "split": "train", "index": 75510, "acecode_id": "oss_36219", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a recursive function that computes 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. If the input n is a negative integer, the function should return an error message in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(5) == 120\", \"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(10) == 3628800\", \"assert factorial(7) == 5040\", \"assert facto...
{ "split": "train", "index": 75511, "acecode_id": "evol_31393", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks for the occurrence of a specific variable in a list and counts how many times it appears. Your function should take two parameters: a list `variables` and a variable `var`. The function should return a tuple containing two...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_occurrence([1, 2, 3, 2, 1], 2) == (True, 2)\", \"assert check_occurrence([1, 2, 3, 2, 1], 1) == (True, 2)\", \"assert check_occurrence([1, 2, 3, 2, 1], 3) == (True, 1)\", \"assert check_occurrence([1, 2, 3, 2, 1], 4) == (False, 0)\", \"assert check_occ...
{ "split": "train", "index": 75512, "acecode_id": "oss_28954", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers `valores`. Your task is to write a function that finds the indices of all occurrences of the maximum value in the list and returns them as a list. If the maximum value appears multiple times, all corresponding indices should be included in the o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_maximum_indices([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]) == [5]\", \"assert find_maximum_indices([1, 2, 3, 4, 5]) == [4]\", \"assert find_maximum_indices([5, 5, 5, 5, 5]) == [0, 1, 2, 3, 4]\", \"assert find_maximum_indices([-1, -2, -3, -4, -5]) == [0]\", \"as...
{ "split": "train", "index": 75513, "acecode_id": "oss_3839", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two datasets representing the spread of a disease using the SIR and SEIR models under certain conditions, write a function that determines if the predictions from both models are the same when specific parameters are enforced: alpha should equal gamma, the number of expos...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_sir_vs_seir({'infected': 100, 'exposed': 0, 'recovered': 50}, {'infected': 100, 'exposed': 0, 'recovered': 50}) == True\", \"assert compare_sir_vs_seir({'infected': 200, 'exposed': 0, 'recovered': 150}, {'infected': 200, 'exposed': 5, 'recovered': 15...
{ "split": "train", "index": 75514, "acecode_id": "bigcode_python_fns_10306", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates downloading a file in chunks. The file has a total size represented by a positive integer, and the download can be split into smaller chunks. The function should take the total file size, the size of each chunk, and the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert chunk_download(100, 20) == [(0, 19), (20, 39), (40, 59), (60, 79), (80, 99)]\", \"assert chunk_download(250, 50) == [(0, 49), (50, 99), (100, 149), (150, 199), (200, 249)]\", \"assert chunk_download(75, 25) == [(0, 24), (25, 49), (50, 74)]\", \"assert chunk_...
{ "split": "train", "index": 75515, "acecode_id": "bigcode_python_fns_16779", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries, write a function `remove_subsets(lst)` that returns a new list of dictionaries excluding any dictionaries that are subsets of others in the input list. A dictionary A is considered a subset of dictionary B if every key-value pair in A is also prese...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_subsets([{'a': 1}, {'a': 1, 'b': 2}, {'b': 2}]) == [{'a': 1, 'b': 2}]\", \"assert remove_subsets([{'x': 1}, {'x': 1, 'y': 2}, {'y': 2}, {'x': 1, 'y': 2, 'z': 3}]) == [{'x': 1, 'y': 2, 'z': 3}]\", \"assert remove_subsets([{'k': 1, 'l': 2}, {'k': 1}, {'...
{ "split": "train", "index": 75516, "acecode_id": "evol_4239", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a response for a video feed request in a specified format. The function should take a single parameter, `project_id`, which will be used to construct a URL for accessing the video feed. The function should return a dictiona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert inference_video_feed(1) == {'status': 'ok', 'url': 'http://inference_module.example.com/video_feed?inference=1'}\", \"assert inference_video_feed(2) == {'status': 'ok', 'url': 'http://inference_module.example.com/video_feed?inference=1'}\", \"assert inferenc...
{ "split": "train", "index": 75517, "acecode_id": "bigcode_python_fns_22556", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `sum_between` that takes a list of two integers as input and returns the sum of all integers between the two input integers, inclusive. If the input list does not contain exactly two integers, the function should raise a TypeError. Fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_between([1, 3]) == 6\", \"assert sum_between([8, 5]) == 26\", \"assert sum_between([2, 2]) == 2\", \"assert sum_between([0, 0]) == 0\", \"assert sum_between([-1, 1]) == 0\", \"assert sum_between([-3, 2]) == -3\", \"assert sum_between([-5, -2]) == -14\", ...
{ "split": "train", "index": 75518, "acecode_id": "oss_11041", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks if each integer in a given list is a palindrome number. The function should return a list of indices of palindrome integers and -1 for non-palindrome integers. The function must handle negative numbers and zeros. A palindrome number is defined a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_palindrome([11, 22, 33, 44]) == [0, 1, 2, 3]\", \"assert check_palindrome([123, 321, 12321]) == [-1, -1, 2]\", \"assert check_palindrome([1, 2, 3, 4, 5]) == [0, 1, 2, 3, 4]\", \"assert check_palindrome([-1, -2, -3]) == [-1, -1, -1]\", \"assert check_pa...
{ "split": "train", "index": 75519, "acecode_id": "evol_33574", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function `animal_sound(animal_type: str) -> str` that takes in a string representing the type of an animal ('mammal' or 'bird') and returns the sound that the animal makes. If the input is 'mammal', return 'Mammal sound'. If the input is 'bird', return 'Bird sound'. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert animal_sound('mammal') == 'Mammal sound'\", \"assert animal_sound('bird') == 'Bird sound'\", \"assert animal_sound('fish') == 'Unknown animal type'\", \"assert animal_sound('reptile') == 'Unknown animal type'\", \"assert animal_sound('mammal') == 'Mammal sou...
{ "split": "train", "index": 75520, "acecode_id": "evol_4336", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two integers, `p` and `g`, which represent the change in brightness and the current brightness level respectively. The brightness level must always remain between 0 and a maximum value, `m`, which defaults to 255. Your task is to implement a function that calculat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_brightness(-10, 50) == 40\", \"assert calculate_brightness(10, 50) == 60\", \"assert calculate_brightness(-60, 50) == 0\", \"assert calculate_brightness(300, 50) == 255\", \"assert calculate_brightness(0, 0) == 0\", \"assert calculate_brightness(25...
{ "split": "train", "index": 75521, "acecode_id": "bigcode_python_fns_19827", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers and a scaling factor, implement a function that scales each element in the array by the scaling factor and returns the new array. The function signature should be: def scale_array(arr: List[int], scale_factor: int) -> List[int].\nPlease reason step by...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scale_array([1, 2, 3, 4], 2) == [2, 4, 6, 8]\", \"assert scale_array([-1, 0, 1], 3) == [-3, 0, 3]\", \"assert scale_array([10, 20, 30], 0) == [0, 0, 0]\", \"assert scale_array([], 5) == []\", \"assert scale_array([5], 10) == [50]\", \"assert scale_array([1, ...
{ "split": "train", "index": 75522, "acecode_id": "evol_8248", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two strings `s` and `t`. String `t` is formed by shuffling the characters of string `s` and then adding one or more occurrences of one letter at random positions. Write a function that identifies the letter that was added to `t` and returns its frequency in the fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_added_letter('abcd', 'abcdee') == {'e': 2}\", \"assert find_added_letter('', 'yy') == {'y': 2}\", \"assert find_added_letter('a', 'aaa') == {'a': 2}\", \"assert find_added_letter('ae', 'aeaaa') == {'a': 3}\", \"assert find_added_letter('abc', 'abcc') ==...
{ "split": "train", "index": 75523, "acecode_id": "evol_15542", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with normalizing a given list of numerical points that are represented as fractions in the form of strings (e.g., '1/2', '3/4'). Your function should take in a list of these fraction strings and return a new list where each fraction is converted to a decimal numb...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_fractions(['1/2', '3/4', '5/6']) == [0.5, 0.75, 0.83]\", \"assert normalize_fractions(['1/3', '2/3', '4/5']) == [0.33, 0.67, 0.8]\", \"assert normalize_fractions(['2/1', '7/3', '9/2']) == [2.0, 2.33, 4.5]\", \"assert normalize_fractions(['1/2', 'ab...
{ "split": "train", "index": 75524, "acecode_id": "bigcode_python_fns_8637", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a configuration object containing details about job submission parameters and returns the appropriate submission method based on whether the job should run locally or on a cluster. The configuration object has the following att...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert job_submission_method({'local': True, 'metadata': 'job1', 'config': 'config1', 'max_memory': 2048, 'runtime': 3600, 'dry_run': False, 'debug': False, 'workdir': '/tmp'}) == 'submit_local'\", \"assert job_submission_method({'local': False, 'metadata': 'job2',...
{ "split": "train", "index": 75525, "acecode_id": "bigcode_python_fns_1033", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns a list of unique integer pairs (a, b) from the input list such that the sum of their cubes (a^3 + b^3) is a perfect square. Each pair should be returned only once, and the order of pairs does not matter.\nPlease reason ste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pairs([3, 6, 9, 10]) == []\", \"assert find_pairs([2, 2, 2, 2]) == [(2, 2)]\", \"assert find_pairs([15, 16, 17]) == []\", \"assert find_pairs([]) == []\", \"assert find_pairs([5]) == []\", \"assert find_pairs([10, 11, 12, 13]) == []\", \"assert find_pai...
{ "split": "train", "index": 75526, "acecode_id": "evol_3683", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of song names represented as strings. Your task is to implement a function that takes this list of songs and returns the list of songs that you need to download based on the following conditions: If a song is already present in the list, it should not be in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_download_list(['Song A', 'Song B', 'Song C'], ['Song A', 'Song D'], False) == ['Song B', 'Song C']\", \"assert get_download_list(['Song X', 'Song Y'], ['Song X', 'Song Y'], True) == ['Song X', 'Song Y']\", \"assert get_download_list(['Song A'], [], True)...
{ "split": "train", "index": 75527, "acecode_id": "bigcode_python_fns_31634", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the initial positions of objects. Write a function `max_minus_one` that takes this list as input and returns a new list where each element is the maximum of 0 and the corresponding element in the input list minus 1. The function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_minus_one([5, 3, 0, 7, 2]) == [4, 2, 0, 6, 1]\", \"assert max_minus_one([0, 1, 2, 3, 4]) == [0, 0, 1, 2, 3]\", \"assert max_minus_one([-1, -5, 2]) == [0, 0, 1]\", \"assert max_minus_one([10]) == [9]\", \"assert max_minus_one([]) == []\", \"assert max_min...
{ "split": "train", "index": 75528, "acecode_id": "oss_2086", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that counts the number of vowels in a given string. The function should take a single string as input and return the total count of vowels (a, e, i, o, u) in that string, regardless of their case. If the input string is empty, the fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_vowels('Hello World!') == 3\", \"assert count_vowels('Python Programming') == 4\", \"assert count_vowels('') == 0\", \"assert count_vowels('AEIOU') == 5\", \"assert count_vowels('abcdEFG') == 2\", \"assert count_vowels('A quick brown fox jumps over the...
{ "split": "train", "index": 75529, "acecode_id": "oss_23398", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `find_squares_cubes(nested_list)` that takes a multi-dimensional array of integers as input and returns a tuple containing the count of perfect square numbers and perfect cube numbers separately. The function should ignore negative numbers and zero. A perfect s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_squares_cubes([[2, 3, 5], [7, 11, 13]]) == (0, 0)\", \"assert find_squares_cubes([[100, 121], [125, 216]]) == (2, 2)\", \"assert find_squares_cubes([[30, 45], [20, 50]]) == (0, 0)\", \"assert find_squares_cubes([[49, 81, 100], [-25, -36]]) == (3, 0)\", ...
{ "split": "train", "index": 75530, "acecode_id": "evol_18076", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function called `cube_elements` that takes a list of integers as input and returns a new list containing the cube of each integer from the input list. For instance, if the input is `[2, 4, 6]`, the output should be `[8, 64, 216]`.\nPlease reason step by step, then w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cube_elements([1]) == [1]\", \"assert cube_elements([0]) == [0]\", \"assert cube_elements([-1]) == [-1]\", \"assert cube_elements([2, 3]) == [8, 27]\", \"assert cube_elements([5, 10]) == [125, 1000]\", \"assert cube_elements([7, 8, 9]) == [343, 512, 729]\", ...
{ "split": "train", "index": 75531, "acecode_id": "evol_34472", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tuples where each tuple contains the name of an employee and the number of hours they worked in a month, write a function `employee_check(work_hours)` that returns a tuple containing the name of the employee who worked the most hours and the number of hours they...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert employee_check([('sam', 300), ('ream', 200), ('deam', 400)]) == ('deam', 400)\", \"assert employee_check([('alice', 150), ('bob', 200), ('charlie', 200)]) == ('bob', 200)\", \"assert employee_check([('john', 100), ('jane', 150), ('doe', 120)]) == ('jane', 15...
{ "split": "train", "index": 75532, "acecode_id": "evol_22218", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a dataset. Your task is to implement a function that splits this dataset into two parts: a training dataset and a testing dataset. The function should take in the dataset as a list and a float representing the test size (between 0.0...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_dataset([1, 2, 3], 0.0) == ([1, 2, 3], [])\", \"assert split_dataset([1, 2, 3], 1.0) == ([], [1, 2, 3])\", \"assert split_dataset([0], 0.0) == ([0], [])\", \"assert split_dataset([1, 1, 1, 1], 0.5) == ([1, 1], [1, 1])\", \"assert split_dataset([], 0.5)...
{ "split": "train", "index": 75533, "acecode_id": "bigcode_python_fns_21667", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a date represented as a string in the format 'YYYY-MM-DD', implement a function `add_to_date(date: str, years: int, months: int, weeks: int, days: int) -> str` that adds the specified number of years, months, weeks, and days to the given date. The function should return t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_to_date('2023-01-01', 0, 0, 0, 0) == '2023-01-01'\", \"assert add_to_date('2023-01-01', 1, 0, 0, 0) == '2024-01-01'\", \"assert add_to_date('2023-01-01', 0, 1, 0, 0) == '2023-02-01'\", \"assert add_to_date('2023-01-01', 0, 0, 1, 0) == '2023-01-08'\", \"a...
{ "split": "train", "index": 75534, "acecode_id": "bigcode_python_fns_44939", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of numbers and returns a new list containing only the even numbers from the original list. If the input list is empty, the function should return an empty list. The function should be named 'filter_even_numbers' and shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 21, 32, 43, 54]) == [10, 32, 54]\", \"assert filter_even_numbers([7, 8, 9, 10]) == [8, 10]\", \"assert filter_even_numbers([0, 1, 2, 3, 4]) == [0, 2, 4]\", \"assert filter_ev...
{ "split": "train", "index": 75535, "acecode_id": "oss_37182", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of distinct words, implement a function `merge_words(lst)` that concatenates all the words into a single string, where each word is separated by a comma followed by a space. The input list will contain only distinct words. For example, if the input list is `['Hello...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_words(['Hello', 'world']) == 'Hello, world'\", \"assert merge_words(['This', 'is', 'a', 'test']) == 'This, is, a, test'\", \"assert merge_words(['Python', 'is', 'fun']) == 'Python, is, fun'\", \"assert merge_words(['Apple', 'Banana', 'Cherry']) == 'App...
{ "split": "train", "index": 75536, "acecode_id": "evol_24763", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `calculate_user_stats(data: List[Dict[str, Union[int, str]]]) -> Tuple[int, str, str]` that takes a list of user data dictionaries and returns a tuple containing the highest user ID, the username of the user with the highest number of completed tasks, and the u...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_user_stats([]) == (None, None, None)\", \"assert calculate_user_stats([{'id': 3, 'username': 'user3', 'completed_tasks': 7, 'posts': 1}, {'id': 4, 'username': 'user4', 'completed_tasks': 7, 'posts': 3}]) == (4, 'user3', 'user3')\", \"assert calcula...
{ "split": "train", "index": 75537, "acecode_id": "evol_6485", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of tuples where each tuple contains two floating-point numbers representing the values of two different metrics, write a function that calculates the Spearman correlation coefficient between these two sets of values. The function should take in a list of tuples and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_spearman_correlation([(1.0, 2.0), (2.0, 3.0), (3.0, 4.0)]) == 1.0\", \"assert calculate_spearman_correlation([(1.0, 3.0), (2.0, 2.0), (3.0, 1.0)]) == -1.0\", \"assert calculate_spearman_correlation([(1.0, 1.0), (2.0, 2.0), (3.0, 3.0)]) == 1.0\", \"...
{ "split": "train", "index": 75538, "acecode_id": "bigcode_python_fns_37780", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given user-submitted comment is spam based on certain criteria. Given a string `comment`, your function should determine if the comment contains any of the specified spam keywords. If the comment includes any of these...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_spam('You can win a cash prize!') == 'Spam'\", \"assert check_spam('This is a normal comment.') == 'Not Spam'\", \"assert check_spam('Get your free trial now!') == 'Spam'\", \"assert check_spam('Looking for feedback on my project.') == 'Not Spam'\", \"...
{ "split": "train", "index": 75539, "acecode_id": "oss_34001", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that checks if a given list of numerical values contains only a single unique element. The function should raise a ValueError if the list is empty or if any of the list elements are not numeric. Define a function named `check_single_unique_element(ls...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_single_unique_element([1, 1, 1]) == True\", \"assert check_single_unique_element([2.5, 2.5, 2.5]) == True\", \"assert check_single_unique_element([5]) == True\", \"assert check_single_unique_element([3, 3, 3, 3]) == True\", \"assert check_single_unique...
{ "split": "train", "index": 75540, "acecode_id": "evol_27204", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing DNS TXT records for a specific hostname. Each string may contain different types of records, but you are only interested in identifying valid SPF records. An SPF record starts with 'v=spf'. Your task is to implement a function that t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_spf_record(['v=spf1 include:example.com -all']) == 'v=spf1 include:example.com -all'\", \"assert get_spf_record(['v=spf1 include:example.com -all', 'v=spf1 include:another.com -all']) == ''\", \"assert get_spf_record(['v=spf1 include:example.com -all', '...
{ "split": "train", "index": 75541, "acecode_id": "bigcode_python_fns_13342", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the functionality of an API Gateway method for handling events. Your function should allow for the addition of a method, specifying its HTTP method type, integration, and authorization type. Additionally, the function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert api_gateway_method('GET', 'events_integration', 'CUSTOM', 'AuthorizerId', '12345') == {'HTTPMethod': 'GET', 'Integration': 'events_integration', 'AuthorizationType': 'CUSTOM', 'AuthorizerId': '12345'}\", \"assert api_gateway_method('POST', 'user_integration'...
{ "split": "train", "index": 75542, "acecode_id": "oss_9325", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the MGS (Mean Grayscale Score) values of different tissue samples and a corresponding list of tissue IDs, write a function that creates a new list where each element is the product of the MGS value and its corresponding tissue ID. The tissu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_weighted_scores([1, 2, 3], [0.5, 1.0, 1.5]) == [0.5, 2.0, 4.5]\", \"assert compute_weighted_scores([0, 1, 2], [1.0, 2.0, 3.0]) == [0.0, 2.0, 6.0]\", \"assert compute_weighted_scores([5, 10, 15], [1.1, 2.2, 3.3]) == [5.5, 22.0, 49.5]\", \"assert compu...
{ "split": "train", "index": 75543, "acecode_id": "bigcode_python_fns_28274", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `add_review(restaurant_name: str, review_text: str, latitude: float, longitude: float, user: User) -> str` that allows a user to add a review for a restaurant. The function should create a new review with the provided restaurant name, review text, latitude,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_review('Pasta Place', 'Great pasta and friendly service!', 40.7128, -74.0060, user) == 'Review added'\", \"assert add_review('Sushi World', 'Fresh sushi with a nice atmosphere.', 34.0522, -118.2437, user) == 'Review added'\", \"assert add_review('Burger ...
{ "split": "train", "index": 75544, "acecode_id": "evol_29736", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a custom embedding layer in a neural network setup. Write a function called `create_embedding` that accepts a variable number of parameters and returns a dictionary containing two keys: 'parameters' and 'cus...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_embedding(1, 2, 3) == {'parameters': [1, 2, 3], 'custom_param': 1}\", \"assert create_embedding('a', 'b', 'c') == {'parameters': ['a', 'b', 'c'], 'custom_param': 'a'}\", \"assert create_embedding(3.5, 2.1) == {'parameters': [3.5, 2.1], 'custom_param':...
{ "split": "train", "index": 75545, "acecode_id": "oss_13366", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings representing labels and a number of columns, write a function `arrange_labels` that rearranges the labels such that they are organized into the specified number of columns, reading from right to left. The function should return the rearranged list of lab...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert arrange_labels([], 2) == []\", \"assert arrange_labels(['A'], 1) == ['A']\", \"assert arrange_labels(['Alpha', 'Beta'], 2) == ['Beta', 'Alpha']\", \"assert arrange_labels(['A', 'B', 'C'], 3) == ['C', 'B', 'A']\", \"assert arrange_labels(['Apple', 'Banana', '...
{ "split": "train", "index": 75546, "acecode_id": "bigcode_python_fns_48057", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given two integers x and y, write a function `contfrac(x: int, y: int) -> List[int]` that returns a list containing the terms of the continued fraction representation of the fraction x/y. The continued fraction is generated by repeatedly taking the integer part of the division ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contfrac(1, 1) == [1]\", \"assert contfrac(0, 1) == [0]\", \"assert contfrac(5, 0) == []\", \"assert contfrac(0, 0) == []\", \"assert contfrac(9, -2) == [-5, 2]\", \"assert contfrac(3, 1) == [3]\", \"assert contfrac(6, 1) == [6]\", \"assert contfrac(1, 100) ...
{ "split": "train", "index": 75547, "acecode_id": "bigcode_python_fns_33298", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a dictionary where each key is a unique case ID and the value is a JSON-like structure representing the case data. Your task is to compare the provided case data with a set of case data retrieved from an SQL database (simulated with a predefined list). Implement a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert diff_cases({'case1': {'doc_type': 'typeA', 'data': {'field1': 'value1', 'field2': 'value2'}}, 'case2': {'doc_type': 'typeB', 'data': {'field1': 'value1', 'field2': 'value3'}}}) == [('typeB', 'case2', {'field2': ('value3', 'value2')})]\", \"assert diff_cases(...
{ "split": "train", "index": 75548, "acecode_id": "bigcode_python_fns_3000", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the merging of multiple documents based on a common identifier. Given a list of strings representing document content and a string representing the common identifier, your function should return a single string that con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_documents(['Doc1 Content', 'Doc2 Content'], 'ID123') == 'ID123: Doc1 Content\\\\nID123: Doc2 Content'\", \"assert merge_documents(['First Document', 'Second Document'], 'DOC_ID') == 'DOC_ID: First Document\\\\nDOC_ID: Second Document'\", \"assert merge...
{ "split": "train", "index": 75549, "acecode_id": "oss_30720", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with writing a program to extract the MD5 checksum of a specific language pack from a given XML string. The XML string contains multiple language packs, each defined by attributes such as version and language. Write a function `find_languagepack_md5(xml_string, v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_languagepack_md5('<languagepack version=\\\"2.2.3\\\" language=\\\"fr_FR\\\"><md5>f39b898bf9efedfbbf8b670e7ce7bb88</md5></languagepack>', '2.2.3', 'fr_FR') == 'f39b898bf9efedfbbf8b670e7ce7bb88'\", \"assert find_languagepack_md5('<languagepack version=\\...
{ "split": "train", "index": 75550, "acecode_id": "oss_16205", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns the maximum sum of a non-empty subarray. A subarray is defined as a contiguous part of the array. Your function should handle both positive and negative integers. The input list can be of any leng...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_subarray_sum([1, -2, 3, 4, -1]) == 7\", \"assert max_subarray_sum([-2, -3, -1, -5]) == -1\", \"assert max_subarray_sum([2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([-1, -2, -3, -4]...
{ "split": "train", "index": 75551, "acecode_id": "bigcode_python_fns_16000", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to convert an unordered list of unique integers into a min heap and determine the potential swap candidates along with the cumulative count of swaps required to sort the heap. Implement the following function: \n\n```python\ndef get_s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_swap_info([1, 2, 3]) == {'index': -1, 'swap_with': -1, 'total_swaps': 0}\", \"assert get_swap_info([3, 1, 2]) == {'index': 0, 'swap_with': 1, 'total_swaps': 1}\", \"assert get_swap_info([1, 3, 2, 4, 5]) == {'index': -1, 'swap_with': -1, 'total_swaps': 0}...
{ "split": "train", "index": 75552, "acecode_id": "evol_30697", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a python function that moves all zeroes to the end of a given list. The function should maintain the relative order of the non-zero elements. Additionally, the function should handle nested lists, moving all zeroes within those nested lists to the end of their respective ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert move_zeroes_to_end([0, 1, 0, 3, 12]) == [1, 3, 12, 0, 0]\", \"assert move_zeroes_to_end([[0, 1, 0], 3, 12]) == [[1, 0, 0], 3, 12]\", \"assert move_zeroes_to_end([1, 0, 2, 0, 3, 0]) == [1, 2, 3, 0, 0, 0]\", \"assert move_zeroes_to_end([[0], [0, 0], [1, 2, 0]]...
{ "split": "train", "index": 75553, "acecode_id": "evol_18827", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string and a character, write a function that inserts the specified character at a given index in the string. The function should take three parameters: the string, the index (0-based), and the character to insert. The function should return the new string after the ins...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_char('Hello World', 5, ' ') == 'Hello World'\", \"assert insert_char('OpenAI', 3, '-') == 'Ope-nAI'\", \"assert insert_char('Python', 0, 'I') == 'IPython'\", \"assert insert_char('LeetCode', 8, '!') == 'LeetCode!'\", \"assert insert_char('abcdef', 2,...
{ "split": "train", "index": 75554, "acecode_id": "evol_34796", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given two values, x and y, write a function `ifnone(x, y)` that returns x if x is not None, otherwise returns y. You may assume that the inputs x and y can be of any type. The function should only return one of the two values based on the presence of None.\nPlease reason step b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ifnone(None, 5) == 5\", \"assert ifnone(10, 20) == 10\", \"assert ifnone('hello', 'world') == 'hello'\", \"assert ifnone(None, 'default') == 'default'\", \"assert ifnone([], [1, 2, 3]) == []\", \"assert ifnone(None, None) == None\", \"assert ifnone(0, 1) == ...
{ "split": "train", "index": 75555, "acecode_id": "bigcode_python_fns_39974", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that combines two 8-bit unsigned integers into a single 16-bit unsigned integer. The first integer (upper) represents the higher 8 bits of the final result and the second integer (lower) represents the lower 8 bits. The function should ta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine_registers(255, 255) == 65535\", \"assert combine_registers(0, 0) == 0\", \"assert combine_registers(1, 1) == 257\", \"assert combine_registers(128, 128) == 32896\", \"assert combine_registers(0, 255) == 255\", \"assert combine_registers(255, 0) == 65...
{ "split": "train", "index": 75556, "acecode_id": "bigcode_python_fns_48438", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of a set of buildings. Your task is to write a function that determines the number of buildings that can see the sunset. A building can see the sunset if it is taller than all the buildings to its right. The input will b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_buildings_with_sunset_view([4, 2, 3, 1]) == 3\", \"assert count_buildings_with_sunset_view([3, 3, 3, 3]) == 1\", \"assert count_buildings_with_sunset_view([]) == 0\", \"assert count_buildings_with_sunset_view([1, 2, 3, 2, 1]) == 3\", \"assert count_bui...
{ "split": "train", "index": 75557, "acecode_id": "bigcode_python_fns_39777", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a log line represented as a string, split the string at the first occurrence of either the substring 'apple' or 'banana'. If 'apple' appears first, return the substring starting from 'apple' (inclusive) to the end of the string. If 'banana' appears first, return the subst...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_log_line('apple pie is delicious') == 'apple pie is delicious'\", \"assert split_log_line('banana bread is great') == 'banana bread is great'\", \"assert split_log_line('I like apple and banana') == 'apple and banana'\", \"assert split_log_line('banana...
{ "split": "train", "index": 75558, "acecode_id": "bigcode_python_fns_48333", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, implement a function `generate_sequence(n)` that generates a list of numbers based on the following rules: If n is even, the list should contain the first n positive even numbers in ascending order. If n is odd, the list should contain the first n positive o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_sequence(0) == []\", \"assert generate_sequence(1) == [1]\", \"assert generate_sequence(2) == [2, 4]\", \"assert generate_sequence(3) == [5, 3, 1]\", \"assert generate_sequence(4) == [2, 4, 6, 8]\", \"assert generate_sequence(5) == [9, 7, 5, 3, 1]\"...
{ "split": "train", "index": 75559, "acecode_id": "oss_5131", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `manage_account` that simulates basic banking operations. The function should take three parameters: an initial balance (float), a deposit amount (float), and a withdrawal amount (float). It should return the final balance after performing the deposit follo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_account(100.0, 50.0, 30.0) == 120.0\", \"assert manage_account(200.0, 100.0, 50.0) == 250.0\", \"assert manage_account(100.0, 0.0, 50.0) == 50.0\", \"assert manage_account(0.0, 50.0, 20.0) == 30.0\", \"assert manage_account(100.0, 50.0, 150.0) == 0.0\...
{ "split": "train", "index": 75560, "acecode_id": "evol_34395", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of organizations, each represented by a dictionary containing the keys 'lead_inspector' and 'deputy_lead_inspector', write a function `inspectors_for_each_mode(lead_type: str) -> Dict[str, Set[str]]` that groups the lead inspectors or deputy lead inspectors by thei...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert inspectors_for_each_mode('lead_inspector', [{'submode': 'A', 'lead_inspector': 'Inspector1'}, {'submode': 'A', 'lead_inspector': 'Inspector2'}, {'submode': 'B', 'lead_inspector': None}]) == {'A': {'Inspector1', 'Inspector2'}, 'B': set()}\", \"assert inspecto...
{ "split": "train", "index": 75561, "acecode_id": "bigcode_python_fns_32036", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of strings, each representing a line from a CSV file. Each line contains three values separated by commas. Your function should take a list of such strings and return a list of lists, where each inner list contains t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_csv(['value1,value2,value3', 'value4,value5,value6', 'value7,value8']) == [['value1', 'value2', 'value3'], ['value4', 'value5', 'value6']]\", \"assert process_csv(['value1,value2,value3', 'value4,value5', 'value6']) == [['value1', 'value2', 'value3']...
{ "split": "train", "index": 75562, "acecode_id": "bigcode_python_fns_97", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the nth Bell number, a sequence in number theory. The function should raise a ValueError if the input is negative. The function should be efficient and able to handle large inputs. Write the function as follows: def calculate_bell_number(n: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_bell_number(0) == 1\", \"assert calculate_bell_number(1) == 1\", \"assert calculate_bell_number(2) == 2\", \"assert calculate_bell_number(3) == 5\", \"assert calculate_bell_number(4) == 15\", \"assert calculate_bell_number(5) == 52\", \"assert calc...
{ "split": "train", "index": 75563, "acecode_id": "evol_10645", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `convert_pressure` that converts a given pressure between atmospheres (atm) and Pascals (Pa). The function should take two parameters: `value` (a float representing the pressure) and `unit` (a string that can be either 'atm' or 'Pa'). If the unit is 'atm', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_pressure(1.0, 'atm') == 101325.0\", \"assert convert_pressure(101325.0, 'Pa') == 1.0\", \"assert convert_pressure(0.5, 'atm') == 50662.5\", \"assert convert_pressure(50662.5, 'Pa') == 0.5\", \"assert convert_pressure(2.0, 'atm') == 202650.0\", \"asse...
{ "split": "train", "index": 75564, "acecode_id": "evol_18050", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a directed graph represented by its edges and a list of function argument placeholders. Your task is to implement a function that creates a mapping from the names of the graph's nodes to the names of the corresponding function's tensor outputs based on certain rul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_input_dict([], []) == {}\", \"assert create_input_dict([('A', 'B'), ('A', 'C')], ['A']) == {'A': 'A', 'B': 'A:output:0', 'C': 'A:output:1'}\", \"assert create_input_dict([('1', '2'), ('2', '3')], ['1']) == {'1': '1', '2': '1:output:0', '3': '2:output:...
{ "split": "train", "index": 75565, "acecode_id": "bigcode_python_fns_44880", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that marks a ticket as complete. The function should take a list of ticket IDs and return a list of the same IDs, but with an additional property indicating that each ticket is complete. Specifically, you will implement a function called ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mark_tickets_complete([1, 2, 3]) == [{1: True}, {2: True}, {3: True}]\", \"assert mark_tickets_complete([10, 20, 30]) == [{10: True}, {20: True}, {30: True}]\", \"assert mark_tickets_complete([]) == []\", \"assert mark_tickets_complete([7]) == [{7: True}]\",...
{ "split": "train", "index": 75566, "acecode_id": "bigcode_python_fns_7973", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple banking operation. The function should take three parameters: an initial balance (an integer), a list of deposit amounts (a list of integers), and a list of withdrawal amounts (a list of integers). The function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_operations(0, [1000], [500]) == 500\", \"assert bank_operations(500, [1000], [200]) == 1300\", \"assert bank_operations(1000, [500, 300], [200]) == 1600\", \"assert bank_operations(1000, [100, 200], [150]) == 1150\", \"assert bank_operations(0, [], []) ...
{ "split": "train", "index": 75567, "acecode_id": "oss_34707", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a variable number of positional arguments and a variable number of keyword arguments. Your task is to implement a function `format_arguments(*args, **kwargs)` that returns a tuple containing a list of positional arguments and a dictionary of keyword arguments. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_arguments('arg1', 'arg2', key1='value1', key2='value2') == (['arg1', 'arg2'], {'key1': 'value1', 'key2': 'value2'})\", \"assert format_arguments() == ([], {})\", \"assert format_arguments('single_arg') == (['single_arg'], {})\", \"assert format_argume...
{ "split": "train", "index": 75568, "acecode_id": "bigcode_python_fns_7920", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You have been given a class called `Model` that has a method `predict`. This method takes a list of integers called `values` as input and returns a list containing a single integer, specifically the number 1, regardless of the input values. Your task is to implement a function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_values([1, 2, 3]) == [1]\", \"assert predict_values([]) == [1]\", \"assert predict_values([-1, -2, -3]) == [1]\", \"assert predict_values([0]) == [1]\", \"assert predict_values([100, 200, 300]) == [1]\", \"assert predict_values([5]) == [1]\", \"asser...
{ "split": "train", "index": 75569, "acecode_id": "bigcode_python_fns_34331", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two positive integers n and m (n <= m). Your task is to find the weighted median of the integers ranging from n to m (inclusive), where the weights are determined by the sum of the factors of each integer. After computing the weighted median, round it to the close...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert weighted_median_custom_base(1, 5, 3) == '0b11'\", \"assert weighted_median_custom_base(7, 5, 3) == -1\", \"assert weighted_median_custom_base(1, 1, 4) == '0b1'\", \"assert weighted_median_custom_base(1, 10, 2) == -1\", \"assert weighted_median_custom_base(21...
{ "split": "train", "index": 75570, "acecode_id": "evol_34858", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are working on a project to analyze energy consumption data. Your task is to create a Python function that takes in a list of energy values and a threshold value. The function should return the number of energy values that exceed the given threshold. Write a Python function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_exceeding_energy([10.5, 20.3, 15.8, 25.2], 15.0) == 3\", \"assert count_exceeding_energy([1.0, 2.0, 3.0, 4.0, 5.0], 3.0) == 2\", \"assert count_exceeding_energy([5.5, 5.5, 5.5, 5.5], 5.5) == 0\", \"assert count_exceeding_energy([10.0, 20.0, 30.0, 40.0]...
{ "split": "train", "index": 75571, "acecode_id": "oss_13369", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if two 2D points are the same based on their x and y coordinates. Each point is represented by a tuple of two integers (x, y). The function should take two such tuples as input and return True if the points are equal (i.e....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_points_equal((3, 4), (3, 4)) == True\", \"assert are_points_equal((5, 6), (5, 6)) == True\", \"assert are_points_equal((0, 0), (0, 0)) == True\", \"assert are_points_equal((1, 2), (2, 1)) == False\", \"assert are_points_equal((10, 20), (10, 20)) == True\...
{ "split": "train", "index": 75572, "acecode_id": "oss_21522", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that converts a 2D point to its polar representation, considering a given origin point (a, b). The function should take four parameters: the x and y coordinates of the point to convert, and the x and y coordinates of the origin. The output should be a tuple co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_polar(1, 1, 0.5, 0.5) == (0.7071067811865476, 0.7853981633974483)\", \"assert convert_to_polar(0, 0, 0, 0) == (0.0, 0.0)\", \"assert convert_to_polar(1, 2, 1, 2) == (0.0, 0.0)\", \"assert convert_to_polar(-1, 1, -1, 0) == (1.0, 1.5707963267948966)...
{ "split": "train", "index": 75573, "acecode_id": "evol_9822", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function in Python that counts the number of prime numbers present in a two-dimensional array. Each sub-array can contain integers from 2 to N, where N is defined by the user when the function is called. Use recursion in your solution. You may use the Python math librar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_primes([[2, 3, 4], [5, 6, 7], [8, 9, 10]]) == 4\", \"assert count_primes([[1, 4, 6], [8, 10, 12], [14, 16, 18]]) == 0\", \"assert count_primes([[2, 2], [2, 3], [5, 11]]) == 6\", \"assert count_primes([[4, 6, 8], [9, 10, 12]]) == 0\", \"assert count_pri...
{ "split": "train", "index": 75574, "acecode_id": "evol_31464", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `word_counter(text: str) -> dict` that takes a string of text as input and returns a dictionary containing each unique word in the text (case-insensitive), along with the number of times each word occurs. The function should ignore punctuation and handle mu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_counter('I like dogs, cats and \\u0398\\u03c9\\u03bc\\u03ac\\u03c2. I like cats more than \\u0398\\u03c9\\u03bc\\u03ac\\u03c2!') == {'i': 2, 'like': 2, 'dogs': 1, 'cats': 2, 'and': 1, '\\u03b8\\u03c9\\u03bc\\u03ac\\u03c2': 2, 'more': 1, 'than': 1}\", \"...
{ "split": "train", "index": 75575, "acecode_id": "evol_2180", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines if a user has permission to access a specific page in a web application based on their role. The roles are defined as 'admin', 'owner', and 'member'. Only users with the role of 'admin' or 'owner' should have permission to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_permission('admin') == True\", \"assert has_permission('owner') == True\", \"assert has_permission('member') == False\", \"assert has_permission('guest') == False\", \"assert has_permission('admin') == True\", \"assert has_permission('owner') == True\", ...
{ "split": "train", "index": 75576, "acecode_id": "oss_21623", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a binary string composed of '0's and '1's as input, reverses the string, and then performs a bit-wise NOT operation on each bit in the reversed string. The function should return the final transformed string. The input will only consist of '0's a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert not_reverse_binary('010') == '101'\", \"assert not_reverse_binary('111') == '000'\", \"assert not_reverse_binary('000') == '111'\", \"assert not_reverse_binary('110011') == '001100'\", \"assert not_reverse_binary('1') == '0'\", \"assert not_reverse_binary('0...
{ "split": "train", "index": 75577, "acecode_id": "evol_31339", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that creates a representation of a regular expression node for a simple parser. The function `create_regex_node` takes a single argument `regex` which is a string representing a regular expression. Your goal is to create a dictionary ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_regex_node('a|b') == {'nodetype': 'REGULAR_EXPRESSION', 'raw': 'a|b', 'is_argument': True}\", \"assert create_regex_node('^abc$') == {'nodetype': 'REGULAR_EXPRESSION', 'raw': '^abc$', 'is_argument': True}\", \"assert create_regex_node('.*') == {'nodet...
{ "split": "train", "index": 75578, "acecode_id": "oss_16569", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a byte stream representing a GUID in raw mode (a sequence of 16 bytes), write a function `guid_bytes_to_string(stream: bytes) -> str` that converts this byte stream into a standard GUID string format. The GUID string format is represented as 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxx...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert guid_bytes_to_string(b'\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00\\\\x00') == '00000000-0000-0000-0000-000000000000'\", \"assert guid_bytes_to_string(b'\\\\xff\\\\xff\\\\xff\\\\xff\\\\xff\\\\xff\...
{ "split": "train", "index": 75579, "acecode_id": "bigcode_python_fns_29242", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that predicts the price of a cryptocurrency based on a specified model. The function should take in a list of predictions as input, where each prediction is represented by a dictionary containing a 'model' key (with values 0 for ARIMA...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_models([{'model': 0, 'predict': True}, {'model': 1, 'predict': True}, {'model': 2, 'predict': True}]) == ['ARIMA', 'Prophet', 'LSTM']\", \"assert predict_models([{'model': 0, 'predict': False}, {'model': 1, 'predict': True}, {'model': 2, 'predict': F...
{ "split": "train", "index": 75580, "acecode_id": "bigcode_python_fns_38251", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that retrieves a player's Steam ID from a given player's information dictionary. The player's information dictionary contains the player's name and their associated Steam ID. Write a function `get_steam_id` that takes one parameter...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_steam_id({'player': 'JohnDoe', 'steam_id_64': '12345678901234567'}) == '12345678901234567'\", \"assert get_steam_id({'player': 'JaneDoe', 'steam_id_64': '76543210987654321'}) == '76543210987654321'\", \"assert get_steam_id({'player': 'PlayerOne', 'steam_...
{ "split": "train", "index": 75581, "acecode_id": "oss_24623", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, return the list in the same order without any modifications. The input list will always contain the integers 13, 29, 37, and 42. Implement the function `get_array()` that returns this list.\nPlease reason step by step, then write a self-contained Pytho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_array() == [13, 29, 37, 42]\", \"assert len(get_array()) == 4\", \"assert get_array()[0] == 13\", \"assert get_array()[1] == 29\", \"assert get_array()[2] == 37\", \"assert get_array()[3] == 42\", \"assert isinstance(get_array(), list)\", \"assert all(is...
{ "split": "train", "index": 75582, "acecode_id": "evol_26819", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified battery management system for a device. The system needs to detect if AC power is connected and if the battery is successfully connected. Implement a function `battery_management_system()` that follows these conditions: 1. If AC pow...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert battery_management_system() == 0\", \"assert battery_management_system() == 0\", \"assert battery_management_system() == 0\", \"assert battery_management_system() == 0\", \"assert battery_management_system() == 0\", \"assert battery_management_system() == 0\...
{ "split": "train", "index": 75583, "acecode_id": "oss_13451", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a maze represented as a 2D grid, where each cell can be either a wall ('#') or an empty space ('.'). The player starts at the top-left corner of the maze and must reach the bottom-right corner by moving either down or right at each step. Write a function `canReach...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert canReachEnd([['#', '#'], ['#', '#']]) == False\", \"assert canReachEnd([['.', '.', '.'], ['#', '#', '.'], ['.', '.', '.']]) == True\", \"assert canReachEnd([['.', '.', '#'], ['.', '#', '.'], ['#', '.', '.']]) == False\", \"assert canReachEnd([['.', '#', '#']...
{ "split": "train", "index": 75584, "acecode_id": "oss_11520", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that counts the occurrences of each word in a given string. Your program should ignore punctuation and consider words in a case-insensitive manner. Additionally, the program should return the top N most frequently occurring words and their...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert top_n_words('Hello world! Hello.', 2) == [('hello', 2), ('world', 1)]\", \"assert top_n_words('Case sensitivity should not matter. Case should be counted.', 3) == [('case', 2), ('should', 2), ('sensitivity', 1)]\", \"assert top_n_words('Single word test test...
{ "split": "train", "index": 75585, "acecode_id": "oss_34528", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two lists of integers, determine if all elements in the first list are strictly less than the corresponding elements in the second list. Implement a function `is_less(list1, list2)` that takes in two lists and returns `True` if every element in `list1` is less than the co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_less([1, 2, 3], [2, 3, 4]) == True\", \"assert is_less([3, 5, 7], [2, 4, 8]) == False\", \"assert is_less([0, 0, 0], [1, 1, 1]) == True\", \"assert is_less([1, 2, 3], [1, 2, 3]) == False\", \"assert is_less([1], [2]) == True\", \"assert is_less([5, 6], [7...
{ "split": "train", "index": 75586, "acecode_id": "evol_25434", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D array representing a matrix of integers. Your task is to implement a Python function that calculates the sum of all elements in a specified row or column of the matrix. The function `calculate_sum(matrix, axis, index)` should take in three parameters: `matrix...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 'row', 0) == 6\", \"assert calculate_sum([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 'row', 1) == 15\", \"assert calculate_sum([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 'row', 2) == 24\", \"assert calculate_sum([[1, 2, 3], [4...
{ "split": "train", "index": 75587, "acecode_id": "oss_34440", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to process an address book and store the contact information in a dictionary. The address book contains pairs of contact names and their corresponding phone numbers. If a contact name already exists in the dictionary, the program should co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_addressbook([]) == {}\", \"assert process_addressbook([('Alice', '1234567890')]) == {'Alice': '1234567890'}\", \"assert process_addressbook([('Bob', '9876543210'), ('Alice', '1234567890')]) == {'Bob': '9876543210', 'Alice': '1234567890'}\", \"assert ...
{ "split": "train", "index": 75588, "acecode_id": "oss_25358", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `validate_input(data: List[float], allow_empty: bool = False, allow_constant: bool = True) -> List[float]` that validates a list of floating-point numbers. The function should raise a `TypeError` if the input is not a list of floats. It should also raise a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_input([1.0, 2.0, 3.0]) == [1.0, 2.0, 3.0]\", \"assert validate_input([1.0], allow_empty=False) == [1.0]\", \"assert validate_input([3.14, 3.14], allow_constant=True) == [3.14, 3.14]\", \"assert validate_input([1.0, 2.0, 3.0], allow_constant=True) ==...
{ "split": "train", "index": 75589, "acecode_id": "bigcode_python_fns_28231", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `find_square_root_bisection(x, epsilon)` that calculates the square root of a given positive number `x` using the bisection method. The function should take two parameters: a positive floating-point number `x` and a small positive floating-point number `eps...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(find_square_root_bisection(4, 0.01) - 2) < 0.01\", \"assert abs(find_square_root_bisection(9, 0.01) - 3) < 0.01\", \"assert abs(find_square_root_bisection(16, 0.01) - 4) < 0.01\", \"assert abs(find_square_root_bisection(25, 0.01) - 5) < 0.01\", \"assert ...
{ "split": "train", "index": 75590, "acecode_id": "oss_6657", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are developing a software application that needs to process a sequence of commands in a specific order. Design a Python function called `execute_commands` that executes three predefined operations sequentially: `operation_a`, `operation_b`, and `operation_c`. Each operation...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_commands() == None\", \"assert operation_a() == 'Operation A executed'\", \"assert operation_b() == 'Operation B executed'\", \"assert operation_c() == 'Operation C executed'\", \"assert execute_commands() == None\", \"assert operation_a() == 'Operat...
{ "split": "train", "index": 75591, "acecode_id": "oss_20321", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that modifies a configuration string. Given a multi-line string representing the content of a configuration file, your function should replace any line containing a specific keyword with a new line that specifies a new setting value. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert patch_configuration('setting1 = true\\\\nsetting2 = false', 'setting3', 'new_value') == 'setting1 = true\\\\nsetting2 = false'\", \"assert patch_configuration('a = 1\\\\nb = 2\\\\nc = 3', 'd', '4') == 'a = 1\\\\nb = 2\\\\nc = 3'\", \"assert patch_configurati...
{ "split": "train", "index": 75592, "acecode_id": "oss_48", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a process state. The function should accept a boolean parameter `signal` that indicates whether to stop the process. If `signal` is `True`, the function should return 'Process stopped'. If `signal` is `False`, the functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_process(True) == 'Process stopped'\", \"assert manage_process(False) == 'Process running'\", \"assert manage_process(True) == 'Process stopped'\", \"assert manage_process(False) == 'Process running'\", \"assert manage_process(True) == 'Process stopped...
{ "split": "train", "index": 75593, "acecode_id": "oss_35532", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of bounding boxes represented as a list of lists, where each bounding box is defined by its center (x, y), width, height, and an objectness score. Your task is to filter out the bounding boxes that have an objectness score below a given confidence threshold...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_bounding_boxes([[1, 1, 2, 2, 0.5], [2, 2, 2, 2, 0.6], [3, 3, 2, 2, 0.3]], 0.4) == [[0.0, 0.0, 2.0, 2.0], [1.0, 1.0, 3.0, 3.0]]\", \"assert process_bounding_boxes([[1, 1, 2, 2, 0.9], [2, 2, 2, 2, 0.8]], 0.7) == [[0.0, 0.0, 2.0, 2.0], [1.0, 1.0, 3.0, 3...
{ "split": "train", "index": 75594, "acecode_id": "bigcode_python_fns_32554", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a Python function that uses recursion to multiply two floating-point numbers without using the '*' operator. The function should handle negative numbers and zero correctly. Function signature: def recursiveMultiply(number1: float, number2: float) -> float.\nPlease rea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert recursiveMultiply(0, 5) == 0\", \"assert recursiveMultiply(5, 0) == 0\", \"assert recursiveMultiply(3, 4) == 12\", \"assert recursiveMultiply(-3, 4) == -12\", \"assert recursiveMultiply(3, -4) == -12\", \"assert recursiveMultiply(-3, -4) == 12\", \"assert re...
{ "split": "train", "index": 75595, "acecode_id": "evol_29316", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple application manager that allows users to install and uninstall applications for specific targets. Each application can only be installed once on a target. If an application is installed again on the same target, it should overwrite the exis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_applications([('install', 1), ('install', 1), ('uninstall', 1), ('install', 2), ('uninstall', 2)]) == [1, 1, 0, 1, 0]\", \"assert manage_applications([('install', 1), ('uninstall', 1), ('install', 1), ('install', 1)]) == [1, 0, 1, 1]\", \"assert manag...
{ "split": "train", "index": 75596, "acecode_id": "bigcode_python_fns_23105", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that finds the k-th smallest prime number in the array. If there are not enough prime numbers, the function should return 'Not enough prime numbers in the array.'\nPlease reason step by step, then write a self-contained Python soluti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_smallest_prime([29, 2, 5, 11, 19, 23], 3) == 11\", \"assert find_smallest_prime([4, 6, 8, 10], 1) == 'Not enough prime numbers in the array.'\", \"assert find_smallest_prime([3, 5, 7, 2], 2) == 3\", \"assert find_smallest_prime([1, 4, 6, 8, 10], 1) == '...
{ "split": "train", "index": 75597, "acecode_id": "evol_29456", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that modifies the numbers based on a boolean flag. If the flag is True, the function should double all even numbers in the list. If the flag is False, the function should square all odd numbers in the list. If the input list is emp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_numbers([], True) == []\", \"assert modify_numbers([], False) == []\", \"assert modify_numbers([1, 2, 3, 4], True) == [1, 4, 3, 8]\", \"assert modify_numbers([0, 1, 2, 3], True) == [0, 1, 4, 3]\", \"assert modify_numbers([10, 15, 20, 25], True) == [20...
{ "split": "train", "index": 75598, "acecode_id": "oss_35194", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `has_duplicates(lst)` that takes a list of integers as input and returns `True` if there are any repeating elements in the list, otherwise returns `False`. For example, given the input list [1, 2, 3, 4], the function should return `False` as there are no du...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_duplicates([1, 2, 3, 4]) == False\", \"assert has_duplicates([1, 2, 3, 3]) == True\", \"assert has_duplicates([1, 1, 1, 1]) == True\", \"assert has_duplicates([5, 4, 3, 2, 1]) == False\", \"assert has_duplicates([2, 4, 6, 8, 2]) == True\", \"assert has_d...
{ "split": "train", "index": 75599, "acecode_id": "evol_6973", "num_tests": 16 }