data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a unique name for a hardware render panel. The function should take in a variable number of string arguments, where each argument represents a component type (e.g., 'GPU', 'CPU', 'RAM') associated with the render panel. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_panel_name('GPU', 'CPU') == 'GPU-CPU'\", \"assert generate_panel_name('RAM', 'GPU', 'CPU') == 'RAM-GPU-CPU'\", \"assert generate_panel_name('SSD') == 'SSD'\", \"assert generate_panel_name() == 'No Components'\", \"assert generate_panel_name('GPU') =...
{ "split": "train", "index": 74200, "acecode_id": "bigcode_python_fns_11336", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that counts the occurrences of a specific target word within a given text. The function should be case-insensitive and should only consider whole word matches. The input text may contain punctuation and special characters, but the tar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_word_occurrences('The mouse found a find_result, but the mouse was not happy with the find_result', 'find_result') == 2\", \"assert count_word_occurrences('The quick brown fox jumps over the lazy dog', 'cat') == 0\", \"assert count_word_occurrences('He...
{ "split": "train", "index": 74201, "acecode_id": "oss_31830", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that performs operations on a list of integers. Your function should take a list of integers as input and perform the following operations: 1. Create a new list containing the squares of the input list elements. 2. Create a new lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_operations([1, 2, 3]) == {'squares': [1, 4, 9], 'combinations': [(1, 2), (1, 3), (2, 1), (2, 3), (3, 1), (3, 2)], 'doubled': [2, 4, 6]}\", \"assert list_operations([0]) == {'squares': [0], 'combinations': [], 'doubled': [0]}\", \"assert list_operations(...
{ "split": "train", "index": 74202, "acecode_id": "oss_12309", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a sorted list of prime numbers, implement a function `find_large_missing_prime(primes)` that returns the largest prime number that is missing from the list. If no prime number is missing, return -1. The function should handle large sequences efficiently. The input list wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_large_missing_prime([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]) == 53\", \"assert find_large_missing_prime([2, 3, 5, 7, 11, 13]) == 17\", \"assert find_large_missing_prime([2, 3, 5, 7, 11, 13, 17, 19]) == 23\", \"assert find_large_missing_...
{ "split": "train", "index": 74203, "acecode_id": "evol_14843", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two distinct lists of integers, create a function that generates a rolling list of the maximum values found in both lists up to the current index. The function should return a list where each element at index i is the maximum value from the start up to index i in both inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rolling_max([1, 2, 3], []) == [1, 2, 3]\", \"assert rolling_max([-1, -2, -3], [-1, -4, -2]) == [-1, -1, -1]\", \"assert rolling_max([0, 0, 0], [0, 0, 0]) == [0, 0, 0]\", \"assert rolling_max([3, 5, 1], [2, 6, 4]) == [3, 6, 6]\", \"assert rolling_max([1], [5]...
{ "split": "train", "index": 74204, "acecode_id": "evol_23964", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string contains a key-value pair in the format 'key=value'. Your task is to construct a dictionary by splitting each string at the first '=' character. If a string does not contain '=', it should be ignored. The values in the key-value...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_dictionary({'name': 'Alice', 'age': '30'}, ['greeting={name}', 'age={age}', 'invalid pair']) == {'greeting': 'Alice', 'age': '30'}\", \"assert construct_dictionary({}, ['key1=value1', 'key2=value2']) == {'key1': 'value1', 'key2': 'value2'}\", \"ass...
{ "split": "train", "index": 74205, "acecode_id": "bigcode_python_fns_9105", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `is_ambigram(text: str) -> bool` that determines whether a given string `text` is an ambigram. An ambigram is a word that can be rotated 180 degrees and still appear the same. The function should be case-insensitive and only consider the characters that are...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_ambigram('pud') == False\", \"assert is_ambigram('010') == True\", \"assert is_ambigram('hooh') == True\", \"assert is_ambigram('a') == True\", \"assert is_ambigram('m') == True\", \"assert is_ambigram('p') == False\", \"assert is_ambigram('q') == False\"...
{ "split": "train", "index": 74206, "acecode_id": "evol_6328", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given two parameters: a string 'applicability_code' and a string 'amount'. Your task is to implement a function that checks the validity of the input based on the following rules: If 'applicability_code' is 'mandatory', then 'amount' must not be an empty string. If 'app...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_validity('mandatory', '100') == True\", \"assert check_validity('mandatory', '') == False\", \"assert check_validity('not permitted', '') == True\", \"assert check_validity('not permitted', '50') == False\", \"assert check_validity('mandatory', '0') ==...
{ "split": "train", "index": 74207, "acecode_id": "bigcode_python_fns_7875", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two dictionaries representing columns from two different tables in a database. Each dictionary contains the table name and column name. Your task is to create a function that verifies if the columns from the two dictionaries can be joined. The function should chec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_join({'table1': {'columns': {'id': 'int', 'name': 'string'}}, 'table2': {'columns': {'id': 'int', 'age': 'int'}}}, {'column': {'table': 'table1', 'name': 'id'}}, {'column': {'table': 'table2', 'name': 'id'}}) == 'Columns can be joined.'\", \"assert can_j...
{ "split": "train", "index": 74208, "acecode_id": "bigcode_python_fns_16280", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a complete Docker image tag based on given specifications. The function should take a dictionary containing the image specifications and a boolean value. The dictionary will have a key 'tag' which represents the base tag of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_docker_image_tag({'tag': 'my_image'}, True) == 'my_image:experiment_1'\", \"assert get_docker_image_tag({'tag': 'my_image'}, False) == 'my_image'\", \"assert get_docker_image_tag({'tag': 'test_image'}, True) == 'test_image:experiment_1'\", \"assert get_d...
{ "split": "train", "index": 74209, "acecode_id": "bigcode_python_fns_4815", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing scores of students in a class. Your task is to implement a function `calculate_average_score(scores: List[int]) -> float` that calculates the average score of the students. The average score is defined as the total sum of scores div...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_score([90, 80, 70]) == 80.0\", \"assert calculate_average_score([100, 90, 80, 75]) == 86.25\", \"assert calculate_average_score([-10, -20, -30]) == -20.0\", \"assert calculate_average_score([0, 0, 0]) == 0.0\", \"assert calculate_average_sc...
{ "split": "train", "index": 74210, "acecode_id": "bigcode_python_fns_26277", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string and a number of partitions, decide if the string can be partitioned into the specified number of substrings which are anagrams of each other. A string can be partitioned into anagrams if all substrings have the same characters in the same frequency. Implement the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_anagram_partitions('helloworld', 2) == False\", \"assert check_anagram_partitions('xyzxyz', 2) == True\", \"assert check_anagram_partitions('abcabcabc', 3) == True\", \"assert check_anagram_partitions('abcd', 2) == False\", \"assert check_anagram_parti...
{ "split": "train", "index": 74211, "acecode_id": "evol_3202", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple logging system for a Python application. The system should support logging messages at different levels (e.g., INFO, WARNING, ERROR) and provide the ability to filter messages based on their level. Implement a function `log_messages(mes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_messages([('This is an informational message', 'INFO'), ('This is a warning message', 'WARNING'), ('This is an error message', 'ERROR')], 'INFO') == ['This is an informational message', 'This is a warning message', 'This is an error message']\", \"assert...
{ "split": "train", "index": 74212, "acecode_id": "oss_6919", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing healthcare practices by calculating the total revenue generated based on the number of patients treated and the average revenue per patient. Write a function named `calculate_revenue` that takes two parameters: `num_patients` (an integer representin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_revenue(0, 100.0) == 0.0\", \"assert calculate_revenue(10, 0.0) == 0.0\", \"assert calculate_revenue(5, -50.0) == 0.0\", \"assert calculate_revenue(-5, 100.0) == 0.0\", \"assert calculate_revenue(3, 20.0) == 60.0\", \"assert calculate_revenue(7, 15...
{ "split": "train", "index": 74213, "acecode_id": "oss_9761", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a role policy document in JSON format for an AWS IAM role. The function should accept a string parameter `role_name` and return a JSON string that represents the role policy document. The JSON should include the version, ef...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_role_policy('Role1') == '{\\\"Version\\\": \\\"2012-10-17\\\", \\\"Statement\\\": [{\\\"Effect\\\": \\\"Allow\\\", \\\"Principal\\\": {\\\"Service\\\": \\\"lambda.amazonaws.com\\\"}, \\\"Action\\\": \\\"sts:AssumeRole\\\"}]}'\", \"assert generate_ro...
{ "split": "train", "index": 74214, "acecode_id": "bigcode_python_fns_31247", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing token IDs and an integer representing the end-of-sequence (EOS) token ID. Your task is to implement a function `decode_sequence(token_ids: List[int], eos_id: int) -> List[int]` that simulates a greedy decoding process. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_sequence([1, 2, 3, 4, 5], 3) == [1, 2, 3]\", \"assert decode_sequence([1, 2, 3, 4, 5], 6) == [1, 2, 3, 4, 5]\", \"assert decode_sequence([], 1) == []\", \"assert decode_sequence([6, 7, 8, 9], 6) == [6]\", \"assert decode_sequence([1, 2, 3, 4, 5, 3], 3...
{ "split": "train", "index": 74215, "acecode_id": "bigcode_python_fns_29315", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a dictionary with string keys and integer values as input and returns a list of tuples containing the key-value pairs from the dictionary. Implement the function `map_to_seq` which will take a dictionary `xs` and return a l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert map_to_seq({'a': 1, 'b': 2, 'c': 3}) == [('a', 1), ('b', 2), ('c', 3)]\", \"assert map_to_seq({'x': 10, 'y': 20}) == [('x', 10), ('y', 20)]\", \"assert map_to_seq({'key1': 5, 'key2': 15, 'key3': 25}) == [('key1', 5), ('key2', 15), ('key3', 25)]\", \"assert m...
{ "split": "train", "index": 74216, "acecode_id": "oss_33249", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the root of a binary tree, implement a function that determines if the tree is height-balanced. A height-balanced binary tree is defined as one where the height difference between the left and right subtrees of any node does not exceed 1. Write a function `isBalanced(root...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isBalanced(TreeNode(3)) == True\", \"assert isBalanced(TreeNode(1, TreeNode(2), TreeNode(2))) == True\", \"assert isBalanced(TreeNode(1, TreeNode(2, TreeNode(3, TreeNode(4))), TreeNode(2))) == False\", \"assert isBalanced(TreeNode(1, TreeNode(2), None)) == T...
{ "split": "train", "index": 74217, "acecode_id": "evol_16843", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function `harmonic_mean(nums)` that takes a list of three numbers and calculates the harmonic mean of these numbers. If any number is zero, it should be ignored in the calculation. If all numbers are zero or negative, the function should return 0. The result should be r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert harmonic_mean([1, 2, 3]) == 1.64\", \"assert harmonic_mean([-1, -2, -3]) == 0\", \"assert harmonic_mean([0, 0, 0]) == 0\", \"assert harmonic_mean([1, 0, 3]) == 1.5\", \"assert harmonic_mean([4, 0, 6]) == 4.8\", \"assert harmonic_mean([3, 3, 3]) == 3.0\", \"a...
{ "split": "train", "index": 74218, "acecode_id": "evol_11546", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of quantum states represented as 2D arrays (matrices) and their corresponding probabilities of occurrence. Your task is to determine whether the quantum states are globally distinguishable given their probabilities. Global distinguishability means that ther...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert state_distinguishability([[[1, 0], [0, 0]], [[0, 1], [1, 0]]], [0.5, 0.5]) == 1\", \"assert state_distinguishability([[[1, 0], [0, 0]], [[0, 0], [0, 1]]], [0.3, 0.7]) == 1\", \"assert state_distinguishability([[[1, 0], [0, 0]], [[0, 1], [0, 0]]], [0.25, 0.75...
{ "split": "train", "index": 74219, "acecode_id": "bigcode_python_fns_9488", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates switching to TCP/IP mode on a device. The function should take two parameters: an integer 'port' that represents the port number (default value is 5555) and a boolean 'debug' that represents whether debugging is enabled...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert switch_to_tcpip() == 'Switched to TCP/IP mode on port 5555.'\", \"assert switch_to_tcpip(8080) == 'Switched to TCP/IP mode on port 8080.'\", \"assert switch_to_tcpip(1) == 'Switched to TCP/IP mode on port 1.'\", \"assert switch_to_tcpip(65535) == 'Switched t...
{ "split": "train", "index": 74220, "acecode_id": "bigcode_python_fns_4549", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the lengths of movies and an integer representing the total flight length. Your task is to determine if there are two distinct movies in the list that, when their lengths are added together, equal the flight length. Implement a func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_watch_two_movies([90, 120, 150, 200], 210) == True\", \"assert can_watch_two_movies([60, 70, 80, 90], 150) == True\", \"assert can_watch_two_movies([30, 60, 90, 120], 150) == True\", \"assert can_watch_two_movies([45, 55, 75, 85], 130) == True\", \"asser...
{ "split": "train", "index": 74221, "acecode_id": "bigcode_python_fns_21795", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of sensor measurements represented as a list of floats. Your task is to implement a function `calibrate_sensor(sensor: str, measurements: List[float]) -> List[float]` that calibrates the sensor measurements. The calibration process should apply a simple lin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calibrate_sensor('temperature', [20.0, 25.0, 30.0]) == [18.0, 23.0, 28.0]\", \"assert calibrate_sensor('pressure', [100.0, 101.0, 102.0]) == [105.0, 106.0, 107.0]\", \"assert calibrate_sensor('unknown', [10.0, 15.0, 20.0]) == [10.0, 15.0, 20.0]\", \"assert c...
{ "split": "train", "index": 74222, "acecode_id": "oss_22585", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `nextIntInRange(low: int, high: int) -> int` that returns a random integer in the range from `low` to `high` (inclusive). The function should use the built-in random module to generate random numbers. Ensure that `low` is less than or equal to `high`. If th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nextIntInRange(1, 10) in range(1, 11)\", \"assert nextIntInRange(0, 0) == 0\", \"assert nextIntInRange(-5, 5) in range(-5, 6)\", \"assert nextIntInRange(-10, -1) in range(-10, 0)\", \"assert nextIntInRange(100, 200) in range(100, 201)\", \"assert nextIntInRa...
{ "split": "train", "index": 74223, "acecode_id": "evol_21875", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes two numbers as inputs, which can be either integers or floating-point numbers, and returns their sum rounded to two decimal places. Implement the function `addTwoNumbers(a, b)` where `a` and `b` are the input numbers.\nPlease reason step by step, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert addTwoNumbers(5, 10) == 15.00\", \"assert addTwoNumbers(1.23, 4.56) == 5.79\", \"assert addTwoNumbers(10, 5.67) == 15.67\", \"assert addTwoNumbers(-1.5, 2.5) == 1.00\", \"assert addTwoNumbers(3.14159, 2.71828) == 5.86\", \"assert addTwoNumbers(-3, -7) == -10...
{ "split": "train", "index": 74224, "acecode_id": "evol_10411", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `apply_to_each` that takes a lambda expression and a list of numbers as parameters. The function should apply the lambda expression to each element in the list and return a new list with the results. If any element in the list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_to_each(lambda x: x ** 2, [1, 2, 3, 4]) == [1, 4, 9, 16]\", \"assert apply_to_each(lambda x: x ** 2, [0, -1, -2]) == [0, 1, 4]\", \"assert apply_to_each(lambda x: x ** 2, [1.5, 2.5, 3.5]) == [2.25, 6.25, 12.25]\", \"assert apply_to_each(lambda x: x ** ...
{ "split": "train", "index": 74225, "acecode_id": "evol_24401", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of items sold in a store over a week (7 days). Your task is to implement a function that calculates the total number of items sold over the week and returns this total. The input to the function will be a list of 7 intege...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_sales([10, 20, 30, 40, 50, 60, 70]) == 280\", \"assert total_sales([0, 0, 0, 0, 0, 0, 0]) == 0\", \"assert total_sales([1, 1, 1, 1, 1, 1, 1]) == 7\", \"assert total_sales([7, 14, 21, 28, 35, 42, 49]) == 196\", \"assert total_sales([100, 200, 300, 400, ...
{ "split": "train", "index": 74226, "acecode_id": "oss_15304", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a synthetic dataset based on sine wave functions. Write a function `generate_sine_data(no: int, seq_len: int, dim: int) -> List[List[List[float]]]` that generates `no` samples of sine wave time-series data. Each sample should consist of a time-ser...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_sine_data(3, 6, 2)) == 3\", \"assert len(generate_sine_data(1, 1, 1)[0][0]) == 1\", \"assert all(0 <= val <= 1 for sample in generate_sine_data(5, 10, 2) for feature in sample for val in feature)\", \"assert generate_sine_data(0, 5, 2) == []\", ...
{ "split": "train", "index": 74227, "acecode_id": "bigcode_python_fns_42292", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of job objects, where each job has a method `status()` that returns a string indicating the current status of the job. Your task is to implement a function `check_all_jobs_status(jobs)` that accepts a list of job objects and returns a list of booleans indic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_all_jobs_status([MockJob('finished'), MockJob('running')]) == [True, False]\", \"assert check_all_jobs_status([MockJob('failed'), MockJob('finished'), MockJob('running')]) == [False, True, False]\", \"assert check_all_jobs_status([MockJob('running'), M...
{ "split": "train", "index": 74228, "acecode_id": "evol_20117", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `apply_active_filters(data: List[str], filters: List[Tuple[List[str], bool]]) -> List[str]` that filters a dataset of strings based on a set of filters. Each filter is defined by a list of words and a boolean indicating whether the filter is act...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_active_filters(['apple banana', 'banana apple', 'citrus'], [(['banana'], True), (['apple'], True)]) == ['apple banana', 'banana apple']\", \"assert apply_active_filters(['foo bar', 'bar foo', 'baz'], [(['foo'], True), (['baz'], True)]) == []\", \"asser...
{ "split": "train", "index": 74229, "acecode_id": "oss_32763", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a device type, return the appropriate distributed strategy and the number of replicas for a given device. The possible device types are 'TPU', 'GPU', and 'CPU'. The function should behave as follows: If the device is 'TPU', return a mock strategy str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_device_strategy('TPU') == ('TPUStrategy', 8)\", \"assert get_device_strategy('tpu') == ('TPUStrategy', 8)\", \"assert get_device_strategy('GPU') == ('GPUStrategy', 1)\", \"assert get_device_strategy('gpu') == ('GPUStrategy', 1)\", \"assert get_device_str...
{ "split": "train", "index": 74230, "acecode_id": "bigcode_python_fns_14513", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Construct a Python function that calculates the factorial of a non-negative integer. This function should take two optional parameters: the first optional parameter is a power that raises each integer in the factorial computation to that power, and the second optional parameter...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(5) == 120\", \"assert factorial(3, 2) == 36\", \"assert factorial(5, 2, 10) == 0\", \"assert factorial(10, 3, 100) == 0\", \"assert factorial(2, 5) == 32\", \"assert factorial(5, 0, 100) =...
{ "split": "train", "index": 74231, "acecode_id": "evol_13919", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a function `calculate_circle_area(radius)` that calculates the area of a circle given its radius. The function should accept a numeric input for the radius and return the area calculated using the formula A = πr². If the input is non-numeric or negative, the function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_circle_area(1) == 3.141592653589793\", \"assert calculate_circle_area(2) == 12.566370614359172\", \"assert calculate_circle_area(3) == 28.274333882308138\", \"assert calculate_circle_area(4) == 50.26548245743669\", \"assert calculate_circle_area(5)...
{ "split": "train", "index": 74232, "acecode_id": "evol_11822", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a file validation result. Each dictionary contains the following keys: 'filepath' (a string representing the path to the file), 'is_valid' (a boolean indicating whether the file is valid), and 'object_result...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert summarize_validation_results([{'filepath': 'file3.txt', 'is_valid': True, 'object_results': [{'warnings': ['Warning 1'], 'errors': []}]}]) == 'file3.txt: Valid\\\\nWarnings: Warning 1\\\\nErrors: None'\", \"assert summarize_validation_results([{'filepath': '...
{ "split": "train", "index": 74233, "acecode_id": "bigcode_python_fns_14542", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents the result of an operation. The dictionary may contain a key 'status' indicating the status of the operation and a key 'httpErrorStatusCode' indicating the HTTP response code. If the status is 'DONE', return the HTTP response code from...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_http_response_code({'status': 'DONE', 'httpErrorStatusCode': 404}, '') == 404\", \"assert get_http_response_code({'status': 'DONE'}, '') == 200\", \"assert get_http_response_code({'status': 'FAILED', 'httpErrorStatusCode': 500}, 'No response') == 'No res...
{ "split": "train", "index": 74234, "acecode_id": "bigcode_python_fns_26232", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries representing pods in a Kubernetes namespace. Each pod has a 'metadata' field containing its 'name' and a 'status' field containing a list of 'containerStatuses'. Each container status includes a 'name' and a boolean 'ready' field. Write a fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_non_ready_pod_names([{'metadata': {'name': 'pod1'}, 'status': {'containerStatuses': [{'name': 'containerA', 'ready': False}]}}, {'metadata': {'name': 'pod2'}, 'status': {'containerStatuses': [{'name': 'containerB', 'ready': True}]}}, {'metadata': {'name'...
{ "split": "train", "index": 74235, "acecode_id": "bigcode_python_fns_23365", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, your task is to create a function called 'transform_and_sort' that transforms each string in the list to uppercase and then sorts the strings in alphabetical order. The function should return the sorted list. For example, given the input list ['apple', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_and_sort(['apple', 'banana', 'cherry']) == ['APPLE', 'BANANA', 'CHERRY']\", \"assert transform_and_sort(['apple', 'banana', 'grape']) == ['APPLE', 'BANANA', 'GRAPE']\", \"assert transform_and_sort(['kiwi', 'pear', 'mango']) == ['KIWI', 'MANGO', 'PE...
{ "split": "train", "index": 74236, "acecode_id": "bigcode_python_fns_42676", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing selected nodes in a 3D scene. Each string can either be a 'polyColorPerVertex' node or another type of node. Your task is to create a function that takes this list of selected nodes and returns a new list that contains only the 'poly...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_polyColorPerVertex_nodes(['node1', 'polyColorPerVertex', 'node2']) == ['polyColorPerVertex']\", \"assert filter_polyColorPerVertex_nodes(['nodeA', 'nodeB', 'nodeC']) == []\", \"assert filter_polyColorPerVertex_nodes(['node1', 'node2', 'node3', 'polyCo...
{ "split": "train", "index": 74237, "acecode_id": "bigcode_python_fns_44329", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of strings representing module names, write a function `can_import_modules(modules: List[str]) -> List[bool]` that checks if each module can be imported. The function should return a list of boolean values, where each value corresponds to whether the respective mod...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_import_modules(['libpdf', 'core', 'os']) == [True, True, False]\", \"assert can_import_modules(['libpdf', 'sys', 'libpdf']) == [True, False, True]\", \"assert can_import_modules(['numpy', 'libpdf']) == [False, True]\", \"assert can_import_modules(['core'...
{ "split": "train", "index": 74238, "acecode_id": "bigcode_python_fns_19727", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of bounding boxes in a 3D space, where each box is represented by its coordinates in the format (x1, y1, x2, y2, z1, z2). Your task is to write a function that computes the volume of each bounding box. The volume of a box can be calculated using the formula...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert box_volume([(0, 0, 1, 1, 0, 1), (1, 1, 2, 2, 1, 2)]) == [1, 1]\", \"assert box_volume([(1, 2, 3, 4, 5, 7)]) == [8]\", \"assert box_volume([(0, 0, 0, 0, 0, 0)]) == [0]\", \"assert box_volume([]) == []\", \"assert box_volume([(1, 1, 2, 2, 1, 2), (3, 3, 4, 4, 3...
{ "split": "train", "index": 74239, "acecode_id": "bigcode_python_fns_29635", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of customer entitlements represented as dictionaries. Each entitlement has the following keys: 'accountId', 'customerId', 'entitlementId', and 'status'. Your task is to implement a function that filters the entitlements based on a specific 'customerId' and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_entitlements([{'accountId': '1', 'customerId': 'A', 'entitlementId': '001', 'status': 'active'}, {'accountId': '2', 'customerId': 'B', 'entitlementId': '002', 'status': 'inactive'}], 'A') == [{'accountId': '1', 'customerId': 'A', 'entitlementId': '001...
{ "split": "train", "index": 74240, "acecode_id": "bigcode_python_fns_6933", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer array A and a target integer, write a function that returns the number of times the target integer appears in the array. The function should be implemented using a recursive approach. The input array can contain both positive and negative integers, and the targ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count([1, 2, 3, 4, 5], 3) == 1\", \"assert count([1, 2, 3, 4, 5], 6) == 0\", \"assert count([1, 2, 3, 3, 3, 4, 5], 3) == 3\", \"assert count([], 1) == 0\", \"assert count([1, 1, 1, 1, 1], 1) == 5\", \"assert count([-1, -2, -3, -1], -1) == 2\", \"assert count...
{ "split": "train", "index": 74241, "acecode_id": "bigcode_python_fns_36566", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that performs a binary search on a sorted array to find the index of a given target value. If the target is found, return its index; otherwise, return None. The binary search algorithm should run in O(log n) time complexity.\nPlease reason step by step, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert binary_search([1, 2, 3, 4, 5], 1) == 0\", \"assert binary_search([1, 2, 3, 4, 5], 5) == 4\", \"assert binary_search([1, 2, 3, 4, 5], 6) == None\", \"assert binary_search([-10, -5, 0, 2, 3], 2) == 3\", \"asse...
{ "split": "train", "index": 74242, "acecode_id": "evol_19145", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function to determine the appropriate folder path for organizing MIDI files based on music genre names. The function should process the genre name by converting it to lowercase, removing any leading and trailing whitespaces, and eliminating all ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_genre_folder_path('Electronic Dance Music') == 'genresDataset/electronicdancemusic/midiworld'\", \"assert get_genre_folder_path(' Jazz ') == 'genresDataset/jazz/midiworld'\", \"assert get_genre_folder_path(' Classical Music ') == 'genresDataset/classi...
{ "split": "train", "index": 74243, "acecode_id": "oss_10028", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, return a list of all distinct triplets (three-element combinations) that can be formed from the array. Each triplet should be represented as a tuple. The input array may contain duplicate integers, and the output should not include any duplicate trip...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findTriplets([0, 0, 0]) == [(0, 0, 0)]\", \"assert findTriplets([]) == []\", \"assert findTriplets([1]) == []\", \"assert findTriplets([1, 2]) == []\", \"assert findTriplets([1, 2, 3]) == [(1, 2, 3)]\", \"assert findTriplets([1, 1, 1, 1]) == [(1, 1, 1)]\", \...
{ "split": "train", "index": 74244, "acecode_id": "evol_1299", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages the configuration of a USB device based on the number of CDC (Communication Device Class) instances and associated functions. Your function should take in the current number of CDC instances and the number of functions as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_usb_configuration(5, 3) == 'IAD Enabled'\", \"assert manage_usb_configuration(3, 2) == 'IAD Enabled'\", \"assert manage_usb_configuration(4, 4) == 'IAD Enabled'\", \"assert manage_usb_configuration(6, 1) == 'IAD Enabled'\", \"assert manage_usb_configu...
{ "split": "train", "index": 74245, "acecode_id": "oss_9636", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a hash table data structure in Python. Your task is to complete the implementation of the `get` method in the `HashTable` class. The `get` method takes a key as input and should return the value associated with that key in the hash table. The ha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert HashTable(10).get('key1') is None\", \"assert HashTable(10).get('key2') is None\", \"assert HashTable(10).get('key3') is None\", \"assert HashTable(10).get('key4') is None\", \"assert HashTable(10).get('key5') is None\", \"assert HashTable(10).get('key6') is...
{ "split": "train", "index": 74246, "acecode_id": "oss_15933", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `cmdStr` that represents a command line instruction. Your task is to simulate the execution of this command. The command can either succeed or fail. If the command succeeds, return the string 'Command executed successfully.' If the command fails, return t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert run_command('echo Hello') == 'Command executed successfully.'\", \"assert run_command('ls') == 'Command executed successfully.'\", \"assert run_command('date') == 'Command executed successfully.'\", \"assert run_command('non_existent_command') == 'Error: Com...
{ "split": "train", "index": 74247, "acecode_id": "bigcode_python_fns_28087", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `next_prime(n: int) -> int` that finds the smallest prime number larger than the given integer `n`. The input `n` will be a non-negative integer. Your task is to return the smallest prime number that is greater than `n`.\nPlease reason step by step, then wr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert next_prime(0) == 2\", \"assert next_prime(1) == 2\", \"assert next_prime(2) == 3\", \"assert next_prime(3) == 5\", \"assert next_prime(4) == 5\", \"assert next_prime(5) == 7\", \"assert next_prime(6) == 7\", \"assert next_prime(7) == 11\", \"assert next_prim...
{ "split": "train", "index": 74248, "acecode_id": "evol_13609", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a tweet message. The function should take three parameters: a string 'message' that represents the tweet content, an optional dictionary 'tweet_to_reply' which, if provided, contains two keys: 'user' (a dictionary with a key ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_tweet('Hello World!', None) == 'Hello World!'\", \"assert format_tweet('Excited for the event!', None) == 'Excited for the event!'\", \"assert format_tweet('Good morning!', {'user': {'screen_name': 'user123'}, 'id': 1}) == 'Good morning! @user123'\", ...
{ "split": "train", "index": 74249, "acecode_id": "bigcode_python_fns_21410", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with updating a list of registration requests for devices based on corresponding conditional registration data. Each registration request is represented as a dictionary containing at least the 'fccId' and 'cbsdSerialNumber' fields. The conditional registration da...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_registration_requests([{'fccId': 'fcc1', 'cbsdSerialNumber': 'serial1'}], [{'fccId': 'fcc1', 'cbsdSerialNumber': 'serial1', 'installationParam': 'param1', 'cbsdCategory': 'A'}]) == [{'fccId': 'fcc1', 'cbsdSerialNumber': 'serial1', 'installationParam':...
{ "split": "train", "index": 74250, "acecode_id": "bigcode_python_fns_35225", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with monitoring temperature and humidity data. You receive two lists: one containing temperature readings and the other containing humidity readings. Your task is to compare each current reading with the previous reading. If the temperature has increased by more ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert monitor_changes([20.0, 21.0, 22.0], [40.0, 41.0, 42.0]) == []\", \"assert monitor_changes([20.5, 23.0], [45.0, 51.0]) == ['Temperature or humidity change detected!']\", \"assert monitor_changes([15.0], [30.0]) == []\", \"assert monitor_changes([], []) == []\...
{ "split": "train", "index": 74251, "acecode_id": "oss_11228", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a string that may contain special characters typically found in text copied from MS Office applications, your task is to implement a function that replaces these special characters with their corresponding ASCII representations. Specifically, replace: 1. Curly quotes (“ a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert accents_dewinize('\\u201cStupid word \\u2022 error inside\\u2122 \\u201d') == '\\\"Stupid word - error inside(TM) \\\"'\", \"assert accents_dewinize('Hello World\\u2122') == 'Hello World(TM)'\", \"assert accents_dewinize('No special characters here.') == 'No...
{ "split": "train", "index": 74252, "acecode_id": "bigcode_python_fns_28653", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a color map for a specified dataset. The function should accept a string representing the type of dataset and return a corresponding color map as a list of tuples, where each tuple represents an RGB color. The supported dat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_label_colormap('PASCAL') == [(255, 0, 0), (0, 255, 0), (0, 0, 255)]\", \"assert create_label_colormap('CITYSCAPES') == [(128, 64, 128), (244, 35, 232), (0, 0, 142)]\", \"assert create_label_colormap('PASCAL') != create_label_colormap('CITYSCAPES')\", ...
{ "split": "train", "index": 74253, "acecode_id": "bigcode_python_fns_32995", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple multimedia application. Your application should be able to process a list of file paths and categorize them into images, videos, and sounds based on their file extensions. Implement a function called `categorize_media_files` that takes a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_media_files(['image.jpg', 'video.mp4', 'sound.mp3']) == {'images': ['image.jpg'], 'videos': ['video.mp4'], 'sounds': ['sound.mp3']}\", \"assert categorize_media_files(['photo.png', 'clip.avi', 'track.wav', 'invalid.txt']) == {'images': ['photo.png...
{ "split": "train", "index": 74254, "acecode_id": "oss_26865", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of active contracts, each represented as a dictionary containing 'chat_id', 'query', and 'contract_id', write a function `list_active_contracts(contracts: List[Dict[str, Union[int, str]]]) -> List[str]` that returns a list of formatted strings for each contract. Ea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_active_contracts([]) == []\", \"assert list_active_contracts([{'chat_id': 1, 'query': 'http://example.com', 'contract_id': 101}]) == ['Contract for url http://example.com \\\\nTo stop watching it, send \\\"/stop 101\\\"']\", \"assert list_active_contra...
{ "split": "train", "index": 74255, "acecode_id": "bigcode_python_fns_29797", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of bounding box coordinates represented as tuples. Each bounding box is defined by its top-left and bottom-right corners in the format (x1, y1, x2, y2). Your task is to implement a function that takes in this list of bounding boxes and a confidence threshol...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_bounding_boxes([(0, 0, 10, 10), (15, 15, 25, 25)], [0.96, 0.90], 0.95) == [(0, 0, 10, 10)]\", \"assert filter_bounding_boxes([(0, 0, 5, 5)], [0.5], 0.1) == [(0, 0, 5, 5)]\", \"assert filter_bounding_boxes([(1, 1, 2, 2), (3, 3, 4, 4)], [0.85, 0.95], 0....
{ "split": "train", "index": 74256, "acecode_id": "bigcode_python_fns_12943", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a positive integer denominator d, define a proper fraction as a fraction where the numerator is smaller than the denominator. A fraction is considered resilient if it cannot be reduced to a simpler form. Your task is to implement a function that calculates the resilience ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(resilience(1) - 0.0) < 1e-9\", \"assert abs(resilience(2) - 0.0) < 1e-9\", \"assert abs(resilience(3) - 1.0) < 1e-9\", \"assert abs(resilience(7) - 6/6) < 1e-9\", \"assert abs(resilience(9) - 6/8) < 1e-9\", \"assert abs(resilience(10) - 4/9) < 1e-9\", \"...
{ "split": "train", "index": 74257, "acecode_id": "evol_10412", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple database connection and table creation. The function, `create_table`, accepts a boolean parameter `is_connected` which indicates whether the database connection is open or not. If the database connection is ope...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_table(True) == 'Table created successfully.'\", \"assert create_table(False) == 'Cannot operate on a closed database.'\", \"assert create_table(True) == 'Table created successfully.'\", \"assert create_table(False) == 'Cannot operate on a closed datab...
{ "split": "train", "index": 74258, "acecode_id": "bigcode_python_fns_48878", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a menu selection system. The function should accept a list of menu options and a user's selection. If the user selects a valid option (one that exists in the list), the function should return the selected option. If the use...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_menu_option(['Option 1', 'Option 2', 'Option 3'], 'Option 1') == 'Option 1'\", \"assert select_menu_option(['Option 1', 'Option 2', 'Option 3'], 'Option 4') == 'Invalid selection'\", \"assert select_menu_option(['Option A', 'Option B'], 'Option B') ==...
{ "split": "train", "index": 74259, "acecode_id": "bigcode_python_fns_10706", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of strings and sorts it alphabetically in a case-insensitive manner. The function should handle strings that may contain non-alphabetical characters, such as numbers, symbols, and spaces. The input is guaranteed to be a list of strings. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sortStringArray(['apple', 'Banana', 'cherry']) == ['apple', 'Banana', 'cherry']\", \"assert sortStringArray(['banana', 'apple', 'Cherry']) == ['apple', 'banana', 'Cherry']\", \"assert sortStringArray(['apple', 'Banana', 'cherry', '2fruit', '1fruit']) == ['1f...
{ "split": "train", "index": 74260, "acecode_id": "evol_19267", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing view IDs. Your task is to write a function that takes this list and returns a new list containing only the unique view IDs that are displayed in a specific window. The window is defined as a range of view IDs from a given start ID t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_displayed_views([1, 2, 3, 4, 5], 2, 4) == [2, 3, 4]\", \"assert get_displayed_views([1, 2, 2, 3, 4, 5], 1, 3) == [1, 2, 3]\", \"assert get_displayed_views([5, 6, 7, 8, 9], 2, 6) == [5, 6]\", \"assert get_displayed_views([10, 11, 12, 13, 14], 14, 14) == [...
{ "split": "train", "index": 74261, "acecode_id": "bigcode_python_fns_7479", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that categorizes a list of sequence records based on their parent ranks. Each sequence record is represented as a dictionary with the following attributes: `name`, `position`, and optionally `rankParent`. Your function should return a dic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_parents_rank_list([{'name': 'seq1', 'position': 0, 'rankParent': 'A'}, {'name': 'seq2', 'position': 3, 'rankParent': 'B'}, {'name': 'seq3', 'position': 6, 'rankParent': 'A'}, {'name': 'seq4', 'position': 9, 'rankParent': 'B'}, {'name': 'seq5', 'position'...
{ "split": "train", "index": 74262, "acecode_id": "oss_13681", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates adding a Health Phenotype Ontology (HPO) term to a subpanel of a phenotype model. The function will take a list of HPO checkboxes, each represented as a dictionary with fields for the term ID ('_id'), description, and a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_hpo_to_subpanel([{'_id': 'HP:0025190', 'description': 'Bilateral tonic-clonic seizure with generalized onset', 'children': [{'_id': 'HP:0012345', 'description': 'Child term description'}]}], 'subpanel_x', True) == {'name': 'HP:0025190', 'checkbox_type': ...
{ "split": "train", "index": 74263, "acecode_id": "bigcode_python_fns_2798", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a 2D list of numerical values, implement a function `extract_columns(values: List[List[float]], start: int, ncomps: int) -> List[List[float]]` that extracts a specific number of columns from the 2D list starting from a given index. The function should return a new 2D list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_columns([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], 0, 2) == [[1.0, 2.0], [4.0, 5.0]]\", \"assert extract_columns([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], 1, 2) == [[2.0, 3.0], [5.0, 6.0]]\", \"assert extract_columns([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], 0, 3) == [...
{ "split": "train", "index": 74264, "acecode_id": "bigcode_python_fns_35084", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing resource IDs. Your task is to implement a function that takes this list as input and returns a new list containing the resource IDs in ascending order. The input list may contain duplicate resource IDs, and the output should only in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_unique_resource_ids([100, 50, 200, 75, 50]) == [50, 75, 100, 200]\", \"assert sort_unique_resource_ids([5, 3, 9, 1, 5, 3]) == [1, 3, 5, 9]\", \"assert sort_unique_resource_ids([1, 2, 3]) == [1, 2, 3]\", \"assert sort_unique_resource_ids([10, 10, 10]) ==...
{ "split": "train", "index": 74265, "acecode_id": "oss_15848", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a library's collection of books. Write a function `manage_library` that takes a list of operations and returns the final list of books in the library after performing the operations. The operations will be provided as a list of tuples, where each tu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_library([('add', 'Python Programming'), ('add', 'Data Structures and Algorithms'), ('add', 'Machine Learning')]) == ['Data Structures and Algorithms', 'Machine Learning', 'Python Programming']\", \"assert manage_library([('add', 'Python Programming'),...
{ "split": "train", "index": 74266, "acecode_id": "oss_35838", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `convert_to_uppercase(input_string)` that takes a single string as input and returns a new string where all the words in the input string are converted to uppercase. If the input is not a string, the function should raise a TypeError. A word is defined as a seq...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_uppercase('hello world') == 'HELLO WORLD'\", \"assert convert_to_uppercase(' leading and trailing ') == ' LEADING AND TRAILING '\", \"assert convert_to_uppercase('multiple spaces') == 'MULTIPLE SPACES'\", \"assert convert_to_uppercase(''...
{ "split": "train", "index": 74267, "acecode_id": "evol_6122", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary representing a configuration for an object, write a function `build_object_from_config(constructor: Callable[..., T], config: Optional[Dict[str, Any]] = None) -> T` that constructs an instance of the object using the provided constructor and the configuration...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_object_from_config(lambda a, b: (a, b), {'a': 1, 'b': 2}) == (1, 2)\", \"assert build_object_from_config(lambda name, age: {'name': name, 'age': age}, {'name': 'Alice', 'age': 30}) == {'name': 'Alice', 'age': 30}\", \"assert build_object_from_config(la...
{ "split": "train", "index": 74268, "acecode_id": "bigcode_python_fns_28939", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a locator for a web page based on a given key. The function should accept a string key and return the corresponding CSS or XPath locator from a predefined set of locators. If the key does not exist, the function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_locator('base') == 'css=#content'\", \"assert get_locator('create') == 'css=#getstarted a'\", \"assert get_locator('catbrowser') == 'css=#content'\", \"assert get_locator('non_existent') == None\", \"assert get_locator('base') == 'css=#content'\", \"asse...
{ "split": "train", "index": 74269, "acecode_id": "oss_32012", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given two strings, str1 and str2, write a function to find and return the longest common substring between the two strings. If more than one longest common substring exists, return all of them in a sorted list. The strings can contain any ASCII characters.\nPlease reason step b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_common_substrings('abcdef', 'xyzabcde') == ['abcde']\", \"assert find_common_substrings('abc', 'ab') == ['ab']\", \"assert find_common_substrings('aabbcc', 'bbaacc') == ['aa', 'bb', 'cc']\", \"assert find_common_substrings('test', 'testing') == ['test']...
{ "split": "train", "index": 74270, "acecode_id": "evol_15828", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a DFS (Dynamic Frequency Selection) radar detection system for a wireless access point. Implement a function `dfs_radar_simulation(chanlist: List[int], radar_detected: bool) -> List[str]` that takes in a list of channel frequencies and a boolean i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dfs_radar_simulation([40, 44], False) == ['success=0 freq=40', 'AP-ENABLED']\", \"assert dfs_radar_simulation([36, 40, 44], False) == ['success=0 freq=36', 'AP-ENABLED']\", \"assert dfs_radar_simulation([48, 52], False) == ['success=0 freq=48', 'AP-ENABLED']...
{ "split": "train", "index": 74271, "acecode_id": "bigcode_python_fns_38051", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a string that contains a specific pattern. The pattern consists of the word 'NumWrite' followed by one or more spaces and then a positive integer. Your task is to implement a function that extracts and returns the positive integer from the string if it follows the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert read_num_write('NumWrite 42') == 42\", \"assert read_num_write('This is a test NumWrite 100') == 100\", \"assert read_num_write('NumWrite 7 and more text') == 7\", \"assert read_num_write('NumWrite 12345') == 12345\", \"assert read_num_write('Start NumWrit...
{ "split": "train", "index": 74272, "acecode_id": "bigcode_python_fns_12750", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, your task is to extract all strings that start with a specified prefix. You will implement a function `extract_strings_with_prefix` that takes in two parameters: a string `prefix` and a list of strings `words`. The function should return a list of strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_strings_with_prefix('a', ['apple', 'banana', 'avocado']) == ['apple', 'avocado']\", \"assert extract_strings_with_prefix('b', ['banana', 'blueberry', 'cherry']) == ['banana', 'blueberry']\", \"assert extract_strings_with_prefix('c', ['cat', 'dog', 'f...
{ "split": "train", "index": 74273, "acecode_id": "bigcode_python_fns_41217", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of text strings, implement a function `extract_hashtags(text_list)` that returns a summary dictionary with various statistics about the hashtags found in the text strings. The returned dictionary should contain the following keys: \n\n1. `hashtags`: A list of lists...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_hashtags(['i like #blue', 'i like #green and #blue', 'i like all']) == {'hashtags': [['#blue'], ['#green', '#blue'], []], 'hashtags_flat': ['#blue', '#green', '#blue'], 'hashtag_counts': [1, 2, 0], 'hashtag_freq': [(0, 1), (1, 1), (2, 1)], 'top_hasht...
{ "split": "train", "index": 74274, "acecode_id": "bigcode_python_fns_46468", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of strings and a substring as inputs and finds all the strings in the list which contain the given substring. The function should be case insensitive and should identify overlapping occurrences. If no strings contain the substring, return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_substrings(['hello', 'WORLD', 'google', 'apple', 'apPle'], 'o') == ['hello', 'WORLD', 'google']\", \"assert find_substrings(['hello', 'heLLo', 'HELLO'], 'h') == ['hello', 'heLLo', 'HELLO']\", \"assert find_substrings(['aaaa', 'aa', 'a'], 'aa') == ['aaaa...
{ "split": "train", "index": 74275, "acecode_id": "evol_20299", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks if two character sequences, string1 and string2, can be made congruent by applying a single modification on string1. The modification can be one of the following: inserting a character, removing a character, or replacing a character. After the m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_string('abc', 'abcd') == True\", \"assert modify_string('abcd', 'abc') == True\", \"assert modify_string('abc', 'ab') == True\", \"assert modify_string('abc', 'bbc') == True\", \"assert modify_string('a', 'ab') == True\", \"assert modify_string('ab', ...
{ "split": "train", "index": 74276, "acecode_id": "evol_23493", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Define a function `create_person(name: str, age: int, height: float, address: str) -> dict` that takes in a person's name, age, height, and address as parameters and returns a dictionary representation of the person with the keys 'name', 'age', 'height', and 'address'.\nPlease ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_person('Alice', 30, 5.5, '123 Main St') == {'name': 'Alice', 'age': 30, 'height': 5.5, 'address': '123 Main St'}\", \"assert create_person('Bob', 25, 6.0, '456 Oak Ave') == {'name': 'Bob', 'age': 25, 'height': 6.0, 'address': '456 Oak Ave'}\", \"asser...
{ "split": "train", "index": 74277, "acecode_id": "evol_12825", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of user IDs associated with a specific account, implement a function `get_random_user(user_ids: List[int]) -> int` that returns a random user ID from the list. If the list is empty, the function should return -1. The function should not modify the input list and sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_random_user([1, 2, 3, 4, 5]) in [1, 2, 3, 4, 5]\", \"assert get_random_user([10, 20, 30, 40]) in [10, 20, 30, 40]\", \"assert get_random_user([100, 200, 300]) in [100, 200, 300]\", \"assert get_random_user([7]) == 7\", \"assert get_random_user([]) == -1\...
{ "split": "train", "index": 74278, "acecode_id": "bigcode_python_fns_18107", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `sort_descending(arr)` that takes an input array of integers and arranges its elements in descending order. The function should return a new array that contains the elements sorted from highest to lowest.\nPlease reason step by step, then write a self-contained...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_descending([7, 4, 1, 2]) == [7, 4, 2, 1]\", \"assert sort_descending([10, 5, 3, 8]) == [10, 8, 5, 3]\", \"assert sort_descending([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert sort_descending([-1, -5, -2]) == [-1, -2, -5]\", \"assert sort_descending([0...
{ "split": "train", "index": 74279, "acecode_id": "evol_20397", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a linear probing hash symbol table (ST) and performs a series of operations: inserting key-value pairs, retrieving values based on keys, deleting keys, and fetching all existing keys. Implement the function `linear_prob...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_probing_hash_operations([('put', 'a', 1), ('put', 'b', 2), ('get', 'a'), ('delete', 'b'), ('keys',)]) == [None, None, 1, None, ['a']]\", \"assert linear_probing_hash_operations([('put', 'key1', 100), ('put', 'key2', 200), ('delete', 'key1'), ('get', '...
{ "split": "train", "index": 74280, "acecode_id": "oss_7014", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes an integer input representing the number of items in an inventory and returns a list of strings that represent the inventory in the format 'Item X: Quantity Y', where X is the item number (from 1 to the input number) and Y is t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_inventory(0) == []\", \"assert manage_inventory(-5) == []\", \"assert manage_inventory(1) == ['Item 1: Quantity 1']\", \"assert manage_inventory(2) == ['Item 1: Quantity 1', 'Item 2: Quantity 2']\", \"assert manage_inventory(3) == ['Item 1: Quantity 1...
{ "split": "train", "index": 74281, "acecode_id": "oss_12484", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a two-dimensional list containing the counts of even and odd digits for each integer. Each element in the output should be a list where the first element represents the count of even digits and the second element repre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert even_odd_count([-12, 123]) == [[1, 1], [1, 2]]\", \"assert even_odd_count([0, 0, 0]) == [[1, 0], [1, 0], [1, 0]]\", \"assert even_odd_count([1, 2, 3, 4, 5]) == [[0, 1], [1, 0], [0, 1], [1, 0], [0, 1]]\", \"assert even_odd_count([2468, 1357]) == [[4, 0], [0, ...
{ "split": "train", "index": 74282, "acecode_id": "evol_29482", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that allows you to define configuration flags for an application. Your function should be able to accept either a single flag or multiple flags at once. A flag consists of a name, a default value, and an optional help message. Implement a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_flags(('gpu', 1, 'CUDA_VISIBLE_DEVICES'), ('verbose', True)) == [{'name': 'gpu', 'default': 1, 'help': 'CUDA_VISIBLE_DEVICES'}, {'name': 'verbose', 'default': True, 'help': ''}]\", \"assert add_flags(('batch_size', 32), ('epochs', 10, 'Number of iteratio...
{ "split": "train", "index": 74283, "acecode_id": "bigcode_python_fns_18664", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with processing a dictionary that represents a row of fiscal data. Your function should ensure that the dictionary contains only the specified fiscal fields. If there are any surplus keys (keys in the dictionary that are not in the fiscal fields), those keys shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_row({'a': 1, 'b': 2}, ['a', 'b']) == {'a': 1, 'b': 2}\", \"assert process_row({'a': 1, 'c': 3}, ['a', 'b']) == {'a': 1, 'b': None}\", \"assert process_row({'a': 1, 'b': 2, 'c': 3}, ['a', 'b']) == {'a': 1, 'b': 2}\", \"assert process_row({}, ['a', 'b'...
{ "split": "train", "index": 74284, "acecode_id": "bigcode_python_fns_1469", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `validate_pin(pin: str) -> bool` that checks if a given pincode is valid based on the following criteria: The pin must have an odd length, contain at least two non-consecutive digits, and not be a universally recognized numeric sequence (like '1234', '1111'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_pin('13579') == True\", \"assert validate_pin('12321') == True\", \"assert validate_pin('11111') == False\", \"assert validate_pin('1234') == False\", \"assert validate_pin('98765') == True\", \"assert validate_pin('00000') == False\", \"assert vali...
{ "split": "train", "index": 74285, "acecode_id": "evol_16216", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given multiple dictionaries that may contain nested dictionaries. Your task is to merge these dictionaries into a single dictionary. The merging process should recursively combine values from nested dictionaries. If the same key exists in multiple dictionaries, the valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_dicts({'a': 1}, {'b': 2}) == {'a': 1, 'b': 2}\", \"assert merge_dicts({'a': {'b': 1}}, {'a': {'c': 2}}) == {'a': {'b': 1, 'c': 2}}\", \"assert merge_dicts({'a': 1}, {'a': 2}) == {'a': 2}\", \"assert merge_dicts({'a': {'b': 1}}, {'a': {'b': 2}}) == {'a'...
{ "split": "train", "index": 74286, "acecode_id": "bigcode_python_fns_9169", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D list representing an image, where each element is an integer value representing pixel intensity. Your task is to implement a function `simplexy` that applies a simple feature extraction technique by transposing the image and returning a new image where each p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simplexy([[1, 2], [3, 4]]) == [[1.0, 3.0], [2.0, 4.0]]\", \"assert simplexy([[0]]) == [[0.0]]\", \"assert simplexy([[1, 0], [0, 1]]) == [[1.0, 0.0], [0.0, 1.0]]\", \"assert simplexy([[10, 20, 30], [40, 50, 60]]) == [[10.0, 40.0], [20.0, 50.0], [30.0, 60.0]]\...
{ "split": "train", "index": 74287, "acecode_id": "oss_34098", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that accepts a list of numerical values and returns the same list sorted in a specific manner: all even numbers should come before odd numbers, and within each category (even and odd), the numbers should be sorted in increasing order. If the input li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert complex_sort([1, 2, 3, 4, 5, 6]) == [2, 4, 6, 1, 3, 5]\", \"assert complex_sort([7, 3, 1, 2, 4, 6]) == [2, 4, 6, 1, 3, 7]\", \"assert complex_sort([8, 3, 5, 2, 1]) == [2, 8, 1, 3, 5]\", \"assert complex_sort([10, 9, 8, 7]) == [8, 10, 7, 9]\", \"assert comple...
{ "split": "train", "index": 74288, "acecode_id": "evol_14992", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given two sorted arrays of integers, write a function that finds the kth smallest element in the combined sorted array formed by merging the two input arrays. If k is larger than the total number of elements in the combined array, the function should return None. The function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findKth([1, 3], [2], 2) == 2\", \"assert findKth([1, 2], [3, 4], 3) == 3\", \"assert findKth([1, 3, 5], [2, 4, 6], 3) == 3\", \"assert findKth([1, 2, 3], [], 2) == 2\", \"assert findKth([], [1, 2, 3], 1) == 1\", \"assert findKth([], [], 1) == None\", \"asser...
{ "split": "train", "index": 74289, "acecode_id": "evol_17363", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that initializes and returns a configuration object for a given list of service names. Each service name in the input list requires a corresponding cookies client and an account client to be created. Implement the function `initialize_ser...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_services(['service1']) == {'service1': {'cookies': 'CookiesClient for service1', 'account': 'AccountClient for service1'}}\", \"assert initialize_services(['service2']) == {'service2': {'cookies': 'CookiesClient for service2', 'account': 'AccountC...
{ "split": "train", "index": 74290, "acecode_id": "bigcode_python_fns_14205", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates sending a command to a device connected via a serial interface. The function should take a command string as input and return the command encoded with a newline character at the end. The command should be encoded as byt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_command('LED ON') == b'LED ON\\\\n'\", \"assert send_command('TURN OFF') == b'TURN OFF\\\\n'\", \"assert send_command('SET TEMP 22') == b'SET TEMP 22\\\\n'\", \"assert send_command('START MOTOR') == b'START MOTOR\\\\n'\", \"assert send_command('STOP MOT...
{ "split": "train", "index": 74291, "acecode_id": "oss_11917", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the recording of variables at different timestamps. The function `record_vars` takes a dictionary `recorded_vars` as input. If `recorded_vars` is empty, the function should do nothing. If it is not empty, it should store th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert record_vars({}, '2023-10-01 10:00:00') == {}\", \"assert record_vars({'temp': 22}, '2023-10-01 10:00:00') == {'2023-10-01 10:00:00': {'temp': 22}}\", \"assert record_vars({'humidity': 60}, '2023-10-01 10:05:00') == {'2023-10-01 10:05:00': {'humidity': 60}}\"...
{ "split": "train", "index": 74292, "acecode_id": "oss_13953", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple inventory management system for a grocery store. Create a function called `manage_inventory` that takes a list of items and their quantities to initialize the inventory, a list of purchases (each represented as a tuple with item name an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_inventory([('Apple', 10), ('Orange', 20), ('Banana', 5), ('Grapes', 15)], [('Banana', 2), ('Apple', 5), ('Grapes', 10)], True) == ['Apple: 5', 'Orange: 20', 'Banana: 3', 'Grapes: 5']\", \"assert manage_inventory([('Apple', 10)], [('Apple', 1), ('Apple...
{ "split": "train", "index": 74293, "acecode_id": "evol_36111", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the current episode number, a minimum epsilon value, a maximum epsilon value, and the target episode number at which the epsilon value should reach the minimum, implement a function `annealing_epsilon` that returns the linearly annealed epsilon value. The epsilon will dec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert annealing_epsilon(0, 0.1, 1.0, 10) == 1.0\", \"assert annealing_epsilon(10, 0.1, 1.0, 10) == 0.1\", \"assert annealing_epsilon(15, 0.1, 1.0, 10) == 0.1\", \"assert annealing_epsilon(0, 0.2, 0.8, 5) == 0.8\", \"assert annealing_epsilon(5, 0.2, 0.8, 5) == 0.2\...
{ "split": "train", "index": 74294, "acecode_id": "bigcode_python_fns_2894", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of instantaneous sound pressure values, your task is to determine the peak sound pressure, which is defined as the greatest absolute sound pressure during the provided time interval. Implement a function 'peak_sound_pressure' that takes a list of pressure values an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert peak_sound_pressure([1.0, 2.5, -3.0, 4.0]) == 4.0\", \"assert peak_sound_pressure([-1.0, -2.0, -3.0]) == 3.0\", \"assert peak_sound_pressure([0.0, 0.0, 0.0]) == 0.0\", \"assert peak_sound_pressure([-5.5, 3.3, 4.4]) == 5.5\", \"assert peak_sound_pressure([1.1...
{ "split": "train", "index": 74295, "acecode_id": "bigcode_python_fns_21366", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `search_books` that takes a list of dictionaries representing books and a dictionary of search criteria. The function should return a list of books that match the given criteria. The search criteria can include 'keyword', 'author', 'publication_year', and '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_books([{'title': 'Book One', 'author': 'Author A', 'publication_year': 2020, 'genre': 'Fiction', 'keywords': ['adventure', 'fantasy']}, {'title': 'Book Two', 'author': 'Author B', 'publication_year': 2021, 'genre': 'Non-Fiction', 'keywords': ['science...
{ "split": "train", "index": 74296, "acecode_id": "evol_23387", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `recursive_sum` that takes a list of integers as input and returns the sum of all the integers in the list using a recursive approach. If the list is empty, the function should return 0.\nPlease reason step by step, then write a self-contained Python...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert recursive_sum([]) == 0\", \"assert recursive_sum([1]) == 1\", \"assert recursive_sum([1, 2]) == 3\", \"assert recursive_sum([1, 2, 3]) == 6\", \"assert recursive_sum([1, -1]) == 0\", \"assert recursive_sum([-1, -2, -3]) == -6\", \"assert recursive_sum([0, 0,...
{ "split": "train", "index": 74297, "acecode_id": "evol_33051", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given string ends with a specific character. The function should take a string as input and return an error message if the string is not a valid string type or if the string is not empty and does not end with the specifie...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_string_ends_with('hello:', ':') == []\", \"assert check_string_ends_with('', ':') == []\", \"assert check_string_ends_with('test', 't') == []\", \"assert check_string_ends_with('example', ':') == ['The string should end with character :']\", \"assert c...
{ "split": "train", "index": 74298, "acecode_id": "bigcode_python_fns_45699", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a request based on a given path. The function `handle_request` takes a dictionary `event` that contains the following keys: `path`, `user_id`, `body`, and `entity`. Your task is to implement the logic to return the appr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_request({'path': '/user', 'user_id': '123', 'body': {}, 'entity': ''}) == 'User details for ID: 123'\", \"assert handle_request({'path': '/user', 'user_id': '101', 'body': {}, 'entity': ''}) == 'User details for ID: 101'\", \"assert handle_request({'p...
{ "split": "train", "index": 74299, "acecode_id": "oss_25679", "num_tests": 12 }