data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Given a list of strings, your task is to implement a function that concatenates all the strings in the list into a single byte string. If the input list is empty, return an empty byte string. Implement the function `pack(pieces: List[str]) -> bytes` where `pieces` is a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pack([]) == b''\", \"assert pack(['hello', 'world']) == b'helloworld'\", \"assert pack(['abc', 'def', 'ghi']) == b'abcdefghi'\", \"assert pack(['1', '2', '3']) == b'123'\", \"assert pack(['a', 'b', 'c', 'd']) == b'abcd'\", \"assert pack(['Python', ' ', 'is',... | {
"split": "train",
"index": 2200,
"acecode_id": "bigcode_python_fns_9648",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the factorial of a positive integer `n` using a stack data structure. Implement a function `factorial_with_stack(n)` that takes a positive integer `n` as input and returns the factorial of `n` by utilizing a stack to hold the numbers from `n` dow... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial_with_stack(1) == 1\", \"assert factorial_with_stack(2) == 2\", \"assert factorial_with_stack(3) == 6\", \"assert factorial_with_stack(4) == 24\", \"assert factorial_with_stack(5) == 120\", \"assert factorial_with_stack(6) == 720\", \"assert factori... | {
"split": "train",
"index": 2201,
"acecode_id": "oss_17966",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function that accepts an array of integers and returns the largest integer in the array. If the array is empty, the function should return 'Array is empty.' Additionally, if any non-integer values are found in the array, the function should return 'Value i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_largest([5, 8, 2, 9, 15, 3]) == 15\", \"assert find_largest([1, 2, 3, 4, 5]) == 5\", \"assert find_largest([-1, -2, -3, -4, -5]) == -1\", \"assert find_largest([10, 20, 30, 40, 50]) == 50\", \"assert find_largest([100]) == 100\", \"assert find_largest([... | {
"split": "train",
"index": 2202,
"acecode_id": "evol_31162",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates moving a file from one directory to another within a file system. The function should take two strings, `source` and `destination`, which represent the paths of the source file and the destination directory respectively. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_file('file.txt', '/new_directory/') == True\", \"assert move_file('document.pdf', '/documents/') == True\", \"assert move_file('image.png', '/images/') == True\", \"assert move_file('', '/empty_directory/') == False\", \"assert move_file('report.docx', ... | {
"split": "train",
"index": 2203,
"acecode_id": "bigcode_python_fns_4311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `is_even` that returns True if at least one integer in the list is even, and False otherwise. The function should handle an empty list by returning False. The input list can contain both positive and negative integers. Please implement... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_even([1, 3, 5]) == False\", \"assert is_even([1, 2, 3]) == True\", \"assert is_even([-1, -3, -5]) == False\", \"assert is_even([-2, -4, -6]) == True\", \"assert is_even([]) == False\", \"assert is_even([0]) == True\", \"assert is_even([1, 2, 4, 5]) == Tru... | {
"split": "train",
"index": 2204,
"acecode_id": "bigcode_python_fns_41697",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple chatbot response function. Your function should take a string input representing a command and return a specific greeting message based on that command. Implement a function named `chatbot_response(command: str) -> str` that returns the fol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert chatbot_response('/start') == '\\u0417\\u0434\\u0440\\u0430\\u0432\\u0441\\u0442\\u0432\\u0443\\u0439\\u0442\\u0435! \\u0427\\u0435\\u043c \\u043c\\u043e\\u0436\\u0435\\u043c \\u043f\\u043e\\u043c\\u043e\\u0447\\u044c?'\", \"assert chatbot_response('/help') ... | {
"split": "train",
"index": 2205,
"acecode_id": "bigcode_python_fns_12831",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function in Python that accepts a string and a list of integers. The function should return a new string with the same letter count but reshuffled in the sequence specified by the list. If the length of the list exceeds the length of the string, ignore the remaining in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reshuffle_string('hello', [1, 0, 4, 3, 2]) == 'eholl'\", \"assert reshuffle_string('test', [0, 1, 2, 3]) == 'test'\", \"assert reshuffle_string('data', [0, 0, 0, 0]) == 'dddd'\", \"assert reshuffle_string('', [0, 1, 2]) == ''\", \"assert reshuffle_string('si... | {
"split": "train",
"index": 2206,
"acecode_id": "evol_12131",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `intricate_frequency_analyzer(test: str) -> dict` that takes in a string composed of space-separated characters, including uppercase and lowercase alphabets, numeric characters, and punctuation. The function should return a dictionary featuring the highest ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intricate_frequency_analyzer('A B c 1 @') == {'a': 1, 'b': 1, 'c': 1, '1': 1, '@': 1}\", \"assert intricate_frequency_analyzer('A b C a B 1 2 2') == {'a': 2, 'b': 2, '2': 2}\", \"assert intricate_frequency_analyzer('B B B b A ! ! ! !') == {'b': 4, '!': 4}\",... | {
"split": "train",
"index": 2207,
"acecode_id": "evol_12295",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that takes a list of dictionaries containing data and performs on-the-fly data transformations. The function should return a new list of transformed dictionaries. For simplicity, the transformation should be defined as converting all string values in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_data([{'name': 'alice'}, {'name': 'bob'}]) == [{'name': 'ALICE'}, {'name': 'BOB'}]\", \"assert transform_data([{'age': '25'}, {'age': '30'}]) == [{'age': '25'}, {'age': '30'}]\", \"assert transform_data([{'city': 'new york'}, {'city': 'los angeles'... | {
"split": "train",
"index": 2208,
"acecode_id": "evol_27332",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and tasked with calculating the sum of the squares of these integers. Write a function `sum_of_squares(numbers: List[int]) -> int` that takes in a list of integers `numbers` and returns the sum of the squares of the numbers in the list. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares([]) == 0\", \"assert sum_of_squares([1]) == 1\", \"assert sum_of_squares([1, 2, 3]) == 14\", \"assert sum_of_squares([-1, -2, -3]) == 14\", \"assert sum_of_squares([0]) == 0\", \"assert sum_of_squares([1, 2, 3, 4]) == 30\", \"assert sum_of_squ... | {
"split": "train",
"index": 2209,
"acecode_id": "oss_3620",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary contains information about a product. Each product has a 'name' and a 'category', among other fields. Your task is to implement a function `filter_products(products: List[Dict[str, Any]]) -> List[Dict[str, Any]]` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_products([{'name': 'Laptop', 'category': 'electronics'}, {'name': 'Chair', 'category': 'furniture'}]) == [{'name': 'Laptop', 'category': 'electronics'}]\", \"assert filter_products([{'name': 'Smartphone', 'category': 'electronics'}, {'name': 'Table', ... | {
"split": "train",
"index": 2210,
"acecode_id": "bigcode_python_fns_44571",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, eliminate all elements positioned at prime indices based on the zero-indexed Fibonacci sequence. Implement a function that takes a list as input and returns a new list with the elements at those prime Fibonacci indices removed.\nPlease reason step by s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_prime_index([5]) == [5]\", \"assert remove_prime_index([]) == []\", \"assert remove_prime_index([1, 2, 3]) == [1, 2]\", \"assert remove_prime_index([0]) == [0]\", \"assert remove_prime_index([5, 10, 15]) == [5, 10]\"]}"
} | {
"split": "train",
"index": 2211,
"acecode_id": "evol_26894",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a declarative sentence, implement a function called `deconstruct_sentence` that takes this sentence as input and returns a list of words contained in the sentence. Words are defined as sequences of characters separated by spaces. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert deconstruct_sentence('The quick brown fox') == ['The', 'quick', 'brown', 'fox']\", \"assert deconstruct_sentence(' Hello world ') == ['Hello', 'world']\", \"assert deconstruct_sentence(' Python is fun ') == ['Python', 'is', 'fun']\", \"assert dec... | {
"split": "train",
"index": 2212,
"acecode_id": "evol_30460",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that generates a sequence of layers for a neural network, consisting of convolutional layers followed by maxpooling layers. The function should take in a configuration dictionary for the model and specify the number of layers a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_network_layers({'filters': 32}, 4, 2) == ['ConvolutionalLayer(filters=32)', 'MaxPoolingLayer(pool_size=2)', 'ConvolutionalLayer(filters=32)', 'MaxPoolingLayer(pool_size=2)', 'ConvolutionalLayer(filters=32)', 'MaxPoolingLayer(pool_size=2)', 'Convolut... | {
"split": "train",
"index": 2213,
"acecode_id": "oss_8785",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `browser_history` that simulates a web browser's back and forward navigation feature. The function should accept a list of URLs visited and a list of commands. The commands will be either 'back' or 'forward'. The function should return the final URL after p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert browser_history(['google.com', 'facebook.com', 'twitter.com'], []) == 'twitter.com'\", \"assert browser_history(['google.com', 'facebook.com', 'twitter.com'], ['back']) == 'facebook.com'\", \"assert browser_history(['google.com', 'facebook.com', 'twitter.com... | {
"split": "train",
"index": 2214,
"acecode_id": "evol_35282",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `prime_range(start: int, end: int) -> List[int]` that takes two integers, `start` and `end`, and returns a list of all prime numbers in the inclusive range from `start` to `end`. A prime number is a number greater than 1 that has no divisors other than 1 an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_range(15, 30) == [17, 19, 23, 29]\", \"assert prime_range(10, 20) == [11, 13, 17, 19]\", \"assert prime_range(1, 10) == [2, 3, 5, 7]\", \"assert prime_range(20, 40) == [23, 29, 31, 37]\", \"assert prime_range(0, 5) == [2, 3, 5]\", \"assert prime_range(... | {
"split": "train",
"index": 2215,
"acecode_id": "evol_28142",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function to calculate the Mean Absolute Error (MAE) between two scalar values. The Mean Absolute Error is defined as the absolute difference between the actual value and the predicted value. Write a function named `calculate_mae` that takes two parameters: `actual` and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_mae(50, 42) == 8\", \"assert calculate_mae(30, 30) == 0\", \"assert calculate_mae(100, 95) == 5\", \"assert calculate_mae(0, 0) == 0\", \"assert calculate_mae(-10, -5) == 5\", \"assert calculate_mae(25, 30) == 5\", \"assert calculate_mae(60, 50) ==... | {
"split": "train",
"index": 2216,
"acecode_id": "evol_29922",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a filename from the Cellomics high-content screening system, your task is to implement a function that extracts the column number from a specific format. The filename follows the format 'MFGTMP_YYMMDDHHMMSS_A##f00d0.TIF', where '##' represents the column number. The colum... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_column('MFGTMP_140206180002_A01f00d0.TIF') == '01'\", \"assert get_column('MFGTMP_150306120000_A12f00d0.TIF') == '12'\", \"assert get_column('MFGTMP_200512090000_A03f00d0.TIF') == '03'\", \"assert get_column('MFGTMP_190701150000_A10f00d0.TIF') == '10'\",... | {
"split": "train",
"index": 2217,
"acecode_id": "bigcode_python_fns_36894",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and two indices, implement a function that swaps the elements at the given indices in the list. The function should modify the list in place and return the modified list. The indices provided are guaranteed to be within the bounds of the list. Implement... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_elements([1, 2, 3, 4], 0, 2) == [3, 2, 1, 4]\", \"assert swap_elements([10, 20, 30, 40, 50], 1, 4) == [10, 50, 30, 40, 20]\", \"assert swap_elements([5, 6, 7], 0, 1) == [6, 5, 7]\", \"assert swap_elements([1, 2], 0, 1) == [2, 1]\", \"assert swap_element... | {
"split": "train",
"index": 2218,
"acecode_id": "bigcode_python_fns_43185",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings representing file names, write a function `filter_files(files: List[str], pattern: str) -> List[str]` that returns a list of file names that match the given regular expression pattern. The input list will contain file names with various extensions, and t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_files(['file1.txt', 'file2.log', 'report.pdf', 'summary.docx'], '.*\\\\.txt') == ['file1.txt']\", \"assert filter_files(['image.png', 'photo.jpg', 'icon.gif'], '.*\\\\.jpg') == ['photo.jpg']\", \"assert filter_files(['data1.csv', 'data2.csv', 'data3.t... | {
"split": "train",
"index": 2219,
"acecode_id": "bigcode_python_fns_25363",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the execution of a SQL command and logs the command being executed. The function will take a command string as input, along with additional arguments, and return a success message indicating that the command has been ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_sql_command(b'SELECT * FROM users', 1) == 'Executed: SELECT * FROM users'\", \"assert execute_sql_command(b'INSERT INTO products VALUES (1, \\\"item\\\")', 'item') == 'Executed: INSERT INTO products VALUES (1, \\\"item\\\")'\", \"assert execute_sql_c... | {
"split": "train",
"index": 2220,
"acecode_id": "oss_14242",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a simple documentation format for a list of configuration rules. Write a function `generate_documentation(rules: List[str], notes: str) -> str:` that takes in a list of configuration rules and a string containing additional notes. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_documentation(['Rule1', 'Rule2'], 'This is a note.') == 'Rule: Rule1\\\\nThis is a note.\\\\nRule: Rule2\\\\nThis is a note.'\", \"assert generate_documentation([], 'No rules.') == ''\", \"assert generate_documentation(['SingleRule'], 'Note for sing... | {
"split": "train",
"index": 2221,
"acecode_id": "bigcode_python_fns_19502",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `odd_cubes(n)` that takes an integer `n` as input and returns a list of the first `n` cube numbers generated from odd numbers less than 20. The function should raise a ValueError if the input `n` is not an integer or if `n` is less than or equal to zero.\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert odd_cubes(1) == [1]\", \"assert odd_cubes(2) == [1, 27]\", \"assert odd_cubes(3) == [1, 27, 125]\", \"assert odd_cubes(4) == [1, 27, 125, 343]\", \"assert odd_cubes(5) == [1, 27, 125, 343, 729]\", \"assert odd_cubes(6) == [1, 27, 125, 343, 729, 1331]\", \"as... | {
"split": "train",
"index": 2222,
"acecode_id": "evol_11027",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that generates a specific greeting string based on user input. Write a Python function called `generate_greeting_string` that takes an integer N as input and returns a string that repeats the word 'Ho' N times, separated by spaces, followe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_greeting_string(0) == '!'\", \"assert generate_greeting_string(1) == 'Ho!'\", \"assert generate_greeting_string(2) == 'Ho Ho!'\", \"assert generate_greeting_string(3) == 'Ho Ho Ho!'\", \"assert generate_greeting_string(4) == 'Ho Ho Ho Ho!'\", \"asse... | {
"split": "train",
"index": 2223,
"acecode_id": "oss_23548",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a software installation process in a simplified environment. Write a Python function called `simulate_installation` that takes no arguments. Inside this function, you will create a list of installed applications and a boolean indicating whether th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_installation() == {'installed_apps': ['example_app'], 'server_running': True}\", \"assert simulate_installation() == {'installed_apps': ['example_app'], 'server_running': True}\", \"assert simulate_installation() == {'installed_apps': ['example_app'... | {
"split": "train",
"index": 2224,
"acecode_id": "oss_1809",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to remove duplicate rows from a given list of lists, where each inner list represents a row of data. Your function should take a list of lists as input and return a new list of lists that contains only the unique rows, maintaining ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_repetition([[1, 2], [3, 4], [1, 2], [5, 6]]) == [[1, 2], [3, 4], [5, 6]]\", \"assert remove_repetition([[1, 2], [1, 2], [1, 2]]) == [[1, 2]]\", \"assert remove_repetition([[1, 2], [2, 1], [1, 2], [3, 4]]) == [[1, 2], [2, 1], [3, 4]]\", \"assert remove... | {
"split": "train",
"index": 2225,
"acecode_id": "oss_22431",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that serializes a given data model into a dictionary format. The input model is represented as a nested structure, where each model may contain properties and references to other models. The serialization process should convert all pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_model({'name': 'John', 'age': 30, 'friends': [{'name': 'Jane', 'age': 28}]}, []) == {'name': 'John', 'age': 30, 'friends': [{'name': 'Jane', 'age': 28}]}\", \"assert serialize_model({'name': 'John', 'age': 30, 'friends': [{'name': 'Jane', 'age': 28... | {
"split": "train",
"index": 2226,
"acecode_id": "bigcode_python_fns_27390",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that accepts a list of integers and returns a list of their absolute values sorted in ascending order. The function should only take a single parameter, which is the list of integers. For example, given the input [-5, 3, -2, 2, 3, -3, 9, 0, -123], the output sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sorted_absolute_values([-5, 3, -2, 2, 3, -3, 9, 0, -123]) == [0, 2, 2, 3, 3, 3, 5, 9, 123]\", \"assert sorted_absolute_values([0, -1, 1]) == [0, 1, 1]\", \"assert sorted_absolute_values([-10, 10, -5, 5, 0]) == [0, 5, 5, 10, 10]\", \"assert sorted_absolute_va... | {
"split": "train",
"index": 2227,
"acecode_id": "evol_30175",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that sets control points for a B-spline surface from a given grid. A B-spline surface is defined by its control points, which can be organized in a 2D grid format. Your task is to implement the function `set_ctrlpts_from_grid(grid: Li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_ctrlpts_from_grid([[1, 2], [3, 4]]) == [[1, 2], [3, 4]]\", \"assert set_ctrlpts_from_grid([[0]]) == [[0]]\", \"assert set_ctrlpts_from_grid([[5, 6, 7], [8, 9, 10]]) == [[5, 6, 7], [8, 9, 10]]\", \"assert set_ctrlpts_from_grid([[1, 1], [1, 1]]) == [[1, 1]... | {
"split": "train",
"index": 2228,
"acecode_id": "oss_8814",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers called `depths`, where each integer represents a depth measurement taken at consecutive time intervals. Your task is to write a function `count_depth_increases(depths)` that counts how many times the depth measurement increases from one measurem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_depth_increases([1, 2, 3, 4]) == 3\", \"assert count_depth_increases([4, 3, 2, 1]) == 0\", \"assert count_depth_increases([1, 1, 1, 1]) == 0\", \"assert count_depth_increases([1, 2, 1, 2]) == 2\", \"assert count_depth_increases([10, 20, 10, 30, 40]) ==... | {
"split": "train",
"index": 2229,
"acecode_id": "bigcode_python_fns_38272",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that translates a given text from one language to another. The function should accept a string input representing the text and return a string output representing the translated text. For this problem, you will simulate the transla... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert translate_text('hello') == 'olleh'\", \"assert translate_text('world') == 'dlrow'\", \"assert translate_text('python') == 'nohtyp'\", \"assert translate_text('leetcode') == 'edocteel'\", \"assert translate_text('translation') == 'noitalsnart'\", \"assert tra... | {
"split": "train",
"index": 2230,
"acecode_id": "oss_6261",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a mapping of worker server IDs to their corresponding network addresses for a load balancing algorithm. Given a bind address and port, and the number of worker servers, your function should create a dictionary where each key is a worker server ID ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_worker_addresses('0.0.0.0:5004', 3) == {1: '0.0.0.0:5005', 2: '0.0.0.0:5006', 3: '0.0.0.0:5007'}\", \"assert generate_worker_addresses('192.168.1.1:8080', 2) == {1: '192.168.1.1:8081', 2: '192.168.1.1:8082'}\", \"assert generate_worker_addresses('12... | {
"split": "train",
"index": 2231,
"acecode_id": "oss_34325",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that computes the mean and standard deviation of the list. The function should return the mean as a float rounded to two decimal places and the standard deviation as a float rounded to two decimal places. The standard deviation should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_mean_std([1]) == (1.0, 0.0)\", \"assert compute_mean_std([1, 1, 1, 1]) == (1.0, 0.0)\", \"assert compute_mean_std([0, 0, 0, 0]) == (0.0, 0.0)\", \"assert compute_mean_std([-5, 5]) == (0.0, 5.0)\", \"assert compute_mean_std([1, 2, 3, 4, 5, 6, 7, 8, 9]... | {
"split": "train",
"index": 2232,
"acecode_id": "bigcode_python_fns_28068",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_parity(n: int) -> str` that determines whether a given integer `n` is even or odd. The function should return a string in the format 'O número {n} é PAR!' if the number is even, and 'O número {n} é ÍMPAR!' if the number is odd. The function should ha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_parity(2) == 'O n\\u00famero 2 \\u00e9 PAR!'\", \"assert check_parity(-2) == 'O n\\u00famero -2 \\u00e9 PAR!'\", \"assert check_parity(3) == 'O n\\u00famero 3 \\u00e9 \\u00cdMPAR!'\", \"assert check_parity(-3) == 'O n\\u00famero -3 \\u00e9 \\u00cdMPAR!... | {
"split": "train",
"index": 2233,
"acecode_id": "oss_23264",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of login credentials, where each credential is represented as a dictionary with 'username' and 'password' keys. Write a function that checks if the given credentials can successfully log into a mock service using the following criteria: the username must st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_logins([{'username': 'user_john', 'password': 'password123'}, {'username': 'admin', 'password': 'pass123'}, {'username': 'user_mike', 'password': 'short'}]) == [True, False, False]\", \"assert check_logins([{'username': 'user_alice', 'password': 'alice... | {
"split": "train",
"index": 2234,
"acecode_id": "bigcode_python_fns_6734",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given two floating-point numbers, `rho` and `phi`. Write a function `primary_astigmatism_00(rho: float, phi: float) -> float` that computes the value of the primary astigmatism at an angle of 0° using the formula: `rho^2 * cos(2 * phi)`. The function should return a sin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert primary_astigmatism_00(0.0, 0.0) == 0.0\", \"assert primary_astigmatism_00(1.0, 0.0) == 1.0\", \"assert primary_astigmatism_00(1.0, 0.5) == 0.5403023058681398\", \"assert primary_astigmatism_00(2.0, 0.0) == 4.0\", \"assert primary_astigmatism_00(0.5, 0.0) ==... | {
"split": "train",
"index": 2235,
"acecode_id": "bigcode_python_fns_32502",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that takes a list of integers as input and returns a new list containing only the odd integers from the original list.\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 odd_elements_list([1, 2, 3, 4, 5]) == [1, 3, 5]\", \"assert odd_elements_list([2, 4, 6, 8]) == []\", \"assert odd_elements_list([1, 3, 5, 7, 9]) == [1, 3, 5, 7, 9]\", \"assert odd_elements_list([10, 15, 20, 25]) == [15, 25]\", \"assert odd_elements_list([0, ... | {
"split": "train",
"index": 2236,
"acecode_id": "evol_998",
"num_tests": 16
} |
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 even numbers from the original list. The function should follow these requirements:\n1. The function should be named `filter_even_numbers`.\n2. The input will be a l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([1, 3, 5])... | {
"split": "train",
"index": 2237,
"acecode_id": "oss_19841",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string of alphanumeric characters and returns a new string with the characters in reverse order.\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 invert_sequence('abc123') == '321cba'\", \"assert invert_sequence('HelloWorld') == 'dlroWolleH'\", \"assert invert_sequence('Python3.9') == '9.3nohtyP'\", \"assert invert_sequence('!@#$$%^&*()') == ')(*&^%$$#@!'\", \"assert invert_sequence('1234567890') == '... | {
"split": "train",
"index": 2238,
"acecode_id": "evol_23265",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and an integer K, write a function `sum_values` that returns a new list containing the sum of all values in the input list, where each integer is added K times to the result. The output list should contain the total sum of all integers repeated K times ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_values([1, 2, 3], 2) == [6, 6]\", \"assert sum_values([5, 10, 15], 1) == [30]\", \"assert sum_values([], 3) == []\", \"assert sum_values([-1, -2, -3], 2) == [-6, -6]\", \"assert sum_values([0, 0, 0], 5) == [0, 0, 0, 0, 0]\", \"assert sum_values([7, 8, 9,... | {
"split": "train",
"index": 2239,
"acecode_id": "bigcode_python_fns_36270",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that assigns seat numbers to passengers on an airplane. The airplane has multiple sections, and each section has 12 rows of seats. The seat numbering follows a specific pattern, and your program needs to determine the seat number and its c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_seat(1, 1) == '1 WS'\", \"assert assign_seat(1, 5) == '5 MS'\", \"assert assign_seat(1, 9) == '9 AS'\", \"assert assign_seat(2, 1) == '13 WS'\", \"assert assign_seat(2, 5) == '17 MS'\", \"assert assign_seat(2, 9) == '21 AS'\", \"assert assign_seat(3, ... | {
"split": "train",
"index": 2240,
"acecode_id": "oss_35189",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a list of cluster names. Your function should take a list of cluster names as input and return a dictionary that counts the occurrences of each unique cluster name. The dictionary should have cluster names as keys and their r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_clusters(['clusterA', 'clusterB', 'clusterA']) == {'clusterA': 2, 'clusterB': 1}\", \"assert count_clusters(['clusterA', 'clusterC', 'clusterC', 'clusterA', 'clusterB']) == {'clusterA': 2, 'clusterC': 2, 'clusterB': 1}\", \"assert count_clusters(['clus... | {
"split": "train",
"index": 2241,
"acecode_id": "oss_14741",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_median(nums)` that returns the median value of the list. The median is defined as the middle element when the numbers are sorted. If the list has an even number of elements, return the average of the two middle elements. The inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_median([1, 3, 3, 6, 7, 8, 9]) == 6\", \"assert find_median([1, 2, 3]) == 2\", \"assert find_median([1, 2]) == 1.5\", \"assert find_median([5, 10, 7, 2]) == 6.0\", \"assert find_median([3, 1, 2, 4]) == 2.5\", \"assert find_median([10]) == 10\", \"assert ... | {
"split": "train",
"index": 2242,
"acecode_id": "evol_5442",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `first_n_even_primes(n)` that generates a list containing the first 'n' even prime numbers. An even prime number is defined as a prime number that is also even. Since 2 is the only even prime number, the function should return a list with 'n' elements, all of w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_n_even_primes(0) == []\", \"assert first_n_even_primes(1) == [2]\", \"assert first_n_even_primes(2) == [2, 2]\", \"assert first_n_even_primes(3) == [2, 2, 2]\", \"assert first_n_even_primes(4) == [2, 2, 2, 2]\", \"assert first_n_even_primes(5) == [2, 2... | {
"split": "train",
"index": 2243,
"acecode_id": "evol_31634",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that determines if a given string is a valid palindrome. A palindrome is a word, phrase, number, or other sequences of characters that reads the same forward and backward, ignoring spaces, punctuation, and capitalization. Your task... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal, Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_pali... | {
"split": "train",
"index": 2244,
"acecode_id": "oss_991",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple encoding and decoding mechanism for a custom data structure. The structure has a method `encode` that encodes a fixed byte attribute as bytes and returns the encoding of the character '5'. Additionally, there is a method `decode` that s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert CustomDataStructure().did_unit == b'\\\\x01\\\\x02\\\\x03'\", \"assert isinstance(CustomDataStructure().length, int)\", \"assert isinstance(CustomDataStructure().width, int)\", \"assert CustomDataStructure().length == 0\", \"assert CustomDataStructure().widt... | {
"split": "train",
"index": 2245,
"acecode_id": "oss_35558",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that counts the occurrences of different types of migration operations from a list. Each migration operation is represented as a tuple containing the operation type and the model name involved. Your function should return a diction... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_migration_operations([('AddField', 'user', 'age'), ('AddField', 'user', 'email')]) == {'AddField': 2}\", \"assert count_migration_operations([('RemoveField', 'work', 'state'), ('RemoveField', 'user', 'address')]) == {'RemoveField': 2}\", \"assert count... | {
"split": "train",
"index": 2246,
"acecode_id": "oss_26051",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_complex(num: str) -> bool` that verifies whether the given string is a valid complex number. The complex number should follow the format 'a+bi' or 'a-bi', where 'a' and 'b' are numerical integers or decimals, and 'i' represents the imaginary unit. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_complex('3+4i') == True\", \"assert is_complex('-2.5-3.5i') == True\", \"assert is_complex('0.5+0.5i') == True\", \"assert is_complex('1-1i') == True\", \"assert is_complex('-1+0i') == True\", \"assert is_complex('0-0i') == True\", \"assert is_complex('2.... | {
"split": "train",
"index": 2247,
"acecode_id": "evol_7856",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that performs a binary search in a list named 'mylist'. The list contains both positive and negative integers and is sorted in non-decreasing order. The function should return the starting and ending indexes of all occurrences of a target value. If no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([-5, -3, -3, 1, 2, 3, 4, 5, 6, 7, 7, 7, 7], -3) == (1, 2)\", \"assert binary_search([-5, -3, -3, 1, 2, 3, 4, 5, 6, 7, 7, 7, 7], 0) == \\\"The target value is not found in the list\\\"\", \"assert binary_search([-10, -5, -5, -1, 0, 2, 3, 4, 4, 5... | {
"split": "train",
"index": 2248,
"acecode_id": "evol_27543",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `detect_and_notify(data: List[str], recipient: str) -> List[str]` that simulates monitoring a data stream and notifying a recipient whenever a new data occurrence is detected. The function will take a list of strings representing the data stream and a strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_and_notify(['data1', 'data2', 'data1'], '1234567890') == ['Novel data detected: data1', 'Novel data detected: data2']\", \"assert detect_and_notify(['new_data1', 'new_data1', 'new_data2'], '9876543210') == ['Novel data detected: new_data1', 'Novel dat... | {
"split": "train",
"index": 2249,
"acecode_id": "evol_27109",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings, `s1` and `s2`, with the same length, determine if some permutation of string `s1` can break some permutation of string `s2` or vice versa. A string `x` can break string `y` if for every index `i`, `x[i] >= y[i]` when both strings are sorted in alphabetical or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert checkIfCanBreak('abc', 'xya') == True\", \"assert checkIfCanBreak('abe', 'acd') == False\", \"assert checkIfCanBreak('leetcodee', 'interview') == True\", \"assert checkIfCanBreak('xyz', 'abc') == True\", \"assert checkIfCanBreak('abcde', 'edcba') == True\", ... | {
"split": "train",
"index": 2250,
"acecode_id": "evol_32203",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates basic bank account operations. The function `manage_account` will take a list of operations and return the final balance and the total number of transactions. Each operation will be represented as a tuple: `('deposit', ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_account([('deposit', 100), ('withdraw', 50)]) == (50, 2)\", \"assert manage_account([('withdraw', 30)]) == (0, 0)\", \"assert manage_account([('deposit', 200), ('withdraw', 300)]) == (200, 1)\", \"assert manage_account([('deposit', 50), ('withdraw', 5... | {
"split": "train",
"index": 2251,
"acecode_id": "oss_13477",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Create a random 4D array with the provided dimensions, layers, rows, and columns. The function should fill this 4D array with randomly generated integers within a given range. Your task is to ensure that all numbers generated are unique across the 4D array. Implement the functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_4d_array(1, 1, 1, 1, 1, 10)[0][0][0][0] >= 1\", \"assert create_4d_array(1, 1, 1, 1, 1, 10)[0][0][0][0] <= 10\", \"assert create_4d_array(3, 3, 3, 3, 1, 100)[0][0][0][0] >= 1\", \"assert create_4d_array(3, 3, 3, 3, 1, 100)[0][0][0][0] <= 100\", \"asse... | {
"split": "train",
"index": 2252,
"acecode_id": "evol_19369",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Create a function that accepts a list of mixed data types, where some elements may be nested lists. The function should flatten all nested lists, convert the flattened list to a tuple, and then return a new tuple with all duplicates removed. The order of the elements in the out... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_tuple([1, 2, 'apple', ['apple', 10], 'banana', 'carrot', ['carrot', 3, [4, 'apple']]]) == (1, 2, 'apple', 10, 'banana', 'carrot', 3, 4)\", \"assert unique_tuple(['a', ['b', ['c', 'a']], 'd']) == ('a', 'b', 'c', 'd')\", \"assert unique_tuple([1, [2, 3]... | {
"split": "train",
"index": 2253,
"acecode_id": "evol_33361",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to generate a stock entry document for incoming items based on a work order in a warehouse management system. Write a function `make_stock_entry_incoming` that takes the necessary parameters and returns a stock entry document for incoming... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_stock_entry_incoming('WO-001', 'ITEM-A', 10) == {'doctype': 'Stock Entry', 'purpose': 'Material Receipt', 'company': '_Test Company', 'items': [{'item_code': 'ITEM-A', 'qty': 10, 's_warehouse': 'Stores - _TC', 't_warehouse': '_Test Company - _TC', 'batc... | {
"split": "train",
"index": 2254,
"acecode_id": "oss_33970",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary and a list of keys, write a function that removes the specified keys from the dictionary and returns a new dictionary containing the remaining key-value pairs. The function should not modify the original dictionary. The input dictionary will have string keys ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_keys({'a': 1, 'b': 2, 'c': 3}, ['b']) == {'a': 1, 'c': 3}\", \"assert remove_keys({'x': 10, 'y': 20, 'z': 30}, ['y', 'z']) == {'x': 10}\", \"assert remove_keys({'name': 5, 'age': 10, 'height': 15}, ['age', 'name']) == {'height': 15}\", \"assert remove... | {
"split": "train",
"index": 2255,
"acecode_id": "bigcode_python_fns_32434",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_primes(nums)` that takes a list of integers `nums` and returns a list of prime numbers contained in `nums`. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself. Please implement the function to correc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_primes([2, 3, 4, 5, 6, 7, 8, 9, 10]) == [2, 3, 5, 7]\", \"assert find_primes([1, 4, 6, 8, 9, 10]) == []\", \"assert find_primes([11, 13, 15, 17, 19]) == [11, 13, 17, 19]\", \"assert find_primes([0, -1, -2, -3]) == []\", \"assert find_primes([29, 31, 37]... | {
"split": "train",
"index": 2256,
"acecode_id": "evol_30809",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `process_number(x)` that takes an integer input `x` and returns a tuple containing the following information: 1) a list of every positive divisor of `x`, 2) the sum of these divisors, 3) the average of these divisors, and 4) a statement indicating whether `x` i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_number(8) == ([1, 2, 4, 8], 15, 3.75, '8 is not a prime number')\", \"assert process_number(11) == ([], -1/11, '11 is a prime number')\", \"assert process_number(1) == ([1], 1, 1.0, '1 is not a prime number')\", \"assert process_number(15) == ([1, 3,... | {
"split": "train",
"index": 2257,
"acecode_id": "evol_1838",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with finding the longest substring in a given string that contains at most two distinct characters. Implement a function `longest_substring_with_two_distinct_chars(s: str) -> int` that takes a string `s` as input and returns the length of the longest substring th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_substring_with_two_distinct_chars('eceba') == 3\", \"assert longest_substring_with_two_distinct_chars('aa') == 2\", \"assert longest_substring_with_two_distinct_chars('abc') == 2\", \"assert longest_substring_with_two_distinct_chars('a') == 1\", \"as... | {
"split": "train",
"index": 2258,
"acecode_id": "bigcode_python_fns_44237",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a ternary tree, implement a function `find_node(root: TreeNode, target: int) -> bool` that determines if a specific node with the value `target` exists in the tree using depth-first search. The function should return `True` if the node is found and `False` otherwise.\nPle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_node(TreeNode(1), 1) == True\", \"assert find_node(TreeNode(1), 2) == False\", \"assert find_node(TreeNode(1, TreeNode(2), TreeNode(3), TreeNode(4)), 2) == True\", \"assert find_node(TreeNode(1, TreeNode(2), TreeNode(3), TreeNode(4)), 5) == False\", \"a... | {
"split": "train",
"index": 2259,
"acecode_id": "evol_33645",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes availability data for a set of resources. The function takes in three parameters: `result` (a boolean indicating availability), `verbose` (a boolean indicating whether to include detailed information), and `q` (a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_availability(True, True, 'Resource1', '') == '\\\\nResource1: '\", \"assert process_availability(True, False, 'Resource1', '') == ''\", \"assert process_availability(True, True, 'Resource2', '\\\\nResource1: ') == '\\\\nResource1: \\\\nResource2: '\"... | {
"split": "train",
"index": 2260,
"acecode_id": "oss_7733",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `organize_text_files` that takes two parameters: `source_files` (a list of strings representing file names) and `timestamp` (a string representing a timestamp in the format 'YYYYMMDDHHMMSS'). The function should perform the following acti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_text_files(['file1.txt', 'file2.txt', 'image.png'], '20230101120000') == ['file1_20230101120000.txt', 'file2_20230101120000.txt']\", \"assert organize_text_files(['report.txt', 'summary.docx', 'notes.txt'], '20230515103000') == ['report_202305151030... | {
"split": "train",
"index": 2261,
"acecode_id": "oss_30744",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a normal distribution characterized by its mean (loc) and standard deviation (scale), implement a function `calculate_probabilities(loc: float, scale: float, values: List[float]) -> List[float]` that calculates the probability density function (PDF) for each value in the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_probabilities(0, 1, []) == []\", \"assert calculate_probabilities(0, -1, [0]) == []\", \"assert calculate_probabilities(1, 1, [0]) == [0.24197072451914337]\", \"assert calculate_probabilities(0, 1, [2, -2]) == [0.05399096651318806, 0.05399096651318... | {
"split": "train",
"index": 2262,
"acecode_id": "bigcode_python_fns_38299",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `remove_packages(python_env: Dict[str, List[str]], packages: List[str]) -> Tuple[Dict[str, List[str]], List[str]]` that removes specified packages from a Python virtual environment and returns the updated environment along with a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_packages({'python': ['numpy', 'pandas']}, ['numpy']) == ({'python': ['pandas']}, ['path/to/site-packages/numpy'])\", \"assert remove_packages({'python': ['numpy', 'pandas']}, ['scipy']) == ({'python': ['numpy', 'pandas']}, [])\", \"assert remove_packa... | {
"split": "train",
"index": 2263,
"acecode_id": "bigcode_python_fns_23127",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates a given URL format. Write a Python function `is_valid_url(url: str) -> bool` that takes in a string representing a URL and returns `True` if it is a valid URL format, and `False` otherwise. A URL is considered valid ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_url('http://example.com') == True\", \"assert is_valid_url('https://example.com') == True\", \"assert is_valid_url('ftp://example.com') == True\", \"assert is_valid_url('https://example.com/path/to/resource') == True\", \"assert is_valid_url('http:/... | {
"split": "train",
"index": 2264,
"acecode_id": "oss_16037",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the size of the maximum clique in a given undirected graph and counts the number of edges in the graph. A clique in a graph is a subset of vertices such that every two distinct vertices in the clique are adjacent. You ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_clique_and_edge_count({0: [1, 2], 1: [0, 2], 2: [0, 1]} ) == (3, 3)\", \"assert find_max_clique_and_edge_count({0: [1], 1: [0, 2], 2: [1, 3], 3: [2]} ) == (2, 3)\", \"assert find_max_clique_and_edge_count({0: [1], 1: [0, 2], 2: [1, 3], 3: [2]} ) == ... | {
"split": "train",
"index": 2265,
"acecode_id": "oss_8744",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of words (dictionary) and a target word. Your task is to find all the words in the dictionary that have the same length as the target word. If the target word starts with a specific letter, you should limit your search to words that also start with the same... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_matching_words(['apple', 'banana', 'cherry', 'date', 'fig', 'grape'], 'apple') == ['apple']\", \"assert find_matching_words(['apple', 'banana', 'cherry', 'date', 'fig', 'grape'], 'banana') == ['banana']\", \"assert find_matching_words(['apple', 'banana'... | {
"split": "train",
"index": 2266,
"acecode_id": "bigcode_python_fns_14788",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of two strings made only of parentheses '(' and ')' and squared brackets '[' and ']'. Your task is to implement a function that checks if the concatenation of these two strings forms a valid nested structure of parentheses and brackets. A valid structure me... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_parens(['(', ']']) == 'No'\", \"assert match_parens(['[(', '])']) == 'No'\", \"assert match_parens(['()', '()']) == 'Yes'\", \"assert match_parens(['((', '))']) == 'Yes'\", \"assert match_parens(['[', ']']) == 'Yes'\", \"assert match_parens(['[(', ''])... | {
"split": "train",
"index": 2267,
"acecode_id": "evol_2905",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two parameters, y and z, representing gravitational acceleration along the y and z axes, write a function `calculate_roll(y: float, z: float) -> float` that estimates the angular roll in degrees. The roll is calculated using the formula: roll = arctan2(y, z) * (180 / π). ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_roll(0, 1) == 0.0\", \"assert calculate_roll(1, 1) == 45.0\", \"assert calculate_roll(0, 0) == 0.0\", \"assert calculate_roll(-1, 1) == -45.0\", \"assert calculate_roll(1, 0) == 90.0\", \"assert calculate_roll(-1, 0) == -90.0\", \"assert calculate_... | {
"split": "train",
"index": 2268,
"acecode_id": "bigcode_python_fns_37521",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `process_guess` that simulates a simplified word-guessing game. The function should take an integer `state`, a boolean `game_over`, and a string `guess`. The `state` represents the current number of attempts made (ranging from 0 to 5), an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_guess(0, False, 'python') == 'Correct!'\", \"assert process_guess(1, False, 'java') == 'Incorrect guess, try again!'\", \"assert process_guess(5, False, 'python') == 'Correct!'\", \"assert process_guess(4, True, 'ruby') == 'The game is over or the st... | {
"split": "train",
"index": 2269,
"acecode_id": "oss_2820",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of integers and returns a new list containing only the even numbers from the original list. The function should preserve the order of the elements as they appeared in the input list. Implement the function `filter_ev... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_numbers([])... | {
"split": "train",
"index": 2270,
"acecode_id": "bigcode_python_fns_30248",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a city skyline. Your task is to determine the maximum height of the skyline. The skyline is defined as the highest contour of the buildings when viewed from afar. Write a function `max_skyline_height(buil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_skyline_height([3, 1, 4, 1, 5, 9]) == 9\", \"assert max_skyline_height([1, 2, 3, 4, 5]) == 5\", \"assert max_skyline_height([5, 4, 3, 2, 1]) == 5\", \"assert max_skyline_height([1, 1, 1, 1]) == 1\", \"assert max_skyline_height([10, 20, 30, 40]) == 40\", ... | {
"split": "train",
"index": 2271,
"acecode_id": "bigcode_python_fns_48019",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of pairs where each pair represents a resource that is replaced by another resource. Each resource is uniquely identified by a short ID (a string). Your task is to create a function that takes this list of pairs and returns a dictionary where each key is a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_replacements([('a', 'b'), ('a', 'c'), ('b', 'd')]) == {'a': ['b', 'c'], 'b': ['d'], 'c': [], 'd': []}\", \"assert map_replacements([('x', 'y'), ('y', 'z'), ('y', 'a')]) == {'x': ['y'], 'y': ['z', 'a'], 'z': [], 'a': []}\", \"assert map_replacements([('1'... | {
"split": "train",
"index": 2272,
"acecode_id": "bigcode_python_fns_37330",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes all unique combinations of three distinct integers from a given list. The function should return a list of these combinations, where each combination is represented as a tuple of integers. The input list will contain distinct integers. If ther... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_combinations([1, 2, 3]) == [(1, 2, 3)]\", \"assert get_combinations([1, 2, 3, 4]) == [(1, 2, 3), (1, 2, 4), (1, 3, 4), (2, 3, 4)]\", \"assert get_combinations([5, 6, 7, 8, 9]) == [(5, 6, 7), (5, 6, 8), (5, 6, 9), (5, 7, 8), (5, 7, 9), (5, 8, 9), (6, 7, 8... | {
"split": "train",
"index": 2273,
"acecode_id": "evol_28516",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a migration report based on a given SQL script. The report should detail the operations performed in the script. The report must include the following information: 1. The table name on which the operations are performed. 2.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_migration_report(\\\"op.alter_column('feed', 'truncated_content', nullable=False)\\\\nop.execute('UPDATE feed SET feed_type=\\\\'classic\\\\' WHERE feed_type=\\\\'fetch\\\\';')\\\") == 'Migration Report:\\\\n-----------------\\\\nTable: feed\\\\nOpe... | {
"split": "train",
"index": 2274,
"acecode_id": "oss_20721",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function to calculate the logarithm (base 10) of a given positive integer without using the built-in logarithm functions available in programming languages. Additionally, calculate the logarithm with a precision up to 5 decimal places. The function should take a positi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log10(1) == 0.00000\", \"assert log10(10) == 1.00000\", \"assert log10(100) == 2.00000\", \"assert log10(1000) == 3.00000\", \"assert log10(10000) == 4.00000\", \"assert log10(100000) == 5.00000\", \"assert log10(1000000) == 6.00000\", \"assert log10(3) == 0... | {
"split": "train",
"index": 2275,
"acecode_id": "evol_15174",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that takes a string as input, transposes the string by reversing its characters, and checks if the transposed string is an anagram of the initial string. The function should return True if they are anagrams, and False otherwise.\nPlease reason step by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_transpose_anagram('aabb') == True\", \"assert check_transpose_anagram('abba') == True\", \"assert check_transpose_anagram('racecar') == True\", \"assert check_transpose_anagram('level') == True\", \"assert check_transpose_anagram('madam') == True\", \"... | {
"split": "train",
"index": 2276,
"acecode_id": "evol_19699",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with removing a list of domains from a blacklisted list. Implement a function `remove_blacklisted_domains(domains: List[str]) -> str` that takes a list of domain names as input and returns a message indicating that the domains were successfully removed from the b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_blacklisted_domains(['example.com', 'test.com']) == 'Domains were successfully removed from the inbound blacklisted list'\", \"assert remove_blacklisted_domains(['domain1.com']) == 'Domains were successfully removed from the inbound blacklisted list'\... | {
"split": "train",
"index": 2277,
"acecode_id": "bigcode_python_fns_44307",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that checks if a given number is an Armstrong number. A number is considered an Armstrong number if the sum of its digits, each raised to the power of the number of digits, equals the number itself. Implement the function `is_armstrong(n: int) -> bool` t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_armstrong(0) == True\", \"assert is_armstrong(1) == True\", \"assert is_armstrong(2) == True\", \"assert is_armstrong(3) == True\", \"assert is_armstrong(4) == True\", \"assert is_armstrong(5) == True\", \"assert is_armstrong(6) == True\", \"assert is_arm... | {
"split": "train",
"index": 2278,
"acecode_id": "evol_10846",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an array of integers as input and returns a dictionary containing the duplicated integers as keys and their respective counts as values. If there are no duplicates, return an empty dictionary. For example, given the input array [11, 15, 40, 14, 1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_duplicates([11, 15, 40, 14, 11]) == {11: 2}\", \"assert find_duplicates([1, 2, 3, 4, 5]) == {}\", \"assert find_duplicates([4, 4, 4, 2, 2]) == {4: 3, 2: 2}\", \"assert find_duplicates([10, 20, 10, 30, 20]) == {10: 2, 20: 2}\", \"assert find_duplicates([... | {
"split": "train",
"index": 2279,
"acecode_id": "evol_277",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a user verification logic. The verification logic should take a user's username and a verification code as input parameters. If the provided username matches 'valid_user' and the verification code matches 'valid_code', return a success message i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_user('valid_user', 'valid_code') == 'User verified successfully'\", \"assert verify_user('valid_user', 'invalid_code') == 'User could not be verified'\", \"assert verify_user('invalid_user', 'valid_code') == 'User could not be verified'\", \"assert ve... | {
"split": "train",
"index": 2280,
"acecode_id": "oss_31925",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates a random integer between a specified lower bound and upper bound, inclusive. The function should take two parameters: lower_bound and upper_bound, ensuring that lower_bound is less than upper_bound. If the parameters are not valid, the functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_number(5, 20) is not None\", \"assert generate_random_number(5, 20) >= 5\", \"assert generate_random_number(5, 20) <= 20\", \"assert generate_random_number(10, 30) is not None\", \"assert generate_random_number(10, 30) >= 10\", \"assert gener... | {
"split": "train",
"index": 2281,
"acecode_id": "evol_22386",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing COVID-19 data for various countries. Each dictionary contains the keys 'Country', 'CountryCode', 'Confirmed', 'Deaths', 'Recovered', and 'Date'. Your task is to write a function that takes this list of dictionaries as input, con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_covid_data([{'Country': 'USA', 'CountryCode': 'US', 'Confirmed': '100000.0', 'Deaths': '5000.0', 'Recovered': '30000.0', 'Date': '2020-05-01'}]) == [{'Country': 'USA', 'CountryCode': 'US', 'Confirmed': 100000.0, 'Deaths': 5000.0, 'Recovered': 30000.0... | {
"split": "train",
"index": 2282,
"acecode_id": "oss_23895",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_fibonacci(n: int) -> List[int]` that generates the first `n` Fibonacci numbers. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. The function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fibonacci(0) == []\", \"assert generate_fibonacci(1) == [0]\", \"assert generate_fibonacci(2) == [0, 1]\", \"assert generate_fibonacci(3) == [0, 1, 1]\", \"assert generate_fibonacci(4) == [0, 1, 1, 2]\", \"assert generate_fibonacci(5) == [0, 1, 1, 2... | {
"split": "train",
"index": 2283,
"acecode_id": "evol_25985",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing keys in a TOML file. Your task is to implement a function that sorts these keys in lexicographical order. The function should be case-insensitive, meaning that 'key' and 'Key' should be treated as equal when determining their order. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_toml_keys(['Zebra', 'elephant', 'Lion', 'giraffe']) == ['elephant', 'giraffe', 'Lion', 'Zebra']\", \"assert sort_toml_keys(['A', 'a', 'B', 'b', 'C', 'c']) == ['A', 'a', 'B', 'b', 'C', 'c']\", \"assert sort_toml_keys([]) == []\", \"assert sort_toml_keys(... | {
"split": "train",
"index": 2284,
"acecode_id": "bigcode_python_fns_48178",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the heights of a series of rectangles in a histogram, write a function that computes the area of the largest rectangle that can be formed within the histogram. The function should take a list of integers as input, where each integer represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_rectangle_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert largest_rectangle_area([1, 1, 1, 1]) == 4\", \"assert largest_rectangle_area([5, 4, 1, 2]) == 8\", \"assert largest_rectangle_area([0, 9, 0, 2]) == 9\", \"assert largest_rectangle_area([]) == 0\", ... | {
"split": "train",
"index": 2285,
"acecode_id": "bigcode_python_fns_46406",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to manage a library of books. Each book has a title, an author, and a genre. Your function should take a list of books represented as dictionaries, each containing 'title', 'author', and 'genre' as keys. The function should return a l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_books_by_author([], 'J.D. Salinger') == []\", \"assert find_books_by_author([{'title': 'The Catcher in the Rye', 'author': 'J.D. Salinger', 'genre': 'Fiction'}], 'J.D. Salinger') == ['The Catcher in the Rye']\", \"assert find_books_by_author([{'title': ... | {
"split": "train",
"index": 2286,
"acecode_id": "oss_19756",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that computes the maximum timestamp from a range defined by two timestamps. The function should accept two parameters: 'start_time' and 'end_time', both represented as strings in the format 'YYYY-MM-DD HH:MM:SS'. The function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_timestamp('2023-01-01 12:00:00', '2023-01-02 12:00:00') == '2023-01-02 12:00:00'\", \"assert max_timestamp('2023-01-02 12:00:00', '2023-01-01 12:00:00') == 'Invalid range'\", \"assert max_timestamp('2023-01-01 12:00:00', '2023-01-01 12:00:00') == '2023-0... | {
"split": "train",
"index": 2287,
"acecode_id": "bigcode_python_fns_14428",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a dataset consisting of three categories, where each category is represented as a list of integers, and a corresponding list of labels for these categories. Your function should return a dictionary where the keys are the lab... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_category_dict([[1, 2, 4, None, 16, 32], [2, 3, None, 6, 11, 23], [None, 2, 3, 5, 7, 9]], ['Victory', 'Defeat', 'Neutral']) == {'Victory': [1, 2, 4, 0, 16, 32], 'Defeat': [2, 3, 0, 6, 11, 23], 'Neutral': [0, 2, 3, 5, 7, 9]}\", \"assert create_category_... | {
"split": "train",
"index": 2288,
"acecode_id": "evol_1330",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to generate a unique identifier for a new entry in a log system. Your task is to create a function that generates a new unique identifier following a specific format and ensures its uniqueness within the existing entries. The unique i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_unique_id(set()) != generate_unique_id(set())\", \"assert generate_unique_id({'550e8400-e29b-41d4-a716-446655440000'}) != '550e8400-e29b-41d4-a716-446655440000'\", \"assert generate_unique_id({'550e8400-e29b-41d4-a716-446655440000'}) not in {'550e84... | {
"split": "train",
"index": 2289,
"acecode_id": "oss_12989",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing various parameters for a machine learning model. Your task is to transform the 'dense' and 'conv' parameters in the following way: If 'dense' is present, convert its value to a list if it is not already one. If 'conv' is present, reshape ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_parameters({'dense': 5}) == {'dense': [5]}\", \"assert transform_parameters({'dense': [10, 20]}) == {'dense': [10, 20]}\", \"assert transform_parameters({'conv': [1, 2, 3, 4, 5, 6]}) == {'conv': [[1, 2, 3], [4, 5, 6]]}\", \"assert transform_paramet... | {
"split": "train",
"index": 2290,
"acecode_id": "bigcode_python_fns_15024",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing information about geometric shapes and their dimensions. Each line of the string contains either a 'cube' followed by its dimensions in the format 'length width height' or a 'sphere' followed by its radius. The input string ends with a line con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_volumes('cube 2.5 3.0 4.0\\\\nsphere 5.0\\\\nend') == ['Cube volume: 30.00', 'Sphere volume: 523.60']\", \"assert calculate_volumes('cube 1.0 1.0 1.0\\\\nend') == ['Cube volume: 1.00']\", \"assert calculate_volumes('sphere 2.0\\\\nend') == ['Sphere... | {
"split": "train",
"index": 2291,
"acecode_id": "oss_21175",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file paths in a file system. Each file path is a string representing the location of a file. Your task is to implement a function `get_owner(file_paths: List[str]) -> List[str]` that returns a list of usernames representing the owners of these files. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_owner(['/file1.txt', '/file2.txt', '/file3.txt']) == ['alice', 'bob', 'charlie']\", \"assert get_owner(['/file4.txt', '/file5.txt']) == ['dave', 'Unknown']\", \"assert get_owner(['/unknown_file.txt']) == ['Unknown']\", \"assert get_owner(['/file1.txt']) ... | {
"split": "train",
"index": 2292,
"acecode_id": "bigcode_python_fns_5562",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an array of integers as input and returns the maximum integer value found in that array. The function should handle both positive and negative integers, as well as arrays with a single element. If the array is empty, the function should return No... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max([2, 4, 6, 9, 3, 7]) == 9\", \"assert find_max([-1, -2, -3, -4]) == -1\", \"assert find_max([0]) == 0\", \"assert find_max([]) == None\", \"assert find_max([5, 5, 5, 5]) == 5\", \"assert find_max([-5, -1, -3, -4]) == -1\", \"assert find_max([1, 2, 3,... | {
"split": "train",
"index": 2293,
"acecode_id": "evol_6629",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes three parameters: a prefix string, a list of strings, and a separator string. The function should return a single string containing each element of the list prefixed by the given prefix string and separated by the provided separator string.\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert craft_string('Item: ', ['apple', 'banana', 'cherry'], ', ') == 'Item: apple, Item: banana, Item: cherry'\", \"assert craft_string('Prefix: ', ['one', 'two'], ' | ') == 'Prefix: one | Prefix: two'\", \"assert craft_string('Result: ', ['x', 'y', 'z'], '-') == ... | {
"split": "train",
"index": 2294,
"acecode_id": "evol_27106",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `apply_pairs(fn: Callable[[List[int], List[int]], None], convert: Callable[[int], int], *args: Union[int, List[Tuple[int, int]]]) -> None` that applies a conversion function to pairs of integers and then calls a provided function with the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_pairs(lambda x, y: (x, y), lambda z: z * 2, 3, 4) == None\", \"assert apply_pairs(lambda x, y: (x, y), lambda z: z + 1, 5, 10) == None\", \"assert apply_pairs(lambda x, y: (x, y), lambda z: z - 3, 8, 2) == None\", \"assert apply_pairs(lambda x, y: (x, ... | {
"split": "train",
"index": 2295,
"acecode_id": "bigcode_python_fns_24388",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of migration operations and extracts the latest migration name for each app label. Each migration operation is represented as a tuple containing the app label and the migration name. The function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_latest_migrations([('auth', '0001_initial'), ('auth', '0002_permissions'), ('contenttypes', '0001_initial'), ('sessions', '0001_initial')]) == {'auth': '0002_permissions', 'contenttypes': '0001_initial', 'sessions': '0001_initial'}\", \"assert extrac... | {
"split": "train",
"index": 2296,
"acecode_id": "oss_6663",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple transaction management function for a banking application. The function should handle transactions represented as strings and keep track of the account balance. You need to implement a function `process_transaction(transaction: str) -> ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_transaction('deposit:100') == 100\", \"assert process_transaction('deposit:200') == 200\", \"assert process_transaction('deposit:150') == 150\", \"assert process_transaction('deposit:500') == 500\", \"assert process_transaction('deposit:1000') == 100... | {
"split": "train",
"index": 2297,
"acecode_id": "oss_36078",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that takes a string as input and returns a dictionary where keys are the unique characters of the string and their corresponding values are the total sum of their ASCII values. The function should be case sensitive and should handle strings of any le... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_dict('Hello') == {'H': 72, 'e': 101, 'l': 216, 'o': 111}\", \"assert generate_dict('aabcdd') == {'a': 194, 'b': 98, 'c': 99, 'd': 200}\", \"assert generate_dict('') == {}\", \"assert generate_dict('!@#') == {'!': 33, '@': 64, '#': 35}\", \"assert ge... | {
"split": "train",
"index": 2298,
"acecode_id": "evol_5830",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates an advanced version of Pascal's Triangle. This triangle should alternate between even and odd numbers, starting with the number 1 at the top. The function will take an integer input 'n', which indicates the number of rows in the triangle to g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_advanced_pascal_triangle(0) == []\", \"assert generate_advanced_pascal_triangle(-1) == []\", \"assert generate_advanced_pascal_triangle(1001) == []\", \"assert generate_advanced_pascal_triangle(1) == [[1]]\", \"assert generate_advanced_pascal_triang... | {
"split": "train",
"index": 2299,
"acecode_id": "evol_22155",
"num_tests": 6
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.