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 writing a function `return_n` that takes an integer `n` as input and returns the sum of `n` and 1. Your function should not rely on any external resources or databases, and should only implement the logic to return the sum. Write the function according to th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert return_n(0) == 1\", \"assert return_n(1) == 2\", \"assert return_n(-1) == 0\", \"assert return_n(5) == 6\", \"assert return_n(10) == 11\", \"assert return_n(-5) == -4\", \"assert return_n(100) == 101\", \"assert return_n(50) == 51\", \"assert return_n(99) ==...
{ "split": "train", "index": 62500, "acecode_id": "oss_8618", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a sequence of characters where each character is either 'A', 'B', or 'C'. Your task is to implement a function that checks if the string can be segmented into substrings such that each substring contains exactly one of the characters 'A', 'B'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_segment_string('A') == True\", \"assert can_segment_string('B') == True\", \"assert can_segment_string('C') == True\", \"assert can_segment_string('AA') == False\", \"assert can_segment_string('BB') == False\", \"assert can_segment_string('CC') == False\...
{ "split": "train", "index": 62501, "acecode_id": "bigcode_python_fns_2111", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_connection(server: str, database: str, username: str, password: str) -> str` that takes four parameters representing the database server, database name, username, and password. The function should return a connection string formatted for use with an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_connection('localhost', 'mydb', 'user', 'pass') == 'DRIVER={ODBC Driver 17 for SQL Server};SERVER=localhost;DATABASE=mydb;UID=user;PWD=pass'\", \"assert create_connection('192.168.1.1', 'testdb', 'admin', 'secret') == 'DRIVER={ODBC Driver 17 for SQL S...
{ "split": "train", "index": 62502, "acecode_id": "evol_4323", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a tuple representing an RGB color value (red, green, blue), write a function `set_transparent_color(rgb: tuple[int, int, int]) -> tuple[int, int, int, int]` that returns a new tuple representing the same color with an added alpha value of 0 (indicating full transparency)....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_transparent_color((0, 0, 0)) == (0, 0, 0, 0)\", \"assert set_transparent_color((255, 255, 255)) == (255, 255, 255, 0)\", \"assert set_transparent_color((128, 128, 128)) == (128, 128, 128, 0)\", \"assert set_transparent_color((0, 255, 0)) == (0, 255, 0, 0...
{ "split": "train", "index": 62503, "acecode_id": "bigcode_python_fns_5727", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a pseudoanonymization function for a voting system. In this context, you are given a list of votes, where each vote is represented as a dictionary with two keys: 'user' (the user who cast the vote) and 'choice' (the choice made by the user). Your go...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pseudoanonymize_votes([{'user': 'Alice', 'choice': 'Yes'}, {'user': 'Bob', 'choice': 'No'}]) == [{'user': None, 'choice': 'Yes'}, {'user': None, 'choice': 'No'}]\", \"assert pseudoanonymize_votes([{'user': 'Charlie', 'choice': 'Yes'}]) == [{'user': None, 'ch...
{ "split": "train", "index": 62504, "acecode_id": "oss_37175", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `normalize_histogram(data: List[int]) -> List[float]` that normalizes the histogram of the given data. The function should return a list of floats representing the normalized counts, where each count is the frequency of the correspondi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_histogram([1, 2, 1, 3]) == [0.5, 0.25, 0.25]\", \"assert normalize_histogram([4, 4, 4, 1, 1]) == [0.6, 0.4]\", \"assert normalize_histogram([10, 20, 10, 30, 20, 10]) == [0.5, 0.3333333333333333, 0.16666666666666666]\", \"assert normalize_histogram(...
{ "split": "train", "index": 62505, "acecode_id": "bigcode_python_fns_14045", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom task scheduler. The scheduler supports adding tasks with associated execution times. Each task has a unique identifier and an execution time. Your task is to implement a function `schedule_tasks(tasks: List[Tuple[str, int]]) -> List[str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert schedule_tasks([('task1', 10), ('task2', 5)]) == ['task2', 'task1']\", \"assert schedule_tasks([('task3', 15), ('task1', 10), ('task2', 5)]) == ['task2', 'task1', 'task3']\", \"assert schedule_tasks([('task1', 3), ('task2', 3), ('task3', 1)]) == ['task3', 't...
{ "split": "train", "index": 62506, "acecode_id": "oss_26360", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a format string describing the lengths of bit fields and a list of field values, then packs these fields into a bytearray. The format string is a space-separated string where each element represents the length (in bits) of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert packify('1 3 2 2', (True, 4, 0, 3)) == bytearray([0xc3])\", \"assert packify('8', (255,)) == bytearray([255])\", \"assert packify('8', (0,)) == bytearray([0])\", \"assert packify('4 4', (15, 15)) == bytearray([0xff])\", \"assert packify('16', (65535,)) == by...
{ "split": "train", "index": 62507, "acecode_id": "bigcode_python_fns_9155", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a timer. The function should take an integer input representing the number of seconds to wait before returning a message 'Timer Finished!'. Implement a function called `start_timer(seconds: int) -> str` that returns the mes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_timer(0) == 'Timer Finished!'\", \"assert start_timer(1) == 'Timer Finished!'\", \"assert start_timer(5) == 'Timer Finished!'\", \"assert start_timer(10) == 'Timer Finished!'\", \"assert start_timer(15) == 'Timer Finished!'\", \"assert start_timer(20) ...
{ "split": "train", "index": 62508, "acecode_id": "bigcode_python_fns_29690", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_full_name(forename: str, surname: str) -> str` that takes in a user's forename and surname as parameters and returns their full name as a single string. The forename and surname parameters are required and should not be empty.\nPlease reason step by st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_full_name('Alice', 'Smith') == 'Alice Smith'\", \"assert get_full_name('Bob', 'Johnson') == 'Bob Johnson'\", \"assert get_full_name('Charlie', 'Brown') == 'Charlie Brown'\", \"assert get_full_name('David', 'Williams') == 'David Williams'\", \"assert get_...
{ "split": "train", "index": 62509, "acecode_id": "evol_20626", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of items that need to be deep copied. Your task is to implement a function called `deep_copy_items` that takes a list of integers and returns a new list that is a deep copy of the input list. The new list should have the same elements, but it should be a co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert deep_copy_items([1, 2, 3]) == [1, 2, 3]\", \"assert deep_copy_items([1, 1, 1]) == [1, 1, 1]\", \"assert deep_copy_items([]) == []\", \"assert deep_copy_items([5, 10, 15]) == [5, 10, 15]\", \"assert deep_copy_items([-1, -2, -3]) == [-1, -2, -3]\", \"assert de...
{ "split": "train", "index": 62510, "acecode_id": "bigcode_python_fns_42367", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a value, determine if it is a scalar. A scalar is defined as a single, indivisible value that can be one of the following types: a number (integer or float), a string, a byte array, None, a datetime object, a timedelta object, a decimal.Decimal, a Fraction, or any other s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_scalar(5) == True\", \"assert is_scalar(3.14) == True\", \"assert is_scalar('hello') == True\", \"assert is_scalar(b'byte array') == True\", \"assert is_scalar(None) == True\", \"assert is_scalar(Fraction(1, 2)) == True\", \"assert is_scalar([1, 2, 3]) ==...
{ "split": "train", "index": 62511, "acecode_id": "bigcode_python_fns_17462", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function `custom_where(condition, x, y)` that takes in three arguments: a boolean list `condition`, a list of values `x`, and a list of values `y`. The function should return a new list where each element is taken from `x` if the corresponding element in `con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_where([True, False, True, False], [1, 2, 3, 4], [5, 6, 7, 8]) == [1, 6, 3, 8]\", \"assert custom_where([False, False, False], [10, 20, 30], [40, 50, 60]) == [40, 50, 60]\", \"assert custom_where([True, True, True], [1, 2, 3], [4, 5, 6]) == [1, 2, 3]\"...
{ "split": "train", "index": 62512, "acecode_id": "oss_12069", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that manipulates a given string based on a set of specific rules. Your function should take a string as input and perform the following operations: 1. If the input string contains the substring \"Hello\", it should be replaced with...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manipulate_string('Hello, world! This is Alice.') == 'Hi, universe! This is Bob.'\", \"assert manipulate_string('No greetings here.') == 'No greetings here.'\", \"assert manipulate_string('Hello, Alice!') == 'Hi, Bob!'\", \"assert manipulate_string('Alice in...
{ "split": "train", "index": 62513, "acecode_id": "oss_10183", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the aliquot sum of a given integer. The aliquot sum of a number is defined as the sum of all its proper divisors, which are the numbers that divide the given number evenly, excluding the number itself. Write a function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aliquot_sum(1) == 0\", \"assert aliquot_sum(2) == 1\", \"assert aliquot_sum(3) == 1\", \"assert aliquot_sum(4) == 3\", \"assert aliquot_sum(5) == 1\", \"assert aliquot_sum(6) == 6\", \"assert aliquot_sum(7) == 1\", \"assert aliquot_sum(8) == 7\", \"assert al...
{ "split": "train", "index": 62514, "acecode_id": "oss_16716", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary `base` and a key `target`. Your task is to write a function `get_entry_or_none(base: dict, target: str, var_type: type = None) -> Optional[Union[str, int, float]]` that retrieves the value associated with the `target` key from the dictionary. If the `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_entry_or_none({'a': 1, 'b': 2}, 'a') == 1\", \"assert get_entry_or_none({'a': 1, 'b': 2}, 'c') == None\", \"assert get_entry_or_none({'a': '1', 'b': '2'}, 'a', int) == 1\", \"assert get_entry_or_none({'a': '1', 'b': '2'}, 'b', int) == 2\", \"assert get_e...
{ "split": "train", "index": 62515, "acecode_id": "bigcode_python_fns_8258", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of events and returns a dictionary with the count of each event. The function should take the following parameters: a list of strings representing events, and an optional boolean flag that, when set to True, will inc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_events(['click', 'scroll', 'click', 'hover'], False) == {'click': 2, 'scroll': 1, 'hover': 1}\", \"assert count_events(['click', 'scroll', 'click', 'hover'], True) == {'scroll': 1, 'hover': 1}\", \"assert count_events([], False) == {}\", \"assert count...
{ "split": "train", "index": 62516, "acecode_id": "bigcode_python_fns_13476", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a robot's movement based on object detection. The robot can spin in either direction until it sees an object within a specified distance. Implement a function `robot_spin(sensor_data: List[int]) -> str` that takes a list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert robot_spin([600, 700, 800]) == 'no object detected'\", \"assert robot_spin([400, 450, 600]) == 'object detected'\", \"assert robot_spin([501, 600, 700]) == 'no object detected'\", \"assert robot_spin([300, 500, 700]) == 'object detected'\", \"assert robot_sp...
{ "split": "train", "index": 62517, "acecode_id": "oss_14407", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a string of text and outputs its UTF-8 encoded version. The function should read a given string and return its encoded version in bytes. If the input string is empty, the function should return an empty bytes object....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_string('Hello, World!') == b'Hello, World!'\", \"assert encode_string('') == b''\", \"assert encode_string('Python is great!') == b'Python is great!'\", \"assert encode_string('LeetCode') == b'LeetCode'\", \"assert encode_string('') == b''\", \"assert...
{ "split": "train", "index": 62518, "acecode_id": "oss_22204", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a string as an input and returns the string with its characters reversed. For example, if the input string is 'Hello world!', the output should be '!dlrow olleH'.\nPlease reason step by step, then write a self-contained Python solution. Give y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('Hello world!') == '!dlrow olleH'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('') == ''\", \"assert reverse_string('a') == 'a'\", \"assert reverse_string('123456') == '654321'\", \"assert reverse_string('!@#$%^&...
{ "split": "train", "index": 62519, "acecode_id": "evol_19150", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that calculates the sum of all even numbers and the sum of all odd numbers in the list. The function should return a tuple containing the sum of even numbers and the sum of odd numbers. If there are no even ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_even_odd([1, 2, 3, 4, 5]) == (6, 9)\", \"assert sum_even_odd([0, 1, 2, 3, 4, 5]) == (6, 9)\", \"assert sum_even_odd([-2, -1, 0, 1, 2]) == (0, 0)\", \"assert sum_even_odd([10, 15, 20, 25]) == (30, 40)\", \"assert sum_even_odd([-10, -15, -20, -25]) == (-30...
{ "split": "train", "index": 62520, "acecode_id": "bigcode_python_fns_38933", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_string(length: int) -> str` that generates a random alphanumeric string of the specified length. The string should consist of characters from lowercase a-z, uppercase A-Z, and digits 0-9. The function should not use any external libraries or resources...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_string(8) != generate_string(8)\", \"assert len(generate_string(8)) == 8\", \"assert all(c in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' for c in generate_string(8))\", \"assert len(generate_string(5)) == 5\", \"assert len(gene...
{ "split": "train", "index": 62521, "acecode_id": "evol_20654", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the total loss based on the Mean Squared Error (MSE) between two sets of values, along with a Kullback-Leibler Divergence (KLD) and an additional regressor loss. The function should take in the following parameters: \n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_loss([1.0, 2.0], [1.0, 2.0], [0.0, 0.0], [0.0, 0.0], [1.0, 1.0], [1.0, 1.0], True) == (0.0, 0.0, 0.0)\", \"assert calculate_loss([0.0, 0.0], [1.0, 1.0], [0.0, 0.0], [0.0, 0.0], [1.0, 1.0], [1.0, 1.0], True) == (1.0, 0.0, 0.0)\", \"assert calculate_...
{ "split": "train", "index": 62522, "acecode_id": "bigcode_python_fns_26709", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given two lists of 3D coordinates representing the base mesh and the target mesh, and a list of allowed axes for movement, implement a function that returns a new list of coordinates where the vertices of the target mesh are adjusted based only on the specified axes. Each coord...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert adjust_mesh_coordinates([(0, 0, 0), (1, 1, 1)], [(0, 0, 0), (2, 2, 2)], ['Y']) == [(0, 0, 0), (1, 2, 1)]\", \"assert adjust_mesh_coordinates([(0, 0, 0), (1, 1, 1)], [(0, 1, 0), (1, 1, 1)], ['Z']) == [(0, 0, 0), (1, 1, 1)]\", \"assert adjust_mesh_coordinates(...
{ "split": "train", "index": 62523, "acecode_id": "bigcode_python_fns_24553", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes environment variable settings from a list of strings. Each string in the list represents a key-value pair in the format 'KEY=VALUE'. Your function should take this list as input and return a dictionary where the keys ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_settings(['HOST=localhost', 'PORT=8080']) == {'HOST': 'localhost', 'PORT': '8080'}\", \"assert process_settings(['HOST=localhost', 'HOST=127.0.0.1']) == {'HOST': '127.0.0.1'}\", \"assert process_settings([]) == {}\", \"assert process_settings(['DATAB...
{ "split": "train", "index": 62524, "acecode_id": "oss_10083", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fetch_data` that simulates data fetching from an API. The function should use a condition-controlled loop (like a while loop) to repeatedly attempt to retrieve data from a given API URL. If the simulated response is successful (indicated by a status code o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fetch_data('http://example.com/api/error') == None\", \"assert fetch_data('http://example.com/api/empty') == None\", \"assert fetch_data('http://example.com/api/unauthorized') == None\", \"assert fetch_data('http://example.com/api/not_found') == None\", \"as...
{ "split": "train", "index": 62525, "acecode_id": "evol_35262", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a Python function named `sort_dict_by_values` that takes a dictionary with string keys and integer values, and returns a new dictionary sorted by the integer values in ascending order. If two keys have the same value, they should maintain their original order in the outpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_dict_by_values({'Jerry': 10, 'Marcus': 3, 'Hanna': 5}) == {'Marcus': 3, 'Hanna': 5, 'Jerry': 10}\", \"assert sort_dict_by_values({'Alice': 5, 'Bob': 3, 'Charlie': 5}) == {'Bob': 3, 'Alice': 5, 'Charlie': 5}\", \"assert sort_dict_by_values({'Zara': 7, 'A...
{ "split": "train", "index": 62526, "acecode_id": "evol_35308", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a specific message from a list of messages and returns it in a dictionary format. The function should take a list of messages as input and return a dictionary containing the first message in the list under the key 'footer_e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_footer_message(['Contact us at support@example.com', 'Follow us on Twitter']) == {'footer_email_me': 'Contact us at support@example.com'}\", \"assert get_footer_message(['Hello World']) == {'footer_email_me': 'Hello World'}\", \"assert get_footer_message...
{ "split": "train", "index": 62527, "acecode_id": "bigcode_python_fns_38120", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with organizing file paths based on their formats. Write a function `organize_files` that takes a parameter `TARGET`, which is a string representing the target directory. The function should return a dictionary where the keys are the file formats ('csv' and 'parq...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert organize_files('/data') == {'csv': ['/data/files.csv', '/data/faces.csv', '/data/plates.csv'], 'parquet': ['/data/files.parquet', '/data/faces.parquet', '/data/plates.parquet']}\", \"assert organize_files('/tmp') == {'csv': ['/tmp/files.csv', '/tmp/faces.csv...
{ "split": "train", "index": 62528, "acecode_id": "oss_5730", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers and a positive integer n, write a function rotate_array(arr, n) that rotates the array to the right by n positions. The rotation should be done in such a way that the last n elements of the array move to the front, while the remaining elements shift t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_array([1, 2, 3, 4, 5], 3) == [3, 4, 5, 1, 2]\", \"assert rotate_array([1, 2, 3, 4, 5], 5) == [1, 2, 3, 4, 5]\", \"assert rotate_array([1, 2, 3, 4, 5], 0) == [1, 2, 3, 4, 5]\", \"assert rotate_array([1, 2, 3, 4, 5], 1) == [5, 1, 2, 3, 4]\", \"assert ro...
{ "split": "train", "index": 62529, "acecode_id": "evol_22488", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a star's mass in solar masses (M) and its surface gravity (logg), write a function `stellar_radius(M: float, logg: float) -> float` that calculates and returns the stellar radius in solar radii using the formula: `R = M / (10 ** (logg - 4.44))`. The function should raise ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stellar_radius(1.0, 4.44) == 1.0\", \"assert stellar_radius(2.0, 4.44) == 2.0\", \"assert stellar_radius(1.0, 5.44) == 0.1\", \"assert stellar_radius(3.0, 4.44) == 3.0\", \"assert stellar_radius(0.1, 4.44) == 0.1\", \"assert stellar_radius(3.5, 4.44) == 3.5\...
{ "split": "train", "index": 62530, "acecode_id": "bigcode_python_fns_23532", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the accuracy of predictions based on a specified threshold. The accuracy is defined as the proportion of predictions that are greater than the threshold compared to the total number of predictions provided. Write a fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_accuracy([0.1, 0.2, 0.3, 0.4], 0.5) == 0.0\", \"assert calculate_accuracy([], 0.5) == 0.0\", \"assert calculate_accuracy([0.99, 0.01, 0.5, 0.3, 0.8], 0.4) == 0.6\", \"assert calculate_accuracy([0.25, 0.75, 0.85, 0.95], 0.6) == 0.75\", \"assert calc...
{ "split": "train", "index": 62531, "acecode_id": "oss_68", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a statement, write a function that revises any negative sentiment related to programming into a positive outlook. Specifically, if the input statement contains the phrase 'can't stand programming anymore', replace it with 'have grown to appreciate programming'. If the phr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert revise_statement(\\\"I love programming.\\\") == 'I love programming.'\", \"assert revise_statement(\\\"Programming is too hard.\\\") == 'Programming is too hard.'\", \"assert revise_statement(\\\"I can't stand programming anymore and want to quit.\\\") == '...
{ "split": "train", "index": 62532, "acecode_id": "evol_15451", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function `generate_password()` that generates a random password with exactly 10 characters. The password must contain at least 1 uppercase letter, 1 lowercase letter, 1 digit, and 1 special character. The function should return the generated password as a string.\nPleas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_password()) == 10\", \"assert any(c.isupper() for c in generate_password())\", \"assert any(c.islower() for c in generate_password())\", \"assert any(c.isdigit() for c in generate_password())\", \"assert any(c in string.punctuation for c in gene...
{ "split": "train", "index": 62533, "acecode_id": "evol_13549", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that simulates the download process of multiple files. The program should keep track of the total file size to be downloaded and display the progress as a percentage after each file is downloaded. Write a Python function `simulate_download...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_download([1000, 1000]) == [50, 100]\", \"assert simulate_download([400, 600]) == [40, 100]\", \"assert simulate_download([800]) == [100]\", \"assert simulate_download([250, 250, 250, 250]) == [25, 50, 75, 100]\", \"assert simulate_download([200, 0, ...
{ "split": "train", "index": 62534, "acecode_id": "oss_9766", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `lcm(a: int, b: int) -> int` that calculates the Least Common Multiple (LCM) of two integers, `a` and `b`. The LCM is defined as the smallest positive integer that is divisible by both `a` and `b`. The function should handle inputs where `1 <= a, b <= 10^6`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lcm(4, 5) == 20\", \"assert lcm(6, 14) == 42\", \"assert lcm(1, 1) == 1\", \"assert lcm(10, 5) == 10\", \"assert lcm(12, 15) == 60\", \"assert lcm(8, 9) == 72\", \"assert lcm(21, 14) == 42\", \"assert lcm(100, 200) == 200\", \"assert lcm(45, 30) == 90\", \"a...
{ "split": "train", "index": 62535, "acecode_id": "evol_1693", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks whether a given model is valid based on a predefined set of allowed models. The function should take a string as input representing the model name and return a boolean value: `True` if the model is valid and `False` if it is n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_model('modelA') == True\", \"assert is_valid_model('modelB') == True\", \"assert is_valid_model('modelC') == True\", \"assert is_valid_model('modelD') == True\", \"assert is_valid_model('modelE') == False\", \"assert is_valid_model('') == False\", \...
{ "split": "train", "index": 62536, "acecode_id": "bigcode_python_fns_29492", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_guest_user(response: str) -> bool` that determines whether a user is a 'GUEST' based on a server response string. The input will be a single string `response` representing the content returned from a server request. The function should return True if th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_guest_user('User: GUEST') == True\", \"assert is_guest_user('User: ADMIN') == False\", \"assert is_guest_user('Current status: GUEST') == True\", \"assert is_guest_user('User: MEMBER') == False\", \"assert is_guest_user('Welcome, GUEST!') == True\", \"ass...
{ "split": "train", "index": 62537, "acecode_id": "bigcode_python_fns_20277", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks the identity of two objects. Specifically, you need to create a function `check_identity(obj_a, obj_b)` that returns `True` if both objects are the same instance (i.e., have the same memory address), and `False` otherwise....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_identity([], []) == False\", \"assert check_identity({}, {}) == False\", \"assert check_identity([], [1, 2, 3]) == False\", \"assert check_identity(object(), object()) == False\", \"assert check_identity(object(), object()) == False\"]}" }
{ "split": "train", "index": 62538, "acecode_id": "bigcode_python_fns_33731", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Develop a Python function that takes a list of strings and returns the 10 most common words in the list. Each string may contain punctuation and mixed case letters, so ensure to clean the words by removing any non-alphabetical characters and converting them to lowercase before ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert most_common_words(['Hello, world!', 'Hello there.', 'This is a test.']) == [('hello', 2), ('world', 1), ('there', 1), ('this', 1), ('is', 1), ('a', 1), ('test', 1)]\", \"assert most_common_words(['Python is great.', 'Python is fun!', 'I love Python.']) == [(...
{ "split": "train", "index": 62539, "acecode_id": "evol_20114", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that checks for the presence of the `gnureadline` module and its version. Create a function `check_for_readline()` that attempts to import the `gnureadline` module. If the import is successful, you should return the version of the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_for_readline() == 'gnureadline module is not available'\", \"assert check_for_readline() == 'gnureadline module is not available'\", \"assert check_for_readline() == 'gnureadline module is not available'\", \"assert check_for_readline() == 'gnureadline...
{ "split": "train", "index": 62540, "acecode_id": "oss_3466", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of command-line arguments for processing a Cypher query in Neo4j. The function should validate the arguments based on the following rules: 1) There must be exactly 2 additional positional arguments after the options....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_cypher_args(['--neo_pw', 'password123', '--cypher', 'MATCH (n) RETURN n', '--cypher_vbl', 'node', 'file.cypher', 'extra_arg']) == False\", \"assert validate_cypher_args(['--neo_pw', 'password123', '--cypher', 'MATCH (n) RETURN n', '--cypher_vbl', 'n...
{ "split": "train", "index": 62541, "acecode_id": "oss_16023", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a health monitoring system for a fleet of vehicles. Create a function `report_health` that takes in a list of vehicle objects and returns a dictionary containing the health status of each vehicle. Each vehicle object is represented as a dictiona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert report_health([{ 'id': 'V1', 'status': 'OK' }, { 'id': 'V2', 'status': 'Warning' }, { 'id': 'V3', 'status': 'Critical' }, { 'id': 'V4', 'status': 'OK' }]) == { 'V1': 'OK', 'V2': 'Warning', 'V3': 'Critical', 'V4': 'OK' }\", \"assert report_health([{ 'id': 'V5...
{ "split": "train", "index": 62542, "acecode_id": "oss_20895", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of tiles covered by various technologies in a country. Your task is to write a function that calculates the total number of tiles covered across all technologies. Each covered tile is represented by a value of 1 in the li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_covered_tiles([1, 0, 1, 1, 0, 1]) == 4\", \"assert total_covered_tiles([0, 0, 0, 0, 0]) == 0\", \"assert total_covered_tiles([1, 1, 1, 1, 1]) == 5\", \"assert total_covered_tiles([1, 0, 0, 0, 1, 1]) == 3\", \"assert total_covered_tiles([]) == 0\", \"as...
{ "split": "train", "index": 62543, "acecode_id": "bigcode_python_fns_46218", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a specific post from a collection of posts based on its unique identifier. The function should take an integer 'post_id' as input and return the corresponding post if it exists. If the post does not exist, the function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_specific_post(1) == ('{\\\"title\\\": \\\"First Post\\\", \\\"content\\\": \\\"This is the first post.\\\"}', 200)\", \"assert get_specific_post(2) == ('{\\\"title\\\": \\\"Second Post\\\", \\\"content\\\": \\\"This is the second post.\\\"}', 200)\", \"a...
{ "split": "train", "index": 62544, "acecode_id": "bigcode_python_fns_43066", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a function `celsius_to_fahrenheit(celsius: float) -> float` that converts a given temperature from Celsius to Fahrenheit. The conversion formula is Fahrenheit = (Celsius * 9/5) + 32. You need to ensure that the function correctly computes the conversion based on the formu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert celsius_to_fahrenheit(0) == 32.0\", \"assert celsius_to_fahrenheit(100) == 212.0\", \"assert celsius_to_fahrenheit(-40) == -40.0\", \"assert celsius_to_fahrenheit(28) == 82.4\", \"assert celsius_to_fahrenheit(37) == 98.6\", \"assert celsius_to_fahrenheit(20)...
{ "split": "train", "index": 62545, "acecode_id": "evol_31169", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of distinct integers, implement a function that returns the longest increasing subsequence of these integers. The subsequence should consist of values that are sorted in ascending order, but their original positions in the list do not matter. If there are multiple ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_increasing_subsequence([5, 1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert longest_increasing_subsequence([1]) == [1]\", \"assert longest_increasing_subsequence([]) == []\", \"assert longest_increasing_subsequence([10, 20, 10, 30, 20, 50]) == [10, 20, 30, 5...
{ "split": "train", "index": 62546, "acecode_id": "evol_14736", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Create a function named `create_employee` that takes three parameters: `name` (a string), `salary` (a float), and `age` (an integer). The function should return a dictionary representing an employee with keys 'name', 'salary', and 'age' set to the corresponding input values.\nP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_employee('Alice', 50000.0, 30) == {'name': 'Alice', 'salary': 50000.0, 'age': 30}\", \"assert create_employee('Bob', 75000.5, 45) == {'name': 'Bob', 'salary': 75000.5, 'age': 45}\", \"assert create_employee('Charlie', 60000.0, 28) == {'name': 'Charlie...
{ "split": "train", "index": 62547, "acecode_id": "evol_17421", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given string is a valid email address. A valid email address must follow these rules: it should contain exactly one '@' symbol, there should be at least one character before the '@', and at least one character after t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_email('test@example.com') == True\", \"assert is_valid_email('user.name@domain.co') == True\", \"assert is_valid_email('user@sub.domain.com') == True\", \"assert is_valid_email('user@domain.com') == True\", \"assert is_valid_email('u@d.co') == True\...
{ "split": "train", "index": 62548, "acecode_id": "oss_17484", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates sending and receiving packets over a hypothetical Bluetooth connection. The function should take the following parameters: a peer identifier (a string representing the Bluetooth address), a list of packets (strings) to ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert srbt('00:11:22:33:44:55', ['packet1', 'packet2', 'packet3']) == (['packet1', 'packet2', 'packet3'], ['Received: packet1', 'Received: packet2', 'Received: packet3'])\", \"assert srbt('00:11:22:33:44:55', ['']) == ([''], ['Received: Empty Packet'])\", \"assert...
{ "split": "train", "index": 62549, "acecode_id": "bigcode_python_fns_18514", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a dataset containing a large number of entities, each representing a piece of text with an associated index. Each entity has a unique ID and a piece of text associated with it. Your goal is to create a function t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_text_by_index(0) == 'Text for index 0'\", \"assert retrieve_text_by_index(1) == 'Text for index 1'\", \"assert retrieve_text_by_index(2) == 'Text for index 2'\", \"assert retrieve_text_by_index(3) == 'Text for index 3'\", \"assert retrieve_text_by_i...
{ "split": "train", "index": 62550, "acecode_id": "oss_25353", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a vector represented as a list of numbers, implement a Python function `magnitude(v)` that calculates the magnitude of the vector. The magnitude of a vector is defined as the square root of the sum of the squares of its elements. For example, for a vector `v = [x1, x2, .....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert magnitude([3, 4]) == 5.0\", \"assert magnitude([1, 2, 2]) == 3.0\", \"assert magnitude([0]) == 0.0\", \"assert magnitude([]) == 0.0\", \"assert magnitude([1, -1]) == 1.4142135623730951\", \"assert magnitude([5]) == 5.0\", \"assert magnitude([0, 0, 0]) == 0.0...
{ "split": "train", "index": 62551, "acecode_id": "oss_13395", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `largest_palindrome(s: str) -> str` that takes a string `s` as input and returns the largest palindromic substring in `s`. If there are multiple palindromic substrings of the same maximum length, return the first one found. If no palindromic substring exist...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largest_palindrome('bananas') == 'anana'\", \"assert largest_palindrome('racecar') == 'racecar'\", \"assert largest_palindrome('a') == 'a'\", \"assert largest_palindrome('aa') == 'aa'\", \"assert largest_palindrome('abccba') == 'abccba'\", \"assert largest_p...
{ "split": "train", "index": 62552, "acecode_id": "evol_17813", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a mock HTTP POST request to a specific endpoint. The function should take a URL and a payload as parameters. Depending on the URL, the function should return a specific JSON response. The URL can either be 'https://someclus...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mocked_requests_post('https://somecluster.kusto.windows.net/v2/rest/query', {'csl': 'truncationmaxrecords', 'properties': '{\\\"Options\\\": {\\\"deferpartialqueryfailures\\\": true}}'}) == {'status_code': 200, 'data': 'mock data from query_partial_results_d...
{ "split": "train", "index": 62553, "acecode_id": "bigcode_python_fns_2542", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n: int) -> int` that returns the nth Fibonacci number. The Fibonacci sequence is defined as follows: the first Fibonacci number is 0, the second is 1, and each subsequent number is the sum of the two preceding ones. For example, the sequence star...
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": 62554, "acecode_id": "evol_2405", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `validate_string_length(s: str) -> bool` that checks if the length of the input string `s` is between 5 and 20 characters, inclusive. The function should return True if the string length is within this range, and False otherwise.\nPlease reason step by step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_string_length('Hello') == True\", \"assert validate_string_length('Hello World') == True\", \"assert validate_string_length('Python') == True\", \"assert validate_string_length('12345') == True\", \"assert validate_string_length('This is a test') ==...
{ "split": "train", "index": 62555, "acecode_id": "evol_16692", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a nested dictionary and a key in the form of a dotted path. Implement a function `get_value` that retrieves the value located at the specified key. The key can include list indexing and may also have a transformation operation appended to it, separated by a '|'. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_value({'name': 'Alice', 'age': 30}, 'name') == 'Alice'\", \"assert get_value({'name': 'Alice', 'age': 30}, 'age') == 30\", \"assert get_value({'name': 'Alice', 'age': 30}, 'gender', 'unknown') == 'unknown'\", \"assert get_value({'list': [1, 2, 3]}, 'list...
{ "split": "train", "index": 62556, "acecode_id": "bigcode_python_fns_30626", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of voltage values recorded from a neuron over time and a spike detection threshold. Your task is to implement a function that identifies the indices and values of all spikes in the voltage data. A spike is defined as a value that exceeds the given threshold...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_spikes([0.2, 0.9, 1.2, 0.5, 0.3, 1.1, 0.0], 1.0) == ([2, 5], [1.2, 1.1])\", \"assert detect_spikes([0.0, 0.0, 0.0, 0.0], 0.1) == ([], [])\", \"assert detect_spikes([0.3, 0.4, 0.2, 0.6, 0.9], 0.5) == ([3], [0.6])\", \"assert detect_spikes([0.5, 0.7, 1....
{ "split": "train", "index": 62557, "acecode_id": "oss_24166", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that serializes an object's attributes into a dictionary format and converts that dictionary into a JSON string. The function should accept an object and an optional list of attribute names to include in the serialization. If no attribute...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert serialize_object({'name': 'Alice', 'age': 30, 'city': 'New York'}, ['name', 'age']) == ({'name': 'Alice', 'age': 30}, '{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}')\", \"assert serialize_object({'name': 'Bob', 'age': 25, 'city': 'Los Angeles'}, None) == (...
{ "split": "train", "index": 62558, "acecode_id": "oss_8606", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer n, implement a function `factorial(n)` that returns the factorial of n. The factorial of a non-negative integer n is defined as the product of all positive integers less than or equal to n. For example, the factorial of 5 (denoted as 5!) is 5 * 4 * ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 62559, "acecode_id": "oss_18743", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `payload` representing a binder update command, extract the page range from it. The string will be formatted as 'binder_update_page_range(start_page, end_page, current_page, total_pages)', where `start_page`, `end_page`, `current_page`, and `total_pages` are inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_page_range('binder_update_page_range(1, 10, 5, 20)') == (1, 10)\", \"assert extract_page_range('binder_update_page_range(0, 100, 50, 200)') == (0, 100)\", \"assert extract_page_range('binder_update_page_range(3, 7, 4, 10)') == (3, 7)\", \"assert extr...
{ "split": "train", "index": 62560, "acecode_id": "bigcode_python_fns_542", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of device names that represent DirectShow devices connected to a Windows system. Your task is to implement a function `filter_audio_devices(devices: List[str]) -> List[str]` that takes in a list of device names and returns a new list containing only the nam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_audio_devices(['Webcam', 'Webcam', 'Audio Device', 'Microphone']) == ['Audio Device', 'Microphone']\", \"assert filter_audio_devices(['Camera', 'Video Capture', 'Audio Capture', 'Microphone']) == ['Audio Capture', 'Microphone']\", \"assert filter_audi...
{ "split": "train", "index": 62561, "acecode_id": "oss_15983", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that calculates the maximum product of any three distinct elements from the list. Additionally, the function should return a list of all unique triplets of elements that yield this maximum product. The function signature should be ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_product_triplets([1, 2, 3, 4]) == (24, [(2, 3, 4)])\", \"assert max_product_triplets([-10, -10, 5, 2]) == (500, [(-10, -10, 5)])\", \"assert max_product_triplets([0, 0, 0]) == (0, [(0, 0, 0)])\", \"assert max_product_triplets([3, 3, 3]) == (27, [(3, 3, 3...
{ "split": "train", "index": 62562, "acecode_id": "evol_17628", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing file names. Your task is to create a function that counts the number of occurrences of each unique file name in the list and returns a dictionary where the keys are the file names and the values are their respective counts. The input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_file_occurrences(['file1.txt', 'file2.txt', 'file1.txt']) == {'file1.txt': 2, 'file2.txt': 1}\", \"assert count_file_occurrences([]) == {}\", \"assert count_file_occurrences(['file3.txt', 'file3.txt', 'file3.txt']) == {'file3.txt': 3}\", \"assert count...
{ "split": "train", "index": 62563, "acecode_id": "bigcode_python_fns_28606", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a percentage value representing the position of a cover that can open and close. The cover has a defined range with an open position at 0% and a closed position at 100%. Implement a function that takes a percentage as input and returns the corresponding position i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_in_range_from_percent(56) == 56\", \"assert find_in_range_from_percent(56, 'cover') == 44\", \"assert find_in_range_from_percent(0) == 0\", \"assert find_in_range_from_percent(100) == 100\", \"assert find_in_range_from_percent(50) == 50\", \"assert find...
{ "split": "train", "index": 62564, "acecode_id": "bigcode_python_fns_26475", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_full_name` that takes a string input representing a person's full legal name. The function should return the name in the format 'Hello, [Full Name]!' if the input is valid (i.e., it is not empty and contains only alphabetic characters and spaces). If t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_full_name('John Doe') == 'Hello, John Doe!'\", \"assert get_full_name('Jane Smith') == 'Hello, Jane Smith!'\", \"assert get_full_name('Alice Wonderland') == 'Hello, Alice Wonderland!'\", \"assert get_full_name('A B C D E F') == 'Hello, A B C D E F!'\", \...
{ "split": "train", "index": 62565, "acecode_id": "evol_33612", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes two arguments: a host IP address and a TCP port number, and returns a formatted string that describes how to launch a CARLA server with the given parameters. The function should follow these specifications: If the provided IP a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert launch_carla_server('localhost', 2000) == 'Starting CARLA server on localhost at port 2000'\", \"assert launch_carla_server('192.168.1.1', 3000) == 'Starting CARLA server on 192.168.1.1 at port 3000'\", \"assert launch_carla_server('localhost', 3001) == 'Sta...
{ "split": "train", "index": 62566, "acecode_id": "oss_19089", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of strings, list1 and list2. Your task is to write a function that returns a new list containing the elements that appear in both list1 and list2, preserving the order of their first occurrence in list1. Write a function called common_elements(list1, lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert common_elements(['apple', 'banana', 'orange'], ['grape', 'banana', 'kiwi']) == ['banana']\", \"assert common_elements(['a', 'b', 'c', 'd'], ['e', 'f', 'g']) == []\", \"assert common_elements(['x', 'y', 'z'], ['x', 'y', 'x', 'y']) == ['x', 'y']\", \"assert co...
{ "split": "train", "index": 62567, "acecode_id": "oss_9828", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `create_contact` that takes three parameters: a person's name (string), email address (string), and phone number (string). The function should return a string representation of the contact in the format: 'Name: {name}, Email: {email}, Phone: {phone}'.\nPlease r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_contact('Alice Smith', 'alice@example.com', '123-456-7890') == 'Name: Alice Smith, Email: alice@example.com, Phone: 123-456-7890'\", \"assert create_contact('Bob Johnson', 'bob.johnson@example.com', '987-654-3210') == 'Name: Bob Johnson, Email: bob.jo...
{ "split": "train", "index": 62568, "acecode_id": "evol_907", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two strings and a numeric value as parameters. The function should return a string that concatenates the first string reversed and the second string repeated based on the numeric parameter. Additionally, the function should handle errors when the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert string_manipulation('hello', 'world', 3) == 'ollehworldworldworld'\", \"assert string_manipulation('abc', 'xyz', 2) == 'cbaxyzxyz'\", \"assert string_manipulation('python', 'rocks', 1) == 'nohtyprocks'\", \"assert string_manipulation('a', 'b', 1) == 'ab'\", ...
{ "split": "train", "index": 62569, "acecode_id": "evol_5839", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You need to implement a function that sets the fan mode of a thermostat. The function should accept two parameters: a string representing the desired fan mode ('on', 'off', 'auto', etc.) and an optional string representing the entity ID of the thermostat. If the entity ID is pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_fan_mode('on') == {'fan_mode': 'on'}\", \"assert set_fan_mode('off') == {'fan_mode': 'off'}\", \"assert set_fan_mode('auto') == {'fan_mode': 'auto'}\", \"assert set_fan_mode('on', 'thermostat_1') == {'entity_id': 'thermostat_1', 'fan_mode': 'on'}\", \"as...
{ "split": "train", "index": 62570, "acecode_id": "bigcode_python_fns_46509", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a resource manager that efficiently stores and retrieves file names based on their hash codes. You need to implement a single function called `manage_resources` that takes a list of tuples as input, where each tuple contains a hash code (a strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_resources([('hash1', 'fileA.txt'), ('hash1', 'fileB.txt'), ('hash2', 'fileC.txt')]) == {'hash1': ['fileA.txt', 'fileB.txt'], 'hash2': ['fileC.txt']}\", \"assert manage_resources([('hash1', 'fileA.txt')]) == {'hash1': ['fileA.txt']}\", \"assert manage_...
{ "split": "train", "index": 62571, "acecode_id": "oss_37022", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a standardized URL for accessing a product on a vendor's website. The URL format should follow the pattern `https://www.<vendor>.com/products/<product>/v<version>`. Write a function `generate_product_url(vendor, prod...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_product_url('apple', 'iphone', '13') == 'https://www.apple.com/products/iphone/v13'\", \"assert generate_product_url('samsung', 'galaxy', '21') == 'https://www.samsung.com/products/galaxy/v21'\", \"assert generate_product_url('microsoft', 'surface',...
{ "split": "train", "index": 62572, "acecode_id": "oss_28969", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a target integer. Write a function that takes the list and the target, and returns a new list containing only the elements that are equal to the target if a boolean flag 'keep' is True, or all elements that are not equal to the target if 'ke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_list([1, 2, 3, 4, 5], 3, True) == [3]\", \"assert filter_list([1, 2, 3, 4, 5], 3, False) == [1, 2, 4, 5]\", \"assert filter_list([1, 1, 2, 1, 3], 1, True) == [1, 1, 1]\", \"assert filter_list([1, 1, 2, 1, 3], 1, False) == [2, 3]\", \"assert filter_lis...
{ "split": "train", "index": 62573, "acecode_id": "bigcode_python_fns_36460", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a variable type, implement a function that checks whether the type is a subclass of the built-in boolean type (bool) in Python. Specifically, if the input type has a `__supertype__` attribute, it should check against that supertype instead. The function should return True...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_bool_type(bool) == True\", \"assert is_bool_type(int) == False\", \"assert is_bool_type(str) == False\", \"assert is_bool_type(type) == False\", \"assert is_bool_type(object) == False\", \"assert is_bool_type(float) == False\", \"assert is_bool_type(list)...
{ "split": "train", "index": 62574, "acecode_id": "bigcode_python_fns_36589", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `sum_of_numbers(a: int, b: int) -> int` that takes two integers as parameters and returns their sum.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_numbers(1, 2) == 3\", \"assert sum_of_numbers(-1, 1) == 0\", \"assert sum_of_numbers(0, 0) == 0\", \"assert sum_of_numbers(100, 200) == 300\", \"assert sum_of_numbers(-50, -50) == -100\", \"assert sum_of_numbers(123456789, 987654321) == 1111111110\", ...
{ "split": "train", "index": 62575, "acecode_id": "evol_8009", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of 3D points in space, where each point is represented by its coordinates (x, y, z). Your task is to compute the Euclidean distance between each pair of points and return a list of distances. The Euclidean distance between two points (x1, y1, z1) and (x2, y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_distances([(0, 0, 0), (1, 1, 1)]) == [1.7320508075688772]\", \"assert compute_distances([(0, 0, 0), (0, 0, 1)]) == [1.0]\", \"assert compute_distances([(1, 0, 0), (0, 1, 0)]) == [1.4142135623730951]\", \"assert compute_distances([(1, 1, 1), (1, 1, 1)...
{ "split": "train", "index": 62576, "acecode_id": "bigcode_python_fns_15682", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a dependency resolution algorithm for a software package manager. The package manager needs to resolve dependencies for a given package based on the provided dependency list. Each package can have dependencies on other packages, forming a direct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resolve_dependencies(True, []) == []\", \"assert resolve_dependencies(True, [('A', 'B')]) in [['B', 'A'], ['A', 'B']]\", \"assert resolve_dependencies(True, [('A', 'B'), ('B', 'C')]) in [['C', 'B', 'A'], ['A', 'B', 'C']]\", \"assert resolve_dependencies(Fals...
{ "split": "train", "index": 62577, "acecode_id": "oss_20584", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of course grades represented as letters (A, B, C, D, F) and returns the calculated grade point average (GPA), rounded to one decimal place. The mapping for letter grades to grade points is as follows: A=4, B=3, C=2, D=1, F=0. If the input ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_gpa(['A', 'B', 'C']) == 3.0\", \"assert calculate_gpa(['A', 'B', 'A']) == 3.7\", \"assert calculate_gpa(['F', 'F', 'F']) == 0.0\", \"assert calculate_gpa([]) == 0.0\", \"assert calculate_gpa(['C', 'C', 'C', 'C']) == 2.0\", \"assert calculate_gpa(['...
{ "split": "train", "index": 62578, "acecode_id": "evol_36182", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers ranging from 0 to 1000, implement a function that returns a list of the numbers that are part of the Fibonacci series, represented in binary format. The function should take a single parameter, which is the list of integers.\nPlease reason step by step,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_in_binary([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == ['0b0', '0b1', '0b10', '0b11', '0b101', '0b1000']\", \"assert fibonacci_in_binary([500, 800, 13]) == ['0b1101']\", \"assert fibonacci_in_binary([1000, 987, 21]) == ['0b1111011011', '0b10101']\", \"as...
{ "split": "train", "index": 62579, "acecode_id": "evol_26406", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates an image processing iterator for a dataset represented as a list of image file paths. The function should return a list of batches, where each batch contains a specified number of image paths. The function will take thr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_image_batches(['img1.jpg', 'img2.jpg', 'img3.jpg', 'img4.jpg', 'img5.jpg'], 2) == [['img1.jpg', 'img2.jpg'], ['img3.jpg', 'img4.jpg'], ['img5.jpg']]\", \"assert get_image_batches(['img1.jpg', 'img2.jpg', 'img3.jpg'], 1) == [['img1.jpg'], ['img2.jpg'], ['...
{ "split": "train", "index": 62580, "acecode_id": "bigcode_python_fns_41732", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an object in Python, implement a function `get_instance_id(instance)` that returns the unique identifier of the instance in hexadecimal format. The identifier should not include the leading '0x'. The input will be a single object, and the output should be a string represe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_instance_id(object()) == hex(id(object()))[2:]\", \"assert get_instance_id(123) == hex(id(123))[2:]\", \"assert get_instance_id('hello') == hex(id('hello'))[2:]\", \"assert get_instance_id([]) == hex(id([]))[2:]\", \"assert get_instance_id({}) == hex(id(...
{ "split": "train", "index": 62581, "acecode_id": "bigcode_python_fns_39480", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the sum of the cubes of all negative odd integers in a given list. The function should ignore positive integers, even integers, and non-integer values. If the input list is empty, the function should return 0.\n\nThe function signature is:\n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert negative_odd_cubes_sum([-3, -5, 2, 1]) == -152\", \"assert negative_odd_cubes_sum([2, 4, 6]) == 0\", \"assert negative_odd_cubes_sum([-1, -7, 8]) == -344\", \"assert negative_odd_cubes_sum([]) == 0\", \"assert negative_odd_cubes_sum([-9, -11, 0]) == -729 + -...
{ "split": "train", "index": 62582, "acecode_id": "evol_17640", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given three integers `lo`, `hi` and `k`, your task is to return the `k-th` integer in the range `[lo, hi]` sorted by their power values in ascending order. The power of an integer `x` is defined as the number of steps required to transform `x` into `1` using the following rules...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getKth(8, 12, 3) == 10\", \"assert getKth(3, 7, 2) == 5\", \"assert getKth(20, 30, 1) == 20\", \"assert getKth(7, 14, 3) == 10\", \"assert getKth(100, 100, 1) == 100\", \"assert getKth(11, 19, 2) == 12\"]}" }
{ "split": "train", "index": 62583, "acecode_id": "evol_7262", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of nodes, where each node can be either an atom or a complex structure that contains sub-nodes. Each complex node contains a list of items, and the first item in this list is an atom that has a value. Your task is to implement a function that takes in a lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findNode([{'type': 'Complex', 'items': [{'type': 'Atom', 'value': 'A'}, {'type': 'Atom', 'value': 'B'}]}], 'A') == {'type': 'Complex', 'items': [{'type': 'Atom', 'value': 'A'}, {'type': 'Atom', 'value': 'B'}]}\", \"assert findNode([{'type': 'Complex', 'items...
{ "split": "train", "index": 62584, "acecode_id": "bigcode_python_fns_7405", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that computes the factorial of a non-negative integer using recursion with memoization. Your function should adhere to the following constraints: 1. Do not use any built-in factorial modules or libraries. 2. Implement a memoization technique to optimize ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 62585, "acecode_id": "evol_11492", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a report object based on the provided parameters. The function `create_report` should take the following arguments: a mandatory string `tback` which represents the traceback message, an optional string `func_name` that repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_report('Traceback (most recent call last):', 'my_function', 'Error Occurred', True) == Report('Traceback (most recent call last):', 'my_function', 'Error Occurred', True)\", \"assert create_report('Traceback (most recent call last):') == Report('Trace...
{ "split": "train", "index": 62586, "acecode_id": "bigcode_python_fns_35885", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes an integer value representing the intensity of a grayscale pixel and returns a dictionary with the RGB values set to the same intensity. The function should have the following signature: `def create_grayscale_pixel(intensit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_grayscale_pixel(0) == {'r': 0, 'g': 0, 'b': 0}\", \"assert create_grayscale_pixel(255) == {'r': 255, 'g': 255, 'b': 255}\", \"assert create_grayscale_pixel(128) == {'r': 128, 'g': 128, 'b': 128}\", \"assert create_grayscale_pixel(50) == {'r': 50, 'g':...
{ "split": "train", "index": 62587, "acecode_id": "oss_16523", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a polynomial function f(x) = 3x^4, implement a function `derivative(n)` that calculates the n-th derivative of the function without using any libraries or packages. The function should return the derivative as a string in the format 'ax^b', where 'a' is the coefficient an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert derivative(0) == '3x^4'\", \"assert derivative(1) == '12x^3'\", \"assert derivative(2) == '36x^2'\", \"assert derivative(4) == '72'\", \"assert derivative(5) == '0'\", \"assert derivative(6) == '0'\", \"assert derivative(7) == '0'\", \"assert derivative(8) =...
{ "split": "train", "index": 62588, "acecode_id": "evol_12629", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of transactions, where each transaction is represented by a dictionary containing the keys 'from_pubkey', 'to_pubkey', and 'lamports'. Your task is to implement a function that takes this list of transactions and returns a new list containing only unique tr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert deduplicate_transactions([{'from_pubkey': 'A', 'to_pubkey': 'B', 'lamports': 100}, {'from_pubkey': 'A', 'to_pubkey': 'B', 'lamports': 100}]) == [{'from_pubkey': 'A', 'to_pubkey': 'B', 'lamports': 100}]\", \"assert deduplicate_transactions([{'from_pubkey': 'A...
{ "split": "train", "index": 62589, "acecode_id": "bigcode_python_fns_10583", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the volumes connected to a host, and a specific volume ID that needs to be connected. Write a function `connect_volume(host: str, volumes: List[int], volume_id: int) -> bool` that connects the specified volume ID to the host if it i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert connect_volume('HostA', [1, 2, 3], 4) == True\", \"assert connect_volume('HostA', [1, 2, 3], 2) == False\", \"assert connect_volume('HostB', [], 5) == True\", \"assert connect_volume('HostB', [5, 6], 6) == False\", \"assert connect_volume('HostC', [1, 2, 3],...
{ "split": "train", "index": 62590, "acecode_id": "bigcode_python_fns_29141", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates Accept headers for different content types in HTTP requests. Implement a function `make_accept_header(mimetype: str) -> Tuple[str, str]` that takes a `mimetype` as an argument and returns a tuple containing the string 'Acce...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_accept_header('application/json') == ('Accept', 'application/json')\", \"assert make_accept_header('text/html') == ('Accept', 'text/html')\", \"assert make_accept_header('application/xml') == ('Accept', 'application/xml')\", \"assert make_accept_header(...
{ "split": "train", "index": 62591, "acecode_id": "oss_13410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that sorts the array in ascending order using the bubble sort algorithm. The function should return the sorted array. You may assume that the input array will always contain at least one element. The input array can contain both ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bubble_sort([3, 2, 1]) == [1, 2, 3]\", \"assert bubble_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert bubble_sort([-1, -3, -2]) == [-3, -2, -1]\", \"assert bubble_sort([0, 0, 0]) == [0, 0, 0]\", \"assert bubble_sort([1]) == [1]\", \"assert bubble_sort(...
{ "split": "train", "index": 62592, "acecode_id": "bigcode_python_fns_40037", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a file path, write a function that checks if the path is valid. A valid path contains only alphanumeric characters, underscores, hyphens, and periods. The function should return True if the path is valid and False otherwise. For example, 'valid_path....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_path('valid_path.txt') == True\", \"assert is_valid_path('another_valid-path.doc') == True\", \"assert is_valid_path('file_with_number_123.txt') == True\", \"assert is_valid_path('valid.file.name.pdf') == True\", \"assert is_valid_path('invalid/path...
{ "split": "train", "index": 62593, "acecode_id": "bigcode_python_fns_17132", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a data loader for a machine learning model. The function should take a dataset represented as a list of items, a batch size, and a number of worker processes. The function will return a list of batches, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(custom_data_loader([1, 2, 3, 4, 5, 6], 2)) == 3\", \"assert len(custom_data_loader([1, 2, 3, 4, 5], 2)) == 2\", \"assert custom_data_loader([1, 2, 3], 5) == []\", \"assert custom_data_loader([1, 2, 3], 2) in [[[1, 2]], [[2, 3]], [[1, 3]]]\", \"assert cus...
{ "split": "train", "index": 62594, "acecode_id": "oss_16562", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function that checks whether at least one element from the second input array can be found in the first input array. The function should return True if there is at least one common element, and False otherwise. For example, given array1 = [1, 2, 3] and array2 = [3, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_arrays([1, 2, 3], [3, 4, 5]) == True\", \"assert check_arrays([5, 6, 7, 8], [9, 10, 11]) == False\", \"assert check_arrays([1, 2, 3], [0, 4, 5]) == False\", \"assert check_arrays([1, 2, 3, 4], [4, 5, 6]) == True\", \"assert check_arrays([], [1, 2, 3]) ...
{ "split": "train", "index": 62595, "acecode_id": "evol_22094", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing the name of a machine learning algorithm. Your task is to implement a function that checks if the algorithm is either 'PPO' or 'reinforce'. If the algorithm is valid, return the string 'Algorithm is valid'. If the algorithm is not valid, retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_algorithm('PPO') == 'Algorithm is valid'\", \"assert check_algorithm('reinforce') == 'Algorithm is valid'\", \"assert check_algorithm('SAC') == 'Algorithm not defined; options are reinforce or PPO'\", \"assert check_algorithm('DQN') == 'Algorithm not d...
{ "split": "train", "index": 62596, "acecode_id": "bigcode_python_fns_20561", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `makeWebhookResult(req: dict) -> dict` that processes a request dictionary and generates a response in the form of a JSON object. The response should contain a 'speech' field that provides a user-friendly message based on the contents of the input request. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert makeWebhookResult({'user': 'guest'}) == {'speech': 'Hello User!', 'displayText': 'Hello User!', 'source': 'webhookdata'}\", \"assert makeWebhookResult({'user': 'member'}) == {'speech': 'Welcome back!', 'displayText': 'Welcome back!', 'source': 'webhookdata'}...
{ "split": "train", "index": 62597, "acecode_id": "evol_6461", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `simplify_code(code: str) -> str` that takes a string representation of Python code and modifies it to enhance its legibility. Specifically, the function should rename any function named 'myfunc' to 'add_numbers' while keeping the rest of the code intact. The c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simplify_code('def myfunc():\\\\n x = 1\\\\n y = 5\\\\n return x + y\\\\n') == 'def add_numbers():\\\\n x = 1\\\\n y = 5\\\\n return x + y\\\\n'\", \"assert simplify_code('def myfunc(param):\\\\n return param * 2\\\\n') == 'def add_numbe...
{ "split": "train", "index": 62598, "acecode_id": "evol_19736", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design and implement a function that manages student records for an educational institution. Each student record should contain a unique ID, name, demographic information, and a list of courses with grades. The function should support adding a student record, retrieving a stude...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_student_records('add', 1, 'John Doe', 'Grade 10', [(101, 'Math', 3.5), (102, 'Science', 4.0)]) == 'Student added'\", \"assert manage_student_records('add', 2, 'Jane Smith', 'Grade 11', [(201, 'Math', 4.0)]) == 'Student added'\", \"assert manage_studen...
{ "split": "train", "index": 62599, "acecode_id": "evol_21268", "num_tests": 9 }