data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a dictionary that represents a database configuration for a Django project. This dictionary contains various settings for connecting to a MySQL database. Your task is to write a Python function that takes this configuration dictionary as input and retrieves the pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_database_password({'default': {'ENGINE': 'django.db.backends.mysql', 'HOST': '192.168.128.128', 'PORT': 3306, 'USER': 'maimai', 'PASSWORD': 'mypassword1', 'NAME': 'Store'}}) == 'mypassword1'\", \"assert get_database_password({'default': {'ENGINE': 'djang...
{ "split": "train", "index": 5000, "acecode_id": "oss_22805", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to validate network latency values. The function should accept a list of latency values and return a list of boolean values indicating whether each latency value meets the specified criteria. The criteria for a valid latency value is that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_latency_values([0, 10, 5.5, 3.2]) == [True, True, True, True]\", \"assert validate_latency_values([-1, 2, 3]) == [False, True, True]\", \"assert validate_latency_values([None, 2.5]) == [False, True]\", \"assert validate_latency_values([]) == []\", \...
{ "split": "train", "index": 5001, "acecode_id": "oss_12936", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of numbers, `w` and `wo`, representing two different sets of weights. Your task is to implement a function that checks if the total absolute difference between corresponding elements in the two lists is greater than a given threshold `epsilon`. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_weight_difference([1.0, 2.0, 3.0], [1.5, 2.5, 3.5], 1.0) == True\", \"assert check_weight_difference([1.0, 2.0, 3.0], [1.0, 2.0, 3.0], 0.0) == False\", \"assert check_weight_difference([10.0, 20.0], [10.0, 21.0], 0.5) == True\", \"assert check_weight_d...
{ "split": "train", "index": 5002, "acecode_id": "bigcode_python_fns_47178", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to manage access to a shared resource in a multi-threaded environment. The function, `manage_resource_access`, should take a boolean parameter named `can_access` which indicates if the resource can be accessed or not. If `can_access` is t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_resource_access(True) == 'Resource accessed'\", \"assert manage_resource_access(False) == 'Access denied'\", \"assert manage_resource_access(True) == 'Resource accessed'\", \"assert manage_resource_access(False) == 'Access denied'\", \"assert manage_r...
{ "split": "train", "index": 5003, "acecode_id": "bigcode_python_fns_21991", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that removes the last word from a given string of text. A word is defined as a sequence of characters that are separated by spaces or punctuation marks. The function should return the modified string with the last word removed. If the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_last_word('Hello World!') == 'Hello'\", \"assert delete_last_word('') == ''\", \"assert delete_last_word(' ') == ''\", \"assert delete_last_word('Hello') == ''\", \"assert delete_last_word('...leading punctuation') == '...leading'\"]}" }
{ "split": "train", "index": 5004, "acecode_id": "oss_24834", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given two strings, `str1` and `str2`, along with an integer `k`. Your task is to determine whether it is possible to convert `str1` into `str2` by performing at most `k` operations. An operation is defined as either inserting a character, deleting a character, or replac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isKPal('kitten', 'sitting', 3) == True\", \"assert isKPal('flaw', 'lawn', 2) == True\", \"assert isKPal('intention', 'execution', 5) == True\", \"assert isKPal('abc', 'abc', 0) == True\", \"assert isKPal('abc', 'def', 3) == True\", \"assert isKPal('abc', 'd'...
{ "split": "train", "index": 5005, "acecode_id": "oss_27746", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing raw counts of a certain biological measurement. Write a function `normalize_counts(counts: List[int]) -> List[float]` that normalizes these counts to counts per million (CPM). CPM is calculated using the formula: `(count / total_cou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_counts([0, 0, 0]) == [0.0, 0.0, 0.0]\", \"assert normalize_counts([0, 5, 0]) == [0.0, 1000000.0, 0.0]\", \"assert normalize_counts([5, 0, 0]) == [1000000.0, 0.0, 0.0]\", \"assert normalize_counts([10, 20, 30]) == [166666.666667, 333333.333333, 5000...
{ "split": "train", "index": 5006, "acecode_id": "bigcode_python_fns_37432", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple plugin system that allows plugins to register callback functions by name. Implement a function `plugin_system` that takes a list of plugin definitions and a list of commands, and returns a list of results from executing those commands. Each...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert plugin_system([('plugin1', lambda x: x + 1)], [('plugin1', 3)]) == [4]\", \"assert plugin_system([('plugin1', lambda x: x + 1), ('plugin1', lambda x: x * 2)], [('plugin1', 3)]) == [6]\", \"assert plugin_system([('plugin1', lambda x: x + 1)], []) == []\", \"a...
{ "split": "train", "index": 5007, "acecode_id": "bigcode_python_fns_25199", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of strings, create a function that returns a new string which is a concatenation of all the input strings, separated by a space. The function should accept a variable number of string arguments. If no strings are provided, the function should return an empty string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concat_strings('hello', 'world') == 'hello world'\", \"assert concat_strings('foo', 'bar', 'baz') == 'foo bar baz'\", \"assert concat_strings('one') == 'one'\", \"assert concat_strings() == ''\", \"assert concat_strings('a', 'b', 'c', 'd') == 'a b c d'\", \"...
{ "split": "train", "index": 5008, "acecode_id": "bigcode_python_fns_10246", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function named `is_perfect_square_or_cube`. This function should take a number as an argument and return 'square' if the number is a perfect square, 'cube' if the number is a perfect cube, and 'none' if the number is neither. If the input is not a number (integer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_perfect_square_or_cube(0) == 'square'\", \"assert is_perfect_square_or_cube(1) == 'square'\", \"assert is_perfect_square_or_cube(4) == 'square'\", \"assert is_perfect_square_or_cube(16) == 'square'\", \"assert is_perfect_square_or_cube(9) == 'square'\", \...
{ "split": "train", "index": 5009, "acecode_id": "evol_2163", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a region name. Your task is to implement a function that returns a list of unique region names that appear in the input list. The output list should maintain the order of the first appearance of each region in the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_regions(['us-east', 'eu-west', 'us-east', 'ap-south']) == ['us-east', 'eu-west', 'ap-south']\", \"assert get_unique_regions(['us-west', 'us-west', 'us-east', 'eu-central', 'eu-central']) == ['us-west', 'us-east', 'eu-central']\", \"assert get_uniq...
{ "split": "train", "index": 5010, "acecode_id": "bigcode_python_fns_15980", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists, one containing user names and the other containing role names. Write a function `count_users_and_roles(users: List[str], roles: List[str]) -> Dict[str, int]` that takes two lists as input: `users` which contains the names of users and `roles` which cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_users_and_roles(['user1', 'user2', 'user3'], ['role1', 'role2', 'role3', 'role4']) == {'user_count': 3, 'role_count': 4}\", \"assert count_users_and_roles([], []) == {'user_count': 0, 'role_count': 0}\", \"assert count_users_and_roles(['user1'], []) ==...
{ "split": "train", "index": 5011, "acecode_id": "oss_19101", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function to evaluate a project portfolio and determine if it contains any features labeled with the substring 'new'. The input to the function will be a dictionary that includes various project features. Each key in the dictionary represent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_new_capacity_type({'scenarios': 'N/A', 'subscenario_': 'subscenarios_project_old', 'input_': 'inputs_project_old'}) == False\", \"assert check_new_capacity_type({'project_1': 'old capacity', 'project_2': 'new project'}) == True\", \"assert check_new_ca...
{ "split": "train", "index": 5012, "acecode_id": "oss_10268", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple event system. Write a function `create_event` that takes a string `event_name` and a callable `handler`. The function should register the event with the provided name and associate it with the given handler function. If an event with the sa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_event('click', handler_function) == 'Event created successfully'\", \"assert create_event('', handler_function) == 'Invalid event name'\", \"assert create_event('hover', handler_function) == 'Event created successfully'\", \"assert create_event('submi...
{ "split": "train", "index": 5013, "acecode_id": "bigcode_python_fns_28790", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `evaluate_conditions` that takes a variable number of arguments, each representing a condition in the form of a boolean value (True or False). The function should return the index (0-based) of the first condition that evaluates...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_conditions(False, False, True) == 2\", \"assert evaluate_conditions(True, False, False) == 0\", \"assert evaluate_conditions(False, True, True) == 1\", \"assert evaluate_conditions(False, False, False) == -1\", \"assert evaluate_conditions(True, Tru...
{ "split": "train", "index": 5014, "acecode_id": "bigcode_python_fns_35394", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D grid containing 0s (water) and 1s (land), where each land cell is connected horizontally or vertically to another land cell. Your task is to implement a function that returns the minimum number of land cells that need to be changed to water cells in order to ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_land_to_water([[0, 0, 0], [0, 1, 0], [0, 0, 0]]) == 0\", \"assert min_land_to_water([[1, 1, 1], [1, 0, 1], [1, 1, 1]]) == 0\", \"assert min_land_to_water([[0, 0], [0, 0]]) == 0\", \"assert min_land_to_water([[1]]) == 0\", \"assert min_land_to_water([[1, ...
{ "split": "train", "index": 5015, "acecode_id": "evol_6241", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given two lists of 3D boxes, where each box is represented by a list of 7 floating-point numbers: [x, y, z, length, width, height, rotation]. Your task is to implement a function `box_overlap(boxes: List[List[float]], qboxes: List[List[float]]) -> List[float]` that calc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert box_overlap([[0, 0, 0, 1, 1, 1, 0]], [[0, 0, 0, 1, 1, 1, 0]]) == [1.0]\", \"assert box_overlap([[0, 0, 0, 1, 1, 1, 0]], [[1, 1, 1, 1, 1, 1, 0]]) == [0.0]\", \"assert box_overlap([], [[1, 1, 1, 1, 1, 1, 0]]) == []\", \"assert box_overlap([[0, 0, 0, 2, 2, 2, 0...
{ "split": "train", "index": 5016, "acecode_id": "bigcode_python_fns_24070", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in a dictionary of events associated with an identity pool and returns a new dictionary containing only the events that are associated with a specified Lambda function. The function should take in two parameters: a dictionary '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_events({'PreSignUp': 'lambda1', 'PostAuthentication': 'lambda2'}, 'lambda1') == {'PreSignUp': 'lambda1'}\", \"assert filter_events({'PreSignUp': 'lambda1', 'PostAuthentication': 'lambda1'}, 'lambda1') == {'PreSignUp': 'lambda1', 'PostAuthentication': ...
{ "split": "train", "index": 5017, "acecode_id": "bigcode_python_fns_27085", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, write a function that takes an integer n and a list of n strings as input. The function should return a new list containing only the unique strings from the input list, preserving the original order of their first occurrence. If there are no unique stri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_strings(3, ['cat', 'dog', 'cat']) == ['dog']\", \"assert unique_strings(4, ['hello', 'world', 'hello', 'hello']) == ['world']\", \"assert unique_strings(6, ['red', 'blue', 'red', 'green', 'blue', 'yellow']) == ['green', 'yellow']\", \"assert unique_st...
{ "split": "train", "index": 5018, "acecode_id": "bigcode_python_fns_45616", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of different buildings in a city skyline. Your task is to find the maximum height of the buildings that can be seen from the left side of the skyline. A building can be seen if it is taller than all the previous building...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxVisibleHeight([1, 3, 2, 5, 4]) == 5\", \"assert maxVisibleHeight([5, 3, 4, 2, 1]) == 5\", \"assert maxVisibleHeight([1]) == 1\", \"assert maxVisibleHeight([1, 2, 3, 4, 5]) == 5\", \"assert maxVisibleHeight([5, 5, 5, 5]) == 5\", \"assert maxVisibleHeight([...
{ "split": "train", "index": 5019, "acecode_id": "bigcode_python_fns_41027", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a migration file to modify an existing model in a content management system. The model represents a video and you need to add a new field called `duration` to the `Video` model. The `duration` field should be an IntegerField that stores the duration...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_migration() == \\\"from django.db import migrations, models\\\\n\\\\nclass Migration(migrations.Migration):\\\\n\\\\n dependencies = [\\\\n ('your_app_name', 'previous_migration_number'), # Replace with the actual app name and previous mi...
{ "split": "train", "index": 5020, "acecode_id": "oss_26429", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of executing different configurations based on a specified parameter. The function should take a string parameter representing a configuration name and return a specific output based on the configuration. The b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_config('config_a') == 'result_a'\", \"assert execute_config('config_b') == 'result_b'\", \"assert execute_config('config_c') == 'result_c'\", \"assert execute_config('unknown') == 'unknown_config'\", \"assert execute_config('config_a') == 'result_a'\...
{ "split": "train", "index": 5021, "acecode_id": "evol_7570", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a configuration dictionary for a server deployment, extract the server name, intersection, start hour, and start minute from the following structure: config['DataTransfer']['server'], config['DataTransfer']['intersection'], config['DataTransfer']['StartTime_PullFromInters...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_server_pull_config({'DataTransfer': {'server': 'Server1', 'intersection': 'IntersectionA', 'StartTime_PullFromIntersections': {'hour': 10, 'minute': 30}}}) == ('Server1', 'IntersectionA', 10, 30)\", \"assert get_server_pull_config({'DataTransfer': {'serv...
{ "split": "train", "index": 5022, "acecode_id": "bigcode_python_fns_6747", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates input parameters for a simulation setup. The function should accept a dictionary where the keys are parameter names (strings) and the values are the corresponding parameter values. Your goal is to check if all parameters ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_parameters({'llg_n_iterations': 10, 'mc_n_iterations': 5, 'bravais_lattice': 'simple'}) is None\", \"assert validate_parameters({'llg_n_iterations': 1, 'mc_n_iterations': 2, 'bravais_lattice': 'cubic'}) is None\", \"assert validate_parameters({'llg_...
{ "split": "train", "index": 5023, "acecode_id": "bigcode_python_fns_32149", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple scheduler. The function should take two parameters: a list of tasks and a time limit. Each task is represented as a string and the time limit is an integer representing the maximum time the scheduler can run. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert schedule_tasks(['task1', 'task2', 'task3'], 2) == ['task1', 'task2']\", \"assert schedule_tasks(['task1', 'task2', 'task3', 'task4'], 0) == []\", \"assert schedule_tasks(['task1', 'task2'], 1) == ['task1']\", \"assert schedule_tasks([], 5) == []\", \"assert ...
{ "split": "train", "index": 5024, "acecode_id": "oss_3159", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string and an integer n as input, and returns a list containing the string repeated n times. If n is less than or equal to zero, return an empty list.\nPlease reason step by step, then write a self-contained Python solution. Give your final program...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_string_n_times('hello', 3) == ['hello', 'hello', 'hello']\", \"assert print_string_n_times('test', 1) == ['test']\", \"assert print_string_n_times('example', 0) == []\", \"assert print_string_n_times('recursion', -2) == []\", \"assert print_string_n_ti...
{ "split": "train", "index": 5025, "acecode_id": "evol_19325", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a planning problem represented by a dictionary containing the following keys: 'initial', 'goals', and 'actions'. The 'initial' key holds a string representing the initial state, the 'goals' key holds a list of strings representing the goal states, and the 'actions...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert copy_planning_problem({'initial': 'A', 'goals': ['B', 'C'], 'actions': ['move', 'pick']}) == {'initial': 'A', 'goals': ['B', 'C'], 'actions': ['move', 'pick']}\", \"assert copy_planning_problem({'initial': 'X', 'goals': ['Y'], 'actions': []}) == {'initial': ...
{ "split": "train", "index": 5026, "acecode_id": "bigcode_python_fns_44782", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `elite_truncation(figure: str, low: int, apex: int) -> Union[int, str]` that takes a string `figure` representing a number, and two integers `low` and `apex` which act as boundaries. The function should return the closest integer to the numerical value repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert elite_truncation('10', 0, 20) == 10\", \"assert elite_truncation('14.5', 10, 20) == 14\", \"assert elite_truncation('-14.5', -20, -10) == -14\", \"assert elite_truncation('0', -5, 5) == 0\", \"assert elite_truncation('100.0', 50, 150) == 100\", \"assert elit...
{ "split": "train", "index": 5027, "acecode_id": "evol_7392", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a dictionary of indicators of compromise (IOCs) in the form of key-value pairs. The function takes the following parameters: \n- `iocs_json`: A dictionary where the keys are indicator types (e.g., 'IP', 'domain') and the va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert panos_url_formatting({'IP': [], 'domain': []}, True, True) == ({'IP': [], 'domain': []}, 0)\", \"assert panos_url_formatting({'IP': ['192.168.1.1:8080'], 'domain': ['example.com:3000']}, False, False) == ({'IP': ['192.168.1.1:8080'], 'domain': ['example.com:...
{ "split": "train", "index": 5028, "acecode_id": "oss_20374", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates if a given package version is compatible with a specified Python version. The function should take two parameters: a string representing the required Python version and a string representing the minimum required vers...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_package_compatibility('3.6.0', '1.2.3') == True\", \"assert validate_package_compatibility('3.6.0', '1.0.0') == True\", \"assert validate_package_compatibility('3.6.0', '1.2.4') == True\", \"assert validate_package_compatibility('3.6.0', '3.6.0') ==...
{ "split": "train", "index": 5029, "acecode_id": "oss_3600", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple circular buffer data structure in Python. A circular buffer is a fixed-size buffer that overwrites the oldest data with the newest data when full. Your task is to implement a function `circular_buffer_operations(size: int, items: List[i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert circular_buffer_operations(3, [1, 2, 3, 4, 5]) == ([3, 4, 5], 'usage : 100 %')\", \"assert circular_buffer_operations(4, [10, 20, 30]) == ([10, 20, 30], 'usage : 75 %')\", \"assert circular_buffer_operations(2, [1, 2, 3, 4, 5]) == ([4, 5], 'usage : 100 %')\"...
{ "split": "train", "index": 5030, "acecode_id": "oss_14282", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `shuffle_list(nums: List[int], buffer_size: int) -> List[int]` that shuffles the list in place using a buffer of a specified size. The function should take two parameters: `nums`, a list of integers, and `buffer_size`, an integer r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shuffle_list([10, 20, 30, 40, 50], 5) == [10, 20, 30, 40, 50]\", \"assert shuffle_list([], 5) == []\", \"assert shuffle_list([1], 1) == [1]\", \"assert shuffle_list([100, 200], 1) == [100, 200]\", \"assert shuffle_list([10, 20, 30], 10) == [10, 20, 30]\", \"...
{ "split": "train", "index": 5031, "acecode_id": "bigcode_python_fns_19869", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the edit distance between two DNA sequences. The edit distance is defined as the minimum number of operations required to transform one string into another, where substitutions cost 2, and both insertions and deletions...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert edit_distance('AACCTG', 'ACCTG') == 1\", \"assert edit_distance('AGT', 'AGTC') == 1\", \"assert edit_distance('A', 'B') == 2\", \"assert edit_distance('DNA', 'DNA') == 0\", \"assert edit_distance('', 'ABC') == 3\", \"assert edit_distance('ABC', '') == 3\", \...
{ "split": "train", "index": 5032, "acecode_id": "evol_9874", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that takes a positive integer n and generates an array of numbers starting from n down to 0, inclusive. The function should return the array. For example, if the input is 5, the output should be [5, 4, 3, 2, 1, 0].\nPlease reason step by step, then write a sel...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_array(1) == [1, 0]\", \"assert generate_array(2) == [2, 1, 0]\", \"assert generate_array(3) == [3, 2, 1, 0]\", \"assert generate_array(4) == [4, 3, 2, 1, 0]\", \"assert generate_array(5) == [5, 4, 3, 2, 1, 0]\", \"assert generate_array(10) == [10, 9...
{ "split": "train", "index": 5033, "acecode_id": "evol_24988", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that processes a string containing various types of brackets: round brackets '()', square brackets '[]', curly brackets '{}', and angle brackets '<>'. The string may contain nested groups of these brackets, and it may also contain irregula...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert separate_bracket_groups('(()') == []\", \"assert separate_bracket_groups(')(') == []\", \"assert separate_bracket_groups('((()))') == ['((()))']\", \"assert separate_bracket_groups('{[<>()]}') == ['{[<>()]}']\", \"assert separate_bracket_groups('<<>>') == ['...
{ "split": "train", "index": 5034, "acecode_id": "evol_33332", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that retrieves the URL of a pre-trained Vision Transformer (ViT) model based on the specified model name and image resolution. The function, `get_vit_model_url(model_name, image_resolution)`, should take two input parameters: `mode...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_vit_model_url('vit_small_patch16_224', (3, 224, 224)) == 'https://storage.googleapis.com/vit_models/augreg/S_16-i21k-300ep-lr_0.001-aug_light1-wd_0.03-do_0.0-sd_0.0--imagenet2012-steps_20k-lr_0.03-res_224.npz'\", \"assert get_vit_model_url('vit_base_patc...
{ "split": "train", "index": 5035, "acecode_id": "oss_18433", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `complex_addition(a: Tuple[int, int], b: Tuple[int, int]) -> Tuple[int, int]` that takes two complex numbers represented as tuples (real part, imaginary part) and returns their sum as a tuple (real part, imaginary part).\nPlease reason step by step, then wr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert complex_addition((1, 2), (3, 4)) == (4, 6)\", \"assert complex_addition((0, 0), (0, 0)) == (0, 0)\", \"assert complex_addition((-1, -1), (1, 1)) == (0, 0)\", \"assert complex_addition((5, 7), (2, 3)) == (7, 10)\", \"assert complex_addition((0, 1), (1, 0)) ==...
{ "split": "train", "index": 5036, "acecode_id": "evol_6794", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of numbers and a comparison function. Your task is to implement a function called `versatile_median` that constructs a binary search tree (BST) from the numbers in the list using the comparison function to determine the placement of each number. After const...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert versatile_median([1, 3, 2], lambda a, b: a < b) == 2\", \"assert versatile_median([7, 2, 5, 10, 6], lambda a, b: a < b) == 6\", \"assert versatile_median([1], lambda a, b: a < b) == 1\", \"assert versatile_median([1, 2], lambda a, b: a < b) == 1.5\", \"asser...
{ "split": "train", "index": 5037, "acecode_id": "evol_18513", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python program to process and analyze a list of 3D shapes along with their corresponding chamfer distances. Implement a function named `find_shape_with_min_chamfer_distance` that takes a list of tuples as input, where each tuple contains the shape...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_shape_with_min_chamfer_distance([('cube', 0.12), ('sphere', 0.08), ('cylinder', 0.05)]) == ('cylinder', 0.05)\", \"assert find_shape_with_min_chamfer_distance([('cube', 0.5), ('sphere', 0.3), ('tetrahedron', 0.2)]) == ('tetrahedron', 0.2)\", \"assert fi...
{ "split": "train", "index": 5038, "acecode_id": "oss_24144", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that identifies the non-identical elements present in two provided tuples, quantifies the frequency of these non-identical elements in both tuples, and pinpoints the originating tuple of the non-identical element. The function should yield a dictionary where ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_tuples((1, 2, 3), (2, 3, 4)) == {1: (1, 'tuple1'), 4: (1, 'tuple2')}\", \"assert compare_tuples((1, 2), (1, 2)) == {}\", \"assert compare_tuples((1, (2, 3)), (3, [4, 5])) == {1: (1, 'tuple1'), 2: (1, 'tuple1'), 4: (1, 'tuple2'), 5: (1, 'tuple2')}\", ...
{ "split": "train", "index": 5039, "acecode_id": "evol_27537", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Write a function that takes an array of numbers (which can include both integers and floating-point numbers) and calculates the total product of the elements within the array. You should not use any built-in Python functions or methods for multiplication. The function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product_of_elements([4, 8, 1, 6]) == 192.0\", \"assert product_of_elements([0, 1, 2, 3]) == 0.0\", \"assert product_of_elements([-1, -2, -3]) == -6.0\", \"assert product_of_elements([1, 2, 3, 4, 5]) == 120.0\", \"assert product_of_elements([]) == 1.0\", \"as...
{ "split": "train", "index": 5040, "acecode_id": "evol_28814", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that computes the duration of an activity given its start and end times. The input times are represented in a 24-hour format (e.g., \"13:45\", \"09:30\"). Your function should calculate the duration of the activity in hours and minute...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_duration('09:00', '10:00') == '1 hours 0 minutes'\", \"assert compute_duration('10:30', '12:15') == '1 hours 45 minutes'\", \"assert compute_duration('14:00', '14:30') == '0 hours 30 minutes'\", \"assert compute_duration('23:30', '00:15') == '0 hours...
{ "split": "train", "index": 5041, "acecode_id": "oss_20395", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that calculates the sum of four integer inputs: a, b, c, and d. However, the function should return an error message if any of the inputs are None. Your function should be defined as `def calculate_sum(a=0, b=0, c=0, d=0):` where all param...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum(1, 2, 3, 4) == 10\", \"assert calculate_sum(0, 0, 0, 0) == 0\", \"assert calculate_sum(5, 10, 15, 20) == 50\", \"assert calculate_sum(-1, -2, -3, -4) == -10\", \"assert calculate_sum(1) == 1\", \"assert calculate_sum(1, 2) == 3\", \"assert calc...
{ "split": "train", "index": 5042, "acecode_id": "oss_37711", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function `find_twin_primes(start: int, end: int) -> List[Tuple[int, int]]` that returns a list of all twin prime pairs between the given start and end (inclusive). Twin primes are pairs of prime numbers that differ by two. The function should return the list of twin pri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_twin_primes(50, 70) == [(59, 61)]\", \"assert find_twin_primes(20, 40) == [(29, 31)]\", \"assert find_twin_primes(30, 50) == [(41, 43)]\", \"assert find_twin_primes(50, 50) == []\", \"assert find_twin_primes(60, 80) == [(71, 73)]\", \"assert find_twin_p...
{ "split": "train", "index": 5043, "acecode_id": "evol_8356", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the average grade for a list of students based on their grades. You are given a list of strings, where each string represents a student's name followed by their grade, separated by a comma. Your function should process this list, calculate the av...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_grades(['Alice,85', 'Bob,90', 'Alice,92', 'Bob,88']) == ['Alice,88.5', 'Bob,89.0']\", \"assert calculate_average_grades(['John,75', 'Jane,85', 'John,95']) == ['John,85.0', 'Jane,85.0']\", \"assert calculate_average_grades(['Sam,65', 'Sam,70...
{ "split": "train", "index": 5044, "acecode_id": "oss_7256", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of package dependencies and returns a dictionary containing the count of each unique dependency. Each dependency is represented as a string containing a package name followed by a version, separated by double ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_dependencies(['numpy==1.19.5', 'tensorflow==2.5.0', 'keras==2.4.3', 'flask==1.1.2', 'numpy==1.19.5', 'tensorflow==2.5.0', 'numpy==1.19.5']) == {'numpy==1.19.5': 3, 'tensorflow==2.5.0': 2, 'keras==2.4.3': 1, 'flask==1.1.2': 1}\", \"assert count_dependen...
{ "split": "train", "index": 5045, "acecode_id": "oss_21671", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a retry mechanism for connecting to a resource that might fail intermittently. Implement a function `retry_connection(max_attempts: int, delay: int) -> List[str]` that takes two parameters: `max_attempts`, an integer repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retry_connection(3, 1) in [['Connection successful', 1], ['Connection successful', 2], ['Connection failed', 3]]\", \"assert retry_connection(5, 2) in [['Connection successful', 1], ['Connection successful', 2], ['Connection successful', 3], ['Connection suc...
{ "split": "train", "index": 5046, "acecode_id": "bigcode_python_fns_36362", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing COVID-19 statistics for England. Write a function `get_covid_statistics(data: List[Dict[str, Union[str, int]]]) -> Dict[str, int]` that takes a list of dictionaries, where each dictionary contains the following keys: 'date' (string in 'YYYY-MM-DD' ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_covid_statistics([{'date': '2023-01-01', 'newCasesByPublishDate': 100, 'newAdmissions': 10, 'cumDailyNsoDeathsByDeathDate': 1}, {'date': '2023-01-02', 'newCasesByPublishDate': 200, 'newAdmissions': 20, 'cumDailyNsoDeathsByDeathDate': 2}]) == {'totalNewCa...
{ "split": "train", "index": 5047, "acecode_id": "bigcode_python_fns_9470", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with managing a set of tasks and their connections. Each task is represented by a unique identifier, and connections are established between output parameters of one task and input parameters of another task. Implement a function `get_connected_tasks(tasks: List[...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_connected_tasks([('task1', ['input1'], ['output1']), ('task2', ['input2'], ['output2'])], [('task1', 'output1', 'task2', 'input2')], 'task1') == ['task2']\", \"assert get_connected_tasks([('task1', ['input1'], ['output1']), ('task2', ['input2'], ['output...
{ "split": "train", "index": 5048, "acecode_id": "oss_34870", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with designing a function that transforms a given list of integers by doubling each element in the list and returning a new list containing these doubled values. The function should be able to handle an empty list as well, returning an empty list in that case. Im...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert double_elements([]) == []\", \"assert double_elements([1]) == [2]\", \"assert double_elements([0]) == [0]\", \"assert double_elements([2, 4, 6]) == [4, 8, 12]\", \"assert double_elements([-1, -2, -3]) == [-2, -4, -6]\", \"assert double_elements([10, 20, 30])...
{ "split": "train", "index": 5049, "acecode_id": "oss_27434", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a JSON-like dictionary representing a document that contains a list of types. Each type can have fields, and some types may have an import reference. Your task is to implement a function that processes this document by filtering out types based on the import refer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rewrite_schemadef({'types': [{'name': 'type1', 'fields': [{'name': 'field1'}], '$import': 'import1'}, {'name': 'type2', 'fields': [{'name': 'field2'}, {'name': 'field3'}]}]}) == {'import1'}\", \"assert rewrite_schemadef({'types': [{'name': 'type1/type2', 'fi...
{ "split": "train", "index": 5050, "acecode_id": "bigcode_python_fns_39955", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two vectors represented as lists of numbers, implement a function `dot_product(u: List[float], v: List[float]) -> float` that returns the dot product of the two vectors. The dot product is calculated as the sum of the products of the corresponding entries of the two seque...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dot_product([0.0, 2.0, 1.0], [1.0, -0.5, 2.0]) == 1.0\", \"assert dot_product([1.0, 2.0, 3.0], [4.0, 5.0, 6.0]) == 32.0\", \"assert dot_product([1.0, -1.0, 2.0], [2.0, 0.0, -3.0]) == -4.0\", \"assert dot_product([], []) == 0.0\", \"assert dot_product([0.0], ...
{ "split": "train", "index": 5051, "acecode_id": "bigcode_python_fns_40638", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of tuples representing physical characteristics of an object, where each tuple contains a feature name (as a string) and its corresponding value. The first tuple in the list must specifically contain 'Height' as the feature name and '6.3' ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_json_object([('Height', '6.3'), ('Weight', '75.4'), ('Color', 'Red')]) == '{\\\"Height\\\": \\\"6.3\\\", \\\"Weight\\\": \\\"75.4\\\", \\\"Color\\\": \\\"Red\\\"}'\", \"assert create_json_object([('Height', '6.3')]) == '{\\\"Height\\\": \\\"6.3\\\"}'\...
{ "split": "train", "index": 5052, "acecode_id": "evol_11797", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a 2D list representing an image, where each element is a list of three integers (representing RGB values) ranging from 0 to 255, write a function `is_white_on_edges(image: List[List[List[int]]]) -> bool` that checks if all pixels on the edges of the image are white. A pix...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_white_on_edges([[[255, 255, 255], [255, 255, 255]], [[255, 255, 255], [255, 255, 255]]]) == True\", \"assert is_white_on_edges([[[240, 240, 240], [240, 240, 240]], [[240, 240, 240], [240, 240, 240]]]) == True\", \"assert is_white_on_edges([[[255, 255, 255...
{ "split": "train", "index": 5053, "acecode_id": "bigcode_python_fns_8230", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the indices of qubits, write a function `inverse_quantum_fourier_transform` that returns a list representing the inverse quantum Fourier transform operations to be applied to the given qubits. The output should be a list of operations in th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert inverse_quantum_fourier_transform([0, 1, 2]) == ['inv_qft(2)', 'inv_qft(1)', 'inv_qft(0)']\", \"assert inverse_quantum_fourier_transform([1, 2, 3, 4]) == ['inv_qft(4)', 'inv_qft(3)', 'inv_qft(2)', 'inv_qft(1)']\", \"assert inverse_quantum_fourier_transform([...
{ "split": "train", "index": 5054, "acecode_id": "bigcode_python_fns_22567", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representation of a GeoJSON object. Your task is to implement a function that checks if the provided GeoJSON string is valid according to the GeoJSON format specification. The function should return True if the GeoJSON is valid and False otherwise. The Ge...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_geojson('{\\\"type\\\":\\\"Feature\\\", \\\"properties\\\":{}, \\\"geometry\\\":{\\\"type\\\":\\\"Point\\\", \\\"coordinates\\\":[8.5781228542328, 22.87500500679]}}') == True\", \"assert is_valid_geojson('{\\\"type\\\":\\\"FeatureCollection\\\", \\\...
{ "split": "train", "index": 5055, "acecode_id": "bigcode_python_fns_19610", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s`, define a function `f(s)` that returns the count of the lexicographically smallest character in the string `s`. Write a function `numSmallerByFrequency(queries, words)` that takes a list of strings `queries` and a list of strings `words`. For each string in `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert numSmallerByFrequency(['cbd'], ['zaaaz']) == [1]\", \"assert numSmallerByFrequency(['bbb', 'cc'], ['a', 'aa', 'aaa', 'aaaa']) == [1, 2]\", \"assert numSmallerByFrequency(['a'], ['b', 'c']) == [0]\", \"assert numSmallerByFrequency(['z'], ['z', 'y', 'x', 'w'])...
{ "split": "train", "index": 5056, "acecode_id": "evol_35596", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that prepares a virtual environment based on provided input parameters. The function should be called `prepare_virtual_environment`. It takes three parameters: a dictionary `config`, a string `env_file`, and a boolean `install_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prepare_virtual_environment({'skip_consistency_check': False}, 'env.yaml', True) == 'Consistency check performed; Dependencies installed; Environment set up using env.yaml'\", \"assert prepare_virtual_environment({'skip_consistency_check': True}, 'env.yaml',...
{ "split": "train", "index": 5057, "acecode_id": "oss_5701", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of Auto Scaling Group names and a target name. Your task is to determine if the target name exists in the list. If it does exist, return the index of the target name in the list. If it does not exist, return -1. Write a function `find_auto_scaling_group_ind...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_auto_scaling_group_index(['group1', 'group2', 'group3'], 'group2') == 1\", \"assert find_auto_scaling_group_index(['groupA', 'groupB', 'groupC'], 'groupD') == -1\", \"assert find_auto_scaling_group_index(['alpha', 'beta', 'gamma'], 'alpha') == 0\", \"as...
{ "split": "train", "index": 5058, "acecode_id": "bigcode_python_fns_35454", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `startswith(x: Union[List[str], str], prefix: str) -> List[bool]` that determines if each entry in the input `x` (which can be either a list of strings or a single string) starts with the specified `prefix`. Return a list of boolean values where each entry ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert startswith(['apple', 'banana', 'apricot'], 'ap') == [True, False, True]\", \"assert startswith('cherry', 'che') == [True]\", \"assert startswith(['grape', 'orange', 'blueberry'], 'b') == [False, False, True]\", \"assert startswith(['kiwi', 'kiwi fruit', 'mel...
{ "split": "train", "index": 5059, "acecode_id": "bigcode_python_fns_9371", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_doubly_linked_list(values: List[Any]) -> DoublyLinkedList` that takes a list of values and creates a doubly linked list from them. The function should return the head of the newly created doubly linked list. If the input list is empty, the function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_doubly_linked_list([]) is None\", \"assert create_doubly_linked_list([1]).head.data == 1\", \"assert create_doubly_linked_list(['A', 'B', 'C']).head.data == 'A'\", \"assert create_doubly_linked_list(['A', 'B', 'C']).head.next.data == 'B'\", \"assert c...
{ "split": "train", "index": 5060, "acecode_id": "evol_10207", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that identifies reduced states from a given list of states. A state is represented as a dictionary, and a state is considered reduced if it contains only one key, and the value associated with that key is a list that contains at least...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_reduced_states([{'x': ['data.']}, {'y': ['info']}, {'z': ['sample.']}, {'w': []}]) == {0: {'x': ['data.']}, 2: {'z': ['sample.']}}\", \"assert get_reduced_states([{'state1': ['valid.']}, {'state2': ['not valid']}, {'state3': ['end.']}, {'state4': ['anoth...
{ "split": "train", "index": 5061, "acecode_id": "oss_1588", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the unique elements from the input list, preserving the original order of their first occurrence. Write a function `remove_duplicates(nums: List[int]) -> List[int]` that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([4, 4, 4, 4]) == [4]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert remove_duplicates([-1, -2, -2, -3, -1]...
{ "split": "train", "index": 5062, "acecode_id": "oss_7421", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers `nums` and an integer `i`. Your task is to implement the function `helper(nums, i)` that returns the value of the list at index `i` if the index is valid. If the index `i` is equal to the length of the list `nums` minus 1, return the last elemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert helper([1, 2, 3], 2) == 3\", \"assert helper([5, 10, 15, 20], 3) == 20\", \"assert helper([7, 14, 21], 1) == 14\", \"assert helper([9], 0) == 9\", \"assert helper([], 0) == -1\", \"assert helper([1, 2, 3, 4, 5], 2) == 3\", \"assert helper([10, 20], 1) == 20\...
{ "split": "train", "index": 5063, "acecode_id": "oss_34091", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing column names and a target string. Your task is to find the first column name that matches the target string, ignoring case differences. If no column name matches the target, return None. Implement a function called `find_matching_col...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_matching_column(['Name', 'Age', 'Gender'], 'age') == 'Age'\", \"assert find_matching_column(['Height', 'Weight', 'BMI'], 'BMI') == 'BMI'\", \"assert find_matching_column(['Location', 'Country', 'City'], 'city') == 'City'\", \"assert find_matching_column...
{ "split": "train", "index": 5064, "acecode_id": "bigcode_python_fns_47752", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `s` consisting only of uppercase English letters. Your task is to write a function `findUniqueCharacter(s)` that returns the first unique character in the string. A unique character is defined as one that appears exactly once in the string. If no unique c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findUniqueCharacter('AABBCC') == ''\", \"assert findUniqueCharacter('ABCDEFG') == 'A'\", \"assert findUniqueCharacter('XXYYZZA') == 'A'\", \"assert findUniqueCharacter('HELLO') == 'H'\", \"assert findUniqueCharacter('RACECAR') == 'E'\", \"assert findUniqueCh...
{ "split": "train", "index": 5065, "acecode_id": "oss_20381", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, return the length of the longest increasing subsequence consisting of consecutive elements, regardless of their original indices. If there are multiple subsequences with the maximum length, return the length. If there is only one subsequence with the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_longest_increasing_subsequence([1]) == 1\", \"assert find_longest_increasing_subsequence([]) == 0\", \"assert find_longest_increasing_subsequence([1, 1, 1, 1]) == 1\", \"assert find_longest_increasing_subsequence([0, 1, 0, 2, 3]) == 4\", \"assert find_l...
{ "split": "train", "index": 5066, "acecode_id": "evol_20681", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a string of numerical values separated by commas, implement a function `shuffle_values(input_str: str) -> List[str]` that returns a list of the values rearranged in a random order. For example, if the input is '1, 3, 5, 7, 9', the output could be a list such as ['3', '1',...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shuffle_values('1, 2, 3') != ['1', '2', '3']\", \"assert len(shuffle_values('10, 20, 30')) == 3\", \"assert set(shuffle_values('1, 2, 3')) == {'1', '2', '3'}\", \"assert shuffle_values('4, 5, 6') != ['4', '5', '6']\", \"assert shuffle_values('7') == ['7']\",...
{ "split": "train", "index": 5067, "acecode_id": "evol_1154", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that contains bounding box coordinates (x and y values) along with other attributes. Your task is to write a function that scales the x and y coordinates of these bounding boxes based on a new image size and the original image size. The function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scale_annotations({'x1': 100, 'y1': 200, 'label': 'car'}, (800, 600), (400, 300)) == {'x1': 200.0, 'y1': 400.0, 'label': 'car'}\", \"assert scale_annotations({'x_center': 250, 'y_center': 350, 'category': 'bike'}, (640, 480), (320, 240)) == {'x_center': 500....
{ "split": "train", "index": 5068, "acecode_id": "bigcode_python_fns_32324", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple file caching functionality in Python. Your goal is to create a function `cache_object(obj: Any, filename: str)` that stores a Python object into a file using serialization. The function should accept two parameters: the object to be cac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cache_object({'key': 'value'}, 'test_file_1.pkl') == True\", \"assert cache_object([1, 2, 3], 'test_file_2.pkl') == True\", \"assert cache_object('Hello, World!', 'test_file_3.pkl') == True\", \"assert cache_object(12345, 'test_file_4.pkl') == True\", \"asse...
{ "split": "train", "index": 5069, "acecode_id": "oss_14106", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a recursive function that takes a string as input and returns a boolean indicating whether the string is a palindrome. A palindrome is a string that reads the same forwards and backwards, ignoring special characters, punctuation, and case sensitivity. Do not use slicing t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('') == Tr...
{ "split": "train", "index": 5070, "acecode_id": "evol_8184", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `create_circular_linked_list(n: int) -> List[int]` that generates a circular linked list containing numbers from 1 to n. The function should return the elements in the circular linked list starting from the head node in the order they are linked. For example, i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_circular_linked_list(1) == [1]\", \"assert create_circular_linked_list(2) == [1, 2]\", \"assert create_circular_linked_list(3) == [1, 2, 3]\", \"assert create_circular_linked_list(4) == [1, 2, 3, 4]\", \"assert create_circular_linked_list(5) == [1, 2,...
{ "split": "train", "index": 5071, "acecode_id": "evol_6282", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_key(length: int) -> str` that generates a randomized ASCII string of exactly `length` characters. The ASCII characters should be in the range of 33 to 126 (inclusive). The function should return the generated string. Note that the generated string sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_key(15)) == 15\", \"assert len(generate_key(10)) == 10\", \"assert len(generate_key(5)) == 5\", \"assert len(generate_key(20)) == 20\", \"assert all(33 <= ord(c) <= 126 for c in generate_key(15))\", \"assert all(33 <= ord(c) <= 126 for c in gene...
{ "split": "train", "index": 5072, "acecode_id": "evol_21349", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that maps two-character instrument codes to their corresponding instrument names. Implement a function `get_instrument_name(instrument_code: str) -> Optional[str]` that takes in a two-character instrument code and returns the full instrument name if i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_instrument_name('AB') == 'Guitar'\", \"assert get_instrument_name('CD') == 'Piano'\", \"assert get_instrument_name('EF') == 'Violin'\", \"assert get_instrument_name('GH') == 'Drums'\", \"assert get_instrument_name('IJ') == 'Flute'\", \"assert get_instrum...
{ "split": "train", "index": 5073, "acecode_id": "bigcode_python_fns_20658", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the sum of the first N elements in a series of natural numbers. The function should return 0 for non-positive integers and raise a ValueError for non-integer types. Optimize your solution for a large value of N (up to 10^9).\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_series(1) == 1\", \"assert sum_series(2) == 3\", \"assert sum_series(3) == 6\", \"assert sum_series(10) == 55\", \"assert sum_series(100) == 5050\", \"assert sum_series(1000) == 500500\", \"assert sum_series(10000) == 50005000\", \"assert sum_series(1000...
{ "split": "train", "index": 5074, "acecode_id": "evol_35242", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `connect_to_database(db: str) -> sqlite3.Cursor` that attempts to connect to a SQLite database specified by the `db` parameter. If the connection is successful, the function should return the cursor object. If an error occurs while trying to connect to the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert connect_to_database('valid_database.db') is not None\", \"assert connect_to_database('another_valid_database.db') is not None\", \"assert connect_to_database('non_existent_folder/non_existent_database.db') is None\", \"assert connect_to_database('temp.db') i...
{ "split": "train", "index": 5075, "acecode_id": "evol_16926", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a list of slider identifiers based on a given number and a maximum count. The function should take two parameters: an integer 'no' representing the slider group number and an integer 'f' representing the number of sliders t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_sliders(1, 3) == ['Slider_1_1', 'Slider_1_2', 'Slider_1_3']\", \"assert make_sliders(2, 2) == ['Slider_2_1', 'Slider_2_2']\", \"assert make_sliders(0, 1) == ['Slider_0_1']\", \"assert make_sliders(5, 0) == []\", \"assert make_sliders(3, 5) == ['Slider_3...
{ "split": "train", "index": 5076, "acecode_id": "bigcode_python_fns_4410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a command-line argument parser for logging configuration. The function should accept two optional parameters: `log_level` and `config_location`. The `log_level` parameter should accept one of four predefined...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_arguments() == {'log_level': 'INFO', 'config_location': '/config.yml'}\", \"assert parse_arguments(log_level='DEBUG') == {'log_level': 'DEBUG', 'config_location': '/config.yml'}\", \"assert parse_arguments(log_level='INFO') == {'log_level': 'INFO', 'co...
{ "split": "train", "index": 5077, "acecode_id": "oss_30353", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a flashcard management system. Each flashcard has a question, an answer, and an easy factor that determines the next practice interval. Your task is to implement a function `update_easy_factor(score: int, current_easy_factor: float) -> float` th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_easy_factor(3, 2.5) == 2.5\", \"assert update_easy_factor(1, 2.5) == 2.2\", \"assert update_easy_factor(3, 2.4) == 2.5\", \"assert update_easy_factor(2, 2.4) == 2.5\", \"assert update_easy_factor(1, 2.4) == 2.1\", \"assert update_easy_factor(3, 1.5) =...
{ "split": "train", "index": 5078, "acecode_id": "oss_28862", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the unique elements from the original list, preserving the order of their first occurrence. Write a function named `get_unique_elements` that accepts one parameter: a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 2, 3, 4, 1, 5]) == [1, 2, 3, 4, 5]\", \"assert get_unique_elements([1]) == [1]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_elements([1, 1, 1, 1]) == [1]\", \"assert get_unique_elements([5, 5, 4, 4, 3, 3, 2, 2, ...
{ "split": "train", "index": 5079, "acecode_id": "oss_10844", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing an IP address and a string representing a netmask, implement a function that calculates the network address. The network address is derived by applying the netmask to the IP address. The function should return the network address as a string. The IP ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getNetAddress('192.168.1.1', '255.255.255.0') == '192.168.1.0'\", \"assert getNetAddress('10.0.0.5', '255.0.0.0') == '10.0.0.0'\", \"assert getNetAddress('172.16.0.10', '255.255.0.0') == '172.16.0.0'\", \"assert getNetAddress('192.168.0.10', '255.255.255.128...
{ "split": "train", "index": 5080, "acecode_id": "bigcode_python_fns_14157", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of floating-point numbers and a dictionary. Your function should perform the following operations: 1. Assign the first element of the list to the key 'latent' in the dictionary. 2. Return the first element of the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert complete_and_save({}, [3.14]) == 3.14\", \"assert complete_and_save({'key': 1}, [2.71]) == 2.71\", \"assert complete_and_save({}, [1.0, 2.0, 3.0]) == 1.0\", \"assert complete_and_save({}, [0.5, 0.75]) == 0.5\", \"assert complete_and_save({'a': 'test'}, [10.0...
{ "split": "train", "index": 5081, "acecode_id": "oss_4490", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `encode_cyclic(z: str) -> str` that takes a string as input and returns an encoded string by cycling groups of three characters. Each group of three characters should have the first character moved to the end of the group. If the last group has fewer than t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_cyclic('abc') == 'bca'\", \"assert encode_cyclic('ab') == 'ab'\", \"assert encode_cyclic('a') == 'a'\", \"assert encode_cyclic('') == ''\", \"assert encode_cyclic('xyz') == 'yzx'\"]}" }
{ "split": "train", "index": 5082, "acecode_id": "evol_19448", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the construction of a ResNet-34 model with specified parameters. The function should take four parameters: `pretrained` (a boolean indicating whether to return a pre-trained model), `shift` (a string that indicates the type...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_resnet34(True, 'TSM', 8, 0) == {'pretrained_weights': 'loaded', 'shift': 'TSM', 'num_segments': 8, 'flow_estimation': 0}\", \"assert construct_resnet34(False, 'TSM', 16, 1) == {'pretrained_weights': 'not loaded', 'shift': 'TSM', 'num_segments': 16,...
{ "split": "train", "index": 5083, "acecode_id": "bigcode_python_fns_39926", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in a restaurant name and cuisine type as strings, and returns a formatted string describing the restaurant in title case. The function signature is `def describe_restaurant(restaurant_name: str, cuisine_type: str) -> str:`. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert describe_restaurant('tasty bites', 'indian') == 'Restaurant Name: Tasty Bites, Cuisine Type: Indian'\", \"assert describe_restaurant('pasta palace', 'italian') == 'Restaurant Name: Pasta Palace, Cuisine Type: Italian'\", \"assert describe_restaurant('sushi s...
{ "split": "train", "index": 5084, "acecode_id": "oss_23959", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and decimals, implement a function `hybrid_sort(lst)` that arranges the list in a special order where the ordering starts with the smallest value, then the largest, then the smallest of the remaining values not yet included in the output, and continue t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hybrid_sort([1, 2, 3, 4]) == [1, 4, 2, 3]\", \"assert hybrid_sort([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert hybrid_sort([]) == []\", \"assert hybrid_sort([-2, 1.5, 3.5, -1]) == [-2, 3.5, -1, 1.5]\", \"assert hybrid_sort([10, 20, 30, 40, 50]) == [10, 50, 20, ...
{ "split": "train", "index": 5085, "acecode_id": "evol_11926", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing temperatures in degrees Celsius. Write a function that determines the number of times the temperature exceeds a certain threshold. The function should take in two parameters: a list of integers 'temperatures' and an integer 'thresho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_exceeding_temperatures([0, -5, 10, 15], 5) == 2\", \"assert count_exceeding_temperatures([-10, -5, 0, 5], 0) == 1\", \"assert count_exceeding_temperatures([100, 200, 300], 150) == 2\", \"assert count_exceeding_temperatures([], 10) == 0\", \"assert coun...
{ "split": "train", "index": 5086, "acecode_id": "bigcode_python_fns_29673", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `shuffle_and_draw(seed: int, draw_count: int, max_closed: int) -> Tuple[int, int, int]` that simulates a card game. The function takes in three parameters: `seed` (an integer used for shuffling the deck), `draw_count` (an integer repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shuffle_and_draw(1, 5, 2) == (1, 5, 7)\", \"assert shuffle_and_draw(10, 3, 4) == (10, 3, 7)\", \"assert shuffle_and_draw(0, 0, 0) == (0, 0, 0)\", \"assert shuffle_and_draw(100, 10, 1) == (100, 10, 11)\", \"assert shuffle_and_draw(5, 5, 5) == (5, 5, 10)\", \"...
{ "split": "train", "index": 5087, "acecode_id": "bigcode_python_fns_1610", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that returns the total number of unique subarrays. A subarray is defined as a contiguous portion of the array.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```pytho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_subarrays([3, 1, 4, 2, 5]) == 15\", \"assert count_unique_subarrays([1, 1, 1]) == 3\", \"assert count_unique_subarrays([2, 2, 2, 2]) == 4\", \"assert count_unique_subarrays([]) == 0\", \"assert count_unique_subarrays([5]) == 1\", \"assert count_...
{ "split": "train", "index": 5088, "acecode_id": "evol_8952", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with translating a DNA sequence into its corresponding amino acid sequence using the genetic code. Write a function `translate_dna_to_protein(dna_sequence: str) -> str` that takes a DNA sequence as input and returns the corresponding protein sequence. The transla...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate_dna_to_protein('ATGTTTAA') == 'MF'\", \"assert translate_dna_to_protein('ATG') == 'M'\", \"assert translate_dna_to_protein('') == ''\", \"assert translate_dna_to_protein('A') == ''\", \"assert translate_dna_to_protein('AT') == ''\", \"assert transl...
{ "split": "train", "index": 5089, "acecode_id": "oss_37002", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of lists of integers representing benchmark results for multiple algorithm-problem pairs, write a function `calculate_median(benchmark_result)` that returns a list containing the median of the integers for each algorithm-problem pair. Each inner list represents the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_median([[1, 2], [3, 4, 5], [6]]) == [1, 4, 6]\", \"assert calculate_median([[1], [2], [3]]) == [1, 2, 3]\", \"assert calculate_median([[1, 2, 3, 4], [5, 6], [7, 8, 9]]) == [2, 5, 8]\", \"assert calculate_median([[1, 2, 3], [1, 2], [1]]) == [2, 1, 1...
{ "split": "train", "index": 5090, "acecode_id": "bigcode_python_fns_8308", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of column attributes, each represented as a dictionary with the following keys: `key`, `doc`, and `type`, and returns a list of formatted strings. Each string in the output should contain the column key, its documentatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_columns([{ 'key': 'id', 'doc': 'Primary Key', 'type': 'Integer' }, { 'key': 'name', 'doc': None, 'type': 'String' }, { 'key': 'created_at', 'doc': 'Creation timestamp', 'type': 'DateTime' }]) == ['Key: id, Doc: Primary Key, Type: Integer', 'Key: name,...
{ "split": "train", "index": 5091, "acecode_id": "bigcode_python_fns_29961", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of strings and returns a new list containing only the strings that contain the letter 'a'. Each string in the input list should be checked in a case-insensitive manner. Your function should have the following signatu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_strings_with_a(['apple', 'banana', 'cherry']) == ['apple', 'banana']\", \"assert filter_strings_with_a(['Hello', 'world', 'Python']) == []\", \"assert filter_strings_with_a(['test', 'case', 'python', 'java']) == ['case', 'java']\", \"assert filter_str...
{ "split": "train", "index": 5092, "acecode_id": "oss_32544", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function `list_length_and_is_prime(lst)` that takes a list as input and returns a tuple containing the length of the list and a boolean indicating whether that length is a prime number. The function should handle any possible TypeError exceptions gracefully, returning (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_length_and_is_prime([1, 2, 3]) == (3, True)\", \"assert list_length_and_is_prime([]) == (0, False)\", \"assert list_length_and_is_prime(['a', 'b', 'c', 'd']) == (4, False)\", \"assert list_length_and_is_prime([1, 2, 3, 4, 5]) == (5, True)\", \"assert li...
{ "split": "train", "index": 5093, "acecode_id": "evol_3792", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates a URL and simulates connecting to a controller for a home automation system. The function should take a configuration dictionary `config` as input, which contains a key `CONF_CONTROLLER` representing the base URL of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_and_create_config_entry({'CONF_CONTROLLER': 'http://valid-url.com'}) == '123456789'\", \"assert validate_and_create_config_entry({'CONF_CONTROLLER': 'http://invalid-url.com'}) == 'cannot_connect: http://invalid-url.com'\", \"assert validate_and_crea...
{ "split": "train", "index": 5094, "acecode_id": "oss_28788", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given two appointments represented by their start and end times on the same day. Each appointment is defined by a start time and an end time in 24-hour format (HH:MM). Your task is to write a function that determines whether the two appointments overlap. The function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_time_overlap(('09:00', '10:00'), ('10:00', '11:00')) == False\", \"assert compute_time_overlap(('09:00', '10:30'), ('10:00', '11:00')) == True\", \"assert compute_time_overlap(('10:00', '11:00'), ('10:00', '11:00')) == True\", \"assert compute_time_o...
{ "split": "train", "index": 5095, "acecode_id": "bigcode_python_fns_29559", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary of schemas where each schema is represented by a string containing its name and a boolean indicating whether it inherits from another schema, write a function `get_base_schema(name: str, schemas: Dict[str, bool]) -> str` that returns the base class name for t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_base_schema('SchemaB', {'SchemaA': True, 'SchemaB': False}) == 'Base'\", \"assert get_base_schema('SchemaC', {'SchemaC': False}) == 'Base'\", \"assert get_base_schema('SchemaE', {'SchemaD': True, 'SchemaE': False}) == 'Base'\", \"assert get_base_schema('...
{ "split": "train", "index": 5096, "acecode_id": "bigcode_python_fns_29448", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a CSV file represented as a list of strings, where each string is a line from the CSV. Your function should calculate the average of the numeric values in each column, ignoring any non-numeric entries. The input will be a l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_column_averages(['a,b,c', '1,2,3', '4,5,6']) == [2.5, 3.5, 4.5]\", \"assert calculate_column_averages(['col1,col2', '10.5,20.5', '30,40']) == [20.25, 30.25]\", \"assert calculate_column_averages(['x,y,z', '100,200,300', 'a,b,c', '10,20,30']) == [55...
{ "split": "train", "index": 5097, "acecode_id": "bigcode_python_fns_47994", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the minimum number of moves required to solve the Tower of Hanoi problem for a given number of disks. The Tower of Hanoi is a mathematical puzzle where you have three rods and n disks of different sizes which can slide...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_moves(0) == 0\", \"assert min_moves(1) == 1\", \"assert min_moves(2) == 3\", \"assert min_moves(3) == 7\", \"assert min_moves(4) == 15\", \"assert min_moves(5) == 31\", \"assert min_moves(6) == 63\", \"assert min_moves(7) == 127\", \"assert min_moves(8) ...
{ "split": "train", "index": 5098, "acecode_id": "bigcode_python_fns_31055", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function in Python to perform a quadrille swap of four integers. The function should take four integers as input and return them in the order of the last two integers first, followed by the first two integers. For example, if the inputs are a = 2, b = 4, c = 6, d = 8, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quadrille_swap(2, 4, 6, 8) == (6, 8, 2, 4)\", \"assert quadrille_swap(1, 2, 3, 4) == (3, 4, 1, 2)\", \"assert quadrille_swap(10, 20, 30, 40) == (30, 40, 10, 20)\", \"assert quadrille_swap(-1, -2, -3, -4) == (-3, -4, -1, -2)\", \"assert quadrille_swap(0, 0, 0...
{ "split": "train", "index": 5099, "acecode_id": "evol_23543", "num_tests": 16 }