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 an integer n, write a function that returns a dictionary containing two lists: one with all prime numbers less than n and another with all Fibonacci numbers less than n. The function should be defined as follows: def prime_and_fibonacci_less_than(n):\nPlease reason step b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_and_fibonacci_less_than(10) == {'Primes': [2, 3, 5, 7], 'Fibonacci': [0, 1, 1, 2, 3, 5, 8]}\", \"assert prime_and_fibonacci_less_than(5) == {'Primes': [2, 3], 'Fibonacci': [0, 1, 1, 2, 3]}\", \"assert prime_and_fibonacci_less_than(15) == {'Primes': [2,...
{ "split": "train", "index": 5700, "acecode_id": "evol_11307", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the duration of an event in hours. The event is defined by the following attributes: a unique identifier (UUID), a name (string), a description (string), a start date and time (datetime), an end date and time (datetime), ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_event_duration('2023-10-01 10:00:00', '2023-10-01 12:00:00') == 2.0\", \"assert calculate_event_duration('2023-10-01 09:30:00', '2023-10-01 11:00:00') == 1.5\", \"assert calculate_event_duration('2023-10-01 08:00:00', '2023-10-01 10:30:00') == 2.5\...
{ "split": "train", "index": 5701, "acecode_id": "oss_37046", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of job objects, where each job is represented as a dictionary containing the following keys: 'flowchart_id', 'id', 'path', and 'submitted' (a datetime string in ISO format). Write a function `get_job_by_id(jobs: List[Dict[str, Union[str, int]]], job_id: int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_job_by_id([{'flowchart_id': 'ABCD', 'id': 3, 'path': '/Users/username/seamm/projects', 'submitted': '2016-08-29T09:12:00.000000+00:00'}], 3) == {'flowchart_id': 'ABCD', 'id': 3, 'path': '/Users/username/seamm/projects', 'submitted': '2016-08-29 09:12'}\"...
{ "split": "train", "index": 5702, "acecode_id": "bigcode_python_fns_37250", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a given list of integers and returns a new list that contains only the even integers from the original list, in the order they appeared. Write a function called `filter_even_numbers(nums: List[int]) -> List[int]` that takes...
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([0, -2, -4, 3, 5]) == [0, -2, -4]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([2...
{ "split": "train", "index": 5703, "acecode_id": "bigcode_python_fns_41508", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that creates a single Node for a Linked List. The Node should store an integer value and have a pointer to the next Node, initialized to None. The function should take an integer as input and return a Node object containing that integer value.\nPlease reaso...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Node(5).data == 5 and Node(5).next == None\", \"assert Node(0).data == 0 and Node(0).next == None\", \"assert Node(-1).data == -1 and Node(-1).next == None\", \"assert Node(10).data == 10 and Node(10).next == None\", \"assert Node(99).data == 99 and Node(99)...
{ "split": "train", "index": 5704, "acecode_id": "evol_10973", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of filenames and a mapping of basenames to new names. Your task is to create a new list of filenames where each filename in the original list is replaced by its corresponding new name from the mapping. If a filename does not have a corresponding new name, i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_filenames(['file1.txt', 'file2.txt', 'file3.txt'], [('file1.txt', 'new_file1.txt'), ('file3.txt', 'new_file3.txt')]) == ['new_file1.txt', 'new_file3.txt']\", \"assert transform_filenames(['doc1.pdf', 'doc2.pdf'], [('doc1.pdf', 'report1.pdf')]) == [...
{ "split": "train", "index": 5705, "acecode_id": "bigcode_python_fns_47715", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string 'phrase' and a string 'letters' (defaulting to 'aeiou'), write a function that returns a set of the letters found in 'phrase' that are also present in 'letters'. The function should only consider the case-insensitive presence of the letters. The input 'phrase' ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search4letters('hello world', 'aeiou') == {'o', 'e'}\", \"assert search4letters('Goodbye!', 'aeiou') == {'o', 'e'}\", \"assert search4letters('12345', 'aeiou') == set()\", \"assert search4letters('', 'aeiou') == set()\", \"assert search4letters('A quick brow...
{ "split": "train", "index": 5706, "acecode_id": "bigcode_python_fns_20300", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that verifies if a given string is a palindrome. A palindrome is a string that reads the same backward as forward. Your task is to implement the `is_palindrome` function, which takes a single string `input_string` as input and retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('12321') == True\", \"assert is...
{ "split": "train", "index": 5707, "acecode_id": "oss_25681", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that parses command-line arguments for configuring a machine learning model training process. The function should accept a list of strings representing the arguments and return a dictionary containing the parsed arguments. The expecte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_args(['--architecture', 'vgg19', '--dataset', 'cifar10', '--batch-size', '256', '--model-path', '/path/to/model']) == {'architecture': 'vgg19', 'dataset': 'cifar10', 'batch_size': 256, 'model_path': '/path/to/model'}\", \"assert parse_args(['--architec...
{ "split": "train", "index": 5708, "acecode_id": "bigcode_python_fns_45606", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two distinct arrays of integers, implement a function that determines the longest continuous subarray that is common between the two arrays. The function should return the subarray along with its length. If there is no common subarray, return an empty array and 0. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_common_subarray([1,2,4,4,4,4,7], [1,4,4,5,5]) == ([4, 4], 2)\", \"assert longest_common_subarray([1,2,3], [4,5,6]) == ([], 0)\", \"assert longest_common_subarray([1,1,1,1], [1,1]) == ([1, 1], 2)\", \"assert longest_common_subarray([1,2,3,4,5], [0,1,2...
{ "split": "train", "index": 5709, "acecode_id": "evol_23478", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D list `img` representing an image of dimensions m x n, and a list `pos` of two integers where `pos[0]` is the horizontal coordinate (x) and `pos[1]` is the vertical coordinate (y), write a function that returns the value of the pixel at the specified position in the i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_pixel_value([[1, 2], [3, 4]], [0, 0]) == 1\", \"assert get_pixel_value([[1, 2], [3, 4]], [1, 1]) == 4\", \"assert get_pixel_value([[1, 2, 3], [4, 5, 6]], [2, 0]) == None\", \"assert get_pixel_value([[5]], [0, 0]) == 5\", \"assert get_pixel_value([[1, 1, ...
{ "split": "train", "index": 5710, "acecode_id": "bigcode_python_fns_19270", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `smallest_odd_number` that returns the smallest odd number from the list. If there are no odd numbers, return None. You should not use any built-in functions, and the function should ignore zeros. Your implementation should only in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smallest_odd_number([1, 2, 4, 3]) == 1\", \"assert smallest_odd_number([2, 4, 6]) == None\", \"assert smallest_odd_number([-1, -2, -3]) == -3\", \"assert smallest_odd_number([0, 0, 0]) == None\", \"assert smallest_odd_number([-5, -3, -7, -2, -4]) == -7\", \"...
{ "split": "train", "index": 5711, "acecode_id": "evol_16195", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a target integer and a list of integers, write a function that finds the smallest positive difference between the target value and the sum of any combination of the provided integers. You can use each integer from the list multiple times. The function should return this s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_difference(22, [3, 7, 12, 9, 4]) == 0\", \"assert min_difference(10, [1, 2, 3]) == 0\", \"assert min_difference(15, [5, 10]) == 0\", \"assert min_difference(5, [10, 20]) == 5\", \"assert min_difference(8, [3, 5, 7]) == 0\", \"assert min_difference(30, [5...
{ "split": "train", "index": 5712, "acecode_id": "evol_962", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, A and B, of the same length, and an integer mxBasis. Your task is to implement a function `avg_gate_infidelity(A: List[int], B: List[int], mxBasis: int) -> float` that returns the average of the absolute differences between corresponding ele...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert avg_gate_infidelity([1, 2, 3], [4, 5, 6], 3) == 3.0\", \"assert avg_gate_infidelity([10, 20, 30], [10, 20, 30], 5) == 0.0\", \"assert avg_gate_infidelity([1, 5, 9], [2, 6, 10], 2) == 1.0\", \"assert avg_gate_infidelity([1, 2, 3], [1, 2, 3], 10) == 0.0\", \"a...
{ "split": "train", "index": 5713, "acecode_id": "bigcode_python_fns_40721", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a list of integers and returns a list containing only the odd integers. If any element in the list is not an integer, the function should return an error message: 'Error: All elements in the list should be integers.' Your solution should effic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert odd_numbers([1, 2, 3, 4, 5]) == [1, 3, 5]\", \"assert odd_numbers([10, 15, 20, 25]) == [15, 25]\", \"assert odd_numbers([0, 2, 4, 6]) == []\", \"assert odd_numbers([-1, -2, -3, -4]) == [-1, -3]\", \"assert odd_numbers([1, 'a', 3]) == 'Error: All elements in ...
{ "split": "train", "index": 5714, "acecode_id": "evol_838", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a method that retrieves the default value for a specified attribute based on predefined settings. You need to implement the `get_default_value` function that takes two parameters: `settings`, a dictionary that holds the configuration for differe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_default_value({'DEFAULT_FACTORY': lambda: 42}, 'attr') == 42\", \"assert get_default_value({'USER_DEFAULT': (lambda x: x + 1, [5])}, 'attr') == 6\", \"assert get_default_value({'DEFAULT_VALUE': 100}, 'attr') == 100\", \"assert get_default_value({}, 'attr...
{ "split": "train", "index": 5715, "acecode_id": "oss_35445", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `compute_aggregate_sum(arr)` that takes an array of integers and returns the sum of all the integers in the array. The array may contain both positive and negative integers. You may assume that the input array will always be valid and will contain integers only...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_aggregate_sum([1, 2, 3]) == 6\", \"assert compute_aggregate_sum([-1, -2, -3]) == -6\", \"assert compute_aggregate_sum([0, 0, 0]) == 0\", \"assert compute_aggregate_sum([1, -1]) == 0\", \"assert compute_aggregate_sum([]) == 0\", \"assert compute_aggre...
{ "split": "train", "index": 5716, "acecode_id": "evol_14525", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a transform represented by a 2D rotation angle in degrees, implement a function that converts this angle into radians. The function should take an integer input representing the angle in degrees and return a float representing the angle in radians. The conversion formula ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_degrees_to_radians(0) == 0.0\", \"assert convert_degrees_to_radians(90) == 1.5707963267948966\", \"assert convert_degrees_to_radians(180) == 3.141592653589793\", \"assert convert_degrees_to_radians(270) == 4.71238898038469\", \"assert convert_degrees...
{ "split": "train", "index": 5717, "acecode_id": "bigcode_python_fns_26465", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that computes the absolute difference between two integers. The function should take in two integers and return their absolute difference, which is defined as the non-negative difference between them. Write a function named `absolute_difference` that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert absolute_difference(5, 3) == 2\", \"assert absolute_difference(3, 5) == 2\", \"assert absolute_difference(-1, 1) == 2\", \"assert absolute_difference(-5, -3) == 2\", \"assert absolute_difference(0, 0) == 0\", \"assert absolute_difference(10, 10) == 0\", \"as...
{ "split": "train", "index": 5718, "acecode_id": "evol_7912", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that filters a list of launch configurations for virtual machines in a cloud environment. Each launch configuration is represented as a dictionary with various attributes. Your function should filter out the launch configurations that do ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_public_ip_configs([{'name': 'vm1', 'instance_type': 't2.micro', 'associate_public_ip_address': True, 'security_groups': ['sg-12345', 'sg-67890']}, {'name': 'vm2', 'instance_type': 't3.small', 'associate_public_ip_address': False, 'security_groups': ['...
{ "split": "train", "index": 5719, "acecode_id": "oss_2470", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a positive integer n representing the number of components for dimensionality reduction. Implement a function `get_reduction_method(n: int) -> Tuple[str, int]` that returns a tuple containing the name of the dimensionality reduction method and the number of compon...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_reduction_method(5) == ('kbest', 5)\", \"assert get_reduction_method(10) == ('kbest', 10)\", \"assert get_reduction_method(0) == ('invalid', 0)\", \"assert get_reduction_method(-1) == ('invalid', 0)\", \"assert get_reduction_method(None) == ('none', None...
{ "split": "train", "index": 5720, "acecode_id": "bigcode_python_fns_28434", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a FHIR (Fast Healthcare Interoperability Resources) extension object and extracts specific information from it. The FHIR extension object is represented as a dictionary containing various key-value pairs, includi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_fhir_info({'url': 'http://hl7.org/fhir/StructureDefinition/patient-birthPlace', 'valueAddress': {'city': 'Springfield', 'state': 'Massachusetts', 'country': 'US'}, '_valueTime': {'id': '123'}}) == {'url': 'http://hl7.org/fhir/StructureDefinition/pati...
{ "split": "train", "index": 5721, "acecode_id": "oss_2844", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the highest frequency value and the half resolution based on the given parameters. The function should take in two arguments: `resolution` and `freqStep`, and return the calculated `xhigh` and `halfres` values. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_values(100, 0.1) == (10.0, 100)\", \"assert calculate_values(50, 0.2) == (10.0, 50)\", \"assert calculate_values(200, 0.05) == (10.0, 200)\", \"assert calculate_values(0, 1) == (0.0, 0)\", \"assert calculate_values(1, 1) == (1.0, 1)\", \"assert cal...
{ "split": "train", "index": 5722, "acecode_id": "oss_6003", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of event types represented as strings. Your task is to implement a function that takes this list as input and modifies it in-place. If any event type is not one of the following valid types: 'create', 'read', 'update', 'delete', 'replicate', 'synchronizatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_events(['create', 'read', 'invalid_event']) == ['create', 'read', 'create']\", \"assert update_events(['update', 'synchronization_failed', 'replication_failed']) == ['update', 'synchronization_failed', 'replication_failed']\", \"assert update_events([...
{ "split": "train", "index": 5723, "acecode_id": "bigcode_python_fns_27298", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a square grid of size `w` by `w` and need to fill in specific rows or columns based on a provided solution character. Implement a function `solveRowCol(puzzle, w, rowcol, solution, index, spots, solutionPath)` that updates the `solutionPath` grid. The parameters a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solveRowCol([[None]], 1, 'r', 'X', 0, [(0, 0)], [[None]]) == [[ 'X' ]]\", \"assert solveRowCol([[None, None], [None, None]], 2, 'c', 'A', 0, [(0, 0), (1, 0)], [[None, None], [None, None]]) == [['A', None], ['A', None]]\", \"assert solveRowCol([[None, None], ...
{ "split": "train", "index": 5724, "acecode_id": "oss_2300", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a random password based on a specified length for the random part of the password. The password should consist of a random string of alphanumeric characters (letters and digits) followed by a fixed suffix '_PASSWORD'. Imple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert random_password(0) == '_PASSWORD'\", \"assert len(random_password(1)) == 10\", \"assert random_password(5).endswith('_PASSWORD')\", \"assert len(random_password(5)) == 14\", \"assert random_password(10).endswith('_PASSWORD')\", \"assert len(random_password(1...
{ "split": "train", "index": 5725, "acecode_id": "oss_11219", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating event dates. Write a function `is_valid_event_date(date: str) -> bool` that takes a string representing a date in the format 'YYYY-MM-DD' and returns True if the date is valid, and False otherwise. A date is considered valid if it can be parsed in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_event_date('2023-10-10') == True\", \"assert is_valid_event_date('2023-02-29') == False\", \"assert is_valid_event_date('2020-02-29') == True\", \"assert is_valid_event_date('1999-12-31') == True\", \"assert is_valid_event_date('2000-01-01') == True...
{ "split": "train", "index": 5726, "acecode_id": "bigcode_python_fns_8199", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a connection to a remote server and also handles potential connection errors by logging them. Create a function named `perform_connection` that accepts the following parameters: \n1. `server_address` (str): A string rep...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_connection('example.com', logger) == 'Connected to example.com'\", \"assert perform_connection('test.error.com', logger) == None\", \"assert perform_connection('api.example.com', logger) == 'Connected to api.example.com'\", \"assert perform_connectio...
{ "split": "train", "index": 5727, "acecode_id": "oss_8227", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a staircase with n steps. You can climb either 1 or 2 steps at a time. Write a function `climb_stairs` that returns the distinct number of ways to reach the top of the staircase. For example, if the staircase has 4 steps, there are 5 distinct ways to climb to the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert climb_stairs(0) == 1\", \"assert climb_stairs(1) == 1\", \"assert climb_stairs(2) == 2\", \"assert climb_stairs(3) == 3\", \"assert climb_stairs(4) == 5\", \"assert climb_stairs(5) == 8\", \"assert climb_stairs(6) == 13\", \"assert climb_stairs(7) == 21\", \...
{ "split": "train", "index": 5728, "acecode_id": "oss_25809", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a polynomial represented as a list of coefficients and a probability distribution represented as a list of tuples (x, p) where x is the value and p is the probability, calculate the expected value of that polynomial over the given distribution. The polynomial is in the fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert expected_value([0, 1], [(1, 1)]) == 1.0\", \"assert expected_value([0, 1], [(0, 0), (1, 1)]) == 1.0\", \"assert expected_value([0], [(1, 1)]) == 0.0\", \"assert expected_value([1], [(1, 1)]) == 1.0\", \"assert expected_value([0, 0, 0], [(0, 1)]) == 0.0\"]}" ...
{ "split": "train", "index": 5729, "acecode_id": "bigcode_python_fns_2412", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the height of bars in a histogram. Your task is to write a function that computes the area of the largest rectangle that can be formed within the histogram. The rectangle must be formed using contiguous bars, and the area is determi...
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, 1]) == 5\", \"assert largest_rectangle_area([0, 0, 0, 0]) == 0\", \"assert largest_rectangle_area([1]) == 1\", \"assert largest_rectangle_area([3, 6, 2, 5, 4, 5,...
{ "split": "train", "index": 5730, "acecode_id": "bigcode_python_fns_24882", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the relative momentum of a two-body system given their masses and an additional mass. Write a function `calculate_relative_momentum(m_0: float, m_1: float, m_2: float) -> float` that takes three parameters: `m_0`, `m_1`, and `m_2`, which represen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_relative_momentum(5.0, 5.0, 5.0) == 0.0\", \"assert calculate_relative_momentum(0.0, 1.0, 1.0) == 0.0\", \"assert calculate_relative_momentum(4.0, 4.0, 4.0) == 0.0\", \"assert calculate_relative_momentum(7.0, 2.0, 2.0) > 0.0\", \"assert calculate_r...
{ "split": "train", "index": 5731, "acecode_id": "bigcode_python_fns_36745", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a dataset partitioning function for a machine learning application. The function `partition_dataset` takes a list of data points and a number of partitions. Your goal is to split the data points into the specified number of partitions as evenly as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert partition_dataset(['a', 'b', 'c', 'd'], 2) == [['a', 'b'], ['c', 'd']]\", \"assert partition_dataset(['a', 'b', 'c', 'd'], 3) == [['a', 'b'], ['c'], ['d']]\", \"assert partition_dataset(['a', 'b', 'c', 'd', 'e'], 2) == [['a', 'b', 'c'], ['d', 'e']]\", \"asse...
{ "split": "train", "index": 5732, "acecode_id": "bigcode_python_fns_5902", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of items representing pages in a document. Each item can either be a 'PagesSummaryItem' or a 'CorrectedPagesSummaryItem'. Your goal is to replace every instance of 'PagesSummaryItem' in the list with a new instance of 'CorrectedPagesSummary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_corrected_pages_summary_panel(None, [PagesSummaryItem()]) == None\", \"assert add_corrected_pages_summary_panel(None, [PagesSummaryItem(), PagesSummaryItem()]) == None\", \"assert add_corrected_pages_summary_panel(None, [PagesSummaryItem(), PagesSummaryI...
{ "split": "train", "index": 5733, "acecode_id": "bigcode_python_fns_19133", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents data for a specific year containing the following keys: 'year', 'pdsiAvg', and 'precipAvg'. Your task is to implement a function that processes this data to generate a summary for each year. The output shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert summarize_data([{'year': 2020, 'pdsiAvg': 2.5, 'precipAvg': 2.0}, {'year': 2020, 'pdsiAvg': 3.0, 'precipAvg': 2.5}, {'year': 2021, 'pdsiAvg': -1.0, 'precipAvg': 1.5}]) == [{'year': 2020, 'countyAmt': 2, 'size': 2.75, 'color': 2.25}, {'year': 2021, 'countyAmt...
{ "split": "train", "index": 5734, "acecode_id": "bigcode_python_fns_21514", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of calibration data, where each entry contains a unique calibration identifier, a name, a source entity, measurement unit, precision, and a polynomial function. Your task is to implement a function that extracts and returns a list of formatted calibration s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_calibration_sensors([]) == []\", \"assert format_calibration_sensors([{'id': '001', 'name': 'Sensor A', 'source': 'Source A', 'unit': 'Celsius', 'precision': 2, 'polynomial': 'x^2'}]) == ['Calibration ID: 001, Name: Sensor A, Source: Source A, Unit: C...
{ "split": "train", "index": 5735, "acecode_id": "bigcode_python_fns_37792", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a definition of a tree node and need to implement a function that calculates the average value of the nodes at each level of the tree. The tree node is defined as follows: class TreeNode: def __init__(self, val=0, children=None): self.val = val self.children = chi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert averageOfLevels(TreeNode(3, [TreeNode(9), TreeNode(20, [TreeNode(15), TreeNode(7)])])) == [3.0, 14.5, 11.0]\", \"assert averageOfLevels(TreeNode(1)) == [1.0]\", \"assert averageOfLevels(TreeNode(1, [TreeNode(2), TreeNode(3)])) == [1.0, 2.5]\", \"assert avera...
{ "split": "train", "index": 5736, "acecode_id": "oss_19734", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the divisor needed to generate a given baud rate for a communication system. The function should take an integer input representing the baud rate and return an integer representing the divisor. The divisor is calculated ba...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_divisor(9600) == 5208\", \"assert calculate_divisor(1000000) == 50\", \"assert calculate_divisor(5000000) == 10\", \"assert calculate_divisor(25000000) == 2\", \"assert calculate_divisor(0) == -1\", \"assert calculate_divisor(-9600) == -1\", \"asse...
{ "split": "train", "index": 5737, "acecode_id": "bigcode_python_fns_16380", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of integers, which may contain both positive and negative values, and returns a tuple containing the sorted array and the count of unique integers in that array. The function should handle arrays of at least 10^5 elements efficiently.\nP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_and_find_unique_count([7, -19, 5, -4, 16, 7, -4, -4]) == ([-19, -4, -4, -4, 5, 7, 7, 16], 5)\", \"assert sort_and_find_unique_count([]) == ([], 0)\", \"assert sort_and_find_unique_count([3, 3, -1, -1, 0]) == ([-1, -1, 0, 3, 3], 3)\", \"assert sort_and_f...
{ "split": "train", "index": 5738, "acecode_id": "evol_15624", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D array `data` where each row contains an integer representing a word ID. You also have a dictionary `questionDict` that contains a key 'where' which maps to a specific word ID. Your task is to find the first word ID that appears after the row in `data` that co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert locate_word([[1], [2], [3], [4]], {'where': 1}) == 2\", \"assert locate_word([[1], [2], [3], [4]], {'where': 2}) == 3\", \"assert locate_word([[1], [2], [3], [4]], {'where': 3}) == 4\", \"assert locate_word([[1], [2], [3], [4]], {'where': 4}) == 4\", \"asser...
{ "split": "train", "index": 5739, "acecode_id": "bigcode_python_fns_21878", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of commit messages from a version control system. Your task is to implement a function that counts the number of unique commit messages in the list. A commit message is considered unique if it is not identical to any other commit message in the list. Write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_commits(['Fix bug', 'Update README', 'Fix bug', 'Add feature']) == 3\", \"assert count_unique_commits(['Initial commit', 'Initial commit', 'Initial commit']) == 1\", \"assert count_unique_commits(['Feature A', 'Feature B', 'Feature A']) == 2\", ...
{ "split": "train", "index": 5740, "acecode_id": "bigcode_python_fns_18208", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that receives a list of strings representing names of database columns. Your function should return a dictionary where the keys are the column names and the values are the lengths of those names. The function should ignore any empty s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert column_name_lengths(['id', 'name', 'email']) == {'id': 2, 'name': 4, 'email': 5}\", \"assert column_name_lengths(['']) == {}\", \"assert column_name_lengths(['column1', 'column2', 'column3', '']) == {'column1': 7, 'column2': 7, 'column3': 7}\", \"assert colu...
{ "split": "train", "index": 5741, "acecode_id": "oss_35676", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the temperatures recorded over a period of time. Your task is to write a function that finds the longest contiguous subarray of temperatures where the temperature is strictly decreasing. If there are multiple such subarrays of maxim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_decreasing_subarray([30, 25, 20, 15, 10]) == [30, 25, 20, 15, 10]\", \"assert longest_decreasing_subarray([10, 9, 8, 7, 5, 6]) == [10, 9, 8, 7, 5]\", \"assert longest_decreasing_subarray([5, 4, 3, 2, 1, 2]) == [5, 4, 3, 2, 1]\", \"assert longest_decr...
{ "split": "train", "index": 5742, "acecode_id": "oss_33671", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a dictionary of dummy variables for a makefile. The function should take a list of tuples, where each tuple contains a variable name and an associated condition. You need to return a list of dictionaries, where each diction...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_dummy_vars_dicts([('foo', 'COND'), ('bar', None)]) == [{'name': 'foo', 'condition': 'COND'}, {'name': 'bar', 'condition': ''}]\", \"assert generate_dummy_vars_dicts([('alpha', 'A'), ('beta', 'B'), ('gamma', None)]) == [{'name': 'alpha', 'condition':...
{ "split": "train", "index": 5743, "acecode_id": "bigcode_python_fns_9580", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of strings and transforms each string to uppercase. Your function should accept a single parameter, which is a list of strings. The function should return a new list containing the transformed strings in uppercase. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_to_uppercase(['hello', 'world']) == ['HELLO', 'WORLD']\", \"assert transform_to_uppercase(['python', 'is', 'fun']) == ['PYTHON', 'IS', 'FUN']\", \"assert transform_to_uppercase(['leet', 'code']) == ['LEET', 'CODE']\", \"assert transform_to_uppercas...
{ "split": "train", "index": 5744, "acecode_id": "oss_2639", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates an HTTP emitter protocol. The function should return the protocol used by the emitter as a string. Your implementation should return 'http' for an HTTP emitter. Define a function named `get_emitter_protocol` that takes ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_emitter_protocol() == 'http'\", \"assert get_emitter_protocol() == 'http'\", \"assert get_emitter_protocol() == 'http'\", \"assert get_emitter_protocol() == 'http'\", \"assert get_emitter_protocol() == 'http'\", \"assert get_emitter_protocol() == 'http'\...
{ "split": "train", "index": 5745, "acecode_id": "oss_18332", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that returns a specific loss function based on a given task type. The function accepts a dictionary containing parameters and a string that indicates the task type. The available task types are: 'edge', 'semseg', 'human_parts', 'norma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_loss({'edge_w': 1.0}, 'edge') == 'BalancedCrossEntropyLoss'\", \"assert get_loss({}, 'semseg') == 'SoftMaxwithLoss'\", \"assert get_loss({'edge_w': 2.0}, 'edge') == 'BalancedCrossEntropyLoss'\", \"assert get_loss({'edge_w': 0.5}, 'edge') == 'BalancedCros...
{ "split": "train", "index": 5746, "acecode_id": "bigcode_python_fns_33927", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_abaqus_info(filename: str, debug: bool = False) -> str` that takes an Abaqus INP file name as input and returns a string containing a summary of the file content. The summary should include the name of the file and whether the debug ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_abaqus_info('model.inp', False) == 'File: model.inp, Debug mode is OFF'\", \"assert get_abaqus_info('analysis.inp', True) == 'File: analysis.inp, Debug mode is ON'\", \"assert get_abaqus_info('simulation.inp', False) == 'File: simulation.inp, Debug mode ...
{ "split": "train", "index": 5747, "acecode_id": "bigcode_python_fns_45747", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that counts how many times the digit 5 appears in a given list of exactly 10 single-digit integers. The function should accept a list of integers as input and return the count of the digit 5. Each integer in the list will be between 0 and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_digit_five([1, 2, 3, 4, 5, 5, 6, 7, 8, 9]) == 2\", \"assert count_digit_five([0, 1, 2, 3, 4, 6, 7, 8, 9, 5]) == 1\", \"assert count_digit_five([5, 5, 5, 5, 5, 5, 5, 5, 5, 5]) == 10\", \"assert count_digit_five([1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 0\", \"...
{ "split": "train", "index": 5748, "acecode_id": "oss_17123", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that takes in two lists of integers, list1 and list2, and returns a dictionary containing the mutual elements between the two lists. For each mutual element, the dictionary should map the element to a tuple that contains the count of that element in list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_lists([3, 6, 6, 9, 12, 9, 9], [2, 4, 5, 6, 8, 9, 9, 12]) == {6: (2, 1), 9: (3, 2), 12: (1, 1)}\", \"assert compare_lists([], []) == {}\", \"assert compare_lists([1, 2, 3], [4, 5, 6]) == {}\", \"assert compare_lists([10, 20, 30], [30, 40, 50]) == {30:...
{ "split": "train", "index": 5749, "acecode_id": "evol_32743", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to manage question-answer pairs for a quiz application. You need to implement a function `manage_quiz` that takes a list of operations on a collection of question-answer pairs and returns the results of each operation. The operations ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_quiz(['add:What is the capital of France?:Paris', 'exists:What is the capital of France?']) == [None, True]\", \"assert manage_quiz(['add:What is the capital of France?:Paris', 'remove:What is the capital of France?', 'get:What is the capital of Franc...
{ "split": "train", "index": 5750, "acecode_id": "oss_27639", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary where each key represents a configuration option and the value can either be a string or a list. Your task is to implement a function `get_default_configuration(config: Dict[str, Union[str, List[str]]]) -> Dict[str, str]` that returns a new dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_default_configuration({'option1': 'value1', 'option2': ['value2a', 'value2b'], 'option3': '{{template}}'}) == {'option1': 'value1', 'option2': 'value2a'}\", \"assert get_default_configuration({'configA': 'default', 'configB': ['item1', 'item2'], 'configC...
{ "split": "train", "index": 5751, "acecode_id": "bigcode_python_fns_20775", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple registration system for a messaging application. Implement a function named `registration_system` that manages the registration of functions and retrieves the structure of a function based on its ID. The function should accept a list of tup...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert registration_system([(1, ('id', 'User1')), (2, ('id', 'User2'))]) == {1: ('id', 'User1'), 2: ('id', 'User2')}\", \"assert registration_system([(1, ('id', 'User1')), (1, ('id', 'User2'))]) == {1: ('id', 'User2')}\", \"assert registration_system([(1, ('id', 'U...
{ "split": "train", "index": 5752, "acecode_id": "oss_10460", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing a namespace and a list of strings representing names that are considered incorrect for that namespace. Write a function `download_missing_namespace(namespace: List[str], incorrect_names: List[str]) -> List[str]` that returns a new li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert download_missing_namespace(['a', 'b', 'c', 'd'], ['b', 'd']) == ['a', 'c']\", \"assert download_missing_namespace(['apple', 'banana', 'cherry'], ['banana']) == ['apple', 'cherry']\", \"assert download_missing_namespace(['name1', 'name2', 'name3'], ['name1', ...
{ "split": "train", "index": 5753, "acecode_id": "bigcode_python_fns_32935", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with verifying access permissions for a user to a set of resource IDs. Write a function `has_access(user_token: str, resource_ids: List[str]) -> Dict[str, bool]` that takes in a user token and a list of resource IDs. The function should return a dictionary where ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_access('user4_token', ['open1', 'open2', 'controlled5']) == {'open1': True, 'open2': True, 'controlled5': False}\", \"assert has_access('user4_token', ['open1']) == {'open1': True}\", \"assert has_access('user4_token', ['controlled5']) == {'controlled5':...
{ "split": "train", "index": 5754, "acecode_id": "bigcode_python_fns_41562", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n)` that returns the nth Fibonacci number using recursion. The Fibonacci sequence is defined as follows: Fibonacci(0) = 0, Fibonacci(1) = 1, and Fibonacci(n) = Fibonacci(n-1) + Fibonacci(n-2) for n > 1. The input `n` is a non-negative integer.\nP...
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": 5755, "acecode_id": "evol_13518", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates sending messages in a simple messaging system. The function takes a list of users, a list of rooms, a list of topics, and a list of messages, then returns a list of confirmed messages that successfully satisfy the condition...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_messages(['User1', 'User2'], ['Room1', 'Room2'], [('Topic1', 'Room1'), ('Topic2', 'Room2')], [('User1', 'Topic1', 'Room1', 'Hello!'), ('User2', 'Topic3', 'Room1', 'Hi!')]) == [{'user': 'User1', 'topic': 'Topic1', 'room': 'Room1', 'content': 'Hello!'}]\"...
{ "split": "train", "index": 5756, "acecode_id": "oss_12719", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a mathematical expression in the form of a string and returns the result of evaluating that expression. The expression can contain integers, addition (+), subtraction (-), multiplication (*), and division (/). The division shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_expression('3 + 5') == 8\", \"assert evaluate_expression('10 - 2') == 8\", \"assert evaluate_expression('2 * 3') == 6\", \"assert evaluate_expression('8 / 2') == 4\", \"assert evaluate_expression('5 + 2 * 3') == 11\", \"assert evaluate_expression('7...
{ "split": "train", "index": 5757, "acecode_id": "bigcode_python_fns_44022", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that converts a boolean value into a string representation. If the boolean value is True, the function should return the string 'yes'. If the boolean value is False, the function should return the string 'no'. Implement the function `bool...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert boolean_to_string(True) == 'yes'\", \"assert boolean_to_string(False) == 'no'\", \"assert boolean_to_string(True) == 'yes'\", \"assert boolean_to_string(False) == 'no'\", \"assert boolean_to_string(True) == 'yes'\", \"assert boolean_to_string(False) == 'no'\...
{ "split": "train", "index": 5758, "acecode_id": "bigcode_python_fns_3922", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a user registration system for a web application. Write a function `register_user(email: str, password: str) -> None` that simulates the user registration process. The function should perform the following actions: 1. Create a new user using the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_user('test1@example.com', 'password1') is None and session == {'sessionUser': {'email': 'test1@example.com', 'password': 'password1'}, 'sessionKey': int(time.time()*1000)}\", \"assert register_user('user@example.com', 'securepassword') is None and s...
{ "split": "train", "index": 5759, "acecode_id": "oss_31252", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `agent_param`, implement a function that processes this string to extract an agent id and a namespace. The function should follow these rules: If the string ends with 'TEXT', remove the 'TEXT' suffix and set the namespace to 'TEXT'. If the string does not end wit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_agent('agent1@namespace1') == ('agent1', 'namespace1')\", \"assert process_agent('agent2@namespace2') == ('agent2', 'namespace2')\", \"assert process_agent('agent3') == ('agent3', 'HGNC-SYMBOL')\", \"assert process_agent('agent4TEXT') == ('agent4', '...
{ "split": "train", "index": 5760, "acecode_id": "bigcode_python_fns_26714", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string input which may represent an integer, a float, or a non-numeric string. Implement a function `num_or_str(x: str) -> Union[int, float, str]` that processes the input as follows: If the input can be converted to an integer, return that integer. If it cannot...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert num_or_str('42') == 42\", \"assert num_or_str(' 42 ') == 42\", \"assert num_or_str('3.14') == 3.14\", \"assert num_or_str(' 3.14 ') == 3.14\", \"assert num_or_str('42.0') == 42.0\", \"assert num_or_str(' 42.0 ') == 42.0\", \"assert num_or_str('42x') ==...
{ "split": "train", "index": 5761, "acecode_id": "bigcode_python_fns_40404", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of observations in a scientific experiment. Each observation can be either synchronous or asynchronous. Your goal is to implement a function that allows you to add new observations and retrieve the next observation based on its synchronicity....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert next_observation([('Obs1', True), ('Obs2', False), ('Obs3', True)]) == 'Obs1'\", \"assert next_observation([('Obs1', False), ('Obs2', False), ('Obs3', False)]) == 'Obs1'\", \"assert next_observation([]) == None\", \"assert next_observation([('Obs1', True), (...
{ "split": "train", "index": 5762, "acecode_id": "oss_12247", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `below_zero(operations: List[Tuple[str, int]], case_insensitive: bool = False) -> bool` that checks if the balance goes below or equals to zero after performing a series of deposit and withdrawal operations. Each operation is represented as a tuple where th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert below_zero([('Deposit', 100), ('Withdrawal', 100)], case_insensitive=False) == True\", \"assert below_zero([('Deposit', 50), ('Withdrawal', 100)], case_insensitive=False) == True\", \"assert below_zero([('Withdrawal', 50)], case_insensitive=False) == True\",...
{ "split": "train", "index": 5763, "acecode_id": "evol_13138", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the results of a series of submissions in a programming contest. Each integer represents the result of a submission, where 1 indicates a correct answer and 0 indicates a wrong answer. Your task is to find the index of the first inco...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_first_incorrect([1, 1, 0, 1, 0, 1, 1]) == 2\", \"assert find_first_incorrect([1, 1, 1, 1, 1]) == -1\", \"assert find_first_incorrect([0, 1, 1, 1]) == 0\", \"assert find_first_incorrect([1, 0, 1]) == 1\", \"assert find_first_incorrect([1, 1, 1, 0, 1]) ==...
{ "split": "train", "index": 5764, "acecode_id": "oss_15683", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the installation of Python package dependencies. The function should take a list of package names as input and return a list of strings indicating whether each package was successfully installed or if it failed to install. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert install_packages(['numpy', 'pandas', 'matplotlib']) == ['Successfully installed numpy', 'Successfully installed pandas', 'Successfully installed matplotlib']\", \"assert install_packages(['valid_package', 'another_valid']) == ['Successfully installed valid_p...
{ "split": "train", "index": 5765, "acecode_id": "bigcode_python_fns_46818", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `custom_import(name: str, allowed_modules: List[str]) -> None`. This function simulates a custom module import mechanism in Python. Your goal is to check if a module can be imported based on a list of allowed modules. The function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_import('module1', ['module1', 'module2']) is None\", \"assert custom_import('module2', ['module1', 'module2']) is None\", \"assert custom_import('module1', ['module1']) is None\", \"assert custom_import('module2', ['module2']) is None\", \"assert cust...
{ "split": "train", "index": 5766, "acecode_id": "oss_21268", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `get_cli_version(version: bool) -> str` that returns the version of the CLI application if the input argument `version` is set to `True`. If `version` is `False`, the function should return an empty string. The function should return a string formatted as '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_cli_version(True) == 'MyApp CLI version: 1.0.0'\", \"assert get_cli_version(False) == ''\", \"assert get_cli_version(True) == 'MyApp CLI version: 1.0.0'\", \"assert get_cli_version(False) == ''\", \"assert get_cli_version(True) == 'MyApp CLI version: 1.0...
{ "split": "train", "index": 5767, "acecode_id": "bigcode_python_fns_11527", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the likelihood type based on a given mode. The function `likelihood_type(ll_mode: str, mode: str) -> str` should take in two parameters: `ll_mode`, which is a string representing the likelihood mode, and `mode`, which is a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert likelihood_type('hZIP', 'basic') == 'Zero-Inflated Poisson'\", \"assert likelihood_type('hCMP', 'standard') == 'Compoisson'\", \"assert likelihood_type('ZIP', 'basic') == 'Zero-Inflated Poisson'\", \"assert likelihood_type('NB', 'standard') == 'Negative Bino...
{ "split": "train", "index": 5768, "acecode_id": "bigcode_python_fns_23919", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that processes a simplified version of Markdown text. Your program should be able to recognize and convert a specific subset of Markdown syntax into HTML. The subset of Markdown syntax to be supported includes: \n\n1. Headers: Lines starti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert markdownToHTML('# Hello\\\\n## World\\\\n**bold text**\\\\n*italic text*') == '<h1>Hello</h1>\\\\n<h2>World</h2>\\\\n<strong>bold text</strong>\\\\n<em>italic text</em>'\", \"assert markdownToHTML('# Header Level 1\\\\n## Header Level 2') == '<h1>Header Leve...
{ "split": "train", "index": 5769, "acecode_id": "oss_6157", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing the names of cloud emulators. Write a function `start_emulators` that takes a list of emulator names and returns a dictionary with the emulator names as keys and their respective status (either 'started' or 'not found') as values. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_emulators(['datastore', 'firestore']) == {'datastore': 'started', 'firestore': 'started'}\", \"assert start_emulators(['pubsub', 'storage']) == {'pubsub': 'started', 'storage': 'started'}\", \"assert start_emulators(['unknown_emulator']) == {'unknown_e...
{ "split": "train", "index": 5770, "acecode_id": "bigcode_python_fns_39287", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of words. Your task is to implement a function that sorts these words first by their length in ascending order, and then alphabetically for words of the same length. Write a function `sort_words(words: List[str]) -> List[str]` that returns the sorted list o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_words(['banana', 'kiwi', 'watermelon', 'peach']) == ['kiwi', 'peach', 'banana', 'watermelon']\", \"assert sort_words(['cat', 'dog', 'elephant', 'ant']) == ['ant', 'cat', 'dog', 'elephant']\", \"assert sort_words(['zebra', 'antelope', 'lion', 'tiger']) =...
{ "split": "train", "index": 5771, "acecode_id": "evol_14179", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of job vacancies represented as a list of strings, where each string contains a job title and a description. Write a function `search_vac(vacancies: List[str], search_phrase: str) -> List[str]` that returns a list of all the vacancies that contain the `sear...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_vac(['Junior Developer', 'Senior Developer', 'Junior Data Analyst'], 'junior') == ['<a href=\\\"https://example.com/vacancy/0\\\">Junior Developer</a>', '<a href=\\\"https://example.com/vacancy/2\\\">Junior Data Analyst</a>']\", \"assert search_vac(['...
{ "split": "train", "index": 5772, "acecode_id": "bigcode_python_fns_44987", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing a given string to count the occurrences of each unique word. A word is defined as a sequence of alphanumeric characters (a-z, A-Z, 0-9) separated by any non-alphanumeric character. The analysis should ignore the case of the words, treating 'Word' a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_words('This is a sample text. It contains some sample words, and it is a simple example.', ['is', 'a', 'it', 'and']) == {'this': 1, 'sample': 2, 'text': 1, 'contains': 1, 'some': 1, 'words': 1, 'simple': 1, 'example': 1}\", \"assert count_unique...
{ "split": "train", "index": 5773, "acecode_id": "oss_16632", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers and returns a new list that contains only the unique elements from the original list, preserving the order of their first occurrence. Write a function `unique_elements(arr: List[int]) -> List[int]:` that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 1, 4]) == [1, 2, 3, 4]\", \"assert unique_elements([1, 1, 1, 1]) == [1]\", \"assert unique_elements([]) == []\", \"assert unique_elements([5, 3, 5, 2, 3, 1]) == [5, 3, 2, 1]\", \"assert unique_elements([-1, -1, 2, 3, -1]) == [-1,...
{ "split": "train", "index": 5774, "acecode_id": "oss_28126", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages a database of Minecraft servers. The function should allow you to add a new server and retrieve the list of servers. The function `manage_servers` takes an action and relevant parameters: \n\n- If the action is 'add', it take...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_servers('add', '192.168.1.1', 1) is None\", \"assert manage_servers('add', '192.168.1.2', 2, 8080) is None\", \"assert manage_servers('add', '10.0.0.1', 3) is None\", \"assert manage_servers('add', '172.16.0.1', 4, 3000) is None\", \"assert manage_ser...
{ "split": "train", "index": 5775, "acecode_id": "oss_14600", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given two unsorted lists of integers, implement a function that merges these two lists into one sorted list without using the built-in sort function. The function should take two parameters: list1 and list2, both of which are lists of integers. The function should return a new ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sorted_lists([], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_sorted_lists([10, 20], [1, 2, 3]) == [1, 2, 3, 10, 20]\", \"assert merge_sorted_lists([1, 1, 1], [1, 1, 1]) == [1, 1, 1, 1, 1, 1]\", \"assert merge_sorted_lists([7], [1]) == [1, 7]\", \"assert ...
{ "split": "train", "index": 5776, "acecode_id": "evol_22907", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a report string based on a title, a generating URL, and a list of datasets. Each dataset contains a name and a list of data points. Your function should take three parameters: a string for the report title, a string for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_report('Weekly Summary', 'http://example.com/week', [('Inventory', [20, 30, 25]), ('Returns', [1, 0, 2])]) == 'Report: Weekly Summary\\\\nGenerating URL: http://example.com/week\\\\nDataSet: Inventory\\\\nData: [20, 30, 25]\\\\nDataSet: Returns\\\\n...
{ "split": "train", "index": 5777, "acecode_id": "oss_4814", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are to implement a function `generate_image_feature_vector(input_image_height: int, input_image_width: int, output_feature_dim: int, image_data: List[List[List[int]]]) -> List[float]` that simulates the encoding of an image into a feature vector. The input parameters are: \...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_image_feature_vector(2, 2, 3, [[[255, 0, 0], [0, 255, 0]], [[0, 0, 255], [255, 255, 255]]]) == [127.5, 127.5, 127.5]\", \"assert generate_image_feature_vector(1, 1, 1, [[[255, 255, 255]]]) == [255.0]\", \"assert generate_image_feature_vector(1, 2, 1...
{ "split": "train", "index": 5778, "acecode_id": "bigcode_python_fns_10892", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a function that checks whether a given string represents a valid decimal number with exactly 2 decimal places. The function should ensure that the number is positive, falls within the range of 0 to 1000, is not a multiple of 10, and is a prime number. The function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isValidDecimal('1000.00') == False\", \"assert isValidDecimal('200.00') == False\", \"assert isValidDecimal('10.00') == False\", \"assert isValidDecimal(' 15.00 ') == False\", \"assert isValidDecimal(' 7.00 ') == False\", \"assert isValidDecimal(' 0.00 ')...
{ "split": "train", "index": 5779, "acecode_id": "evol_28740", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You need to implement a function `change_ip_string` that modifies a given string containing an IP address. The function takes three parameters: `input_string` (a string containing the original IP address), `old_ip_address` (the IP address to be replaced), and `new_ip_address` (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert change_ip_string('192.168.1.1 is my old IP', '192.168.1.1', '10.0.0.1') == '10.0.0.1 is my old IP'\", \"assert change_ip_string('No IP here', '192.168.1.1', '10.0.0.1') == 'No IP here'\", \"assert change_ip_string('Connect to 172.16.0.1', '172.16.0.1', '192....
{ "split": "train", "index": 5780, "acecode_id": "oss_21991", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the lap fraction for a runner in a race. The lap fraction is defined as the ratio of the lap time to the total race time. Your function should also generate a logging message that includes the lap number, runner's name...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_lap_fraction(60.0, 1800.0, 1, 'Alice') == 0.03333333333333333\", \"assert calculate_lap_fraction(90.0, 1800.0, 2, 'Bob') == 0.05\", \"assert calculate_lap_fraction(45.0, 900.0, 3, 'Charlie') == 0.05\", \"assert calculate_lap_fraction(120.0, 2400.0,...
{ "split": "train", "index": 5781, "acecode_id": "oss_15954", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings `word` and `example`, your task is to restore the capitalization of `word` to match the capitalization style of `example`. The capitalization of each segment of `word` should match the corresponding segment of `example` when split by the '-' character. If `exa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert restore_capitalization('bye', 'Hello') == 'Bye'\", \"assert restore_capitalization('usa', 'IEEE') == 'USA'\", \"assert restore_capitalization('pre-world', 'anti-World') == 'pre-World'\", \"assert restore_capitalization('123-do', 'anti-IEEE') == '123-DO'\", \...
{ "split": "train", "index": 5782, "acecode_id": "bigcode_python_fns_10905", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats and generates a string containing the details of an article. The function should take in the article's title, URL, and publication date as input parameters. The output should be a single string in the following format: 'Title...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_article_details('Python Basics', 'https://example.com/python-basics', '2023-10-01') == 'Title: Python Basics, Link: https://example.com/python-basics, Published on: 2023-10-01'\", \"assert format_article_details('Understanding AI', 'https://example.co...
{ "split": "train", "index": 5783, "acecode_id": "bigcode_python_fns_20362", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that computes the factorial of a given non-negative integer using recursion. The function should take a single integer parameter, n, and return the factorial of n. The factorial of a non-negative integer n is the product of all positive integers less than o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 5784, "acecode_id": "evol_19410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a custom exception class in Python. Your goal is to define a new custom exception class named `CustomException` that inherits from the base `Exception` class. Additionally, implement a function named `handle_custom_exception` that takes an exception...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_custom_exception(CustomException('An error occurred')) == 'Custom exception handled: An error occurred'\", \"assert handle_custom_exception(ValueError('A value error occurred')) == 'Unhandled exception'\", \"assert handle_custom_exception(CustomExcept...
{ "split": "train", "index": 5785, "acecode_id": "oss_2461", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `convert_hex_bin(lst)` that takes a list of strings containing either hexadecimal or binary values. The function should convert each hexadecimal string to its binary representation and each binary string to its hexadecimal representation. The function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_hex_bin(['1010', '1111', '1001']) == ['A', 'F', '9']\", \"assert convert_hex_bin(['00', '01', '10', '11']) == ['0', '1', '2', '3']\", \"assert convert_hex_bin(['A', 'B', 'C']) == ['1010', '1011', '1100']\", \"assert convert_hex_bin(['0000', '1111', '...
{ "split": "train", "index": 5786, "acecode_id": "evol_26646", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a list of stock symbols and exchanges and returns a list of mock contract objects, each represented as a dictionary containing the symbol and exchange. The function should simulate the process of querying contract information by...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert query_contracts(['AAPL', 'GOOGL'], ['NASDAQ', 'NASDAQ']) == [{'symbol': 'AAPL', 'exchange': 'NASDAQ'}, {'symbol': 'GOOGL', 'exchange': 'NASDAQ'}]\", \"assert query_contracts(['MSFT'], ['NASDAQ']) == [{'symbol': 'MSFT', 'exchange': 'NASDAQ'}]\", \"assert quer...
{ "split": "train", "index": 5787, "acecode_id": "oss_743", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer n, implement a function that calculates the number of leading zeros in the binary representation of n factorial (n!). The function should return this count. For example, if n = 5, the binary representation of 5! (which is 120) is '1111000', and the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_leading_zeros_factorial(0) == 0\", \"assert count_leading_zeros_factorial(1) == 0\", \"assert count_leading_zeros_factorial(2) == 0\", \"assert count_leading_zeros_factorial(3) == 0\", \"assert count_leading_zeros_factorial(4) == 0\", \"assert count_le...
{ "split": "train", "index": 5788, "acecode_id": "evol_11317", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a string of length N and a list of allowed characters, implement a function `dominant_character(string: str, allowed_chars: List[str]) -> Optional[str]` that finds the dominant character among the allowed characters. The dominant character is defined as the one that appea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dominant_character('aaabb', ['a', 'b']) == 'a'\", \"assert dominant_character('abcde', ['a', 'b', 'c', 'd', 'e']) == None\", \"assert dominant_character('aabbcc', ['a', 'b', 'c']) == None\", \"assert dominant_character('aaa', ['a']) == 'a'\", \"assert domina...
{ "split": "train", "index": 5789, "acecode_id": "evol_10381", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that performs Depth-First Search (DFS) traversal on a graph represented as an adjacency list. The graph is a dictionary where keys are node identifiers and values are lists of adjacent nodes. Your function should take two parameters: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dfs_traversal({'A': ['B'], 'B': ['A', 'C'], 'C': ['B', 'D'], 'D': ['C']}, 'A') == ['A', 'B', 'C', 'D']\", \"assert dfs_traversal({'A': [], 'B': [], 'C': []}, 'A') == ['A']\", \"assert dfs_traversal({'A': ['B', 'C'], 'B': ['A'], 'C': []}, 'B') == ['B', 'A', '...
{ "split": "train", "index": 5790, "acecode_id": "oss_10359", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simplified version of an imaging process. Given a list of slices, you need to determine which slices are considered 'good' based on a provided threshold. The slices are represented by integers, and a slice is considered 'good' if it falls within...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_good_slices([1, 2, 3, 4, 5], 1) == [2, 3, 4]\", \"assert filter_good_slices([5, 5, 5, 5], 0) == [5, 5, 5, 5]\", \"assert filter_good_slices([], 5) == []\", \"assert filter_good_slices([1, 2, 3], 0) == [2]\", \"assert filter_good_slices([1, 1, 1, 1, 1]...
{ "split": "train", "index": 5791, "acecode_id": "bigcode_python_fns_10340", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of constraints for parameters in a scientific model. Each constraint is represented as a string in the format 'n:val' for strict constraints, or 'n:val1,val2' for loose constraints. Here, 'n' is the index of the parameter (an integer) and 'val' or 'val1,val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert (params := [0.0, 0.0, 0.0]) or (bounds := [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]), set_constraints(['0:1.0'], params, bounds) or (params == [1.0, 0.0, 0.0]) and (bounds == [[1.0, 1.0], [0.0, 0.0], [0.0, 0.0]])\", \"assert (params := [0.0, 0.0, 0.0]) or (bounds...
{ "split": "train", "index": 5792, "acecode_id": "bigcode_python_fns_36262", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with approximating the temperature and liquid water density of sea-ice based on the given salinity and pressure. The function should take in two parameters: 'salt' (a float representing salinity in kg/kg) and 'pres' (a float representing pressure in Pa). The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert approximate_sea_ice(0.0, 100000.0) == (273.15, dliq_default(273.15, 100000.0))\", \"assert approximate_sea_ice(0.1, 100000.0) == (273.15, dliq_default(273.15, 100000.0))\", \"assert approximate_sea_ice(0.2, 100000.0) == (273.15, dliq_default(273.15, 100000.0...
{ "split": "train", "index": 5793, "acecode_id": "bigcode_python_fns_12129", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates an HTML header string. The function should take a text string and an optional color string as input. If the color is provided, the header should use that color; if not, it should default to 'black'. Additionally, if a third...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_header('Hello World') == '<h1 style=\\\"margin-top:12px;color: black;font-size:54px\\\"><center>Hello World</center></h1>'\", \"assert generate_header('Hello World', 'blue') == '<h1 style=\\\"margin-top:12px;color: blue;font-size:54px\\\"><center>He...
{ "split": "train", "index": 5794, "acecode_id": "bigcode_python_fns_18330", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that computes the shares for a lease between multiple tenants over a specified period. Each tenant has a numerator and denominator that represent their share of the lease. Given a list of tenants, each defined by their share (numerator an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_tenant_shares([], '2017-01-01', '2017-12-31') == {}\", \"assert get_tenant_shares([('TenantX', 1, 1)], '2017-01-01', '2017-12-31') == {'TenantX': [('2017-01-01', '2017-12-31')]}\", \"assert get_tenant_shares([('TenantA', 1, 2)], '2021-05-01', '2021-12-01...
{ "split": "train", "index": 5795, "acecode_id": "bigcode_python_fns_32193", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a dictionary representing metadata for a biosample table. The function should accept two lists: one containing the column names and another containing the corresponding metadata values. The function should return a dictiona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_biosample_metadata(['id', 'BioSample_id', 'BioSampleAccession'], ['1', '12991206', 'SAMN12991206']) == {'id': '1', 'BioSample_id': '12991206', 'BioSampleAccession': 'SAMN12991206'}\", \"assert generate_biosample_metadata(['BioSampleSubmissionDate', ...
{ "split": "train", "index": 5796, "acecode_id": "bigcode_python_fns_7895", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to process a set of image patches based on certain parameters. The function takes in a dictionary of pattern parameters and a list of offsets, and it needs to exclude certain offsets from processing. The `pattern_params` dictionary co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_patches({'theta': 30, 'pattern_offset': 5}, [0, 1, 2], [1]) == {0: 'Processed patch for offset 0 with theta 30 and pattern offset 5', 2: 'Processed patch for offset 2 with theta 30 and pattern offset 5'}\", \"assert process_patches({'theta': 45, 'pat...
{ "split": "train", "index": 5797, "acecode_id": "oss_21666", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings, implement a function that returns the length of the longest common subsequence between them. A subsequence is a sequence that appears in the same relative order, but not necessarily contiguous. For example, if the input strings are 'abcdaf' and 'acbcf', the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_common_subsequence('abc', 'abc') == 3\", \"assert longest_common_subsequence('abc', 'def') == 0\", \"assert longest_common_subsequence('', 'abc') == 0\", \"assert longest_common_subsequence('abc', '') == 0\", \"assert longest_common_subsequence('a', ...
{ "split": "train", "index": 5798, "acecode_id": "evol_509", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `find_median(lst)` that takes a list of integers as input and returns the median value. The median is the middle element when the list is sorted. If the list has an even number of elements, return the average of the two middle values.\nPlease reason step by ste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_median([3, 6, 9, 11, 15]) == 9\", \"assert find_median([1, 2, 3, 4, 5]) == 3\", \"assert find_median([5, 3, 1, 2, 4]) == 3\", \"assert find_median([7, 8, 9, 10]) == 8.5\", \"assert find_median([10, 20, 30]) == 20\", \"assert find_median([4, 3, 2, 1]) ==...
{ "split": "train", "index": 5799, "acecode_id": "evol_27544", "num_tests": 16 }