data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates rolling two dice and returns the sum of the values obtained from each die. Your function should generate two random integers between 1 and 6 (inclusive), representing the results of rolling two six-sided dice, calculate the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert roll_dice() >= 2 and roll_dice() <= 12\", \"assert roll_dice() >= 2 and roll_dice() <= 12\", \"assert roll_dice() >= 2 and roll_dice() <= 12\", \"assert roll_dice() >= 2 and roll_dice() <= 12\", \"assert roll_dice() >= 2 and roll_dice() <= 12\", \"assert rol... | {
"split": "train",
"index": 80800,
"acecode_id": "oss_17106",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `factorial_tuple(tup)` that takes a tuple `tup` as input and calculates the factorial of each integer element in the tuple. The function should handle nested tuples (tuples within tuples) of any depth and return a list of the calculated factorials. If the t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial_tuple(()) == 'Error: Tuple is empty'\", \"assert factorial_tuple((1, 2, 3)) == [1, 2, 6]\", \"assert factorial_tuple((5, (2, 3))) == [120, 2, 6]\", \"assert factorial_tuple((4, (1, (0, 2)))) == [24, 1, 1, 2]\", \"assert factorial_tuple(((2, 3), (4,... | {
"split": "train",
"index": 80801,
"acecode_id": "evol_18271",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `factorial(n: int) -> int` that returns the factorial of a given positive integer n. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. You can assume that the input n is always a positive integer grea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"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(8) == 40320\", \"assert factor... | {
"split": "train",
"index": 80802,
"acecode_id": "evol_20586",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the distance between two geographical points given their coordinates. Each point is defined by a tuple containing its latitude and longitude. Your function should take the coordinates of two points and return the distance ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(calculate_distance((0, 0), (0, 0)) - 0.0) < 1e-6\", \"assert abs(calculate_distance((0, 0), (90, 0)) - 10007.543398) < 1e-6\", \"assert abs(calculate_distance((0, 0), (0, 90)) - 10007.543398) < 1e-6\", \"assert abs(calculate_distance((34.0522, -118.2437)... | {
"split": "train",
"index": 80803,
"acecode_id": "oss_6227",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of node tags represented as strings, where each tag corresponds to a specific type of node in a 3D scene. Your task is to implement a function `load_node_type(tags: List[str]) -> List[str]` that returns a list of corresponding node types based on the follow... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_node_type(['node']) == ['Node']\", \"assert load_node_type(['translate']) == ['TranslateTransform']\", \"assert load_node_type(['rotate']) == ['RotateTransform']\", \"assert load_node_type(['scale']) == ['ScaleTransform']\", \"assert load_node_type(['ma... | {
"split": "train",
"index": 80804,
"acecode_id": "bigcode_python_fns_1914",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a vocabulary from a list of words. The function should take a list of strings as input and return a set containing all unique words from the list. Additionally, the function should ignore case, meaning that 'Word' an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_vocabulary(['apple', 'banana', 'Apple', 'banana']) == {'apple', 'banana'}\", \"assert generate_vocabulary(['hello', 'world', 'Hello', 'WORLD']) == {'hello', 'world'}\", \"assert generate_vocabulary(['LeetCode', 'leetcode', 'LEETCODE']) == {'leetcode... | {
"split": "train",
"index": 80805,
"acecode_id": "oss_10242",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of unique pairs of integer ranges, e.g. [(2,6), (8,10)], write a Python function that returns the pair with the maximum sum of integers in that range. If the input contains overlapping or invalid integer ranges, raise a ValueError. Each pair must be a tuple of two ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_and_find_max_sum([(1, 3), (4, 6)]) == [(4, 6)]\", \"assert print_and_find_max_sum([(1, 2), (3, 4), (5, 6)]) == [(5, 6)]\", \"assert print_and_find_max_sum([(0, 1), (2, 3)]) == [(2, 3)]\", \"assert print_and_find_max_sum([(5, 10), (1, 4)]) == [(5, 10)]\... | {
"split": "train",
"index": 80806,
"acecode_id": "evol_4189",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of names and removes all names that do not end with a consonant. The function should preserve the original order of the remaining names and handle inputs in different cases. The implementation should avoid using built-in functions except for t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_names(['Zoe', 'Emma', 'Liam', 'Noah']) == ['Liam', 'Noah']\", \"assert remove_names(['Neal', 'Orson', 'Eli', 'Sam']) == ['Neal', 'Orson', 'Sam']\", \"assert remove_names(['Olivia', 'Ethan', 'Isla', 'Emma']) == ['Ethan']\", \"assert remove_names(['Anna... | {
"split": "train",
"index": 80807,
"acecode_id": "evol_2833",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if two strings can be made equal by replacing some characters in the first string with asterisks in the same order as they appear in the second string. The function should return the minimal number of replacements needed to make the first string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimal_replacements('abc', 'a*c') == 1\", \"assert minimal_replacements('abcd', 'a*d') == 2\", \"assert minimal_replacements('aaaa', 'a*aa') == 1\", \"assert minimal_replacements('testcase', 't*stcase') == 1\", \"assert minimal_replacements('a', 'b') == 1\"... | {
"split": "train",
"index": 80808,
"acecode_id": "evol_21141",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple stack data structure in Python. A stack is a Last-In-First-Out (LIFO) data structure, where elements are added and removed from the top of the stack. Your implementation should include the following functionalities: 1. `push(item)`: Add... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stack_operations([('push', 1), ('push', 2), ('push', 3), ('pop',), ('is_empty',), ('pop',), ('pop',), ('is_empty',)]) == [3, False, 2, 1, True]\", \"assert stack_operations([('push', 42), ('pop',), ('pop',)]) == [42, None]\", \"assert stack_operations([('is_... | {
"split": "train",
"index": 80809,
"acecode_id": "oss_228",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional array of integers, implement a function that counts the quantity of odd numbers in each sub-array and calculates the sum of all odd numbers in the entire two-dimensional array. Your function should return a list of dictionaries where each dictionary cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_and_sum_odds([[1,2,3,4,5],[6,7,8,9,10],[-7,-6,-5,-4,-3]]) == [{'Odd numbers in 1th array': 3, 'Sum': 9}, {'Odd numbers in 2th array': 2, 'Sum': 16}, {'Odd numbers in 3th array': 3, 'Sum': -15}, {'Total sum of all odd numbers': 10}]\", \"assert count_an... | {
"split": "train",
"index": 80810,
"acecode_id": "evol_1794",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that calculates the nth Fibonacci number. Your function should take a single integer input n and return the nth Fibonacci number, where the Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, F(2) = 1, F(3) = 2, F(4) = 3, F(5) = ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Fibonacci(0) == 0\", \"assert Fibonacci(1) == 1\", \"assert Fibonacci(2) == 1\", \"assert Fibonacci(3) == 2\", \"assert Fibonacci(4) == 3\", \"assert Fibonacci(5) == 5\", \"assert Fibonacci(6) == 8\", \"assert Fibonacci(7) == 13\", \"assert Fibonacci(8) == 2... | {
"split": "train",
"index": 80811,
"acecode_id": "evol_23202",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that converts it to a YAML pipe literal format. A YAML pipe literal format represents multi-line strings and begins with a pipe symbol ('|'). The function should return the input string formatted as a YAML pipe literal. Ensure that each line... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_yaml_pipe_literal('Hello, World!') == \\\"|\\\\n 'Hello, World!'\\\"\", \"assert convert_to_yaml_pipe_literal('This is a test.') == \\\"|\\\\n 'This is a test.'\\\"\", \"assert convert_to_yaml_pipe_literal('Line 1\\\\nLine 2\\\\nLine 3') == \\\"... | {
"split": "train",
"index": 80812,
"acecode_id": "bigcode_python_fns_21138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine whether a given string is 'nice' according to a specific set of rules. A string is considered 'nice' if it contains at least one pair of two letters that appears at least twice in the string without overlapping, and it al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isNice('xyxy') == True\", \"assert isNice('aabcdefgaa') == False\", \"assert isNice('aaa') == False\", \"assert isNice('qwertyuiop') == False\", \"assert isNice('aabbcc') == False\", \"assert isNice('xyxzyx') == True\", \"assert isNice('abab') == True\", \"a... | {
"split": "train",
"index": 80813,
"acecode_id": "oss_23101",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns a dictionary containing the details of a specific source. The function should be named `get_digiwhist_source_details`. It should not take any parameters. The returned dictionary should have the keys 'publisher_name' and 'url'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_digiwhist_source_details() == {'publisher_name': 'Greece Republic', 'url': 'https://opentender.eu/download'}\", \"assert get_digiwhist_source_details()['publisher_name'] == 'Greece Republic'\", \"assert get_digiwhist_source_details()['url'] == 'https://o... | {
"split": "train",
"index": 80814,
"acecode_id": "oss_34194",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of scorekeeper names and their corresponding appearances in a game. Your function should return a dictionary where each scorekeeper's name is a key and their total appearances are the values. Given a list of tuples w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert aggregate_appearances([('Alice', 5), ('Bob', 3), ('Alice', 2)]) == {'Alice': 7, 'Bob': 3}\", \"assert aggregate_appearances([('Charlie', 4), ('Alice', 1), ('Charlie', 2)]) == {'Charlie': 6, 'Alice': 1}\", \"assert aggregate_appearances([('Alice', 0), ('Bob',... | {
"split": "train",
"index": 80815,
"acecode_id": "bigcode_python_fns_25760",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of chemical reactions and a dictionary of species data, where each reaction consists of a set of reactants. Your task is to compute the total energy for a given reference reaction at 0K. The total energy is calculated by summing the energies of each reactan... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_energy([('R1', (['A', 'B'], ['C'])), ('R2', (['D'], ['E']))], {'A': {'ene': [1.0]}, 'B': {'ene': [2.0]}, 'C': {'ene': [3.0]}, 'D': {'ene': [4.0]}, 'E': {'ene': [5.0]}}, 0) == 3.0\", \"assert calculate_total_energy([('R1', (['H2', 'O2'], ['H2O... | {
"split": "train",
"index": 80816,
"acecode_id": "bigcode_python_fns_40433",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `author_name`, which represents the username of an item's author. Your task is to implement a function `check_author_username(current_username: str, author_name: str) -> bool` that checks if the provided `current_username` matches the `author_name`. If th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_author_username('Alice', 'Alice') == True\", \"assert check_author_username('alice', 'Alice') == False\", \"assert check_author_username('Bob', 'Bob') == True\", \"assert check_author_username('Charlie', 'charlie') == False\", \"assert check_author_use... | {
"split": "train",
"index": 80817,
"acecode_id": "bigcode_python_fns_45654",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of a game. Your task is to implement a function `calculate_final_score(scores)` that calculates the final score based on the following rules: - The final score is the sum of the highest three scores in the list. - If the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_final_score([10, 20, 30, 40, 50]) == 120\", \"assert calculate_final_score([8, 15, 25]) == 48\", \"assert calculate_final_score([12, 5]) == 17\", \"assert calculate_final_score([30]) == 30\", \"assert calculate_final_score([1, 2, 3, 4, 5]) == 12\",... | {
"split": "train",
"index": 80818,
"acecode_id": "oss_20722",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the CPU times spent in different modes (i.e., user, nice, system, idle). Your task is to create a function `get_cpu_usage(cpu_times: List[int]) -> float` that calculates the percentage of CPU usage. The CPU usage percentage is calcu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_cpu_usage([0, 0, 0, 0]) == 0.0\", \"assert get_cpu_usage([0, 0, 100, 0]) == 100.0\", \"assert get_cpu_usage([1, 1, 1, 1]) == 75.0\", \"assert get_cpu_usage([10, 20, 30, 40]) == 60.0\", \"assert get_cpu_usage([50, 50, 50, 50]) == 75.0\", \"assert get_cpu_... | {
"split": "train",
"index": 80819,
"acecode_id": "bigcode_python_fns_888",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Check if Number is a Sum of Distinct Powers of Two and Three\n\nGiven an integer `n`, return `true` if it is possible to represent `n` as the sum of distinct powers of three and two. Otherwise, return `false`. An integer `y` is a power of three if there exists an integer `x` su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert canRepresent(13) == True\", \"assert canRepresent(91) == True\", \"assert canRepresent(21) == False\", \"assert canRepresent(2) == True\", \"assert canRepresent(3) == True\", \"assert canRepresent(4) == True\", \"assert canRepresent(5) == True\", \"assert ca... | {
"split": "train",
"index": 80820,
"acecode_id": "evol_27757",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that evaluates a simple mathematical SQL statement in the form of 'SELECT <expression>;' where <expression> is a valid arithmetic expression consisting of non-negative integers and the operators +, -, *, and /. Your function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_sql_expression('SELECT 1 + 1;') == 2.0\", \"assert evaluate_sql_expression('SELECT 5 - 3;') == 2.0\", \"assert evaluate_sql_expression('SELECT 10 * 2;') == 20.0\", \"assert evaluate_sql_expression('SELECT 8 / 4;') == 2.0\", \"assert evaluate_sql_exp... | {
"split": "train",
"index": 80821,
"acecode_id": "bigcode_python_fns_24305",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns a new string with all uppercase letters converted to lowercase. The function should not modify any characters that are already in lowercase. The input string may contain letters, numbers, and special characters.\nPle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_lower('HELLO') == 'hello'\", \"assert convert_to_lower('Hello World!') == 'hello world!'\", \"assert convert_to_lower('python3.8') == 'python3.8'\", \"assert convert_to_lower('UPPERCASE') == 'uppercase'\", \"assert convert_to_lower('lowercase') ==... | {
"split": "train",
"index": 80822,
"acecode_id": "evol_13592",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of elements and sorts it in descending order. The function should be able to handle elements of any data type that can be compared (e.g., integers, floats, strings). You can use any sorting algorithm of your choice. The function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_descending([5, 1, 3, 2, 4]) == [5, 4, 3, 2, 1]\", \"assert sort_descending(['apple', 'orange', 'banana', 'kiwi']) == ['orange', 'kiwi', 'banana', 'apple']\", \"assert sort_descending([1.2, 3.4, 2.2, 0.8]) == [3.4, 2.2, 1.2, 0.8]\", \"assert sort_descend... | {
"split": "train",
"index": 80823,
"acecode_id": "evol_6096",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a decoding system that converts a number from octal format to hexadecimal format. Your task is to implement the function `dec_hex(dec)` that takes a string `dec` representing a number in octal format and returns the corresponding hexadecimal str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dec_hex('0') == '0'\", \"assert dec_hex('1') == '1'\", \"assert dec_hex('10') == '8'\", \"assert dec_hex('11') == '9'\", \"assert dec_hex('12') == 'a'\", \"assert dec_hex('17') == 'f'\", \"assert dec_hex('20') == '10'\", \"assert dec_hex('30') == '18'\", \"a... | {
"split": "train",
"index": 80824,
"acecode_id": "oss_278",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing multiple spectra, where each dictionary contains the following keys: 'total_flux', 'spectrum_filename', and 'spectrum_stride'. Your task is to create a function `get_spectrum_data(spectra)` that takes in a list of these dictiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_spectrum_data([{'total_flux': 5.0, 'spectrum_filename': 'spectrum1.txt', 'spectrum_stride': 10}]) == [(5.0, 'spectrum1.txt', 10)]\", \"assert get_spectrum_data([{'total_flux': 3.5, 'spectrum_filename': 'spectrum2.txt', 'spectrum_stride': 12}, {'total_flu... | {
"split": "train",
"index": 80825,
"acecode_id": "bigcode_python_fns_15501",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of command-line argument strings based on a given configuration dictionary. The configuration dictionary contains key-value pairs representing argument names and their corresponding default values. The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_arguments({'arg1': 10, 'arg2': 'test'}) == ['config_file', '--arg1 10', '--arg2 test']\", \"assert generate_arguments({'name': 'John', 'age': 30}) == ['config_file', '--name John', '--age 30']\", \"assert generate_arguments({'flag': True, 'count': 5... | {
"split": "train",
"index": 80826,
"acecode_id": "bigcode_python_fns_10132",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of function names as strings. Write a function that checks whether each function name starts with a double underscore '__'. The function should return a list of boolean values where each entry corresponds to whether the function name starts with '__'. For e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_double_underscore(['__init__', 'my_function', '__str__', 'anotherFunction']) == [True, False, True, False]\", \"assert check_double_underscore(['__private_method', 'publicMethod', '__private']) == [True, False, True]\", \"assert check_double_underscore... | {
"split": "train",
"index": 80827,
"acecode_id": "bigcode_python_fns_47324",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the range of a laser module in meters based on given data. You will implement a function named `calculate_laser_range` that accepts the following parameters: \n\n- `data`: A list containing information about the laser module. The first element is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_laser_range(['Laser', 1, 1000]) == 1.0\", \"assert calculate_laser_range(['Laser', 2, 1500]) == 1.5\", \"assert calculate_laser_range(['Laser', 3, 2000]) == 2.0\", \"assert calculate_laser_range(['Laser', 4, 0]) == 0.0\", \"assert calculate_laser_r... | {
"split": "train",
"index": 80828,
"acecode_id": "oss_16366",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to normalize a given kernel matrix. A kernel matrix is a symmetric matrix used in various computational tasks, such as image processing and machine learning. Normalizing a kernel matrix involves dividing each element by the sum of all... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_kernel([[0, 0], [0, 0]]) == [[0.0, 0.0], [0.0, 0.0]]\", \"assert normalize_kernel([[1]]) == [[1.0]]\", \"assert normalize_kernel([[1, 1], [1, 1]]) == [[0.25, 0.25], [0.25, 0.25]]\", \"assert normalize_kernel([[10, 20], [30, 40]]) == [[0.1, 0.2], [0... | {
"split": "train",
"index": 80829,
"acecode_id": "oss_31522",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of examples where each example consists of three lists: tokens, labels, and predictions. Each of these lists contains strings. Your task is to implement a function that takes this list of examples and returns a single string formatted in the CoNLL file form... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_conll([[['word1', 'word2'], ['label1', 'label2'], ['pred1', 'pred2']]]) == 'word1\\\\tlabel1\\\\tpred1\\\\nword2\\\\tlabel2\\\\tpred2\\\\n\\\\n'\", \"assert format_conll([[['a', 'b', 'c'], ['x', 'y', 'z'], ['1', '2', '3']]]) == 'a\\\\tx\\\\t1\\\\nb\\\... | {
"split": "train",
"index": 80830,
"acecode_id": "bigcode_python_fns_32611",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that simulates the behavior of processes with different priorities. The function, `simulate_process_runtime`, takes in two parameters: `priority` (a string that can be either 'high' or 'low') and `duration` (an integer representing the tim... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_process_runtime('high', 31) == 'Process terminated: high priority process exceeded its runtime limit.'\", \"assert simulate_process_runtime('low', 16) == 'Process terminated: low priority process exceeded its runtime limit.'\", \"assert simulate_pro... | {
"split": "train",
"index": 80831,
"acecode_id": "evol_14321",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer `n`, write a function that returns the largest prime factor of `n`. A prime factor is a factor that is a prime number. If `n` is prime itself, return `n`. The input number will be a positive integer up to `10^12`.\nPlease reason step by step, then write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_prime_factor(600851475143) == 6857\", \"assert largest_prime_factor(3000) == 5\", \"assert largest_prime_factor(29) == 29\", \"assert largest_prime_factor(10) == 5\", \"assert largest_prime_factor(49) == 7\", \"assert largest_prime_factor(100) == 5\"... | {
"split": "train",
"index": 80832,
"acecode_id": "bigcode_python_fns_44031",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple game of rock-paper-scissors. Implement the function `rock_paper_scissors(user_choice)`, which takes a string `user_choice` representing the user's input (either 'rock', 'paper', or 'scissors'). The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rock_paper_scissors('rock') in ['User wins!', 'Computer wins!', 'Tie!']\", \"assert rock_paper_scissors('paper') in ['User wins!', 'Computer wins!', 'Tie!']\", \"assert rock_paper_scissors('scissors') in ['User wins!', 'Computer wins!', 'Tie!']\", \"assert r... | {
"split": "train",
"index": 80833,
"acecode_id": "oss_30806",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_professor_details(name: str, university: str, title: str, num_papers: int, avg_student_rating: float) -> str` that takes a professor's name, affiliated university, academic title, number of published research papers, and average student rating as input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_professor_details('Alice Johnson', 'Harvard University', 'Professor', 150, 4.8) == 'Professor Name: Alice Johnson, Affiliated University: Harvard University, Academic Title: Professor, Number of Published Research Papers: 150, Average Student Rating: 4.8... | {
"split": "train",
"index": 80834,
"acecode_id": "evol_15615",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function called `get_sorted_unique_models` that accepts a list of rack models as input and returns a sorted list of unique rack models. Each rack model is represented as a string. Your function should ensure that the output list contains no duplicates an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sorted_unique_models(['modelA', 'modelB', 'modelA', 'modelC']) == ['modelA', 'modelB', 'modelC']\", \"assert get_sorted_unique_models(['modelX', 'modelY', 'modelX', 'modelZ', 'modelY']) == ['modelX', 'modelY', 'modelZ']\", \"assert get_sorted_unique_mode... | {
"split": "train",
"index": 80835,
"acecode_id": "bigcode_python_fns_15123",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a leave management validation system for an organization. The system should validate the type of leave applied for by an employee. The leave can either be leave without pay (LWP) or partial pay leave (PPL), but not both at the same time. You nee... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_leave_type(True, True) == 'Leave Type can be either without pay or partial pay'\", \"assert validate_leave_type(True, False) == ''\", \"assert validate_leave_type(False, True) == ''\", \"assert validate_leave_type(False, False) == ''\", \"assert val... | {
"split": "train",
"index": 80836,
"acecode_id": "oss_37334",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that parses a list of URL patterns and returns a dictionary mapping each URL pattern to its corresponding view function. The URL patterns are represented as a list of tuples, where each tuple contains a URL pattern as a string and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_url_patterns([(r'^home/', 'home_view'), (r'^about/', 'about_view'), (r'^contact/', 'contact_view')]) == {'^home/': 'home_view', '^about/': 'about_view', '^contact/': 'contact_view'}\", \"assert parse_url_patterns([(r'^products/', 'products_view')]) == ... | {
"split": "train",
"index": 80837,
"acecode_id": "oss_4081",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a currency conversion function that converts a given amount in Brazilian reais (BRL) to British pounds (GBP). You are given an amount in reais and a constant exchange rate that represents the conversion rate from BRL to GBP. Implement a function `co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_pounds(500, 7.5) == 66.66666666666667\", \"assert convert_to_pounds(1000, 5.0) == 200.0\", \"assert convert_to_pounds(0, 10.0) == 0.0\", \"assert convert_to_pounds(750, 3.5) == 214.28571428571428\", \"assert convert_to_pounds(1200, 6.0) == 200.0\"... | {
"split": "train",
"index": 80838,
"acecode_id": "oss_19610",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing marker IDs. Your task is to implement a function that creates a plot description for each marker by generating a string that describes the marker based on its ID. Each marker description should follow the format: 'Marker <marker_id>... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert plot_marker_descriptions([1, 2, 3]) == ['Marker 1 is plotted with corresponding reference and model values. This marker is odd', 'Marker 2 is plotted with corresponding reference and model values. This marker is even', 'Marker 3 is plotted with corresponding... | {
"split": "train",
"index": 80839,
"acecode_id": "bigcode_python_fns_8236",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of parameters and generates a configuration dictionary. The function should take a list of tuples, where each tuple contains a parameter name and its corresponding value. The function should return a dictionary where... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_config([('crt_hruflg', 1), ('crt_flowflg', 0), ('crt_dpit', 0.01)]) == {'crt_hruflg': 1, 'crt_flowflg': 0, 'crt_dpit': 0.01}\", \"assert generate_config([('crt_hruflg', 1), ('crt_flowflg', 0), ('crt_dpit', 0)]) == {'crt_hruflg': 1, 'crt_flowflg': 0,... | {
"split": "train",
"index": 80840,
"acecode_id": "bigcode_python_fns_19702",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of stop areas along with their associated locality references and the count of stop points in each locality, write a function `get_dominant_locality(stop_areas: List[Tuple[str, str, int]]) -> List[Tuple[str, str]]` that returns a list of tuples containing the stop ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_dominant_locality([('SA1', 'L1', 2), ('SA1', 'L2', 2), ('SA1', 'L3', 1)]) == [('SA1', 'L1'), ('SA1', 'L2')]\", \"assert get_dominant_locality([('SA1', 'L1', 10), ('SA2', 'L1', 10), ('SA2', 'L2', 5)]) == [('SA1', 'L1'), ('SA2', 'L1')]\", \"assert get_domi... | {
"split": "train",
"index": 80841,
"acecode_id": "bigcode_python_fns_19185",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing only lowercase English letters. Your task is to write a function that compresses the string by replacing consecutive identical characters with a single instance of the character followed by the number of times it appears consecutively. If the c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compressString('abc') == 'abc'\", \"assert compressString('aabbcc') == 'aabbcc'\", \"assert compressString('aaabbbccc') == 'a3b3c3'\", \"assert compressString('abcd') == 'abcd'\", \"assert compressString('a') == 'a'\", \"assert compressString('aaa') == 'a3'\... | {
"split": "train",
"index": 80842,
"acecode_id": "oss_30536",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `pattern` that may contain special characters `?` and `*`, and a string `text`, write a function `match(pattern: str, text: str) -> bool` that checks if the `text` matches the `pattern`. The character `?` matches any single character, while the character `*` matc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match('a*b', 'aaab') == True\", \"assert match('a?b', 'acb') == True\", \"assert match('a?b', 'ab') == False\", \"assert match('a*b', 'ab') == True\", \"assert match('a*b', 'a') == False\", \"assert match('*', 'anything') == True\", \"assert match('a*', 'a')... | {
"split": "train",
"index": 80843,
"acecode_id": "bigcode_python_fns_14764",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a directory name for a satellite based on its metadata. The metadata is provided as a dictionary with a key 'satId' that contains a string. Your function should extract the second character from the 'satId' string and prepe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert makeSatelliteDir({'satId': 'A1B'}) == 'Sentinel-1'\", \"assert makeSatelliteDir({'satId': 'X2Y'}) == 'Sentinel-2'\", \"assert makeSatelliteDir({'satId': 'C3D'}) == 'Sentinel-3'\", \"assert makeSatelliteDir({'satId': 'E4F'}) == 'Sentinel-4'\", \"assert makeSa... | {
"split": "train",
"index": 80844,
"acecode_id": "bigcode_python_fns_38393",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list (matrix) of integers where each row represents a series of numbers. Your task is to write a function that shifts all non-zero integers in each row of the matrix to the left, maintaining their relative order, and fills the remaining spaces with zeros. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert displacement_numbers([[0, 0, 0], [0, 0, 0]]) == ([[0, 0, 0], [0, 0, 0]], False)\", \"assert displacement_numbers([[0, 0, 0], [0, 0, 0]]) == ([[0, 0, 0], [0, 0, 0]], False)\", \"assert displacement_numbers([[1, 0, 1], [0, 0, 0]]) == ([[1, 1, 0], [0, 0, 0]], T... | {
"split": "train",
"index": 80845,
"acecode_id": "bigcode_python_fns_48271",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a data processing function for an optical communication system. The system organizes data based on the number of modules in a cascade and metadata information. Your task is to write a function `process_data` that takes the following parameters: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data(1, 'metadata1', 'signal1', 'output1') == {1: {'metadata1': [['signal1', 'output1']]}}\", \"assert process_data(1, 'metadata1', 'signal1', 'output1') == {1: {'metadata1': [['signal1', 'output1']]}}\", \"assert process_data(2, 'metadata2', 'signal... | {
"split": "train",
"index": 80846,
"acecode_id": "oss_5013",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a file name with an extension, write a function that extracts and returns the name of the file without its extension. The input will always be a valid file name containing a dot (.) indicating the start of the extension. You should only return the na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_file_name('document.pdf') == 'document'\", \"assert split_file_name('photo.jpeg') == 'photo'\", \"assert split_file_name('archive.zip') == 'archive'\", \"assert split_file_name('notes.txt') == 'notes'\", \"assert split_file_name('presentation.pptx') ==... | {
"split": "train",
"index": 80847,
"acecode_id": "bigcode_python_fns_4610",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing dates in the format 'YYYY-MM-DD'. Your task is to implement a function `convert_dates(dates: List[str]) -> List[Optional[str]]` that converts each date string in the list to a standardized format 'YYYY/MM/DD'. If the date string is N... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_dates(['2023-01-01', '2022-12-31']) == ['2023/01/01', '2022/12/31']\", \"assert convert_dates(['2023-02-29']) == [None]\", \"assert convert_dates(['2024-02-29']) == ['2024/02/29']\", \"assert convert_dates(['2023-04-31']) == [None]\", \"assert conver... | {
"split": "train",
"index": 80848,
"acecode_id": "bigcode_python_fns_37939",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function named 'mergeStrings' that takes two string parameters and returns a new string formed by concatenating the first string with the second string. For example, if the input strings are 'Good' and 'Morning', the function should return 'GoodMorning'.\nPlease ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mergeStrings('Good', 'Morning') == 'GoodMorning'\", \"assert mergeStrings('Python', 'Programming') == 'PythonProgramming'\", \"assert mergeStrings('Leet', 'Code') == 'LeetCode'\", \"assert mergeStrings('Data', 'Science') == 'DataScience'\", \"assert mergeStr... | {
"split": "train",
"index": 80849,
"acecode_id": "evol_21728",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether a given integer falls within a specified inclusive range. The function should take three parameters: a number to check, a minimum value, and a maximum value. If the number is within the range (inclusive), return Tr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_number_in_range(7, 5, 10) == True\", \"assert check_number_in_range(5, 5, 10) == True\", \"assert check_number_in_range(10, 5, 10) == True\", \"assert check_number_in_range(4, 5, 10) == False\", \"assert check_number_in_range(11, 5, 10) == False\", \"a... | {
"split": "train",
"index": 80850,
"acecode_id": "bigcode_python_fns_3648",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of words, implement a function that returns a new list containing only those words that include the vowel 'e'. Your implementation should not use any list comprehensions or built-in Python functions like filter(), map(), or reduce(). The function should take a sing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_words(['cat', 'dog', 'fish']) == []\", \"assert filter_words(['peach', 'pear', 'plum']) == ['peach', 'pear']\", \"assert filter_words(['hello', 'world', 'python']) == ['hello']\", \"assert filter_words(['egg', 'milk', 'cheese']) == ['egg', 'cheese']\"... | {
"split": "train",
"index": 80851,
"acecode_id": "evol_26369",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a JSON schema and a JSON object. Your task is to implement a function that checks whether the JSON object conforms to the provided schema. The schema is defined using a subset of the JSON Schema Draft 2020-12, which supports the following types: 'object', 'array',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_json({'type': 'object', 'properties': {'name': {'type': 'string'}}}, {'name': 'Alice'}) == True\", \"assert validate_json({'type': 'object', 'properties': {'age': {'type': 'number'}}}, {'age': 30}) == True\", \"assert validate_json({'type': 'array',... | {
"split": "train",
"index": 80852,
"acecode_id": "bigcode_python_fns_7825",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a registry of custom operators for a computation engine. Implement a function `unregister_custom_op(op_name: str) -> None` that removes a custom operator from the registry given its name. The registry is represented as a dictionary called `bound_op_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unregister_custom_op('add') is None and bound_op_map == {'mul': 'multiplication operator'}\", \"assert unregister_custom_op('mul') is None and bound_op_map == {'add': 'addition operator'}\", \"assert unregister_custom_op('sub') is None and bound_op_map == {'... | {
"split": "train",
"index": 80853,
"acecode_id": "bigcode_python_fns_8768",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that finds the unique positive and negative integers in a given array, then calculates the summation of all unique positive integers raised to the power 'p' and all unique negative integers raised to the power 'q'. Finally, multiply these summations by the cou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_powers_sum_and_mult([0, 1], 2, 2) == 1\", \"assert unique_powers_sum_and_mult([], 2, 2) == None\", \"assert unique_powers_sum_and_mult([-2, 2], 2, 2) == 8\", \"assert unique_powers_sum_and_mult([], 3, 4) == None\", \"assert unique_powers_sum_and_mult(... | {
"split": "train",
"index": 80854,
"acecode_id": "evol_29433",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given two sorted lists of integers, merge them into a single sorted list without using built-in functions or libraries. Implement the function `merge_sorted_lists(list_1, list_2)` that takes two lists as input and returns a new sorted list containing all the elements from both ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sorted_lists([2, 5, 9], [1, 4, 6, 7]) == [1, 2, 4, 5, 6, 7, 9]\", \"assert merge_sorted_lists([], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_sorted_lists([1, 2, 3], []) == [1, 2, 3]\", \"assert merge_sorted_lists([], []) == []\", \"assert merge_sorted_l... | {
"split": "train",
"index": 80855,
"acecode_id": "evol_13743",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `preserve_uppercase(sequence: str) -> str` that takes an alphanumeric string as input and returns a new string consisting only of the uppercase alphabetical characters from the input string, in the order they appear. For example, given the input 'Hello World!',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert preserve_uppercase('Hello World!') == 'HW'\", \"assert preserve_uppercase('Python 3.8') == 'P'\", \"assert preserve_uppercase('123abcXYZ') == 'XYZ'\", \"assert preserve_uppercase('ABCDE') == 'ABCDE'\", \"assert preserve_uppercase('abcde') == ''\", \"assert p... | {
"split": "train",
"index": 80856,
"acecode_id": "evol_8367",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a monitoring system for an application that tracks various metrics and triggers alarms based on predefined conditions. You are given a dictionary of alarm parameters, where each key represents an alarm name and the corresponding value contains t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_alarms({'ENDPOINT': 15}) == ['TestAlarm']\", \"assert process_alarms({'ENDPOINT': 8}) == []\", \"assert process_alarms({'ENDPOINT': 10}) == []\", \"assert process_alarms({'ENDPOINT': 20}) == ['TestAlarm']\", \"assert process_alarms({'ENDPOINT': 5}) =... | {
"split": "train",
"index": 80857,
"acecode_id": "oss_35324",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simple bracket study by managing a bracket ID. Your function should take a single argument, `bracket_id`, which can either be an integer or a string. The function will return the bracket ID, ensuring that it handle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_bracket_id(123) == 123\", \"assert get_bracket_id('ABC') == 'ABC'\", \"assert get_bracket_id(0) == 0\", \"assert get_bracket_id(-1) == -1\", \"assert get_bracket_id('123') == '123'\", \"assert get_bracket_id('Test') == 'Test'\", \"assert get_bracket_id(9... | {
"split": "train",
"index": 80858,
"acecode_id": "oss_7787",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two non-negative integers, 'x' and 'y', and returns the product of 'x' and 'y' in hexadecimal format. The function should raise a ValueError if either of the inputs is negative, or a TypeError if the inputs are not integers.\nPlease reason step b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_multiplication(2, 3) == '0x6'\", \"assert binary_multiplication(0, 5) == '0x0'\", \"assert binary_multiplication(4, 7) == '0x1c'\", \"assert binary_multiplication(10, 10) == '0x64'\", \"assert binary_multiplication(1, 1) == '0x1'\", \"assert binary_mu... | {
"split": "train",
"index": 80859,
"acecode_id": "evol_13286",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of normalized values representing stock prices over time, along with the last known stock price (last_value) before the predictions were made. Your task is to implement a function that denormalizes these values using the last known price. The denormalizatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert denormalize([0.0, 0.0, 0.0], 50) == [50.0, 50.0, 50.0]\", \"assert denormalize([-1.0, -0.5, 0.5], 200) == [0.0, 100.0, 300.0]\", \"assert denormalize([1.0, 0.5, 0.5, -1.0], 80) == [160.0, 120.0, 120.0, 0.0]\", \"assert denormalize([2.0, 3.0, -0.5], 150) == [... | {
"split": "train",
"index": 80860,
"acecode_id": "bigcode_python_fns_9130",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a dictionary of metrics related to thermostat data. The function should take in a dictionary, `metrics_dict`, where the keys are thermostat IDs (strings) and the values are lists of integers representing metrics. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_metrics({'thermostat1': [10, 20]}, 'thermostat1') == [10, 20]\", \"assert process_metrics({'thermostat1': [15, 25, 35]}, 'thermostat1') == [15, 25, 35]\", \"assert process_metrics({'thermostat2': [1, 2, 3]}, 'thermostat2') == [1, 2, 3]\", \"assert pr... | {
"split": "train",
"index": 80861,
"acecode_id": "oss_19569",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a singly linked list implemented in Python. Your task is to implement a function called `remove_duplicates` that removes any duplicate elements from the linked list. The linked list is represented by the `Node` class, which contains an `item` and a reference to th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates(LinkedList([1, 2, 3, 4, 5])) == [1, 2, 3, 4, 5]\", \"assert remove_duplicates(LinkedList([1, 1, 1, 1, 1])) == [1]\", \"assert remove_duplicates(LinkedList([1, 2, 2, 3, 3, 4])) == [1, 2, 3, 4]\", \"assert remove_duplicates(LinkedList([5, 5, ... | {
"split": "train",
"index": 80862,
"acecode_id": "oss_20854",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two sorted lists of integers, arr1 and arr2. Your task is to implement a function that merges these two lists into a single sorted list. The merged list should maintain the sorted order of the elements from both input lists. Write a function `merge_sorted_lists(ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sorted_lists([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sorted_lists([], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_sorted_lists([1, 2, 3], []) == [1, 2, 3]\", \"assert merge_sorted_lists([], []) == []\", \"assert merge_sorted_lists([... | {
"split": "train",
"index": 80863,
"acecode_id": "evol_25641",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that serializes user data based on a given model and specified fields. The user model contains various attributes, and you need to create a function named `serialize_user` that takes a dictionary representing a user and a list of fiel... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_user({'id': 1, 'phone': '123-456-7890', 'first_name': 'John', 'last_name': 'Doe', 'two_step_password': 'abc123'}, ['id', 'first_name', 'last_name']) == {'id': 1, 'first_name': 'John', 'last_name': 'Doe'}\", \"assert serialize_user({'id': 2, 'phone'... | {
"split": "train",
"index": 80864,
"acecode_id": "oss_33532",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of pixels representing an image, write a function that calculates the dimensions of the image. The function should return a tuple containing the width and height of the image. The height is defined as the number of rows in the list, while the width is determined... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_dimensions([[0, 1], [2, 3]]) == (2, 2)\", \"assert calculate_dimensions([[0], [1], [2], [3]]) == (1, 4)\", \"assert calculate_dimensions([[1, 2, 3], [4, 5, 6]]) == (3, 2)\", \"assert calculate_dimensions([[1]]) == (1, 1)\", \"assert calculate_dimen... | {
"split": "train",
"index": 80865,
"acecode_id": "bigcode_python_fns_16997",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the number of days remaining in the current month based on a given date. The function should take a date as input in the format 'YYYY-MM-DD' and return the number of days remaining until the end of that month. Consi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert days_remaining_in_month('2023-03-15') == 16\", \"assert days_remaining_in_month('2023-02-28') == 0\", \"assert days_remaining_in_month('2024-02-29') == 0\", \"assert days_remaining_in_month('2023-01-31') == 0\", \"assert days_remaining_in_month('2023-04-01')... | {
"split": "train",
"index": 80866,
"acecode_id": "oss_23187",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a Python function that computes the sum of all subarrays of uneven length from a given list. The function should return the maximum and minimum sums along with all corresponding subarrays that yield these sums. The input list can contain positive and negative integers... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_min_subarrays([]) == {'max_sum': None, 'max_arrays': [], 'min_sum': None, 'min_arrays': []}\", \"assert max_min_subarrays([1]) == {'max_sum': 1, 'max_arrays': [[1]], 'min_sum': 1, 'min_arrays': [[1]]}\", \"assert max_min_subarrays([1, 2, 3]) == {'max_sum... | {
"split": "train",
"index": 80867,
"acecode_id": "evol_3699",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `add_purchase(purchase_history: dict, product_id: str, quantity: int) -> dict` that takes a dictionary representing the purchase history of a customer, a product ID as a string, and a quantity as an integer. The function should update the purchase history b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_purchase({}, 'prod001', 5) == {'prod001': 5}\", \"assert add_purchase({'prod001': 5}, 'prod001', 3) == {'prod001': 8}\", \"assert add_purchase({'prod002': 2}, 'prod003', 4) == {'prod002': 2, 'prod003': 4}\", \"assert add_purchase({'prod001': 1, 'prod002'... | {
"split": "train",
"index": 80868,
"acecode_id": "evol_5645",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a time series dataset, where some values may be marked as invalid with a specific 'no_data' value. Your task is to create a function that processes this dataset by replacing the 'no_data' values with zero, and then computes the foll... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perform_timeseries_analysis([-9999, -9999, -9999], -9999) == {'normalized_data': 0.0, 'total_data': 0, 'total_clean': 0}\", \"assert perform_timeseries_analysis([], -9999) == {'normalized_data': 0.0, 'total_data': 0, 'total_clean': 0}\", \"assert perform_tim... | {
"split": "train",
"index": 80869,
"acecode_id": "bigcode_python_fns_9212",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `format_step_text(text: str) -> str` that takes a string input `text`, removes any extra whitespace between words, and formats it in a specific way. The output should be a string that wraps the cleaned text within the markers `@@@STEP_TEX... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_step_text(' This is a test ') == '@@@STEP_TEXT@This is a test@@@'\", \"assert format_step_text('Hello World') == '@@@STEP_TEXT@Hello World@@@'\", \"assert format_step_text('Python is fun') == '@@@STEP_TEXT@Python is fun@@@'\", \"assert f... | {
"split": "train",
"index": 80870,
"acecode_id": "bigcode_python_fns_39896",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a positive integer N which represents the dimension of states. Write a function that returns a list of integers where each integer is calculated as 2 raised to the power of i (i.e., 2^i) for all i from 0 up to (but not including) log2(N). You may also provide an o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_fredkin_gate_indices(1) == []\", \"assert get_fredkin_gate_indices(2) == [1]\", \"assert get_fredkin_gate_indices(3) == [1]\", \"assert get_fredkin_gate_indices(4) == [1, 2]\", \"assert get_fredkin_gate_indices(5) == [1, 2]\", \"assert get_fredkin_gate_i... | {
"split": "train",
"index": 80871,
"acecode_id": "bigcode_python_fns_31087",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the transfer of a file from a server to a client using a given size for the chunks. The function will take two parameters: the total size of the file (in bytes) and the size of each chunk (in bytes). Your goal is to det... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_chunks(1024, 256) == 4\", \"assert count_chunks(5000, 1024) == 5\", \"assert count_chunks(0, 256) == 0\", \"assert count_chunks(1024, 0) == 0\", \"assert count_chunks(-1024, 256) == 0\", \"assert count_chunks(2048, 512) == 4\", \"assert count_chunks(10... | {
"split": "train",
"index": 80872,
"acecode_id": "oss_31524",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that takes a tuple of numbers and returns a list containing the factorial of each element. The function should handle zero and negative numbers by returning an error message for negative inputs, and it should round any floating point numbers to the nearest int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial_of_tuple((1, 2, 3)) == [1, 2, 6]\", \"assert factorial_of_tuple((2.5, 3.2, 1.1)) == [2, 6, 1]\", \"assert factorial_of_tuple((1.9, 2.2, 3.1, 0)) == [2, 2, 6, 1]\", \"assert factorial_of_tuple((9, 8, 7)) == [362880, 40320, 5040]\", \"assert factoria... | {
"split": "train",
"index": 80873,
"acecode_id": "evol_32119",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `parse_field_constraint` that takes in a value `x`, a constraint type `constraint`, and an optional field type `type`. The function should return the parsed value based on the given constraints. The input value `x` can be of type string, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_field_constraint('test', 'string') == 'test'\", \"assert parse_field_constraint(123, 'integer') == 123\", \"assert parse_field_constraint(45.67, 'float') == 45.67\", \"assert parse_field_constraint(True, 'boolean') == True\", \"assert parse_field_const... | {
"split": "train",
"index": 80874,
"acecode_id": "bigcode_python_fns_33923",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `unique_odd_sum_elements` that returns a sorted list of unique positive elements whose digit sum is odd. The input list may contain negative integers, but the output list must not contain them. Each element in the output must be un... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_odd_sum_elements([-1, -2, -3]) == []\", \"assert unique_odd_sum_elements([1, 2, 3, 4, 5]) == [1, 3, 5]\", \"assert unique_odd_sum_elements([0, 1, 2, 3, 4, 5]) == [1, 3, 5]\", \"assert unique_odd_sum_elements([111, 222, 333]) == [111, 333]\", \"assert ... | {
"split": "train",
"index": 80875,
"acecode_id": "evol_2785",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a sample data table into a string representation. The function should accept a list of lists (2D list) as input, where each inner list represents a row of data in the table. If the input is None, the function should return an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_sample_table([[\\\"Name\\\", \\\"Age\\\", \\\"Height\\\"], [\\\"Alice\\\", 30, 5.5], [\\\"Bob\\\", 25, 6.0]]) == 'Name\\tAge\\tHeight\\\\nAlice\\t30\\t5.5\\\\nBob\\t25\\t6.0'\", \"assert format_sample_table([[\\\"Product\\\", \\\"Price\\\"], [\\\"Appl... | {
"split": "train",
"index": 80876,
"acecode_id": "bigcode_python_fns_37190",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of professors and returns a string that represents all of their information in a specific format. Each professor is represented by a dictionary with the following keys: 'id', 'firstname', 'lastname', 'dob', 'hiring_year'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_professors([{'id': 1, 'firstname': 'John', 'lastname': 'Doe', 'dob': '1980-01-01', 'hiring_year': 2010, 'salary': 90000, 'courses': ['Math', 'Physics'], 'research_projects': []}]) == 'Professor John Doe (ID: 1, DOB: 1980-01-01, Hiring Year: 2010, Sala... | {
"split": "train",
"index": 80877,
"acecode_id": "oss_7444",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of peak values based on a specified number of peaks to fit. Write a function `fit_peaks` that takes the following parameters: \n- `fit_npeaks`: An integer representing the number of peaks to fit.\n- `peaks`: A li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fit_peaks(2, [10.5, 15.2, 20.1, 25.8]) == ([10.5, 15.2, 20.1, 25.8], -1, 'fit_peaks')\", \"assert fit_peaks(3, [8.3, 12.7, 18.6, 22.4, 27.9]) == ([8.3, 12.7, 18.6, 22.4, 27.9], 0, 'fit_peaks')\", \"assert fit_peaks(1, [5.5, 10.0]) == ([5.5, 10.0], -1, 'fit_p... | {
"split": "train",
"index": 80878,
"acecode_id": "oss_21924",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of numbers representing an embedding, write a function `preprocess_embedding(z: List[List[float]]) -> List[List[float]]` that preprocesses the embedding by centering and scaling it to be between -0.5 and 0.5. The function should calculate the mean of each column... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert preprocess_embedding([[1, 2], [3, 4], [5, 6]]) == [[-0.5, -0.5], [0.0, 0.0], [0.5, 0.5]]\", \"assert preprocess_embedding([[10, 20], [30, 40], [50, 60]]) == [[-0.5, -0.5], [0.0, 0.0], [0.5, 0.5]]\", \"assert preprocess_embedding([[2, 4], [6, 8], [10, 12]]) =... | {
"split": "train",
"index": 80879,
"acecode_id": "bigcode_python_fns_45071",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given two lists, `x` and `y`, representing the independent variable data and signal data, respectively. You are also given a list of dictionaries called `peaks`, where each dictionary contains the following keys: 'p', 'phalf0', and 'valid'. Your task is to implement a f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_peak_bottom([0, 1, 2, 3, 4], [0, 1, 0, 1, 0], [{'p': 1, 'phalf0': 1, 'valid': True}]) == [{'p': 1, 'phalf0': 1, 'valid': True, 'pbottom': 0}]\", \"assert find_peak_bottom([0, 1, 2], [1, 2, 1], [{'p': 1, 'phalf0': 1, 'valid': True}, {'p': 2, 'phalf0': 2,... | {
"split": "train",
"index": 80880,
"acecode_id": "bigcode_python_fns_31803",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, return the Collatz sequence starting from n up to 1, as well as the number of steps taken to reach 1. The Collatz conjecture states that for a given number n, if n is even, the next number will be n / 2, and if n is odd, the next number will be 3n + ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert collatz(1) == ([1], 0)\", \"assert collatz(2) == ([2, 1], 1)\", \"assert collatz(3) == ([3, 10, 5, 16, 8, 4, 2, 1], 7)\", \"assert collatz(4) == ([4, 2, 1], 2)\", \"assert collatz(5) == ([5, 16, 8, 4, 2, 1], 5)\", \"assert collatz(6) == ([6, 3, 10, 5, 16, 8,... | {
"split": "train",
"index": 80881,
"acecode_id": "evol_34783",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the main loop of a simple application. The application runs on a main screen and can handle user inputs to perform specific actions. Implement a function `run_app()` that simulates the running of the application. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_app(['start', 'action', 'action', 'exit']) == ['start', 'action', 'action']\", \"assert run_app(['start', 'exit']) == ['start']\", \"assert run_app(['exit']) == []\", \"assert run_app(['start', 'action', 'exit', 'action']) == ['start', 'action']\", \"ass... | {
"split": "train",
"index": 80882,
"acecode_id": "bigcode_python_fns_29967",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that selects a random joke from a predefined list of jokes. Your function should be named `get_random_joke` and should take no arguments. It should return a random joke from the `jokes` list. If the `jokes` list is empty, or if an error o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_random_joke() in jokes\", \"assert isinstance(get_random_joke(), str)\", \"assert get_random_joke() in jokes or get_random_joke() == 'Failed to retrieve joke'\", \"assert get_random_joke().startswith(\\\"I'm\\\") or get_random_joke().startswith(\\\"Did\\... | {
"split": "train",
"index": 80883,
"acecode_id": "oss_21868",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that returns the longest common prefix among the strings in the list. If there is no common prefix, return an empty string. The function should handle edge cases, such as an empty list or a list with one string. The input list will ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_common_prefix(['leet', 'leets', 'lee', 'leeston', 'leeve']) == 'lee'\", \"assert longest_common_prefix(['dog', 'racecar', 'car']) == ''\", \"assert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\", \"assert longest_common_prefix(['a']) =... | {
"split": "train",
"index": 80884,
"acecode_id": "evol_22494",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining the credit rating of a user based on various inputs such as their role, sex, location, carbon credit, and their environmental footprint activities. Implement a function `get_credit_rating(rolename: str, sex: str, username: str, location: str, car... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_credit_rating('farmer', 'male', 'user1', 'Cantwell city, Alaska, USA', 20, ['Buy apples', 'Seed corn']) == 'Good credit'\", \"assert get_credit_rating('farmer', 'female', 'user3', 'Cantwell city, Alaska, USA', 50, ['Seed wheat', 'Buy seeds', 'Buy fertili... | {
"split": "train",
"index": 80885,
"acecode_id": "bigcode_python_fns_28290",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a loading screen message for a game. The function should return a list of strings representing the messages that will be displayed to the player. The loading screen should include the following messages: 'Welcome to Hungry ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_loading_screen_messages() == ['Welcome to Hungry Geese!!!', 'Please press any key to start.', 'You will play the white character, you can control it', 'using the direction keys. After each input, the NPCs', 'will take a second to submit their direct... | {
"split": "train",
"index": 80886,
"acecode_id": "bigcode_python_fns_44097",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of Protocol Buffers message attributes and returns a dictionary summarizing these attributes. The input to the function will be a list of tuples, where each tuple contains the following elements: nested_types (li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_proto_message([( ['NestedType1', 'NestedType2'], ['EnumType1'], 'option1', True, 'proto2', [(1, 100)], ['oneof1'], 0, 10)]) == {'nested_types': ['NestedType1', 'NestedType2'], 'enum_types': ['EnumType1'], 'serialized_options': 'option1', 'is_extendab... | {
"split": "train",
"index": 80887,
"acecode_id": "oss_10580",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that can parse and validate a custom markup language used for documentation. The markup language allows the use of special syntax for inline code samples, where the code is enclosed within backticks (`) and may contain escaped braces.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_inline_code('`a{{b}}c`') == ['a', ['b'], 'c']\", \"assert parse_inline_code('`text with no braces`') == ['text with no braces']\", \"assert parse_inline_code('`simple`') == ['simple']\", \"assert parse_inline_code('`open{{ and close}}`') == ['open', ['... | {
"split": "train",
"index": 80888,
"acecode_id": "oss_7919",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `multiply_with_range` that takes a single integer input `number`. The function should return a list containing the results of multiplying `number` with each integer from 1 to `number` (inclusive).\nPlease reason step by step, then write a self-contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_with_range(1) == [1]\", \"assert multiply_with_range(2) == [2, 4]\", \"assert multiply_with_range(3) == [3, 6, 9]\", \"assert multiply_with_range(4) == [4, 8, 12, 16]\", \"assert multiply_with_range(5) == [5, 10, 15, 20, 25]\", \"assert multiply_wit... | {
"split": "train",
"index": 80889,
"acecode_id": "evol_26481",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `validate_birth_date(date: str) -> bool` that takes a string `date` representing a birth date in the format 'YYYY-MM-DD'. The function should return True if the date is valid, and False otherwise. A valid date must conform to the 'YYYY-MM-DD' format and represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_birth_date('1990-07-05') == True\", \"assert validate_birth_date('2000-01-01') == True\", \"assert validate_birth_date('2023-12-31') == True\", \"assert validate_birth_date('1900-02-28') == True\", \"assert validate_birth_date('2004-02-29') == True\... | {
"split": "train",
"index": 80890,
"acecode_id": "evol_28479",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a positive integer 'prob'. Your task is to determine if 'prob' is a valid positive integer and return a string representation of the object in the format 'PRi' where 'i' is the value of 'prob'. Implement a function named 'math_concept(prob)' that takes an integer ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert math_concept(1) == (True, 'PR1')\", \"assert math_concept(5) == (True, 'PR5')\", \"assert math_concept(10) == (True, 'PR10')\", \"assert math_concept(0) == (False, 'PR0')\", \"assert math_concept(-3) == (False, 'PR-3')\", \"assert math_concept(100) == (True,... | {
"split": "train",
"index": 80891,
"acecode_id": "oss_3364",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function `fill_zeros(original_array)` that takes a 2D array as input and returns a new 2D array with the same dimensions, where all elements are set to zero. The original array should remain unchanged. Your implementation should ensure that a new array is created, and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fill_zeros([[1, 2], [3, 4]]) == [[0, 0], [0, 0]]\", \"assert fill_zeros([[5]]) == [[0]]\", \"assert fill_zeros([[1, 1, 1], [2, 2, 2]]) == [[0, 0, 0], [0, 0, 0]]\", \"assert fill_zeros([[]]) == [[]]\", \"assert fill_zeros([[7, 8, 9], [10, 11, 12], [13, 14, 15... | {
"split": "train",
"index": 80892,
"acecode_id": "evol_31761",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that processes election results and identifies possible election fraud. The function should take a list of tuples, where each tuple contains a candidate's name and their corresponding number of votes. If any candidate has more than 60% of the total votes, the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert election_fraud_detector([('A', 55), ('B', 43), ('C', 21)]) == 'No Fraud Detected'\", \"assert election_fraud_detector([('A', 70), ('B', 20), ('C', 10)]) == 'Possible Fraud Detected'\", \"assert election_fraud_detector([('A', 40), ('B', 41), ('C', 19)]) == 'N... | {
"split": "train",
"index": 80893,
"acecode_id": "evol_11975",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the Euclidean distance between two points in an n-dimensional space. The points will be represented as lists or tuples of coordinates. The function should raise a ValueError if the two points do not have the same number of dimensions. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_euclidean_distance((1, 2), (4, 6)) == 5.0\", \"assert calculate_euclidean_distance((0, 0, 0), (0, 0, 0)) == 0.0\", \"assert calculate_euclidean_distance((1, 1), (1, 1)) == 0.0\", \"assert calculate_euclidean_distance((3, 4), (0, 0)) == 5.0\", \"ass... | {
"split": "train",
"index": 80894,
"acecode_id": "evol_8716",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a multidimensional list that may contain integers or other lists (up to 3 levels deep), write a function `count_unique_elements(array)` that returns the cumulative count of unique integers present in the list. The input list can contain nested lists, and your function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_elements([[[1,2], 3], 4, [[1, 2]], 4]) == 4\", \"assert count_unique_elements([[1, 1, 2], [2, 3], 4]) == 4\", \"assert count_unique_elements([1, 2, [3, [4]], 5]) == 5\", \"assert count_unique_elements([[[1], [1, 1]], 1, 1]) == 1\", \"assert coun... | {
"split": "train",
"index": 80895,
"acecode_id": "evol_10650",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the process of running a set of tests in a testing environment. Your function should take in a workspace path, a benchmark home path, and a list of test names as inputs. It should return a dictionary where each test name is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_tests('/workspace', '/mxnet_repo/incubator-mxnet/example/image-classification', ['test1', 'test2', 'test3']) == {'test1': 'passed', 'test2': 'failed', 'test3': 'passed'}\", \"assert run_tests('/workspace', '/mxnet_repo/incubator-mxnet/example/image-class... | {
"split": "train",
"index": 80896,
"acecode_id": "bigcode_python_fns_34721",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list composed of two strings exclusively made of '(' or ')' parentheses. Your task is to implement a function that checks if concatenating the two strings results in a correctly nested parentheses string. If it is valid, return 'Valid'; otherwise, return 'Invali... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_parentheses([')))', ')))']) == 'Invalid'\", \"assert check_parentheses(['((', '))']) == 'Valid'\", \"assert check_parentheses(['((', '())']) == 'Invalid'\", \"assert check_parentheses(['((()))', '()']) == 'Valid'\", \"assert check_parentheses(['((()))'... | {
"split": "train",
"index": 80897,
"acecode_id": "evol_32712",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `run(s: str) -> str` that takes a string `s` as input and returns its MD5 hash value as a hexadecimal string. The input string can be empty, contain spaces, or include alphanumeric characters and punctuation. Your function should handle all these cases and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run('') == 'd41d8cd98f00b204e9800998ecf8427e'\", \"assert run('hello world') == '5eb63bbbe01eeed093cb22bb8f5acdc3'\", \"assert run('123456') == 'e10adc3949ba59abbe56e057f20f883e'\", \"assert run(' ') == '7215ee9c7d9dc229d2921a40e899ec5f'\", \"assert run('') ... | {
"split": "train",
"index": 80898,
"acecode_id": "bigcode_python_fns_29262",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to interpret and execute simple database index commands. The function should handle commands to create and drop indexes on database tables. You need to implement a Python function `execute_index_command(command)` that takes a string `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_index_command(\\\"create_index('INDEX_A', 'table1')\\\") == \\\"Index 'INDEX_A' created on table 'table1'.\\\"\", \"assert execute_index_command(\\\"drop_index('INDEX_A', 'table1')\\\") == \\\"Index 'INDEX_A' dropped from table 'table1'.\\\"\", \"ass... | {
"split": "train",
"index": 80899,
"acecode_id": "oss_18452",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.