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": "Implement a function that takes a list of integers and returns a list containing only the unique integers in decreasing order. Additionally, return a separate list of all integers that appeared more than once in the original list, preserving their original order of appearance. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_and_duplicates([1, 2, 3, 1, 2, 4, 5, -1, 2, -1, -1]) == ([5, 4, 3, 2, 1, -1], [1, 2, -1])\", \"assert unique_and_duplicates([1, 1, 1, 1]) == ([1], [1])\", \"assert unique_and_duplicates([]) == ([], [])\", \"assert unique_and_duplicates([0, 0, 0, 0, 0]... | {
"split": "train",
"index": 79800,
"acecode_id": "evol_35620",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Write a function that sorts the list in ascending order using an optimized bubble sort algorithm. The function should modify the input list in place and return None. The input list may contain duplicate elements. Your function should handle an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert optimized_bubble_sort([5, 3, 8, 4, 2]) == None; assert [2, 3, 4, 5, 8] == [2, 3, 4, 5, 8]\", \"assert optimized_bubble_sort([]) == None; assert [] == []\", \"assert optimized_bubble_sort([1, 1, 1, 1]) == None; assert [1, 1, 1, 1] == [1, 1, 1, 1]\", \"assert ... | {
"split": "train",
"index": 79801,
"acecode_id": "bigcode_python_fns_29798",
"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: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n >= 2. Your function should efficiently compute the Fibonacci number using dynamic programmin... | 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": 79802,
"acecode_id": "evol_3377",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the execution of a function on a list of input values. Your function should take a list of input values and a function to be executed sequentially. The function should return a list of results corresponding to the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_sequentially(lambda x: x * 2, [1, 2, 3]) == [2, 4, 6]\", \"assert execute_sequentially(lambda x: x + 1, [0, -1, 5]) == [1, 0, 6]\", \"assert execute_sequentially(lambda x: x / 2, [4, 8, 10]) == [2.0, 4.0, 5.0]\", \"assert execute_sequentially(lambda ... | {
"split": "train",
"index": 79803,
"acecode_id": "oss_11741",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function `fibonacci(n: int) -> int` that returns the n-th Fibonacci number. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. Your function should be able to handle non-negative integer inputs (0 ... | 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": 79804,
"acecode_id": "bigcode_python_fns_10550",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the execution of a command in a continuous integration testing system. Your function should accept two parameters: a string `command` representing the command to be executed, and an optional string `python_version` represen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_ci_command('nox --session tests_pip') == 'nox --session tests_pip'\", \"assert generate_ci_command('nox --session tests_pip', '3.8') == 'nox --session tests_pip -p 3.8'\", \"assert generate_ci_command('pytest') == 'pytest'\", \"assert generate_ci_co... | {
"split": "train",
"index": 79805,
"acecode_id": "bigcode_python_fns_756",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a subdomain, a main domain, and a list of path segments, implement a function to create a comprehensive HTTPS URL. The URL must include the provided subdomain, main domain, and all path segments in the correct order. Ensure to handle any special characters within the path... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_url('mypage', 'google', ['search', 'images'], {'q': 'python'}) == 'https://mypage.google/search/images?q=python'\", \"assert create_url('blog', 'example', ['2023', 'posts'], {'category': 'tech'}) == 'https://blog.example/2023/posts?category=tech'\", \... | {
"split": "train",
"index": 79806,
"acecode_id": "evol_23489",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple network port scanning mechanic. The function, named `port_scanner`, should take two parameters: a host (string) and a list of ports (list of integers). The function should return a dictionary containing the sca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert port_scanner('example.com', [80, 443, 8080]) == {'status': 'OK', 'details': ['Open', 'Open', 'Closed']}\", \"assert port_scanner('example.com', [21, 22, 23]) == {'status': 'NG', 'details': ['Error', 'Closed', 'Error']}\", \"assert port_scanner('example.com',... | {
"split": "train",
"index": 79807,
"acecode_id": "oss_31552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a network environment where you need to initialize the status of network interfaces for a given session. You have a list of network interface records, each containing the following fields: 'node1_id', 'node1_eth', and 'node2_eth'. Your goal is to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_network_interfaces(1, [{'node1_id': '1', 'node1_eth': 'eth0', 'node2_eth': ''}, {'node1_id': '2', 'node1_eth': 'eth1', 'node2_eth': 'eth2'}, {'node1_id': '3', 'node1_eth': 'eth2', 'node2_eth': ''}]) == ['ip link set eth0 down', 'ip link set eth2 d... | {
"split": "train",
"index": 79808,
"acecode_id": "bigcode_python_fns_32745",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates and converts IP addresses. The function should take an IP address in the form of a string and a subnet mask as inputs. It should return a dictionary containing the following information: whether the IP address is valid ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_ip('192.168.1.1', '255.255.255.0') == {'valid': True, 'binary': '11000000.10101000.00000001.00000001', 'network': '192.168.1.0', 'broadcast': '192.168.1.255'}\", \"assert process_ip('256.256.256.256', '255.255.255.0') == {'valid': False, 'binary': No... | {
"split": "train",
"index": 79809,
"acecode_id": "oss_8193",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing DNA sequence data from a file. Each DNA sequence follows a specific format: lines starting with '@' represent the name of the sequence, followed by the DNA sequence on the next line, and lines starting with '+' represent the quality ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_sequences(['@seq1', 'ATCG', '+', 'HHHH', '@seq2', 'GCTA', '+', 'IIII']) == [('seq1', 'ATCG', 'HHHH'), ('seq2', 'GCTA', 'IIII')]\", \"assert process_sequences(['@seq3', 'TATA', '+', 'BBBB', '@seq4', 'CGCG', '+', 'AAAA']) == [('seq3', 'TATA', 'BBBB'), ... | {
"split": "train",
"index": 79810,
"acecode_id": "oss_20223",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of floating-point numbers, implement a function `apply_relu` that applies the ReLU (Rectified Linear Unit) activation function to each element in the list. The ReLU function is defined as: if the input is greater than zero, the output is the input; otherwise, the o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_relu([-1.0, 0.0, 1.0, 2.5]) == [0.0, 0.0, 1.0, 2.5]\", \"assert apply_relu([3.5, -2.1, 0.0, 4.7]) == [3.5, 0.0, 0.0, 4.7]\", \"assert apply_relu([-5.3, -1.0, -0.5]) == [0.0, 0.0, 0.0]\", \"assert apply_relu([1.2, 2.3, 3.4]) == [1.2, 2.3, 3.4]\", \"asse... | {
"split": "train",
"index": 79811,
"acecode_id": "bigcode_python_fns_19394",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the execution of tasks in a work database. The function should take a list of tasks, where each task is a tuple consisting of a task identifier (string) and a boolean indicating whether the task is completed. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_incomplete_tasks([('task1', True), ('task2', False), ('task3', False)]) == ['task2', 'task3']\", \"assert get_incomplete_tasks([('task1', False), ('task2', False), ('task3', False)]) == ['task1', 'task2', 'task3']\", \"assert get_incomplete_tasks([('task... | {
"split": "train",
"index": 79812,
"acecode_id": "bigcode_python_fns_38451",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a value or a list of values, implement a function that converts the input into a list of floats. If the input is a single value, it should be wrapped in a list. If the input is already a list, it should simply return as a list of floats. The function should handle both in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert float_list(3) == [3.0]\", \"assert float_list(3.5) == [3.5]\", \"assert float_list([1, 2, 3]) == [1.0, 2.0, 3.0]\", \"assert float_list([1.1, 2.2, 3.3]) == [1.1, 2.2, 3.3]\", \"assert float_list([1, 2.5, 3]) == [1.0, 2.5, 3.0]\", \"assert float_list([]) == [... | {
"split": "train",
"index": 79813,
"acecode_id": "bigcode_python_fns_33553",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a URL. Your task is to create a function that counts how many URLs in the list start with 'http://' and how many start with 'https://'. The function should return a dictionary with two keys: 'http' and 'https', mappi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_url_types(['http://example.com', 'https://secure.com', 'http://test.com']) == {'http': 2, 'https': 1}\", \"assert count_url_types(['http://example.com', 'http://example.com', 'https://secure.com']) == {'http': 2, 'https': 1}\", \"assert count_url_types... | {
"split": "train",
"index": 79814,
"acecode_id": "bigcode_python_fns_12138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that checks if an input array represents a min heap structure. If it does not, the function should reconstruct the array into a valid min heap. The function must handle duplicate values, negative numbers, zero, and floating point numbers within the array. It ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_heap([3, 5, 2, 6, 8]) == ([2, 5, 3, 6, 8], 2)\", \"assert min_heap([10, 15, 20, 17, 25]) == ([10, 15, 20, 17, 25], 10)\", \"assert min_heap([1, 1, 1, 1]) == ([1, 1, 1, 1], 1)\", \"assert min_heap([5, 4, 3, 2, 1]) == ([1, 2, 3, 5, 4], 1)\", \"assert min_h... | {
"split": "train",
"index": 79815,
"acecode_id": "evol_2587",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a Python generator function that outputs the prime numbers between n^2 and 2n^2 for a given number n. The generator should allow the user to specify an optional range (start and end) within n^2 and 2n^2 to limit the output of prime numbers. If the user does not provide a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list(prime_in_range(1)) == [2]\", \"assert list(prime_in_range(9, 80, 90)) == [83, 89]\", \"assert list(prime_in_range(12, 144, 150)) == [149]\", \"assert list(prime_in_range(17, 289, 300)) == [293]\", \"assert list(prime_in_range(19, 361, 370)) == [367]\", ... | {
"split": "train",
"index": 79816,
"acecode_id": "evol_14745",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of pairs, where each pair consists of a URL and its corresponding web path. Your task is to implement a function named `get_web_path` that takes a URL as input and returns the corresponding web path. If the URL does not have a corresponding web path, the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_web_path('https://example.com/home') == '/home'\", \"assert get_web_path('https://example.com/about') == '/about'\", \"assert get_web_path('https://example.com/contact') == '/contact'\", \"assert get_web_path('https://example.com/nonexistent') == ''\", \... | {
"split": "train",
"index": 79817,
"acecode_id": "oss_18089",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given an array of integers. Write a function that returns a tuple containing the maximum element and its index, as well as the second maximum element and its index in the array. If the array has less than two distinct elements, the second maximum should be returned as N... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_max_second_max_element_idx([3, 1, 2, 5, 4]) == ((5, 3), (4, 4))\", \"assert print_max_second_max_element_idx([1, 2]) == ((2, 1), (1, 0))\", \"assert print_max_second_max_element_idx([10]) == ((10, 0), None)\", \"assert print_max_second_max_element_idx(... | {
"split": "train",
"index": 79818,
"acecode_id": "evol_18644",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that accepts as input an unordered list of numbers from 0 to 10 which may contain duplicates and errors. The function should return a sorted list of unique values from 0 to 10, excluding any erroneous data. Include error handling in case of non-numeri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_unique_nums([5, 11, 2, 2, 'error', 8, 10, 0, 9]) == [0, 2, 5, 8, 9, 10]\", \"assert sort_unique_nums([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", \"assert sort_unique_nums(['1', '2', '3', 'error', 5, 10]) == [1, 2, 3, 5, ... | {
"split": "train",
"index": 79819,
"acecode_id": "evol_33367",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of agents represented as unique identifiers (DIDs) and a list of things, also represented as unique identifiers. Your task is to implement a function that returns a count of the agents and things available. The function should also return the first agent an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_agents_and_things(['did:igo:1', 'did:igo:2'], ['did:igo:3']) == (2, 1, 'did:igo:1', 'did:igo:3')\", \"assert count_agents_and_things(['did:igo:1'], []) == (1, 0, 'did:igo:1', None)\", \"assert count_agents_and_things([], ['did:igo:3', 'did:igo:4']) == ... | {
"split": "train",
"index": 79820,
"acecode_id": "bigcode_python_fns_28207",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the least common multiple (LCM) of three integers a, b, and c, and returns the result modulo an integer n. The function should efficiently handle large numbers. Please define the function as follows: def lcm_three_numbers(a: int, b: int, c: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm_three_numbers(2, 3, 5, 10) == 0\", \"assert lcm_three_numbers(4, 5, 6, 10) == 0\", \"assert lcm_three_numbers(1, 2, 3, 10) == 6\", \"assert lcm_three_numbers(2, 2, 2, 5) == 2\", \"assert lcm_three_numbers(9, 6, 3, 100) == 18\", \"assert lcm_three_numbers... | {
"split": "train",
"index": 79821,
"acecode_id": "evol_3026",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `priority_queue_operations(operations: List[Tuple[str, Union[int, None]]]) -> List[Optional[int]]` that simulates a simple version of a priority queue. The function should take a list of operations where each operation is a tuple. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert priority_queue_operations([('pop', None), ('peek', None)]) == [None, None]\", \"assert priority_queue_operations([('insert', 8), ('insert', 2), ('pop', None), ('pop', None), ('pop', None)]) == [8, 2, None]\", \"assert priority_queue_operations([('insert', 15... | {
"split": "train",
"index": 79822,
"acecode_id": "oss_11519",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the initialization of a collision frequency mode for a plasma physics simulation. The function should accept a single argument, `collfreq_mode`, which is a string representing the collision frequency mode to be configured. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_dream_settings('mode1') == {'collisions': {'collfreq_mode': 'mode1'}}\", \"assert initialize_dream_settings('mode2') == {'collisions': {'collfreq_mode': 'mode2'}}\", \"assert initialize_dream_settings('default') == {'collisions': {'collfreq_mode':... | {
"split": "train",
"index": 79823,
"acecode_id": "oss_10880",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a command-line tool to manage different types of model creation for a machine learning project. You should implement a function that takes in a command and its parameters, and returns a string that describes the action to be performed based on the c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_model_command('create-simple-model', 'MySimpleModel', 'A simple model for testing') == 'Creating a simple model with name: MySimpleModel and description: A simple model for testing'\", \"assert create_model_command('create-simple-model', 'TestModel', ... | {
"split": "train",
"index": 79824,
"acecode_id": "oss_17696",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of tuples, where each tuple contains a code (an integer) and an action (a string). Your function should return a formatted string representing a conditional statement. The formatted string should follow the pattern: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_conditional_statement([(1, 'perform'), (2, 'skip'), (3, 'retry')]) == 'Cond: (1): perform; (2): skip; (3): retry'\", \"assert format_conditional_statement([(5, 'jump'), (10, 'wait')]) == 'Cond: (5): jump; (10): wait'\", \"assert format_conditional_sta... | {
"split": "train",
"index": 79825,
"acecode_id": "oss_31471",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a class called 'Person' that represents a person with a name and age. Implement a method called 'display' that returns a string containing the person's name and age in the format 'Name: {name}, Age: {age}'. Additionally, implement a method called 'greet' that returns a g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Person('Alice', 28).display() == 'Name: Alice, Age: 28'\", \"assert Person('Bob', 22).display() == 'Name: Bob, Age: 22'\", \"assert Person('Charlie', 35).greet() == 'Hello, my name is Charlie and I am 35 years old.'\", \"assert Person('Diana', 40).greet() ==... | {
"split": "train",
"index": 79826,
"acecode_id": "evol_5489",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the management of Ethereum 2.0 beacon chain data. This function should create an empty data object, set the block hash and block number, and then retrieve these values. Write a function called `manage_eth1_data` that ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_eth1_data() == ('0x1234567890', 1000)\", \"assert manage_eth1_data() == ('0x1234567890', 1000)\", \"assert manage_eth1_data() == ('0x1234567890', 1000)\", \"assert manage_eth1_data() == ('0x1234567890', 1000)\", \"assert manage_eth1_data() == ('0x1234... | {
"split": "train",
"index": 79827,
"acecode_id": "oss_17436",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two 2D arrays `data_1` and `data_2`, each containing numerical values. Your task is to write a Python function `calculate_column_averages` that calculates the average value of each column across both arrays and returns the result as a list of averages. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_column_averages([[1]], [[2]]) == [1.5]\", \"assert calculate_column_averages([[1, 1], [1, 1]], [[1, 1], [1, 1]]) == [1.0, 1.0]\", \"assert calculate_column_averages([[1, 2]], [[3, 4], [5, 6]]) == [3.0, 4.0]\", \"assert calculate_column_averages([[1... | {
"split": "train",
"index": 79828,
"acecode_id": "oss_17995",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names and a specific file extension. Your task is to write a function that filters the list and returns a new list containing only the file names that match the given file extension. The function should not perform any file system operations and sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_files_by_extension([\\\"file1.txt\\\", \\\"file2.jpg\\\", \\\"file3.txt\\\"], \\\".txt\\\") == [\\\"file1.txt\\\", \\\"file3.txt\\\"]\", \"assert filter_files_by_extension([\\\"script.py\\\", \\\"data.csv\\\", \\\"script_backup.py\\\"], \\\".py\\\") =... | {
"split": "train",
"index": 79829,
"acecode_id": "oss_1254",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing an IP address, write a function `parse_ip(ip_address)` that validates and parses the IP address into its components. The function should support both IPv4 and IPv6 formats. IPv4 addresses are in the format A.B.C.D where each of A, B, C, D are integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_ip('10.23.6.17') == [10, 23, 6, 17]\", \"assert parse_ip('192.168.1.1') == [192, 168, 1, 1]\", \"assert parse_ip('255.255.255.255') == [255, 255, 255, 255]\", \"assert parse_ip('0.0.0.0') == [0, 0, 0, 0]\", \"assert parse_ip('172.16.254.1') == [172, 16... | {
"split": "train",
"index": 79830,
"acecode_id": "evol_4742",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries representing COVID-19 confirmed cases data, where each dictionary contains the 'Date', 'Country', and 'Cases' for that country on that date, implement a function `top_countries(data: List[Dict[str, Union[str, int]]], date: str, n: int = 5) -> List[s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert top_countries([{'Date': '1/22/20', 'Country': 'China', 'Cases': 100}], '1/22/20') == ['China']\", \"assert top_countries([{'Date': '1/22/20', 'Country': 'China', 'Cases': 100}, {'Date': '1/22/20', 'Country': 'Italy', 'Cases': 50}], '1/22/20') == ['China', 'I... | {
"split": "train",
"index": 79831,
"acecode_id": "evol_34107",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_unique_sequence()` that constructs a unique sequence consisting of exactly eight characters. The sequence should include a mix of both uppercase and lowercase Latin letters and Arabic numerals. The function should return a string that meets these ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_unique_sequence()) == 8\", \"assert all(c.isalnum() for c in generate_unique_sequence())\", \"assert any(c.islower() for c in generate_unique_sequence())\", \"assert any(c.isupper() for c in generate_unique_sequence())\", \"assert any(c.isdigit(... | {
"split": "train",
"index": 79832,
"acecode_id": "evol_17615",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a tree structure represented by a list of tuples where each tuple contains a parent node and its child node, and a set of allowed node IDs, write a function `get_filtered_descendants(region_id: int, allowed_ids: Set[int], tree: List[Tuple[int, int]]) -> Set[int]` to find ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_filtered_descendants(1, {3, 4, 5}, [(1, 2), (1, 3), (2, 4), (2, 5), (3, 6)]) == {3, 4, 5, 6}\", \"assert get_filtered_descendants(3, {7, 8}, [(1, 2), (1, 3), (3, 7), (3, 8)]) == {7, 8}\", \"assert get_filtered_descendants(3, {9}, [(1, 2), (1, 3), (3, 9)]... | {
"split": "train",
"index": 79833,
"acecode_id": "bigcode_python_fns_46436",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of values, implement a function `find_unique(values: List[Union[int, float, str]]) -> List[Union[int, float, str]]` that returns a sorted list of unique values from the input list. The input list can contain integers, floats, and strings. Duplicate values and any N... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_unique([1, 2, 3, 2, 1]) == [1, 2, 3]\", \"assert find_unique([1.0, 2.0, 2.0, 3.0]) == [1.0, 2.0, 3.0]\", \"assert find_unique(['apple', 'banana', 'apple', 'orange']) == ['apple', 'banana', 'orange']\", \"assert find_unique([1, 1, 1, 1]) == [1]\", \"asse... | {
"split": "train",
"index": 79834,
"acecode_id": "bigcode_python_fns_43426",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and computes the factorial of all the prime numbers in the list. The function should ignore any non-integer values and return a new list containing the factorials of the prime numbers. If there are no prime numbers in the input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_factorial([2, 3, '4', 5, 6, 7, 8, 9, 10]) == [2, 6, 120, 5040]\", \"assert prime_factorial([1, 4, 6, 'hello', 10]) == []\", \"assert prime_factorial([]) == []\", \"assert prime_factorial([11, 13, 17]) == [39916800, 6227020800, 355687428096000]\", \"ass... | {
"split": "train",
"index": 79835,
"acecode_id": "evol_939",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the weights of several boxes, write a function `max_weight(boxes: List[int]) -> int` that returns the maximum weight that can be carried by a person without exceeding a weight limit of 200 units. The person can only carry boxes that are adj... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_weight([200, 150, 100]) == 200\", \"assert max_weight([80, 90, 50, 30]) == 170\", \"assert max_weight([10, 20, 30, 40, 50]) == 150\", \"assert max_weight([10, 190, 10]) == 200\", \"assert max_weight([200]) == 200\", \"assert max_weight([180, 30]) == 180\... | {
"split": "train",
"index": 79836,
"acecode_id": "bigcode_python_fns_15496",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the lengths of the sides of triangles, write a function `collapse_triangles(sides: List[int]) -> List[Tuple[int, int, int]]` that identifies all unique triangles that can be formed using three sides from the list. A triangle can be formed i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert collapse_triangles([1, 2, 3]) == []\", \"assert collapse_triangles([5, 10, 14, 7]) == [(5, 7, 10), (5, 10, 14), (7, 10, 14)]\", \"assert collapse_triangles([1, 1, 1]) == [(1, 1, 1)]\", \"assert collapse_triangles([1, 2, 4, 5, 6]) == [(2, 4, 5), (2, 5, 6), (4... | {
"split": "train",
"index": 79837,
"acecode_id": "bigcode_python_fns_21635",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates another function to determine whether two items are similar based on a given similarity or distance function and an optional radius. If a similarity function is provided, the generated function should return True if the sim... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_similarity_function(lambda x, y: x + y, None, 10)(5, 5) == True\", \"assert create_similarity_function(None, lambda x, y: abs(x - y), 5)(10, 15) == True\", \"assert create_similarity_function(lambda x, y: x * y, None, 20)(4, 5) == True\", \"assert cre... | {
"split": "train",
"index": 79838,
"acecode_id": "bigcode_python_fns_40641",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a user request is valid based on the presence of a 'uid' parameter in the request data. The function should take a single argument, `request`, which is a dictionary that simulates the POST data of the user request. If the '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_request({'POST': {'uid': '123'}}) == 'Request is valid'\", \"assert check_request({'POST': {'uid': ''}}) == 'Forbidden'\", \"assert check_request({'POST': {}}) == 'Forbidden'\", \"assert check_request({'POST': {'uid': 'abc'}}) == 'Request is valid'\", ... | {
"split": "train",
"index": 79839,
"acecode_id": "oss_4564",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of equal length, `affinity` and `scales`. The `affinity` list contains strings where each string represents a space-separated set of numbers and a label at the start. The `scales` list contains strings where each string consists of space-separated number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scale_affinity(['X 1 1 1'], ['2 3'], 1) == ['X\\t2.0\\t2.0\\t2.0']\", \"assert scale_affinity(['C 10 20 30', 'D 40 50 60'], ['0.1 0.2', '0.5 0.5'], 2) == ['C\\t2.0\\t4.0\\t6.0', 'D\\t20.0\\t25.0\\t30.0']\", \"assert scale_affinity(['P 5 10', 'Q 15 20'], ['2 ... | {
"split": "train",
"index": 79840,
"acecode_id": "bigcode_python_fns_12822",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Create a function named 'create_avatar' that takes a single parameter 'alias' (a string) and returns a dictionary representing an avatar with the key 'alias' and the value being the provided alias string.\nPlease reason step by step, then write a self-contained Python solution.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_avatar('Warrior') == {'alias': 'Warrior'}\", \"assert create_avatar('Mage') == {'alias': 'Mage'}\", \"assert create_avatar('Rogue') == {'alias': 'Rogue'}\", \"assert create_avatar('Healer') == {'alias': 'Healer'}\", \"assert create_avatar('Tank') == {... | {
"split": "train",
"index": 79841,
"acecode_id": "evol_30049",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `find_maximum_subarray_sum(arr: List[int]) -> int` that returns the maximum sum of any contiguous subarray within the list. A contiguous subarray is defined as a sequence of elements that are adjacent in the original array. If the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum_subarray_sum([-2, -3, -1]) == -1\", \"assert find_maximum_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert find_maximum_subarray_sum([1, 2, 3, 4, 5]) == 15\", \"assert find_maximum_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert find_maximum_su... | {
"split": "train",
"index": 79842,
"acecode_id": "bigcode_python_fns_24891",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_upper(s: str) -> int` that computes the frequency of capitalized vowel characters ('A', 'E', 'I', 'O', 'U') found exclusively at even indices of the given string `s`. The function should return the count of such characters. For example, `count_upper(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_upper('aBCdEf') == 1\", \"assert count_upper('abcdefg') == 0\", \"assert count_upper('dBBE') == 0\", \"assert count_upper('A') == 1\", \"assert count_upper('AEIOU') == 3\", \"assert count_upper('bCDeF') == 0\", \"assert count_upper('AEIOUx') == 3\", \"... | {
"split": "train",
"index": 79843,
"acecode_id": "evol_4546",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Create a Python function that generates a random complex number within the range of 1+1j to 2+2j. The function should return a complex number where the real part is between 1 and 2 (inclusive) and the imaginary part is also between 1 and 2 (inclusive).\nPlease reason step by st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert 1 <= random_complex().real <= 2 and 1 <= random_complex().imag <= 2\", \"assert 1 <= random_complex().real <= 2 and 1 <= random_complex().imag <= 2\", \"assert 1 <= random_complex().real <= 2 and 1 <= random_complex().imag <= 2\", \"assert 1 <= random_comple... | {
"split": "train",
"index": 79844,
"acecode_id": "evol_9339",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of DNA sequences represented as strings, where each string consists of characters 'A', 'C', 'G', and 'T'. Your task is to format these sequences into a dictionary where each key is a unique character from the sequences, and the value is a list of all sequen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_dna_sequences(['A', 'T', 'C', 'G']) == {'A': ['A'], 'T': ['T'], 'C': ['C'], 'G': ['G']}\", \"assert format_dna_sequences(['A', 'A', 'A']) == {'A': ['A', 'A', 'A']}\", \"assert format_dna_sequences(['AC', 'TC', 'CG', 'TA']) == {'A': ['AC', 'TA'], 'C': ... | {
"split": "train",
"index": 79845,
"acecode_id": "bigcode_python_fns_6342",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given two integers x and y representing the real and imaginary parts of a complex number respectively, and an integer max_iteration representing the maximum number of iterations to check for membership in the Mandelbrot set, implement a function inMandelSet(x: int, y: int, max_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert inMandelSet(0, 0, 100) == 100\", \"assert inMandelSet(-0.5, 0.5, 50) == 50\", \"assert inMandelSet(0, 1, 10) == 10\", \"assert inMandelSet(0, -1, 10) == 10\", \"assert inMandelSet(0.3, 0.5, 20) == 20\", \"assert inMandelSet(-0.3, -0.5, 20) == 20\", \"assert ... | {
"split": "train",
"index": 79846,
"acecode_id": "bigcode_python_fns_1359",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that merges two sorted lists of distinct integers into one sorted list without using built-in functions. The merged list should not contain any duplicate integers, even if they appear in both input lists. Return the final merged list.\nPlease reason step by... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sorted_lists([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sorted_lists([], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_sorted_lists([5, 6, 7], [1, 2, 3]) == [1, 2, 3, 5, 6, 7]\", \"assert merge_sorted_lists([10, 20, 30], [15, 25, 35]) ==... | {
"split": "train",
"index": 79847,
"acecode_id": "evol_7956",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `help_doc` which contains multiple lines of documentation. Each line may contain multiple options separated by commas. Your task is to implement a function `group(help_doc: str) -> List[str]` that returns a list of unique options found in the documentatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group('option1, option2\\\\noption2, option3\\\\noption1') == ['option1', 'option2', 'option3']\", \"assert group('apple, banana\\\\nbanana, cherry\\\\napricot') == ['apple', 'apricot', 'banana', 'cherry']\", \"assert group('') == []\", \"assert group('singl... | {
"split": "train",
"index": 79848,
"acecode_id": "bigcode_python_fns_1386",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of user profiles, where each user profile is represented as a dictionary containing the user's id, name, and email. Write a function `get_user_profile(user_id: int, profiles: List[Dict[str, Union[int, str]]]) -> Dict[str, Union[int, str]]` that takes an int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_profile(1, [{'id': 1, 'name': 'Alice', 'email': 'alice@example.com'}, {'id': 2, 'name': 'Bob', 'email': 'bob@example.com'}]) == {'id': 1, 'name': 'Alice', 'email': 'alice@example.com'}\", \"assert get_user_profile(2, [{'id': 1, 'name': 'Alice', 'ema... | {
"split": "train",
"index": 79849,
"acecode_id": "bigcode_python_fns_42509",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of `SquadFeatures` objects and returns a new list containing the input IDs of each feature. Each `SquadFeatures` object has an attribute `input_ids` which represents the input IDs for a specific span. Implement t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_input_ids([SquadFeatures(input_ids=[1, 2, 3]), SquadFeatures(input_ids=[4, 5, 6])]) == [[1, 2, 3], [4, 5, 6]]\", \"assert extract_input_ids([SquadFeatures(input_ids=[7]), SquadFeatures(input_ids=[8, 9, 10]), SquadFeatures(input_ids=[])]) == [[7], [8,... | {
"split": "train",
"index": 79850,
"acecode_id": "oss_25282",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that takes two integers, a and b, and returns their sum. Your task is to implement a function called `add` that performs this addition. Additionally, you need to ensure that the function handles both positive and negative integers correctly. Write the `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add(2, 3) == 5\", \"assert add(-1, 1) == 0\", \"assert add(0, 0) == 0\", \"assert add(-5, -5) == -10\", \"assert add(10, -10) == 0\", \"assert add(100, 200) == 300\", \"assert add(-50, 50) == 0\", \"assert add(0, 5) == 5\", \"assert add(5, 0) == 5\", \"asser... | {
"split": "train",
"index": 79851,
"acecode_id": "oss_5609",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that modifies a dictionary representing HTTP response headers to prevent caching. The function should take a dictionary as input and update it to include the following cache control headers: 'Cache-Control' set to 'no-cache, no-store, mus... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert disable_cache({}) == {'Cache-Control': 'no-cache, no-store, must-revalidate, public, max-age=0', 'Expires': 0, 'Pragma': 'no-cache'}\", \"assert disable_cache({'Content-Type': 'application/json'}) == {'Content-Type': 'application/json', 'Cache-Control': 'no-... | {
"split": "train",
"index": 79852,
"acecode_id": "bigcode_python_fns_18300",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of decimal numbers, write a function `max_length_decimal(lst: List[float]) -> List[float]` that returns a new list containing only the decimal numbers from the input list that have a maximum length of 5 characters when represented as strings (including the decimal ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_length_decimal([1.23, 4.567, -12.3, 12345.678]) == [1.23, 4.567, -12.3]\", \"assert max_length_decimal([12.34567, 123.4, 0.1, -0.12]) == [123.4, 0.1, -0.12]\", \"assert max_length_decimal([0.123456, -1.23, 123.0]) == [-1.23, 123.0]\", \"assert max_length... | {
"split": "train",
"index": 79853,
"acecode_id": "bigcode_python_fns_5968",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a header for user policies based on a given encoding option. Implement a function `generate_user_policies_header(encode: str) -> str` that takes a single parameter `encode`. If `encode` is 'on', the function should return a string formatted with t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_user_policies_header('on') == 'QWNjb3VudA==,VXNlck5hbWU=,UG9saWN5TmFtZQ==,UG9saWN5'\", \"assert generate_user_policies_header('off') == 'Account,UserName,PolicyName,Policy'\", \"assert generate_user_policies_header('') == 'Account,UserName,PolicyNam... | {
"split": "train",
"index": 79854,
"acecode_id": "bigcode_python_fns_17607",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_random_string()` that generates an 8-character randomized alphanumeric string incorporating both uppercase and lowercase letters, digits, and special characters. The string must contain at least one digit, one uppercase letter, one lowercase letter, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_string() != generate_random_string()\", \"assert len(generate_random_string()) == 8\", \"assert any(c.isdigit() for c in generate_random_string())\", \"assert any(c.isupper() for c in generate_random_string())\", \"assert any(c.islower() for ... | {
"split": "train",
"index": 79855,
"acecode_id": "evol_13353",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `configure_project` that takes a dictionary `config` as input. The `config` dictionary may contain the keys 'project_config' and 'tf_state_bucket'. If these keys are not present, you need to set 'project_config' to a default value of 'def... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_project({'project_config': 'my_project', 'tf_state_bucket': 'my_tf_state'}) == ({'project_config': 'my_project', 'tf_state_bucket': 'my_tf_state'}, ['Creating S3 project bucket: my_project', 'Creating S3 project bucket: my_tf_state'])\", \"assert c... | {
"split": "train",
"index": 79856,
"acecode_id": "bigcode_python_fns_10525",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given an `m x n` binary `grid`, where each `1` represents a brick and `0` represents an empty space. A brick is stable if it is directly connected to the top of the grid or at least one other brick in its eight adjacent cells is stable. You are also given an array `hits... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve([[0,0],[0,0]], [[0,0]]) == [0]\", \"assert solve([[1,1,1],[1,1,1],[1,1,1]], [[1,1],[0,0]]) == [0,0]\", \"assert solve([[1,0,1],[0,1,0],[1,0,1]], [[0,0],[1,1]]) == [0,0]\", \"assert solve([[1,0],[0,1]], [[0,1]]) == [0]\", \"assert solve([[0,0,0],[0,0,0]... | {
"split": "train",
"index": 79857,
"acecode_id": "evol_35134",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `bubble_sort(arr: List[int]) -> List[int]` that takes a list of integers as input and returns a new list containing the same integers sorted in ascending order using the Bubble Sort algorithm. The function should be able to handle any array size and should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([5, 3, 8, 1, 2]) == [1, 2, 3, 5, 8]\", \"assert bubble_sort([1]) == [1]\", \"assert bubble_sort([]) == []\", \"assert bubble_sort([2, 1]) == [1, 2]\", \"assert bubble_sort([4, 2, 3, 1]) == [1, 2, 3, 4]\", \"assert bubble_sort([10, 9, 8, 7, 6]) ==... | {
"split": "train",
"index": 79858,
"acecode_id": "evol_1734",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `mysqrt(x: int, steps: int = 10) -> float` that calculates the square root of a non-negative integer `x` using Newton's method. The function should take an integer `x` (0 <= x <= 10^6) and an optional integer `steps` (1 <= steps <= 10) which defines how man... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mysqrt(0, 5) == 0.0\", \"assert mysqrt(1, 5) == 1.0\", \"assert mysqrt(4, 5) == 2.0\", \"assert mysqrt(9, 5) == 3.0\", \"assert mysqrt(16, 5) == 4.0\", \"assert mysqrt(25, 5) == 5.0\", \"assert mysqrt(36, 5) == 6.0\", \"assert mysqrt(49, 5) == 7.0\", \"asser... | {
"split": "train",
"index": 79859,
"acecode_id": "bigcode_python_fns_3664",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of version strings representing different software modules. Each version string follows the semantic versioning format 'MAJOR.MINOR.PATCH', where MAJOR, MINOR, and PATCH are non-negative integers. Write a function `max_version(versions: List[str]) -> str` t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_version(['1.0.0', '2.0.0', '1.2.3']) == '2.0.0'\", \"assert max_version(['0.9.0', '0.8.1', '0.10.0']) == '0.10.0'\", \"assert max_version(['1.1.0', '1.1.0', '1.1.0']) == '1.1.0'\", \"assert max_version(['2.0.1', '2.0.0', '2.0.2']) == '2.0.2'\", \"assert ... | {
"split": "train",
"index": 79860,
"acecode_id": "bigcode_python_fns_31808",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given the coordinates in the OSBG36 system represented by easting and northing, as well as the parameters Eo (the delta easting of a local grid), No (the delta northing of a local grid), and one_over_CSF (the reciprocal of the combined scale factor), write a function that conve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_local_grid(0, 0, 0, 0, 1.0) == (0.0, 0.0)\", \"assert convert_to_local_grid(750, 1250, 500, 500, 1.0) == (250.0, 750.0)\", \"assert convert_to_local_grid(2000, 3000, 0, 0, 1.0) == (2000.0, 3000.0)\", \"assert convert_to_local_grid(0, 10000, 0, 0, ... | {
"split": "train",
"index": 79861,
"acecode_id": "bigcode_python_fns_14285",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `longest_strictly_ascending_common_subsequence(seq1, seq2)` that takes two sequences of whole numbers as input parameters. The function should identify and return the longest strictly ascending subsequence which appears identically in both provided sequence... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_strictly_ascending_common_subsequence([], [1, 2, 3]) == []\", \"assert longest_strictly_ascending_common_subsequence([1], [1]) == [1]\", \"assert longest_strictly_ascending_common_subsequence([1, 2, 3], [1, 2, 3]) == [1, 2, 3]\", \"assert longest_str... | {
"split": "train",
"index": 79862,
"acecode_id": "evol_31308",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given an unsorted array of integers, write a function that finds the smallest subarray that, if sorted, would make the entire array sorted. Return the subarray, its length, and the starting and ending indices of the subarray within the original array. If the array is already so... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unsorted_array([1, 2, 3, 4, 5]) == ([], 0, (-1, -1))\", \"assert unsorted_array([5, 4, 3, 2, 1]) == ([5, 4, 3, 2, 1], 5, (0, 4))\", \"assert unsorted_array([1, 2, 5, 4, 3, 6]) == ([5, 4, 3], 3, (2, 4))\", \"assert unsorted_array([1, 2, 3, 7, 5, 6]) == ([7, 5... | {
"split": "train",
"index": 79863,
"acecode_id": "bigcode_python_fns_7978",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that processes a list of news headlines to identify and count the occurrences of specific keywords. You are given a list of headlines and a list of keywords. Your program should output the count of each keyword found in each headline. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_keywords(['New study shows benefits of exercise'], ['new', 'benefits', 'climate', 'discover']) == ['Headline: New study shows benefits of exercise', 'new: 1', 'benefits: 1', 'climate: 0', 'discover: 0']\", \"assert count_keywords(['Tech company launche... | {
"split": "train",
"index": 79864,
"acecode_id": "oss_33706",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sample(p_list: List[float], t: float = 1.0) -> int` that simulates a simple sampling mechanism based on a probability distribution. The function takes a list of probabilities `p_list` where each element is a non-negative float representing the probability ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sample([0.1, 0.2, 0.7], 0) == 2\", \"assert sample([0.5, 0.5], 0) == 0\", \"assert sample([0.0, 1.0, 0.0], 0) == 1\", \"assert sample([0.1, 0.3, 0.6], 1.0) in [0, 1, 2]\", \"assert sample([0.0], 0) == 0\", \"assert sample([0.4, 0.4, 0.2], 0) == 0 or sample([... | {
"split": "train",
"index": 79865,
"acecode_id": "oss_8213",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the creation of specific folders in a given directory. The function should take a list of folder names and return the number of folders that were successfully created. If a folder already exists, it should not be create... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_folders(['doc', 'image', 'output', 'font']) == 4\", \"assert create_folders(['doc', 'image', 'output']) == 3\", \"assert create_folders(['doc', 'doc', 'image']) == 2\", \"assert create_folders(['output', 'output', 'font']) == 2\", \"assert create_fold... | {
"split": "train",
"index": 79866,
"acecode_id": "bigcode_python_fns_19388",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the training process of a simplified neural network model. The function should receive a list of gradients and an optional clipping threshold. If the clipping threshold is provided, all gradients should be clipped to be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clip_gradients([0.1, 0.5, 0.3], 0.4) == [0.1, 0.4, 0.3]\", \"assert clip_gradients([-0.5, 0.5, 0.7], 0.6) == [-0.5, 0.5, 0.6]\", \"assert clip_gradients([1.2, -1.5, 0.0], 1.0) == [1.0, -1.0, 0.0]\", \"assert clip_gradients([10.0, -10.0, 5.0], 5.0) == [5.0, -... | {
"split": "train",
"index": 79867,
"acecode_id": "oss_34342",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of employee schedules, where each schedule is a list of non-overlapping, sorted intervals represented as pairs of integers [start, end], implement a function that returns a list of finite intervals representing the common free time shared by all employees and calcu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert employeeFreeTime([[(1,2),(5,6)],[(1,3)],[(4,10)]]) == ([(3, 4)], 1)\", \"assert employeeFreeTime([[(1,3),(6,7)],[(2,4)],[(2,5),(9,12)]]) == ([(5, 6), (7, 9)], 3)\", \"assert employeeFreeTime([[(0,1),(2,3)],[(1,2),(4,5)]]) == ([(3, 4)], 1)\", \"assert employe... | {
"split": "train",
"index": 79868,
"acecode_id": "evol_4297",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that finds and returns the first contiguous subarray of at least two elements that sums up to a given target sum. If no such subarray exists, return an empty list. The input list can contain both positive and negative integers, and the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_contiguous_subarray(5, [1, 2, 3, 4, 5]) == [2, 3]\", \"assert find_contiguous_subarray(0, [0, 0, 0, 0]) == [0, 0]\", \"assert find_contiguous_subarray(6, [1, 2, 3, 4, 5]) == [1, 2, 3]\", \"assert find_contiguous_subarray(10, [5, 5, 5]) == [5, 5]\", \"as... | {
"split": "train",
"index": 79869,
"acecode_id": "bigcode_python_fns_29351",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the fields to be displayed for a specific resource identified by its primary key (pk). The function should take an integer pk as input and return a list of fields based on certain conditions. If the pk is even, the fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_displayed_fields(1) == ['field1', 'field4', 'field5']\", \"assert get_displayed_fields(2) == ['field1', 'field2', 'field3']\", \"assert get_displayed_fields(3) == ['field1', 'field4', 'field5']\", \"assert get_displayed_fields(4) == ['field1', 'field2', ... | {
"split": "train",
"index": 79870,
"acecode_id": "oss_37667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a customized figure for visualizing spectrograms. The function should accept a variable number of arguments and keyword arguments to customize the figure. The function will return a dictionary representing the figure's prop... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_spectro_figure() == {'FigureClass': 'SpectroFigure'}\", \"assert create_spectro_figure(1, 2, 3) == {'FigureClass': 'SpectroFigure', 0: 1, 1: 2, 2: 3}\", \"assert create_spectro_figure(title='My Figure') == {'FigureClass': 'SpectroFigure', 'title': 'My... | {
"split": "train",
"index": 79871,
"acecode_id": "bigcode_python_fns_9387",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that saves a configuration dictionary to a file in YAML format. The function should take two parameters: a dictionary 'config' that contains the configuration data, and a string 'filename' that specifies the name of the file to which the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_config_to_file({'key1': 'value1', 'key2': 'value2'}, 'test1.yml') == 'File saved successfully'\", \"assert save_config_to_file({'keyA': 'valueA', 'keyB': 'valueB', 'keyC': 'valueC'}, 'test2.yml') == 'File saved successfully'\", \"assert save_config_to_f... | {
"split": "train",
"index": 79872,
"acecode_id": "bigcode_python_fns_23415",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two transformations represented by their rotation angle in degrees and scale factor. The first transformation has a rotation angle of `theta1` degrees and a scale factor of `scale1`. The second transformation has a rotation angle of `theta2` degrees and a scale fa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compose_transformations(90, 4, -45, 0.5) == (45.0, 2.0)\", \"assert compose_transformations(0, 1, 0, 1) == (0.0, 1.0)\", \"assert compose_transformations(30, 2, 60, 3) == (90.0, 6.0)\", \"assert compose_transformations(-90, 5, 90, 2) == (0.0, 10.0)\", \"asse... | {
"split": "train",
"index": 79873,
"acecode_id": "bigcode_python_fns_6266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `convert_hex(hex_val: str) -> Tuple[str, int]` that takes a hexadecimal string `hex_val` (e.g., '0xFA') and converts it into its binary and decimal representations. The function should return a tuple containing the binary representation as a string (without... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_hex('0xFA') == ('11111010', 250)\", \"assert convert_hex('0x0') == ('0', 0)\", \"assert convert_hex('0x1') == ('1', 1)\", \"assert convert_hex('0x2A') == ('101010', 42)\", \"assert convert_hex('0x7F') == ('1111111', 127)\", \"assert convert_hex('0xBE... | {
"split": "train",
"index": 79874,
"acecode_id": "evol_13768",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that sorts a given list of integers, floats, or strings in ascending order. Write a function named `sortList` that takes a single parameter, `arr`, which is a list containing elements of any of the three types (integers, floats, or st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sortList([4, 1, 10, 8, 5]) == [1, 4, 5, 8, 10]\", \"assert sortList([4.5, 1.2, 10.0, 8.3, 5.1]) == [1.2, 4.5, 5.1, 8.3, 10.0]\", \"assert sortList(['banana', 'apple', 'cherry', 'date']) == ['apple', 'banana', 'cherry', 'date']\", \"assert sortList([1.1, 3.3,... | {
"split": "train",
"index": 79875,
"acecode_id": "evol_25897",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the coordinates of points along a straight line between two given points on a 2D plane. The coordinates of the two points are given as integers (x1, y1) and (x2, y2). Your function should return a list of tuples repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert line(1, 1, 8, 5) == [(1, 1), (2, 2), (3, 2), (4, 3), (5, 3), (6, 4), (7, 4), (8, 5)]\", \"assert line(0, 0, 0, 5) == [(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0, 5)]\", \"assert line(1, 1, 1, -5) == [(1, 1), (1, 0), (1, -1), (1, -2), (1, -3), (1, -4), (1, -5... | {
"split": "train",
"index": 79876,
"acecode_id": "oss_481",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a database operation sequence, where each character in the string represents an operation: 'C' for create, 'R' for read, 'U' for update, and 'D' for delete. Your task is to count the number of valid 'create' operations that do not have a corr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_valid_creates('C') == 1\", \"assert count_valid_creates('CRU') == 1\", \"assert count_valid_creates('CCUU') == 2\", \"assert count_valid_creates('CCRD') == 1\", \"assert count_valid_creates('CD') == 0\", \"assert count_valid_creates('R') == 0\", \"asse... | {
"split": "train",
"index": 79877,
"acecode_id": "bigcode_python_fns_18260",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `linked_list_operations(operations: List[Tuple[str, int]]) -> str` that simulates operations on a singly linked list. The function takes a list of operations, where each operation is a tuple consisting of a string and an integer. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert linked_list_operations([('add', 3), ('add', 7), ('add', 5), ('add', 2)]) == '2 -> 5 -> 7 -> 3'\", \"assert linked_list_operations([('add', 1), ('add', 2), ('remove', 2)]) == '1'\", \"assert linked_list_operations([('remove', 10)]) == 'empty'\", \"assert link... | {
"split": "train",
"index": 79878,
"acecode_id": "oss_27743",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a command-line argument parser for a logging and monitoring application. The function should take in a list of command-line arguments and return a dictionary containing the parsed arguments. The supported arguments are as f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments(['--log', 'INFO']) == {'loglevel': 'INFO', 'monitoring': False, 'npx': 1, 'npy': 1, 'npz': 1}\", \"assert parse_arguments(['--log', 'ERROR', '--monitoring']) == {'loglevel': 'ERROR', 'monitoring': True, 'npx': 1, 'npy': 1, 'npz': 1}\", \"asse... | {
"split": "train",
"index": 79879,
"acecode_id": "bigcode_python_fns_9650",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that simulates the execution of a task with a specific name and a list of arguments. The task can also receive additional parameters through a dictionary. Your goal is to implement a function `execute_task(task_name: str, args: List[Any], kwargs: Dict[s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_task('task1', [1, 2, 3], {'a': 4, 'b': 5}) == ('task1', 15)\", \"assert execute_task('task2', [], {'x': 10}) == ('task2', 10)\", \"assert execute_task('task3', [10, 20], {'y': 5}) == ('task3', 35)\", \"assert execute_task('task4', [1.5, 2.5], {'c': 3... | {
"split": "train",
"index": 79880,
"acecode_id": "bigcode_python_fns_3153",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates loading a model based on a given model name and a data loader. The function will take two parameters: `model_name` (a string representing the name of the model) and `dataloader` (a dictionary representing the data loade... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_model('ResNet', {'key': 'ImageLoader'}) == 'Model ResNet loaded with data loader ImageLoader'\", \"assert load_model('VGG', {'key': 'VideoLoader'}) == 'Model VGG loaded with data loader VideoLoader'\", \"assert load_model('Inception', {'key': 'DataLoade... | {
"split": "train",
"index": 79881,
"acecode_id": "bigcode_python_fns_42512",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representation of a grid specification, write a function `parse_gridspec` that takes a string `s` as input and returns a dictionary representing the grid specification. The input string can be in one of the following formats: \n1. A simple name (like 'africa_10')... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_gridspec('africa_10') == {'name': 'africa_10', 'size': (10, 10), 'resolution': (9600, 9600)}\", \"assert parse_gridspec('epsg:6936;-10x10;9600x9600') == {'crs': 'epsg:6936', 'size': (-10, 10), 'resolution': (9600, 9600)}\", \"assert parse_gridspec('eps... | {
"split": "train",
"index": 79882,
"acecode_id": "bigcode_python_fns_7",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes two strings as input: a 'key' and 'content'. The function should convert the 'content' into a specified output format represented by a third string 'output_format'. The function should return the converted content if successful,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_content('test1', 'example content', 'JSON') == 'Converted to JSON: example content'\", \"assert convert_content('test2', 'another example', 'XML') == 'Converted to XML: another example'\", \"assert convert_content('test3', 'sample data', 'CSV') == 'C... | {
"split": "train",
"index": 79883,
"acecode_id": "bigcode_python_fns_1003",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary tree, implement a function that returns the maximum depth of the tree. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.\nPlease reason step by step, then write a self-contained Python solution. Giv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_depth(Node(1)) == 1\", \"assert max_depth(Node(1, Node(2))) == 2\", \"assert max_depth(Node(1, None, Node(3))) == 2\", \"assert max_depth(Node(1, Node(2, Node(4)), Node(3))) == 3\", \"assert max_depth(Node(1, Node(2, Node(4, Node(5))), Node(3))) == 4\", ... | {
"split": "train",
"index": 79884,
"acecode_id": "evol_18266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of HTML strings, each representing a document that contains sections and subsections. Each section in the HTML contains a 'writing_section' and multiple 'reading_sections'. Your task is to extract these sections from the provided HTML documents. Implement a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sections(['<section><writing_section>Intro</writing_section><reading_sections><section>Chapter 1</section><section>Chapter 2</section></reading_sections></section>']) == [('Intro', ['Chapter 1', 'Chapter 2'])]\", \"assert get_sections(['<section><writing... | {
"split": "train",
"index": 79885,
"acecode_id": "bigcode_python_fns_15703",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates the input parameters for a hypothetical distance calculation method. The function should accept a dictionary of parameters and ensure that the input meets certain criteria. The criteria for valid parameters are as follo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_input_dtw({'pointA': (1, 2), 'pointB': (3, 4), 'method': 'euclidean'}) is None\", \"assert check_input_dtw({'pointA': (0, 0), 'pointB': (5, 5), 'method': 'manhattan'}) is None\", \"assert check_input_dtw({'pointA': (2, 3), 'pointB': (4, 1), 'method': '... | {
"split": "train",
"index": 79886,
"acecode_id": "bigcode_python_fns_34998",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a model representation of an energy system based on user-defined narratives. The function should take in a list of narratives and return a dictionary that describes an energy system model. The dictionary should include the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_energy_model(['narrative1', 'narrative2']) == {'name': 'energy', 'description': 'A system of systems model which encapsulates the future supply and demand of energy for the UK', 'scenarios': ['population'], 'narratives': ['narrative1', 'narrative2'], 'se... | {
"split": "train",
"index": 79887,
"acecode_id": "bigcode_python_fns_4",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `log_wrapper` that accepts a function `func` and a dictionary of logging parameters. The function should return a new function that logs the function call's arguments, return value, and any exceptions raised during its execution. The logging parameters incl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_wrapper(lambda x: 'Hello ' + x, {'log_level': 10, 'exc_level': 40, 'max_indent': 5, 'log_call_args': True, 'log_traceback': True, 'log_result_obj': True})('World') == 'Function executed'\", \"assert log_wrapper(lambda: 'Hello World', {'log_level': 10, 'e... | {
"split": "train",
"index": 79888,
"acecode_id": "bigcode_python_fns_43434",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, your task is to implement a function that finds the maximum product of any two distinct integers in the list. The function should return this maximum product. If the list contains fewer than two integers, return 0. Write a function `max_product(nums: L... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_product([1, 2, 3, 4]) == 12\", \"assert max_product([-1, -2, -3, -4]) == 12\", \"assert max_product([-1, 2, 3, 4]) == 12\", \"assert max_product([0, 0, 0]) == 0\", \"assert max_product([1]) == 0\", \"assert max_product([]) == 0\", \"assert max_product([5... | {
"split": "train",
"index": 79889,
"acecode_id": "bigcode_python_fns_49297",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of student records, each containing a name and a major, implement a function that categorizes students into relevant courses based on their field of study. The function should return a dictionary where the keys are the majors and the values are lists of names of st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_learners([{'name':'John', 'major':'Computer Science'}, {'name':'Alice', 'major':'Business Administration'}, {'name':'Bob', 'major':'Computer Science'}, {'name':'Claire', 'major':'Business Administration'}]) == {'Computer Science': ['John', 'Bob'],... | {
"split": "train",
"index": 79890,
"acecode_id": "evol_8298",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing the response from a file creation operation performed by a middleware. The dictionary contains the following keys: 'InodeNumber' (an integer representing the inode number of the newly created file), 'NumWrites' (an integer representing th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_file_creation_response({'InodeNumber': 12345, 'NumWrites': 10, 'CreationTime': 1622547800000000000}) == (1622547800000000000, 12345, 10)\", \"assert parse_file_creation_response({'InodeNumber': 67890, 'NumWrites': 5, 'CreationTime': 1622547800000000000... | {
"split": "train",
"index": 79891,
"acecode_id": "bigcode_python_fns_46237",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing file names that contain metadata information for different variables. Each file name has a specific format where the variable name is the part of the string before the first underscore ('_'). Your task is to write a function that tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_unique_variables(['temperature_001.txt', 'humidity_002.txt', 'temperature_003.txt']) == ['temperature', 'humidity']\", \"assert extract_unique_variables(['pressure_001.txt', 'pressure_002.txt', 'pressure_003.txt']) == ['pressure']\", \"assert extract... | {
"split": "train",
"index": 79892,
"acecode_id": "bigcode_python_fns_5153",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function in Python that generates the Fibonacci series up to the Nth term. The function should return a list containing the Fibonacci sequence starting from 0. If the input is not a positive integer, the function should return None. The function should be able to ha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1... | {
"split": "train",
"index": 79893,
"acecode_id": "evol_24476",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list as input and alternates the positions of consecutive elements. The function should handle edge cases such as invalid input types and lists that contain elements of unusual data types (for instance, strings, booleans, or objects). If the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert alternate([1, 2, 3, 4]) == [2, 1, 4, 3]\", \"assert alternate([]) == []\", \"assert alternate(['a', 'b', 'c', 'd']) == ['b', 'a', 'd', 'c']\", \"assert alternate([True, False, True]) == [False, True, True]\", \"assert alternate([1, 'a', 2, 'b']) == ['a', 1, ... | {
"split": "train",
"index": 79894,
"acecode_id": "evol_19827",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes file paths and performs glob pattern matching. Write a function `process_glob_patterns` that takes a string input `path` representing a file path and returns a modified `FakePathClass` object. The `FakePathClass`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_glob_patterns('test/path').path == Path('test/path')\", \"assert process_glob_patterns('example/file.txt').glob_results == {}\", \"assert isinstance(process_glob_patterns('another/test').glob_results, dict)\", \"assert process_glob_patterns('/user/ho... | {
"split": "train",
"index": 79895,
"acecode_id": "oss_9926",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_parser_statistics(parsers: List[Dict[str, Union[str, bool]]]) -> List[Dict[str, Union[str, float]]]` that takes a list of parsers and returns a list of dictionaries containing statistics about each parser. Each parser dictionary ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_parser_statistics([{'id': 'parser1', 'disabled': False}, {'id': 'parser2', 'disabled': True}]) == [{'id': 'parser1', 'size_doc': 10.0}]\", \"assert get_parser_statistics([{'id': 'parser1', 'disabled': False}, {'id': 'parser2', 'disabled': False}]) == [{'... | {
"split": "train",
"index": 79896,
"acecode_id": "bigcode_python_fns_7028",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of taxonomic entries, where each entry is a string formatted as 'taxid\\t|\\tname\\t|\\tuniqname\\t|\\tname_class'. Your task is to implement a function that parses this list and returns a dictionary mapping each taxid (as an integer) to a tuple containing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_taxonomic_entries(['1\\\\t|\\\\tHomo sapiens\\\\t|\\\\tHuman\\\\t|\\\\tscientific name', '2\\\\t|\\\\tEscherichia coli\\\\t|\\\\tE. coli\\\\t|\\\\tscientific name', '3\\\\t|\\\\tFruit fly\\\\t|\\\\tDrosophila\\\\t|\\\\tnon-scientific name']) == {1: ('H... | {
"split": "train",
"index": 79897,
"acecode_id": "bigcode_python_fns_34775",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `merge_sort(arr: List[int]) -> List[int]` that takes a list of integers as input and returns a new list containing the same integers sorted in non-decreasing order. The function should utilize the merge sort algorithm, which is a divide-and-conquer approach... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sort([3, 1, 2]) == [1, 2, 3]\", \"assert merge_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert merge_sort([]) == []\", \"assert merge_sort([1]) == [1]\", \"assert merge_sort([1, 2]) == [1, 2]\", \"assert merge_sort([2, 1]) == [1, 2]\", \"assert me... | {
"split": "train",
"index": 79898,
"acecode_id": "evol_21296",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_twin_primes()` that returns the first six pairs of twin prime numbers. A twin prime pair consists of two prime numbers that differ by two. The function should not take any parameters and should return a list of tuples, where each tuple represents a twin p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_twin_primes() == [(3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (41, 43)]\", \"assert len(find_twin_primes()) == 6\", \"assert find_twin_primes()[0] == (3, 5)\", \"assert find_twin_primes()[1] == (5, 7)\", \"assert find_twin_primes()[2] == (11, 13)\", \... | {
"split": "train",
"index": 79899,
"acecode_id": "evol_34565",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.