data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that returns the sum of all even integers in the list. If there are no even integers, return 0. Write a function `sum_of_evens(nums: List[int]) -> int` where `nums` is a list of integers. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4]) == 6\", \"assert sum_of_evens([0, 1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([5, 7, 9]) == 0\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert sum_of_evens([10, 20, 30]) == 60\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\... | {
"split": "train",
"index": 1700,
"acecode_id": "bigcode_python_fns_2039",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a list of integers using the shell sorting algorithm. The function should take a list as input and return the sorted list. For example, given the input list = [14, 52, 7, 1, 9, 75, 3], the output should be [1, 3, 7, 9, 14, 52, 75].\nPlease reason... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shell_sort([14, 52, 7, 1, 9, 75, 3]) == [1, 3, 7, 9, 14, 52, 75]\", \"assert shell_sort([5, 2, 9, 1, 5, 6]) == [1, 2, 5, 5, 6, 9]\", \"assert shell_sort([3, 0, 2, 5, -1, 4, 1]) == [-1, 0, 1, 2, 3, 4, 5]\", \"assert shell_sort([10]) == [10]\", \"assert shell_... | {
"split": "train",
"index": 1701,
"acecode_id": "evol_35616",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a command string for creating a backing store in AWS S3. The function should take in the backing store name, underlying storage name, region, AWS access key, and AWS secret key as parameters. The output should be a formatte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_aws_backingstore_command('myBackingStore', 'myBucket', 'us-east-1', 'AKIAEXAMPLE', 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY') == 'backingstore create aws-s3 myBackingStore --access-key AKIAEXAMPLE --secret-key wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEK... | {
"split": "train",
"index": 1702,
"acecode_id": "bigcode_python_fns_39888",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `fibonacci(n)` that takes an integer `n` as input and returns the first `n` numbers of the Fibonacci sequence as a list. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"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]\",... | {
"split": "train",
"index": 1703,
"acecode_id": "evol_8671",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 3-dimensional array of distinct integers, write a function `penultimate_min_3d(array)` that finds the penultimate minimum value from the sums of all integers encountered up to each occurrence of 0 within each height of the array. If a height does not contain a 0, includ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert penultimate_min_3d([[[0, 0]], [[0, 0]], [[0, 0]]]) == None\", \"assert penultimate_min_3d([[[0, 0, 0]], [[0]], [[0, 0, 0]]]) == None\", \"assert penultimate_min_3d([[[0, 1, 2]], [[3, 0, 4]], [[5, 6, 0]]]) == 3\", \"assert penultimate_min_3d([[[5, 5, 5]], [[5... | {
"split": "train",
"index": 1704,
"acecode_id": "evol_23378",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple reporting system for test failures in a software testing framework. Your goal is to create a function called `report_test_failure` that simulates the reporting of a test failure. The function should have the following behavior: it shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert report_test_failure() == (False, 'No reason provided')\", \"assert report_test_failure('Test case 1 failed') == (False, 'Test case 1 failed')\", \"assert report_test_failure('Expected value did not match') == (False, 'Expected value did not match')\", \"asse... | {
"split": "train",
"index": 1705,
"acecode_id": "oss_16119",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a given `status` object and returns a dictionary with specific key-value pairs derived from the attributes of the `status` object. The function should extract the `id`, `PK`, `SK`, `indexKey`, `name`, `filename`, `creat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_status(Status('12345', 'Example Status', 'example.txt', '2022-01-01', 'user123', 'active')) == {'id': '12345', 'PK': '12345', 'SK': '2022-01-01', 'indexKey': 'Status', 'name': 'Example Status', 'filename': 'example.txt', 'createdAt': '2022-01-01', 'c... | {
"split": "train",
"index": 1706,
"acecode_id": "oss_13016",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a postfix expression evaluator using a stack data structure. Postfix notation, also known as Reverse Polish Notation (RPN), is a mathematical notation in which every operator follows all of its operands. For example, the infix expression '3 + 4 ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_postfix('3 4 5 * +') == 23\", \"assert evaluate_postfix('2 3 + 5 *') == 25\", \"assert evaluate_postfix('5 1 2 + 4 * + 3 -') == 14\", \"assert evaluate_postfix('10 2 8 * + 3 -') == 23\", \"assert evaluate_postfix('2 3 * 5 4 * +') == 26\", \"assert e... | {
"split": "train",
"index": 1707,
"acecode_id": "oss_36124",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the retrieval of a recovery point for a virtual tape based on its Amazon Resource Name (ARN) and the ARN of the associated gateway. The function should take two string parameters, `TapeARN` and `GatewayARN`, and return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_tape_recovery_point('arn:aws:tapegateway:us-east-1:123456789012:tape/MyTape', 'arn:aws:tapegateway:us-east-1:123456789012:gateway/MyGateway') == {'TapeARN': 'arn:aws:tapegateway:us-east-1:123456789012:tape/MyTape'}\", \"assert retrieve_tape_recovery... | {
"split": "train",
"index": 1708,
"acecode_id": "bigcode_python_fns_3464",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the execution of a series of move commands for a robotic system. Each move command is represented by a group ID, and the commands must be executed in the order they are received. Your function should take a list of move commands and return a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_move_commands([3]) == [3000]\", \"assert execute_move_commands([5, 0, 1]) == [5000, 5000, 6000]\", \"assert execute_move_commands([0, 0, 0]) == [0, 0, 0]\", \"assert execute_move_commands([1, 1, 1]) == [1000, 2000, 3000]\", \"assert execute_move_comm... | {
"split": "train",
"index": 1709,
"acecode_id": "bigcode_python_fns_6535",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the discovery of an internal address. The function should take a list of IP addresses as input and return the first valid internal address found in the list. An internal address is defined as an IP address that starts with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert discover_internal_address(['10.0.0.1', '192.168.1.1', '172.16.0.1']) == '10.0.0.1'\", \"assert discover_internal_address(['172.16.0.2', '8.8.8.8', '192.168.0.1']) == '172.16.0.2'\", \"assert discover_internal_address(['8.8.4.4', '192.168.1.100', '10.1.1.1'])... | {
"split": "train",
"index": 1710,
"acecode_id": "bigcode_python_fns_29277",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function in Python to compute the weighted average of an array containing floating-point numbers, given an array with the corresponding weights for each number. The function should return the weighted average rounded to 3 decimal places. You may assume that the inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert weighted_average([0.0, 0.0, 0.0], [1.0, 1.0, 1.0]) == 0.0\", \"assert weighted_average([2.0, 4.0], [0.5, 0.5]) == 3.0\", \"assert weighted_average([1.0, 2.0, 3.0, 4.0, 5.0], [0.2, 0.2, 0.2, 0.2, 0.2]) == 3.0\", \"assert weighted_average([1.0, 1.0, 1.0, 1.0],... | {
"split": "train",
"index": 1711,
"acecode_id": "evol_2147",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `max_subarray_sum(arr)` that returns the maximum sum of a contiguous subarray within the input list. A contiguous subarray is defined as a subarray that consists of elements that are adjacent in the original array. Your function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([1, 2, 3, 4, 5]) == 15\", \"assert max_subarray_sum([0, -1, -2, -3]) == 0\", \"assert max_subarray_sum([2, 1, -2, 4, 3]) == 8\", \"assert max_subarray_sum([]) == 0\", \"assert max_subarray... | {
"split": "train",
"index": 1712,
"acecode_id": "oss_2046",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of sentences, where each sentence is represented as a list of words (strings). Your task is to split the list of sentences into two parts: a training set and a testing set. The training set should contain 80% of the sentences, and the testing set should con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_sentences([['I', 'love', 'to', 'code'], ['Python', 'is', 'great'], ['LeetCode', 'is', 'fun'], ['Practice', 'makes', 'perfect'], ['Keep', 'learning', 'new', 'things']]) == ([[ 'I', 'love', 'to', 'code'], ['Python', 'is', 'great'], ['LeetCode', 'is', 'fu... | {
"split": "train",
"index": 1713,
"acecode_id": "bigcode_python_fns_37864",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a string 'etag_str' which may or may not represent a valid quoted ETag. A valid quoted ETag is defined as a string that is surrounded by double quotes. Your task is to implement a function that checks if the input string is a valid quoted ETag. If it is valid, ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quote_etag('\\\"12345\\\"') == '\\\"12345\\\"'\", \"assert quote_etag('abcde') == '\\\"abcde\\\"'\", \"assert quote_etag('\\\"etag\\\"') == '\\\"etag\\\"'\", \"assert quote_etag('etag123') == '\\\"etag123\\\"'\", \"assert quote_etag('\\\"\\\"') == '\\\"\\\"'... | {
"split": "train",
"index": 1714,
"acecode_id": "bigcode_python_fns_4306",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the frequencies (in Hz) and another list of integers representing the corresponding hearing thresholds (in dB HL), implement a function that generates a dictionary containing the following keys: 'title', 'x', and 'y'. The 'title' should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_graph_data([], []) == {}\", \"assert generate_graph_data([100, 200, 300], [-10, -20, -30]) == {'title': 'Hearing Threshold Graph for Frequencies from 100 Hz to 300 Hz', 'x': [100, 200, 300], 'y': [-10, -20, -30]}\", \"assert generate_graph_data([500... | {
"split": "train",
"index": 1715,
"acecode_id": "bigcode_python_fns_18228",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a URL for accessing a MinIO server. The function should take the following parameters: a boolean indicating if the server is running in Docker, a boolean indicating whether to reuse an existing Docker container, the Min... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_minio_url(True, True, 'minio/minio', 'minio_container') == 'http://localhost:9000'\", \"assert generate_minio_url(False, False, 'minio/minio', 'minio_container') == 'http://localhost:9001'\", \"assert generate_minio_url(True, False, 'minio/minio', '... | {
"split": "train",
"index": 1716,
"acecode_id": "oss_23557",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a message processing system that processes a series of data messages. Each message contains a timestamp and a payload. Your function should process the messages and store them in a dictionary where the keys are the timestamps and the values are ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_messages(3, [(1623456789, 'Hello'), (1623456790, 'World'), (1623456791, 'Python')]) == {1623456789: 'Hello', 1623456790: 'World', 1623456791: 'Python'}\", \"assert process_messages(2, [(1623456789, 'Hello'), (1623456789, 'World')]) == {1623456789: 'W... | {
"split": "train",
"index": 1717,
"acecode_id": "oss_36052",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function, `tribonacci_sequence`, that calculates the n-th element of a modified Tribonacci sequence without recursion. The sequence's rules are as follows: `tribonacci_sequence(0) -> 0`, `tribonacci_sequence(1) -> 1`, `tribonacci_sequence(2) -> 1`, `tribonacci_sequence... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tribonacci_sequence(0) == 0\", \"assert tribonacci_sequence(1) == 1\", \"assert tribonacci_sequence(2) == 1\", \"assert tribonacci_sequence(3) == 2\", \"assert tribonacci_sequence(4) == 4\", \"assert tribonacci_sequence(5) == 8\"]}"
} | {
"split": "train",
"index": 1718,
"acecode_id": "evol_10502",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of website URLs and extracts the unique domain names from them. The function should return a list of unique domain names in alphabetical order. A domain name is defined as the second-level domain from the URL.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_unique_domains(['http://www.example.com', 'http://www.test.com', 'http://www.example.com']) == ['example', 'test']\", \"assert extract_unique_domains(['http://www.google.com', 'http://www.facebook.com', 'http://www.google.com']) == ['facebook', 'goog... | {
"split": "train",
"index": 1719,
"acecode_id": "oss_18642",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Develop a function that accepts a list of tuples, where each tuple contains two integers. The function should calculate the greatest common divisor (GCD) for each tuple and return a list of GCDs in the same order as the input tuples. Each integer can range between -1000 to 1000... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gcd_pairs([(10, 12), (22, 66), (-14, 28)]) == [2, 22, 14]\", \"assert gcd_pairs([(0, 0), (15, 0), (0, 15)]) == [0, 15, 15]\", \"assert gcd_pairs([(5, 5), (-5, -5), (5, -5)]) == [5, 5, 5]\", \"assert gcd_pairs([(17, 19), (-17, 19), (17, -19)]) == [1, 1, 1]\",... | {
"split": "train",
"index": 1720,
"acecode_id": "evol_6606",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that sends a message to a user based on their registration status. The function should take a user object as input and return a string that represents the message to be sent. The user object contains the following attributes: `self_regist... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_user_message({'self_registered': True, 'wait_confirmation': False, 'firstname': 'John', 'lastname': 'Doe', 'email': 'john.doe@example.com'}) == 'Welcome John Doe, thank you for registering!'\", \"assert send_user_message({'self_registered': False, 'wait... | {
"split": "train",
"index": 1721,
"acecode_id": "bigcode_python_fns_16160",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a logging middleware for a web application. The function should take in a dictionary representing an HTTP request, which contains headers for 'X-Request-Id' and 'X-Auth-User'. The function should return a log message st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_log_message({'headers': {'X-Request-Id': 'req-123', 'X-Auth-User': 'user1'}}) == 'Request ID: req-123, Authenticated User: user1'\", \"assert generate_log_message({'headers': {'X-Request-Id': 'req-456'}}) == 'Request ID: req-456'\", \"assert generat... | {
"split": "train",
"index": 1722,
"acecode_id": "oss_34239",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary `s`, write a function `is_zsettable(s)` that checks if all the values in the dictionary are either integers or floats. The function should return `True` if all values are valid numbers (i.e., of type `int` or `float`), and `False` otherwise. The input diction... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_zsettable({'a': 1, 'b': 2.5, 'c': 0}) == True\", \"assert is_zsettable({'x': 3.14, 'y': -2}) == True\", \"assert is_zsettable({'key1': 1, 'key2': 2, 'key3': 3}) == True\", \"assert is_zsettable({'one': 1.0, 'two': 2.0, 'three': 3.0}) == True\", \"assert i... | {
"split": "train",
"index": 1723,
"acecode_id": "bigcode_python_fns_10954",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of dictionaries representing user data. Your function should apply the following transformations to each dictionary in the input list: 1. Add a new key-value pair to each dictionary with the key 'processed... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_user_data([{'_id': 1, 'name': 'Alice', 'age': 25}]) == [{'name': 'Alice', 'age': 25, 'processed': True}]\", \"assert process_user_data([{'_id': 2, 'username': 'Bob', '_active': True}]) == [{'username': 'Bob', 'processed': True}]\", \"assert process_u... | {
"split": "train",
"index": 1724,
"acecode_id": "oss_6898",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of candidates and a profile of ballots that indicates how many voters prefer one candidate over another. Your task is to implement a function `find_smith_set(candidates: List[str], ballots: Dict[str, int]) -> List[str]` that computes and returns the Smith s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_smith_set(['A', 'B'], {'A': 3, 'B': 3}) == ['A', 'B']\", \"assert find_smith_set(['A', 'B', 'C', 'D'], {'A': 2, 'B': 2, 'C': 2, 'D': 2}) == ['A', 'B', 'C', 'D']\", \"assert find_smith_set(['A', 'B', 'C', 'D'], {'A': 1, 'B': 1, 'C': 1, 'D': 1}) == ['A', ... | {
"split": "train",
"index": 1725,
"acecode_id": "bigcode_python_fns_6906",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the factorial of a given non-negative integer n. The factorial of a non-negative integer n, denoted as n!, is the product of all positive integers less than or equal to n. Your function should be named `factorial` and ... | 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": 1726,
"acecode_id": "oss_31916",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a polygonal plane context. The function, `create_poly_plane_ctx`, should accept the following parameters: \n\n- `attachToSubdivisionsAll` (bool): Whether to attach to all subdivisions. \n- `attachToSubdivisi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_poly_plane_ctx(True, False, True, 0, 1, True, False, False, 5.0, True, 'image1.png', 'image2.png', 'image3.png', 'MyPlane', 2, 2, 10.0) == {'attachToSubdivisionsAll': True, 'attachToSubdivisionsHeight': False, 'attachToSubdivisionsWidth': True, 'axis'... | {
"split": "train",
"index": 1727,
"acecode_id": "bigcode_python_fns_6904",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a target value, create a function that uses a while loop to iterate over the list and finds all unique pairs of indices that add up to the target value. The function should return a list of tuples, where each tuple contains the indices of the two el... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pairs([1, 2, 3, 4], 5) == [(0, 3), (1, 2)]\", \"assert find_pairs([1, 1, 1, 1], 2) == [(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)]\", \"assert find_pairs([], 5) == []\", \"assert find_pairs([5, 5, 5, 5], 10) == [(0, 1), (0, 2), (0, 3), (1, 2), (1, 3... | {
"split": "train",
"index": 1728,
"acecode_id": "evol_21863",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of tuples, where each tuple contains an entry name and an entry value. The function should return a dictionary that maps each unique entry name to a list of all corresponding entry values. The function should also in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_entries([('A', 1.0), ('B', 2.0), ('A', 3.0)]) == {'A': [1.0, 3.0], 'average': 2.0, 'B': [2.0]}\", \"assert process_entries([('A', 1.5), ('A', 2.5)]) == {'A': [1.5, 2.5], 'average': 2.0}\", \"assert process_entries([('A', 1.0)]) == {'A': [1.0], 'avera... | {
"split": "train",
"index": 1729,
"acecode_id": "bigcode_python_fns_32577",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that performs a specific type of crossover called \"random swap crossover\" on a list representing an individual solution. Your function should take a list of integers as input, randomly select two distinct indices in the list, and sw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert random_swap_crossover([1, 2]) != [1, 2]\", \"assert random_swap_crossover([1, 2, 3, 4]) != [1, 2, 3, 4]\", \"assert random_swap_crossover([5, 6, 7]) != [5, 6, 7]\", \"assert random_swap_crossover([10, 20]) != [10, 20]\", \"assert random_swap_crossover([1, 1,... | {
"split": "train",
"index": 1730,
"acecode_id": "oss_16006",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a sentence and a list of words, implement a function that returns the positions of each specified word in the sentence. The positions should be 1-based indices, and the function should ignore any punctuation or special characters in the sentence. If a word appears multipl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_positions('A B C A B C', ['A', 'B']) == {'A': [1, 4], 'B': [2, 5]}\", \"assert word_positions('The quick brown fox jumps over the lazy dog.', ['quick', 'lazy']) == {'quick': [2], 'lazy': [8]}\", \"assert word_positions('Edge cases: special characters! l... | {
"split": "train",
"index": 1731,
"acecode_id": "evol_19925",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `x` and `y`, representing the coordinates of points in a 2D space. Your task is to implement a function that computes the Euclidean distance between each corresponding pair of points in `x` and `y`. The function should return a list of these... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_distances([], []) == []\", \"assert compute_distances([1], [1]) == [0.0]\", \"assert compute_distances([1, 2], [1]) == []\", \"assert compute_distances([1, 2, 3], [1, 2]) == []\", \"assert compute_distances([1, 1, 1], [1, 1, 1]) == [0.0, 0.0, 0.0]\",... | {
"split": "train",
"index": 1732,
"acecode_id": "bigcode_python_fns_17619",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings containing project names and a boolean flag `clear`. Your task is to implement a function that either returns a list of successfully cleared project names if `clear` is True or a list of project names that are currently being inspected if `clear`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cache_management(['project1', 'project2', 'project3'], True) == ['project1', 'project2', 'project3']\", \"assert cache_management(['projectA', 'projectB'], False) == ['projectA', 'projectB']\", \"assert cache_management([], True) == []\", \"assert cache_mana... | {
"split": "train",
"index": 1733,
"acecode_id": "bigcode_python_fns_4595",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-empty list of positive integers `arr`, write a function `polynomial_occur(arr)` that returns the smallest integer in the list that appears a number of times equal to a polynomial function value (either of the form 2^x or x^2). If no such integer exists, return -1.\n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert polynomial_occur([3, 3, 2, 2, 2, 2]) == 2\", \"assert polynomial_occur([5, 5, 5, 5, 4, 4]) == 4\", \"assert polynomial_occur([4, 4, 4, 4, 5]) == 4\", \"assert polynomial_occur([9, 9, 9, 1]) == 1\", \"assert polynomial_occur([12, 12, 12, 12, 2]) == 2\", \"ass... | {
"split": "train",
"index": 1734,
"acecode_id": "evol_21132",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of n-number of lists, write a function that calculates the coefficient of variation for each sublist. The coefficient of variation is defined as the standard deviation divided by the mean of the elements in the sublist. If a sublist is empty or the mean is zero,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calCoefficient([[1, 1, 1], [2, 2, 2], [0, 0], []]) == [0.0, 0.0, None, None]\", \"assert calCoefficient([[1, 2, 3], [4, 4], [5], [0]]) == [0.408, 0.0, 0.0, None]\", \"assert calCoefficient([[3, 3], [], [0, 0, 0]]) == [0.0, None, None]\", \"assert calCoeffici... | {
"split": "train",
"index": 1735,
"acecode_id": "evol_16673",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a dataset for visualizing data on a map of China. The function should take a list of tuples as input, where each tuple contains a province or municipality name in China and an associated value (e.g., population densi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_map_data([('\\u5317\\u4eac', 100), ('\\u5929\\u6d25', 50), ('\\u4e0a\\u6d77', 80), ('\\u91cd\\u5e86', 70), ('\\u6cb3\\u5317', 60)]) == {'\\u5317\\u4eac': 100, '\\u5929\\u6d25': 50, '\\u4e0a\\u6d77': 80, '\\u91cd\\u5e86': 70, '\\u6cb3\\u5317': 60}\",... | {
"split": "train",
"index": 1736,
"acecode_id": "oss_23098",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of integers based on their parity. The function should take in a list of integers and return a new list containing the result of the operation. The operation to be performed is as follows: For each integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_integers([1, 2, 3, 4, 5]) == [1, 4, 9, 8, 25]\", \"assert process_integers([0, -1, -2, -3, -4]) == [0, 1, -4, 9, -8]\", \"assert process_integers([10, 11, 12, 13, 14]) == [20, 121, 24, 169, 28]\", \"assert process_integers([-5, -6, -7, -8]) == [25, -... | {
"split": "train",
"index": 1737,
"acecode_id": "oss_34647",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that accepts a list of two strings as input and checks if the characters from the second string appear consecutively in the same sequence in the first string. For example, if the input is ['keyboard', 'boa'], the function should return true. Implement the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_consecutive(['keyboard', 'key']) == True\", \"assert check_consecutive(['abcdefg', 'cde']) == True\", \"assert check_consecutive(['abcdefg', 'xyz']) == False\", \"assert check_consecutive(['hello world', 'lo w']) == True\", \"assert check_consecutive([... | {
"split": "train",
"index": 1738,
"acecode_id": "evol_10196",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of dictionaries representing items and returns a list of dictionaries with only specific fields included. Each dictionary in the input list has the following fields: 'uri', 'uri_prefix', 'key', 'comment', 'source', and '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_fields([{'uri': 'http://example.com/1', 'uri_prefix': 'ex', 'key': 'key1', 'comment': 'First item', 'source': {'uri': 'source1'}, 'target_option': {'uri': 'target1'}}]) == [{'uri': 'http://example.com/1', 'uri_prefix': 'ex', 'key': 'key1', 'comment': ... | {
"split": "train",
"index": 1739,
"acecode_id": "oss_22646",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of entries where each entry is a dictionary containing an 'index', 'label', and 'dataFormat'. Your task is to sort the entries first by 'index' and then by 'label'. Return the sorted list of entries. The entries are guaranteed to have unique 'index' values.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_entries([{'index': 2, 'label': 'B', 'dataFormat': 'Link'}, {'index': 1, 'label': 'A', 'dataFormat': 'Link'}, {'index': 3, 'label': 'C', 'dataFormat': 'Link'}]) == [{'index': 1, 'label': 'A', 'dataFormat': 'Link'}, {'index': 2, 'label': 'B', 'dataFormat'... | {
"split": "train",
"index": 1740,
"acecode_id": "bigcode_python_fns_292",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `parse_to_dict(string: str) -> dict` that takes a string of key-value pairs separated by commas and returns a dictionary containing the parsed key-value pairs. Each key-value pair in the string is formatted as `key=value`. Your function should correctly han... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_to_dict('name=John, age=45, gender=m') == {'name': 'John', 'age': '45', 'gender': 'm'}\", \"assert parse_to_dict('') == {}\", \"assert parse_to_dict('key1=value1') == {'key1': 'value1'}\", \"assert parse_to_dict('key1= value1 ') == {'key1': 'value1... | {
"split": "train",
"index": 1741,
"acecode_id": "evol_1029",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a command string for a network scanning tool based on various parameters. Write a function that takes the following parameters: `service`, `nmap_extra`, `port`, `scandir`, `protocol`, and `address`. The function should generate a command string ba... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_nmap_command(None, '', 80, '/tmp', 'tcp', '192.168.1.1') == 'nmap -sV -p 80 --script=\\\"banner,(oracle* or ssl*) and not (brute or broadcast or dos or external or fuzzer)\\\" -oN \\\"/tmp/tcp_80_oracle_nmap.txt\\\" -oX \\\"/tmp/xml/tcp_80_oracle_n... | {
"split": "train",
"index": 1742,
"acecode_id": "oss_1831",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that creates a student record with a given username and additional attributes. The function should take a string 'username' and a variable number of keyword arguments representing additional attributes of the student. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_student('john_doe', age=21, major='Computer Science') == {'username': 'john_doe', 'age': 21, 'major': 'Computer Science'}\", \"assert create_student('jane_smith', gpa=3.8, year='Sophomore') == {'username': 'jane_smith', 'gpa': 3.8, 'year': 'Sophomore'... | {
"split": "train",
"index": 1743,
"acecode_id": "bigcode_python_fns_5866",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that takes a dataset represented as a dictionary where keys are column names and values are lists of integers. Each column represents a different attribute of a dataset. Your task is to implement a function that checks whether all the columns in the dat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_zero_indexed({'MARRIAGE': [0, 1, 0], 'EDUCATION': [0, 2, 1], 'LIMIT_BAL': [0, 5000, 2000], 'BILL_AMT1': [0, 300, 400]}) == True\", \"assert check_zero_indexed({'MARRIAGE': [0, 1, 2], 'EDUCATION': [1, 2, 3], 'LIMIT_BAL': [1000, 5000, 2000], 'BILL_AMT1':... | {
"split": "train",
"index": 1744,
"acecode_id": "bigcode_python_fns_28620",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries, `dict1` and `dict2`, along with a list of operations to perform on these dictionaries. Implement a function `dict_operations(dict1, dict2, operations)` that processes each operation in the list and returns the final result based on the last opera... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dict_operations({'a': 1, 'b': 2}, {'b': 3, 'c': 4}, ['merge']) == {'a': 1, 'b': 3, 'c': 4}\", \"assert dict_operations({'a': 1, 'b': 2}, {'b': 3, 'c': 4}, ['common_keys']) == {'b': 2}\", \"assert dict_operations({'a': 1, 'b': 2}, {'b': 2, 'c': 4}, ['unique_k... | {
"split": "train",
"index": 1745,
"acecode_id": "evol_18951",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: `forest_ids` and `forest_sizes`, representing the IDs and sizes of different forests, respectively. Your task is to sort the `forest_ids` based on the corresponding `forest_sizes` in ascending order. If two `forest_sizes` are equal, maintain their relat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_forests([2, 3, 1], [5, 5, 5]) == [2, 3, 1]\", \"assert sort_forests([10, 20, 30], [1, 2, 3]) == [10, 20, 30]\", \"assert sort_forests([], []) == []\", \"assert sort_forests([1, 2, 3], [3, 3, 3]) == [1, 2, 3]\", \"assert sort_forests([5, 3], [7, 5]) == [... | {
"split": "train",
"index": 1746,
"acecode_id": "bigcode_python_fns_5817",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that accepts an integer array as an argument and generates a new array as a result. The elements in the resultant array should mirror the input array's relative sequence, while preserving the original numerical values. In the event of repeated numbers ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reversed_sequence([4, 3, 3, 2, 2, 2, 1]) == [1, 2, 2, 2, 3, 3, 4]\", \"assert reversed_sequence([1, 1, 2, 2, 3]) == [3, 2, 2, 1, 1]\", \"assert reversed_sequence([5, 5, 5, 1, 1, 2]) == [2, 1, 1, 5, 5, 5]\", \"assert reversed_sequence([3]) == [3]\", \"assert ... | {
"split": "train",
"index": 1747,
"acecode_id": "evol_18973",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a stream of fluid characterized by its temperature (T), pressure (P), and phase (liquid or gas), along with a molecular quantity (m) of a specific compound. Your task is to implement a function that calculates the volumetric flow rate (in cubic meters per hour) of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_volumetric_flow({'T': 300, 'P': 101325, 'phase': 'gas'}, [10, 0.5]) == 5000.0\", \"assert calculate_volumetric_flow({'T': 350, 'P': 101325, 'phase': 'liquid'}, [5, 0.8]) == 4000.0\", \"assert calculate_volumetric_flow({'T': 290, 'P': 101325, 'phase... | {
"split": "train",
"index": 1748,
"acecode_id": "bigcode_python_fns_33147",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a chat room. The function should take a list of rooms, where each room is represented as a dictionary containing the following keys: 'id' (an integer), 'slug' (a string), 'name' (a string), 'access' (a strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_public_rooms([{'id': 1, 'slug': 'room-1', 'name': 'Room One', 'access': 'Public', 'is_active': True, 'black_list': []}, {'id': 2, 'slug': 'room-2', 'name': 'Room Two', 'access': 'Private', 'is_active': True, 'black_list': []}, {'id': 3, 'slug': 'room-... | {
"split": "train",
"index": 1749,
"acecode_id": "oss_15013",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a line of LaTeX code. Your task is to implement a function `toggle_comments(latex_lines: List[str], add_comments: bool) -> List[str]` that adds or removes comments from each line based on the value of `add_comments`.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert toggle_comments(['\\\\documentclass{article}', '\\\\begin{document}', '\\\\end{document}'], True) == ['%\\\\documentclass{article}', '%\\\\begin{document}', '%\\\\end{document}']\", \"assert toggle_comments(['%\\\\documentclass{article}', '%\\\\begin{documen... | {
"split": "train",
"index": 1750,
"acecode_id": "bigcode_python_fns_26308",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to update the position of an alien character in a 2D game window. The alien's position is represented by its coordinates (x, y), and it can be moved based on user input for horizontal and vertical displacements. Write a function `upda... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_alien_position(100, 100, 0, 0, 10, 10) == (10, 10)\", \"assert update_alien_position(100, 100, 0, 0, 150, 150) == (100, 100)\", \"assert update_alien_position(100, 100, 50, 50, -20, -30) == (30, 20)\", \"assert update_alien_position(100, 100, 100, 100... | {
"split": "train",
"index": 1751,
"acecode_id": "oss_13964",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that generates a palette of random RGB colors based on a specified number of colors and ensures that each color in the palette has a minimum difference in hue, saturation, or lightness with respect to other colors in the palette. The function should accept four... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_colors(5, 0.1, 0.2, 0.2) is not None\", \"assert len(generate_colors(5, 0.1, 0.2, 0.2)) == 5\", \"assert all(0 <= channel <= 255 for color in generate_colors(5, 0.1, 0.2, 0.2) for channel in color)\", \"assert len(set(generate_colors(5, 0.1, 0.2, 0.... | {
"split": "train",
"index": 1752,
"acecode_id": "evol_6394",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that counts the number of uppercase letters and digits in a given string. The function should return the results in a formatted dictionary with keys 'Uppercase' and 'Digits'. The input string may contain special characters and unicode characters. Implement the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_uppercase_digits('HELLO 1234!') == {'Uppercase': 5, 'Digits': 4}\", \"assert count_uppercase_digits('abcde') == {'Uppercase': 0, 'Digits': 0}\", \"assert count_uppercase_digits('ABC123') == {'Uppercase': 3, 'Digits': 3}\", \"assert count_uppercase_digi... | {
"split": "train",
"index": 1753,
"acecode_id": "evol_5914",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given two parameters, year and month, which represent a year and a month respectively. Your task is to implement a function called sanitize_query_params that standardizes the month value to a two-digit format and keeps the year value as is. If the month is not provided,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sanitize_query_params('', '1') == ('', '01')\", \"assert sanitize_query_params('2023', '2') == ('2023', '02')\", \"assert sanitize_query_params('2020', '10') == ('2020', '10')\", \"assert sanitize_query_params('1999', '12') == ('1999', '12')\", \"assert sani... | {
"split": "train",
"index": 1754,
"acecode_id": "bigcode_python_fns_2348",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `process_vector(array)` that returns a modified version of the list based on the following rules: If the list is empty or contains only one element, return the list as it is. Otherwise, create a copy of the list, sort it in ascendi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_vector([]) == []\", \"assert process_vector([5]) == [5]\", \"assert process_vector([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert process_vector([4, 3, 2, 1]) == [1, 2, 3, 4]\", \"assert process_vector([2, 4, 6]) == [6, 4, 2]\", \"assert process_vector([1... | {
"split": "train",
"index": 1755,
"acecode_id": "evol_28501",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns the smallest prime number in the list. If there are no prime numbers in the list, return 'No prime numbers found in list'. The function should also handle cases where the list contains non-integer values by returning '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_smallest_prime([12, 27, 9, 11, 15, 3, 20, 5]) == 3\", \"assert get_smallest_prime([1, 4, 6, 8, 10]) == 'No prime numbers found in list'\", \"assert get_smallest_prime([2, 3, 5, 7, 11]) == 2\", \"assert get_smallest_prime([15, 22, 25, 44]) == 'No prime nu... | {
"split": "train",
"index": 1756,
"acecode_id": "evol_35350",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers 'z_in' representing input measurements from a sensor. Your task is to implement a function that computes the average of these measurements and returns a list where each element is the difference between the original measurement and the average. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_differences([1, 2, 3]) == [-1, 0, 1]\", \"assert compute_differences([5, 10, 15]) == [-5, 0, 5]\", \"assert compute_differences([0, 0, 0]) == [0, 0, 0]\", \"assert compute_differences([10]) == [0]\", \"assert compute_differences([-1, 1]) == [-1, 1]\"... | {
"split": "train",
"index": 1757,
"acecode_id": "bigcode_python_fns_29473",
"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 containing only the even numbers from the original list, in the same order they appeared. Write a function called `filter_even_numbers` that implements this functionality. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([1, 2, 3, 4]) == [2, 4]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_numbers([-1, -2, -3, -4]) == [-2, -4]... | {
"split": "train",
"index": 1758,
"acecode_id": "oss_28257",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the factorial of a given non-negative integer n. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. For example, factorial(5) = 5 * 4 * 3 * 2 * 1 = 120. Your func... | 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": 1759,
"acecode_id": "oss_15881",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string 'text' and a dictionary 'citation_map' that maps citation identifiers (UUIDs) to tuples of information, write a function 'find_adjacent_citations' that retrieves all tuples of information corresponding to UUIDs found in the first 50 characters or the last 50 char... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_adjacent_citations('Text without citations.', {'UUID1': ('info1', 'info2')}, True) == []\", \"assert find_adjacent_citations('No citations here.', {'UUID6': ('x', 'y')}, False) == []\", \"assert find_adjacent_citations('Something with citation UUID8.', ... | {
"split": "train",
"index": 1760,
"acecode_id": "bigcode_python_fns_49119",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of boolean values, implement a function `count_group_invariant_inputs(inputs)` that returns the count of distinct group invariant inputs. A group invariant input is defined as a subset of boolean values (of cardinality greater than 1) where all elements are identic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_group_invariant_inputs([True, False]) == 0\", \"assert count_group_invariant_inputs([True, False, True, False]) == 0\", \"assert count_group_invariant_inputs([True, True, False, False]) == 2\", \"assert count_group_invariant_inputs([True, False, True, ... | {
"split": "train",
"index": 1761,
"acecode_id": "oss_35789",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D dataset represented as a list of lists, where each inner list contains numerical values. Your task is to create a function `extract_depth_values(data: List[List[float]], depth: float) -> List[float]` that extracts and returns a list of values from the dataset... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_depth_values([[5.0, 6.0], [5.0, 7.0]], 5.0) == [5.0, 5.0]\", \"assert extract_depth_values([[1.0, 2.0], [3.0, 4.0]], 5.0) == []\", \"assert extract_depth_values([[5.0, 5.0], [5.0, 5.0]], 5.0) == [5.0, 5.0, 5.0, 5.0]\", \"assert extract_depth_values([... | {
"split": "train",
"index": 1762,
"acecode_id": "bigcode_python_fns_38715",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a dictionary containing temperature readings for various cities and returns a modified dictionary. The input dictionary, `temperature_dict`, contains keys representing different cities and corresponding values represent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_temperatures({'CityA': 60, 'CityB': -35, 'CityC': 25}) == {'CityA': 50, 'CityB': -30, 'CityC': 25}\", \"assert process_temperatures({'NewYork': 10, 'LosAngeles': 55, 'Chicago': -15}) == {'NewYork': 10, 'LosAngeles': 50, 'Chicago': -15}\", \"assert pr... | {
"split": "train",
"index": 1763,
"acecode_id": "oss_32952",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a packet routing system for a healthcare network. Create a `Packet` class that represents a packet of data that needs to be routed through the network. The class should have the following attributes: `request` (an integer representing the type o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert (p := Packet(0, 'P123', 'AuthToken1', 'NodeA', '192.168.1.1', 123456, [], 'Sample Data')).encrypt_data('key1') == 'Encrypted: key1-Sample Data'\", \"assert (p := Packet(1, 'P456', 'AuthToken2', 'NodeB', '192.168.1.2', 654321, [], 'Another Data')).encrypt_dat... | {
"split": "train",
"index": 1764,
"acecode_id": "oss_34514",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `take_while(pred: Callable[[Any], bool], lst: List[Any]) -> List[Any]` that takes a predicate function `pred` and a list `lst`. The function should return a new list containing the elements from the start of `lst` while the predicate function returns `True`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert take_while(lambda x: x < 5, [1, 2, 3, 4, 5, 6]) == [1, 2, 3, 4]\", \"assert take_while(lambda x: x % 2 == 0, [2, 4, 6, 1, 8]) == [2, 4, 6]\", \"assert take_while(lambda x: x > 0, [1, 2, 3, -1, 4, 5]) == [1, 2, 3]\", \"assert take_while(lambda x: x != 'stop',... | {
"split": "train",
"index": 1765,
"acecode_id": "bigcode_python_fns_46752",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Define a class named Person with an attribute 'age'. Implement a method named validate_age that checks if age is a positive integer. If the age is not valid, the method should raise a ValueError. Write the validate_age method and demonstrate its functionality. Additionally, exp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Person().validate_age(25) == 25\", \"assert Person().validate_age(0) == 0\", \"assert Person().validate_age(30) == 30\", \"assert Person().validate_age(100) == 100\", \"assert Person().validate_age(1) == 1\", \"assert Person().validate_age(10) == 10\", \"ass... | {
"split": "train",
"index": 1766,
"acecode_id": "evol_19445",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the position of a camera in a 3D graphics application. Given a focal point, a view up vector, and a distance from the focal point, your goal is to compute the camera's position in 3D space. The view direction is determined by the negation of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculateCameraPosition((-288.693092, 228.870041, -91.185421), (0.729526, -0.683360, -0.028488), 653.805539) == (-288.693092 + 653.805539 * -0.729526, 228.870041 + 653.805539 * 0.683360, -91.185421 + 653.805539 * 0.028488)\", \"assert calculateCameraPosition... | {
"split": "train",
"index": 1767,
"acecode_id": "oss_37039",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_phone_number(phone_number: str) -> bool` that checks if a given string conforms to the standard telephone number format used in the United States. The format may include an optional country code, area code in parentheses, and can be separated by s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_phone_number('+1 123-456-7890') == True\", \"assert validate_phone_number('(123) 456-7890') == True\", \"assert validate_phone_number('123.456.7890') == True\", \"assert validate_phone_number('1234567890') == True\", \"assert validate_phone_number('... | {
"split": "train",
"index": 1768,
"acecode_id": "evol_18094",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `process_request(method: str, json_data: Optional[Dict[str, Any]]) -> Tuple[str, int]` that simulates a basic API endpoint. The function should accept a request method (either 'GET' or 'POST') and an optional JSON payload as a dictionary. For a 'GET' reques... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_request('GET', None) == ('Hello World!', 200)\", \"assert process_request('POST', None) == ('Missing JSON in request', 400)\", \"assert process_request('POST', 'string_instead_of_dict') == ('Missing JSON in request', 400)\", \"assert process_request(... | {
"split": "train",
"index": 1769,
"acecode_id": "evol_30433",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns the sum of all the even integers in that list. The function should iterate through the list and identify even numbers, summing them up as it goes. If there are no even numbers in the list, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_even_numbers([0, 1, 2, 3, 4]) == 6\", \"assert sum_even_numbers([]) == 0\", \"assert sum_even_numbers([-2, -1, 0, 1, 2]) == 0\", \"assert sum_even_numbers([2, 4, 6, 8]) == 20\", \"assert sum_even_numbers... | {
"split": "train",
"index": 1770,
"acecode_id": "oss_10406",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a tuple of colors, implement a function `extract_third_last(colors)` that returns the third last item in the tuple. If the tuple has fewer than three items, return a meaningful message indicating that the tuple is too small to have a third last item.\nPlease reason step b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_third_last(('red', 'blue')) == 'Tuple is too small to have a third last item'\", \"assert extract_third_last(('red', 'blue', 'green')) == 'red'\", \"assert extract_third_last(('red', 'blue', 'green', 'yellow')) == 'blue'\", \"assert extract_third_las... | {
"split": "train",
"index": 1771,
"acecode_id": "evol_11704",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a ternary search on a sorted array of integers. The function should take a sorted array, the target integer to search for, and return the index of the target integer if it exists in the array. If the target integer is not found, return -1. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ternary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert ternary_search([1, 2, 3, 4, 5], 1) == 0\", \"assert ternary_search([1, 2, 3, 4, 5], 5) == 4\", \"assert ternary_search([1, 2, 3, 4, 5], 6) == -1\", \"assert ternary_search([], 1) == -1\", \"assert ternary_s... | {
"split": "train",
"index": 1772,
"acecode_id": "evol_29579",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of dictionaries, each representing a user's profile with a 'name' and a 'valid' date string in the format 'YYYY-MM-DD'. Your function should return a list of tuples where each tuple contains the user's name and their cor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_profiles([{'name': 'Alice', 'valid': '2023-10-01'}, {'name': 'Bob', 'valid': '2023-09-30'}]) == [('Alice', datetime(2023, 10, 1)), ('Bob', datetime(2023, 9, 30))]\", \"assert process_profiles([{'name': 'Charlie', 'valid': '2022-12-15'}, {'name': 'Dav... | {
"split": "train",
"index": 1773,
"acecode_id": "bigcode_python_fns_40717",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of user input commands, where each command is a string. The function should ignore any commands that are empty or contain only whitespace. Additionally, the function should stop processing commands when it encounters... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_commands(['command1', ' command2 ', '', ' ', 'break']) == ['command1', 'command2']\", \"assert process_commands([' exit ', 'valid command']) == []\", \"assert process_commands(['command1', 'command2', 'quit', 'command3']) == ['command1', 'command... | {
"split": "train",
"index": 1774,
"acecode_id": "bigcode_python_fns_14219",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine the type of GPS message publisher to create based on the availability of a specific message type. Implement the function `initialize_gps_publisher` that checks if the message type `NavSatFix` is available. If it is availa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_gps_publisher(True) == 'NavSatFix Publisher'\", \"assert initialize_gps_publisher(False) == 'PointStamped Publisher'\", \"assert initialize_gps_publisher(True) == 'NavSatFix Publisher'\", \"assert initialize_gps_publisher(False) == 'PointStamped P... | {
"split": "train",
"index": 1775,
"acecode_id": "oss_33305",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing file names along with their extensions. Your task is to extract the base file names (without extensions) from the list and return them as a new list. For example, given the input ['file1.zip', 'document.pdf', 'image.jpeg'], the outpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_base_filenames(['file1.zip', 'document.pdf', 'image.jpeg']) == ['file1', 'document', 'image']\", \"assert extract_base_filenames(['archive.tar', 'notes.txt', 'photo']) == ['archive', 'notes', 'photo']\", \"assert extract_base_filenames(['data.json', ... | {
"split": "train",
"index": 1776,
"acecode_id": "bigcode_python_fns_43950",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the motion of a particle under the influence of forces in a physics simulation. Given the current position, velocity, and acceleration of a particle, as well as a time step, implement a function that calculates the new position and velocity of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_particle(0.0, 1.0, 0.0, 1.0) == (1.0, 1.0)\", \"assert update_particle(10.0, -1.0, 0.0, 1.0) == (9.0, -1.0)\", \"assert update_particle(1.0, 0.0, 0.0, 10.0) == (1.0, 0.0)\", \"assert update_particle(0.0, 0.0, 0.0, 1.0) == (0.0, 0.0)\", \"assert update... | {
"split": "train",
"index": 1777,
"acecode_id": "bigcode_python_fns_39241",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and two integer parameters, `start` and `end`. The function should return a list of strings representing ranges of numbers within the given list, based on the following rules: - If a single number is miss... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_ranges([1, 3, 50, 100], 0, 100) == ['0', '2', '4->49', '51->99']\", \"assert find_ranges([5, 6, 7], 0, 10) == ['0->4', '8->10']\", \"assert find_ranges([10, 20, 30], 0, 40) == ['0->9', '11->19', '21->29', '31->40']\", \"assert find_ranges([], 0, 5) == [... | {
"split": "train",
"index": 1778,
"acecode_id": "oss_23528",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total training time for a set of learners and checks if the total training time exceeds a specified time limit. The function should take a list of tuples, where each tuple contains the learner's ID as a string and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_training_time([('learner1', 2.5), ('learner2', 3.0)], 6.0) == 5.5\", \"assert check_training_time([('learner1', 1.0), ('learner2', 2.0), ('learner3', 3.0)], 5.0) == 'Total training time limit exceeded'\", \"assert check_training_time([('learner1', 1.0)... | {
"split": "train",
"index": 1779,
"acecode_id": "oss_27828",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of group names represented as strings. Your task is to write a function that checks for duplicate group names in the list. The function should return True if there are no duplicates, and if there are duplicates, it should return a list of those duplicate na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_duplicate_group_names(['admin', 'user', 'guest', 'user']) == ['user']\", \"assert check_duplicate_group_names(['admin', 'user', 'guest', 'admin', 'user']) == ['admin', 'user']\", \"assert check_duplicate_group_names(['admin', 'admin', 'admin']) == ['ad... | {
"split": "train",
"index": 1780,
"acecode_id": "bigcode_python_fns_12039",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `parse_nested_parens(paren_string: str) -> List[int]` that takes a string containing groups of nested parentheses separated by spaces and returns a list of integers representing the maximum depth of nested parentheses for each group. A group is defined as a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_nested_parens('() () ()') == [1, 1, 1]\", \"assert parse_nested_parens('(()()(()))') == [3]\", \"assert parse_nested_parens('(((((())))))') == [6]\", \"assert parse_nested_parens('() () (()) (())') == [1, 1, 2, 2]\", \"assert parse_nested_parens('(((()... | {
"split": "train",
"index": 1781,
"acecode_id": "evol_24535",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of repository names, your task is to create a function that returns a new list of repository names with the prefix 'radiasoft/' added to each name if it is not already present. If a repository name already has the prefix, it should remain unchanged. Write a functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_radiasoft_prefix(['repo1', 'repo2', 'radiasoft/repo3']) == ['radiasoft/repo1', 'radiasoft/repo2', 'radiasoft/repo3']\", \"assert add_radiasoft_prefix(['radiasoft/repoA', 'repoB']) == ['radiasoft/repoA', 'radiasoft/repoB']\", \"assert add_radiasoft_prefix... | {
"split": "train",
"index": 1782,
"acecode_id": "bigcode_python_fns_10767",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function called `organize_files` that simulates organizing files from a source directory into multiple destination directories based on specific criteria. The function should take in the following parameters: a list of file names (strings) ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_files(['dir1_file1.txt', 'dir2_file1.txt', 'dir3_file1.txt'], {}) == {'c1': ['dir1_file1.txt'], 'c2': ['dir2_file1.txt'], 'c3': ['dir3_file1.txt']}\", \"assert organize_files(['dir1_file2.txt', 'dir1_file3.txt'], {}) == {'c1': ['dir1_file2.txt', 'di... | {
"split": "train",
"index": 1783,
"acecode_id": "oss_17929",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function `sum_of_squares(arr)` that computes and returns the sum of the squares of each integer in the array.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code blo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares([2, 5, 6]) == 65\", \"assert sum_of_squares([0]) == 0\", \"assert sum_of_squares([-1, -2, -3]) == 14\", \"assert sum_of_squares([1, 2, 3]) == 14\", \"assert sum_of_squares([10, 20, 30]) == 1400\", \"assert sum_of_squares([]) == 0\", \"assert s... | {
"split": "train",
"index": 1784,
"acecode_id": "evol_18097",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that computes the binary XOR of two given strings, where each string contains only the characters '0' and '1'. The function should then identify the longest alternating subsequence from the XOR result (a sequence where no two adjacent elements are the same) a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_xor_alternating_subseq_indices('1111', '0000') == ('', -1, -1)\", \"assert string_xor_alternating_subseq_indices('00000', '11111') == ('', -1, -1)\", \"assert string_xor_alternating_subseq_indices('11110000', '00001111') == ('', -1, -1)\", \"assert st... | {
"split": "train",
"index": 1785,
"acecode_id": "evol_30007",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that transforms the array into a string of numbers separated by commas. The numbers should be sorted first by the number of divisors they have in descending order, and if two numbers have the same number of divisors, they should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ordered_array([10, 5, 15]) == '10,15,5'\", \"assert ordered_array([12, 6, 28]) == '12,28,6'\", \"assert ordered_array([50, 75, 25, 100]) == '100,50,75,25'\", \"assert ordered_array([16, 12, 8]) == '12,16,8'\", \"assert ordered_array([7, 14, 21]) == '14,21,7'... | {
"split": "train",
"index": 1786,
"acecode_id": "evol_28801",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes two sorted lists and merges them into a single sorted list in ascending order. After merging, reverse the elements of the merged list. Note that you should not use any built-in Python methods for sorting or reversing. The function should handl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_and_reverse([1, 2, 3], [4, 5, 6]) == [6, 5, 4, 3, 2, 1]\", \"assert merge_and_reverse([], []) == []\", \"assert merge_and_reverse([1, 3, 5], [2, 4, 6]) == [6, 5, 4, 3, 2, 1]\", \"assert merge_and_reverse([10, 20], [5, 15, 25]) == [25, 20, 15, 10, 5]\",... | {
"split": "train",
"index": 1787,
"acecode_id": "evol_28852",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of students in a class. Your task is to implement a function `filter_excess_heterozygosity(scores: List[int], threshold: int) -> List[int]` that filters out the scores that are above a specified threshold. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_excess_heterozygosity([45, 78, 56, 89, 90, 34], 75) == [45, 56, 34]\", \"assert filter_excess_heterozygosity([100, 50, 60, 80], 70) == [50, 60]\", \"assert filter_excess_heterozygosity([], 50) == []\", \"assert filter_excess_heterozygosity([10, 20, 30... | {
"split": "train",
"index": 1788,
"acecode_id": "bigcode_python_fns_1446",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two matrices of the same dimensions, implement a function `subtract_matrices(mat1, mat2)` that returns a new matrix representing the element-wise subtraction of the two input matrices. The function should take two 2D lists (matrices) as input and return a 2D list (matrix)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subtract_matrices([[10, 9], [8, 5]], [[2, 3], [4, 1]]) == [[8, 6], [4, 4]]\", \"assert subtract_matrices([[1, 2], [3, 4]], [[1, 1], [1, 1]]) == [[0, 1], [2, 3]]\", \"assert subtract_matrices([[5, 5], [5, 5]], [[5, 5], [5, 5]]) == [[0, 0], [0, 0]]\", \"assert... | {
"split": "train",
"index": 1789,
"acecode_id": "evol_14532",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples, where each tuple contains an event name (a string) and its corresponding date (a datetime object), your task is to create a function that extracts the dates from the list and formats them as strings enclosed in double quotes with an equal sign prefix. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert event_date_row([('Meeting', datetime(2023, 10, 1)), ('Conference', datetime(2023, 10, 2))]) == ['', '', '', '', '', '', '=\\\"2023-10-01 00:00:00\\\"', '=\\\"2023-10-02 00:00:00\\\"']\", \"assert event_date_row([('Webinar', datetime(2023, 5, 15)), ('Workshop... | {
"split": "train",
"index": 1790,
"acecode_id": "bigcode_python_fns_47438",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves details about a source type given its unique ID. The function should take an integer source_type_id as input and return a dictionary containing the details of the source type. If the source type does not exist, the function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_source_type_details(1) == {'id': 1, 'name': 'Type A', 'description': 'Description A'}\", \"assert get_source_type_details(2) == {'id': 2, 'name': 'Type B', 'description': 'Description B'}\", \"assert get_source_type_details(6) == None\", \"assert get_sou... | {
"split": "train",
"index": 1791,
"acecode_id": "bigcode_python_fns_45145",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `process_string(input_string)` that takes a string `input_string` as input and returns a modified version of the string based on the following rules: 1. Convert all lowercase letters in the string to uppercase. 2. Remove all digits from the string. 3. Replace a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_string('Test#case!') == 'TEST CASE '\", \"assert process_string('LowEr123case#') == 'LOWERCASE '\", \"assert process_string('1234567890') == ''\", \"assert process_string('Special*Chars#') == 'SPECIAL CHARS '\", \"assert process_string('UpperCASE!') ... | {
"split": "train",
"index": 1792,
"acecode_id": "oss_27297",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `handle_error` that takes an exception object as input and returns a corresponding error response based on the type of exception. The function should handle three specific types of exceptions: `XMLError`, `EquipamentoNotFoundError`, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_error(EquipamentoNotFoundError('Equipamento not found', id_equipamento=42)) == (117, 42)\", \"assert handle_error(TipoAcessoDoesNotExist('Access type does not exist', id_tipo_acesso=7)) == (171, 7)\", \"assert handle_error(ValueError('Some value error... | {
"split": "train",
"index": 1793,
"acecode_id": "oss_12645",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that simulates a simple game on a grid. The game involves a player navigating through a grid-based world, represented by a 2D array. The player starts at the top-left corner of the grid and must reach the bottom-right corner wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert grid_game([[1, 0, 0], [0, 0, 0], [1, 1, 0]]) == 3\", \"assert grid_game([[0, 0, 0], [0, 1, 0], [0, 0, 0]]) == 5\", \"assert grid_game([[0, 1, 0, 0], [0, 1, 1, 0], [0, 0, 0, 0]]) == 6\", \"assert grid_game([[0, 0, 0], [1, 1, 0], [0, 0, 0]]) == 5\", \"assert g... | {
"split": "train",
"index": 1794,
"acecode_id": "oss_28397",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that finds an available port number for a server on localhost. The function should take an optional integer parameter, `preferred_port`. If `preferred_port` is provided, your function should check the range from `preferred_port` to `prefe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_available_port(3000) in range(3000, 3020)\", \"assert find_available_port(5000) in range(5000, 5020)\", \"assert find_available_port() > 0\", \"assert find_available_port(8080) in range(8080, 8100)\", \"assert find_available_port(9000) in range(9000, 90... | {
"split": "train",
"index": 1795,
"acecode_id": "bigcode_python_fns_1389",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines if a specific string exists within a given list of strings. The function should take in two parameters: a list of strings and a target string. If the target string exists in the list, the function should return True; o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exists_in_list(['apple', 'banana', 'cherry'], 'banana') == True\", \"assert exists_in_list(['apple', 'banana', 'cherry'], 'orange') == False\", \"assert exists_in_list(['one', 'two', 'three'], 'three') == True\", \"assert exists_in_list(['one', 'two', 'three... | {
"split": "train",
"index": 1796,
"acecode_id": "bigcode_python_fns_30662",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns a new list containing only the unique elements from the original list in the order they first appeared. The input list may contain duplicates. For example, if the input is [3, 2, 5, 7, 2, 3, 5, 7, 8, 9, 3, 5], the outp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([3, 2, 5, 7, 2, 3, 5, 7, 8, 9, 3, 5]) == [3, 2, 5, 7, 8, 9]\", \"assert remove_duplicates([1, 1, 1, 1]) == [1]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([10, 20, 10, 30, 20, 40]) == [10, 20, 30, 40]\", \"assert r... | {
"split": "train",
"index": 1797,
"acecode_id": "evol_6548",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of notebook entries, each represented by a tuple containing a notebook name and a library name, implement a function that returns the list of notebooks in reverse order based on their appearance in the input list. The input will be a list of tuples, and the output ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_notebook_order([('Math', 'Library1'), ('Science', 'Library2'), ('History', 'Library3')]) == ['History', 'Science', 'Math']\", \"assert reverse_notebook_order([('Notebook1', 'LibA'), ('Notebook2', 'LibB')]) == ['Notebook2', 'Notebook1']\", \"assert re... | {
"split": "train",
"index": 1798,
"acecode_id": "bigcode_python_fns_43476",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that takes a list of strings and returns the concatenation of those strings in alphabetical order. The function should handle an empty list by returning an empty string.\nPlease reason step by step, then write a self-contained Python solution. Give your final ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate_sorted_strings(['Hello', 'World', 'Programming', 'Language']) == 'HelloLanguageProgrammingWorld'\", \"assert concatenate_sorted_strings(['apple', 'banana', 'cherry']) == 'applebananacherry'\", \"assert concatenate_sorted_strings(['Zebra', 'apple'... | {
"split": "train",
"index": 1799,
"acecode_id": "evol_33704",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.