data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Implement a function `even_odd_count(num)` that takes an integer `num` as input and returns a tuple representing the counts of even and odd digits within the input integer. The function should handle negative numbers and numbers with preceding zeros correctly, treating '0' as a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert even_odd_count(123) == (1, 2)\", \"assert even_odd_count(0) == (1, 0)\", \"assert even_odd_count(-0) == (1, 0)\", \"assert even_odd_count(24680) == (5, 0)\", \"assert even_odd_count(13579) == (0, 5)\", \"assert even_odd_count(-9876543210) == (5, 5)\", \"asse... | {
"split": "train",
"index": 70000,
"acecode_id": "evol_17442",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `discover_devices` that simulates the discovery of devices on a local network. The function will take no parameters and will return a list of device names as strings. For the purpose of this problem, you can assume that there are thre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert discover_devices() == ['Smart Light', 'Smart Thermostat', 'Smart Door Lock']\", \"assert len(discover_devices()) == 3\", \"assert 'Smart Light' in discover_devices()\", \"assert 'Smart Thermostat' in discover_devices()\", \"assert 'Smart Door Lock' in discov... | {
"split": "train",
"index": 70001,
"acecode_id": "bigcode_python_fns_40276",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that parses a given anchor body string to extract a topic ID and the associated text. The anchor body will be a string that may contain a colon (':'). The portion of the string before the colon will be taken as the topic ID, while the por... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_anchor_body('topic1: This is the anchor text') == ('topic1', 'This is the anchor text')\", \"assert parse_anchor_body('topic3') == ('topic3', '')\", \"assert parse_anchor_body(':Empty topic ID') == ('', 'Empty topic ID')\", \"assert parse_anchor_body('... | {
"split": "train",
"index": 70002,
"acecode_id": "bigcode_python_fns_15100",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates one iteration of the Game of Life, a cellular automaton devised by mathematician John Conway. The universe is represented as a 2D grid of cells, where each cell can be either 'alive' (1) or 'dead' (0). The next state of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_generation([[1, 1], [1, 1]]) == [[1, 1], [1, 1]]\", \"assert next_generation([[0, 1, 0], [0, 0, 1], [1, 1, 1]]) == [[0, 0, 0], [1, 0, 1], [0, 1, 1]]\", \"assert next_generation([[1, 0, 1], [0, 1, 0], [1, 0, 1]]) == [[0, 1, 0], [1, 0, 1], [0, 1, 0]]\", \... | {
"split": "train",
"index": 70003,
"acecode_id": "bigcode_python_fns_15594",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function called `generate_complex_number` that generates a complex number with its real and imaginary parts randomly selected from the range of -1 to 1. The function should return the complex number in the form of a Python complex type (e.g., `a + bj`).\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isinstance(generate_complex_number(), complex)\", \"assert -1 <= generate_complex_number().real <= 1\", \"assert -1 <= generate_complex_number().imag <= 1\", \"assert generate_complex_number() != generate_complex_number()\", \"assert (generate_complex_number... | {
"split": "train",
"index": 70004,
"acecode_id": "evol_5206",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to toggle the value of a specified boolean option in a configuration dictionary. The configuration is represented as a dictionary containing key-value pairs where each value is either True or False. The function should update the valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert toggle_option({'closeafterrun': True}, 'closeafterrun') == False\", \"assert toggle_option({'closeafterrun': False}, 'closeafterrun') == True\", \"assert toggle_option({'closeafterrun': True, 'showlog': False}, 'showlog') == True\", \"assert toggle_option({'... | {
"split": "train",
"index": 70005,
"acecode_id": "oss_25104",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with building a function that takes four parameters related to a variance predictor module used in audio processing. The function should return a string describing the configuration of the module based on the given parameters. The parameters are: \n\n1. `fft_conv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_variance_predictor((3, 5), 0.2, 0.3, 64) == 'Variance Predictor Configuration: FFT Kernel Size: (3, 5), Encoder Dropout: 0.2, Decoder Dropout: 0.3, Filter Size: 64'\", \"assert build_variance_predictor((1, 1), 0.0, 0.0, 32) == 'Variance Predictor Confi... | {
"split": "train",
"index": 70006,
"acecode_id": "oss_23329",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the heights of bars in a histogram, implement a function that calculates the area of the largest rectangle that can be formed within the bounds of the histogram. The function should take a list of integers as input, where each integer repre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_rectangle_area([2,1,5,6,2,3]) == 10\", \"assert largest_rectangle_area([0,2]) == 2\", \"assert largest_rectangle_area([1,2,3,4,5]) == 9\", \"assert largest_rectangle_area([5,4,1,2,3]) == 8\", \"assert largest_rectangle_area([]) == 0\", \"assert large... | {
"split": "train",
"index": 70007,
"acecode_id": "bigcode_python_fns_49545",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of numbers and returns the least common multiple (LCM) of those numbers. The function should raise a ValueError if any of the elements in the list are not numbers (either integers or floats).\nPlease reason step by step, then write a self-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lowest_common_multiple([2, 3, 4]) == 12\", \"assert lowest_common_multiple([1, 5, 7]) == 35\", \"assert lowest_common_multiple([6, 8, 10]) == 120\", \"assert lowest_common_multiple([9, 12, 15]) == 180\", \"assert lowest_common_multiple([2, 2, 2]) == 2\", \"a... | {
"split": "train",
"index": 70008,
"acecode_id": "evol_29365",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a list of required utilities is missing. The function should take a list of utility names as input. If the list is not empty, the function should return a formatted string indicating the missing utilities. If the list is em... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_missing_utilities(['git', 'curl']) == 'The tool(s) git, curl were not found. Please install the appropriate package in your host.'\", \"assert check_missing_utilities(['python3', 'npm']) == 'The tool(s) python3, npm were not found. Please install the a... | {
"split": "train",
"index": 70009,
"acecode_id": "bigcode_python_fns_7806",
"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 unique integers from the original list while maintaining their original order. The input list may contain duplicates, and the output list should not include any ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([1, 1, 1, 1]) == [1]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([1, 2, 2, 1, 3, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([10, 20, 10, 30, 20]) =... | {
"split": "train",
"index": 70010,
"acecode_id": "bigcode_python_fns_17505",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the updating of a data packet's send timestamp and destination in a network. Your function should take the current timestamp and a destination string as inputs. The function will update the send timestamp and destinatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_send(0, 'child_1') == (0, 'child_1')\", \"assert update_send(5, 'child_2') == (5, 'child_2')\", \"assert update_send(10, 'child_3') == (10, 'child_3')\", \"assert update_send(15, 'child_4') == (15, 'child_4')\", \"assert update_send(20, 'child_5', 'ec... | {
"split": "train",
"index": 70011,
"acecode_id": "oss_32397",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of dictionaries, where each dictionary represents a row of data with named columns. The function should perform a basic transformation by filtering out any rows that contain a specific key with a value of None. The function should then ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_data([{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': None}, {'name': 'Charlie', 'age': 25}]) == [['Alice', 30], ['Charlie', 25]]\", \"assert transform_data([{'name': 'David', 'age': 40}, {'name': 'Eve', 'age': 35}, {'name': 'Frank', 'age': No... | {
"split": "train",
"index": 70012,
"acecode_id": "evol_26440",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of temperature readings recorded over time from a thermosalinograph (TSG). Each reading is represented as a dictionary with the following keys: 'time', 'lon', 'lat', and 'temperature'. Your task is to write a function that takes this list of readings and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_tsg_readings([{'time': '2023-10-01 12:00:00', 'lon': 5.0, 'lat': 45.0, 'temperature': 20.5}, {'time': '2023-10-01 12:05:00', 'lon': 5.1, 'lat': 45.1, 'temperature': None}, {'time': '2023-10-01 12:10:00', 'lon': 5.2, 'lat': 45.2, 'temperature': 21.0}]... | {
"split": "train",
"index": 70013,
"acecode_id": "bigcode_python_fns_48429",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing the device history for a specific tank based on a list of records. Each record consists of a timestamp, a tank ID, and a device ID. Your goal is to implement a function that returns a list of timestamps and device IDs for a given tank ID, but only ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_device_history([('2023-10-01T10:00:00', 1, 'A1'), ('2023-10-01T10:05:00', 1, 'A1'), ('2023-10-01T10:10:00', 1, 'A2'), ('2023-10-01T10:15:00', 1, 'A2'), ('2023-10-01T10:20:00', 1, 'A3')], 1) == [('2023-10-01T10:00:00', 'A1'), ('2023-10-01T10:10:00', 'A2')... | {
"split": "train",
"index": 70014,
"acecode_id": "bigcode_python_fns_21017",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a target value. Your task is to implement a function `find_target_indices(nums, target)` that returns the indices of two distinct numbers from the list that add up to the target value. If no such pair exists, the function should return an em... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_target_indices([0, 4, 3, 0], 0) == [0, 3]\", \"assert find_target_indices([2, 7, 11, 15], 9) == [0, 1]\", \"assert find_target_indices([3, 2, 4], 6) == [1, 2]\", \"assert find_target_indices([3, 3], 6) == [0, 1]\", \"assert find_target_indices([-1, -2, ... | {
"split": "train",
"index": 70015,
"acecode_id": "oss_31792",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a robot's movement system. The robot can move in four directions: up ('u'), right ('r'), down ('d'), and left ('l'). You need to implement a function `final_position(directions: str) -> List[int]` that takes a string of movement commands and ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_position('') == [0, 0]\", \"assert final_position('u') == [0, 1]\", \"assert final_position('d') == [0, -1]\", \"assert final_position('r') == [1, 0]\", \"assert final_position('l') == [-1, 0]\", \"assert final_position('uu') == [0, 2]\", \"assert fina... | {
"split": "train",
"index": 70016,
"acecode_id": "oss_19621",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a PDF file path. Your task is to implement a function that simulates opening a PDF file for reading and returns a message indicating whether the file was successfully opened or not. The function should return 'File opened successfully' if the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert open_pdf('valid_file.pdf') == 'File opened successfully'\", \"assert open_pdf('valid_file-123.pdf') == 'File opened successfully'\", \"assert open_pdf('valid_file_name.pdf') == 'File opened successfully'\", \"assert open_pdf('another_valid-file-name.pdf') ==... | {
"split": "train",
"index": 70017,
"acecode_id": "bigcode_python_fns_45337",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a network monitoring system that tracks collisions between stations. Each station logs its activity, and the system needs to maintain a record of these collisions. You will implement a function `add_collisions(existing_collisions: int, new_collision... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_collisions(0, 0) == 0\", \"assert add_collisions(5, 0) == 5\", \"assert add_collisions(0, 3) == 3\", \"assert add_collisions(2, 3) == 5\", \"assert add_collisions(10, -5) == 5\", \"assert add_collisions(5, -10) == 0\", \"assert add_collisions(0, -1) == 0... | {
"split": "train",
"index": 70018,
"acecode_id": "oss_35149",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sum_of_primes(array)` that takes a list of integers and returns the sum of all prime numbers in the array. A prime number is defined as a natural number greater than 1 that is not divisible by any other numbers except for 1 and itself. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_primes([]) == 0\", \"assert sum_of_primes([1, 4, 6]) == 0\", \"assert sum_of_primes([-1, -2, -3]) == 0\", \"assert sum_of_primes([2, 3, 5, 7, 11]) == 28\", \"assert sum_of_primes([10, 12, 14, 15]) == 0\", \"assert sum_of_primes([2, 3, 4, 5, 6]) == 10\... | {
"split": "train",
"index": 70019,
"acecode_id": "evol_22926",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the Least Common Multiple (LCM) of four integers. The function should take four parameters: w, x, y, and z, each representing positive integers. The function must efficiently compute the LCM using a mathematical approach. The constraints are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm(4, 6, 8, 12) == 24\", \"assert lcm(21, 14, 7, 14) == 42\", \"assert lcm(10, 25, 5, 20) == 100\", \"assert lcm(12, 15, 3, 9) == 180\", \"assert lcm(9, 3, 1, 6) == 18\", \"assert lcm(1, 1, 1, 1) == 1\", \"assert lcm(2, 3, 5, 7) == 210\", \"assert lcm(8, 4,... | {
"split": "train",
"index": 70020,
"acecode_id": "evol_23236",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a JSON-like data structure represented as a dictionary in Python. This data structure contains key-value pairs, where the keys represent different types of information and the values are the corresponding data. Your task is to extract the email address from the gi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_email({'addr1': '12 J.L.Nehru Road', 'addr2': 'http://capital-chowringhee.com', 'email': '<john.doe@example.com>', 'free1': 'Web site: http://capital-chowringhee.com', 'free2': 'For warranty and replacement please contact respective manufacturer comp... | {
"split": "train",
"index": 70021,
"acecode_id": "oss_5764",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two lists of integers as input and returns a new list containing only the unique elements from both lists, preserving the order of their first appearance. Do not use any built-in functions for merging or removing duplicates.\nPlease reason step b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_without_duplicates([1, 2, 3], [3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert merge_without_duplicates([1, 2, 2], [2, 3, 4]) == [1, 2, 3, 4]\", \"assert merge_without_duplicates([], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_without_duplicates([1, 1, 1], [1, ... | {
"split": "train",
"index": 70022,
"acecode_id": "evol_15427",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function called `remove_character` that takes two parameters: `obj`, which can be a string, list, dictionary, set, tuple, or any nested combination of these types, and `char`, a single character string that you want to remove from `obj`. The function should detec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_character('hello', 'l') == 'heo'\", \"assert remove_character(['hello', 'world'], 'l') == ['heo', 'word']\", \"assert remove_character({'key1': 'value1', 'key2': 'value2'}, 'v') == {'key1': 'alue1', 'key2': 'alue2'}\", \"assert remove_character({(1, 2... | {
"split": "train",
"index": 70023,
"acecode_id": "evol_8878",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list that contains elements of various data types, implement a function `get_data_types(elements)` that takes a list `elements` as input and returns a list of strings representing the data types of each element in the same order they appear in the input list. The data t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_data_types([5, 'hello', 7.8]) == ['int', 'str', 'float']\", \"assert get_data_types([]) == []\", \"assert get_data_types([None, {}, [], set()]) == ['other', 'other', 'other', 'other']\", \"assert get_data_types([3.14, 'pi', 42, 'answer']) == ['float', 's... | {
"split": "train",
"index": 70024,
"acecode_id": "evol_27127",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string `s` and a substring `sub`, implement a function `how_many_times(s: str, sub: str) -> int` that returns the number of times `sub` occurs in `s`, counting overlapping occurrences. For example, in the string `aaa`, the substring `a` occurs 3 times (at indices 0, 1, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert how_many_times('', 'a') == 0\", \"assert how_many_times('abc', 'a') == 1\", \"assert how_many_times('aaa', 'a') == 3\", \"assert how_many_times('aaaa', 'aa') == 3\", \"assert how_many_times('ababa', 'aba') == 2\", \"assert how_many_times('abababab', 'aba') =... | {
"split": "train",
"index": 70025,
"acecode_id": "evol_31283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a mathematical expression represented as a string and a dictionary of variable ranges. Your task is to evaluate the expression for every combination of variable values within their specified ranges and return a list of results. Each variable in the expression can ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expression('x + y', {'x': [1, 2], 'y': [3, 4]}) == [4.0, 5.0, 5.0, 6.0]\", \"assert evaluate_expression('x * y', {'x': [1, 2], 'y': [3, 4]}) == [3.0, 4.0, 6.0, 8.0]\", \"assert evaluate_expression('x - y', {'x': [5, 6], 'y': [1, 2]}) == [4.0, 3.0, 5... | {
"split": "train",
"index": 70026,
"acecode_id": "bigcode_python_fns_15338",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function, `recursive_sum(arr)`, that calculates the sum of all elements in a nested list of integers. The function should handle both empty lists and lists containing integers or nested lists of integers. For example, given the input `[... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recursive_sum([]) == 0\", \"assert recursive_sum([1]) == 1\", \"assert recursive_sum([[1, 2], [3, 4]]) == 10\", \"assert recursive_sum([1, 2, 3]) == 6\", \"assert recursive_sum([1, [2, 3], 4]) == 10\", \"assert recursive_sum([[1], [2], [3]]) == 6\", \"assert... | {
"split": "train",
"index": 70027,
"acecode_id": "oss_19715",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple message processing system. You need to create a class called `Message` that will represent a message with a specific content. Additionally, you need to create a class called `Flow`, which will have a method `process` that takes a `Messa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ExampleFlow('TestFlow').process(Message('Hello World')) == 'Flow Name: TestFlow, Message: Hello World'\", \"assert ExampleFlow('SampleFlow').process(Message('Testing message processing.')) == 'Flow Name: SampleFlow, Message: Testing message processing.'\", \... | {
"split": "train",
"index": 70028,
"acecode_id": "oss_28841",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a permission control system for a web application. The application has a monitoring panel that should only be accessible to users with a specific permission level. Your task is to implement a function named `check_permission` that takes a dictio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_permission({'alice': ['READ', 'WRITE'], 'bob': ['READ']}, ('alice', 'WRITE')) == True\", \"assert check_permission({'alice': ['READ', 'WRITE'], 'bob': ['READ']}, ('alice', 'EXECUTE')) == False\", \"assert check_permission({'alice': ['READ', 'WRITE'], '... | {
"split": "train",
"index": 70029,
"acecode_id": "oss_29556",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `calculate_sum` that returns the sum of all the integers in the list. The function should take a single parameter, a list of integers, and return a single integer value which is the sum of the elements. If the list is empty, return 0.\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sum([1, 2, 3, 4, 5]) == 15\", \"assert calculate_sum([-1, -2, -3]) == -6\", \"assert calculate_sum([]) == 0\", \"assert calculate_sum([10, 20, 30]) == 60\", \"assert calculate_sum([0, 0, 0]) == 0\", \"assert calculate_sum([1]) == 1\", \"assert calc... | {
"split": "train",
"index": 70030,
"acecode_id": "bigcode_python_fns_30186",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function 'sortWords' that takes a string of words and returns a list of each word sorted alphabetically. Additionally, the function should return the total count of vowels in each word as a list of integers corresponding to the sorted words. For example, given the inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sortWords('zebra cat dog') == (['aberz', 'act', 'dgo'], [2, 1, 1])\", \"assert sortWords('hello world') == (['ehllo', 'dlorw'], [2, 1])\", \"assert sortWords('abcdefg') == (['abcdefg'], [2])\", \"assert sortWords('') == ([], [])\", \"assert sortWords('single... | {
"split": "train",
"index": 70031,
"acecode_id": "evol_15804",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that finds the first occurrence of a specified integer in a given list. The function should return the index of the integer if found, or an appropriate error message if the input list is empty, if the specified integer is not found, or if the inputs are inv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_integer([1, 2, 3, 4, 5], 3) == 2\", \"assert find_integer([1, 2, 3, 4, 5], 6) == 'Error: Integer not found in list.'\", \"assert find_integer([], 1) == 'Error: List is empty.'\", \"assert find_integer([1, 1, 1, 1], 1) == 0\", \"assert find_integer([5, 4... | {
"split": "train",
"index": 70032,
"acecode_id": "evol_2972",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks if a given string is a valid email address. A valid email address should contain exactly one '@' symbol, followed by a domain name that includes at least one '.' character. The function should return True if the email a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_email('test@example.com') == True\", \"assert validate_email('user.name@domain.co') == True\", \"assert validate_email('user@sub.domain.com') == True\", \"assert validate_email('invalid@domain') == False\", \"assert validate_email('user@.com') == Fa... | {
"split": "train",
"index": 70033,
"acecode_id": "oss_7856",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the dimensions of a tensor. Your task is to implement a function that modifies the dimensions based on a specified parallel dimension and world size. The parallel dimension indicates how the dimensions of the tensor should be scaled... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_tensor_dimensions([2, 3], 0, 4) == [2, 12]\", \"assert modify_tensor_dimensions([2, 3], 1, 4) == [8, 3]\", \"assert modify_tensor_dimensions([2, 3], -1, 4) == [8, 3]\", \"assert modify_tensor_dimensions([2, 3, 4], 0, 2) == [2, 3, 8]\", \"assert modify... | {
"split": "train",
"index": 70034,
"acecode_id": "bigcode_python_fns_40988",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a dictionary representing environment variables, a string representing a request type, and a string representing the current environment. The function should return a formatted string that combines the request type and the e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_request({'PROD_DB': 'db_prod', 'DEV_DB': 'db_dev', 'API_KEY': '12345'}, 'GET', 'prod') == 'Request: GET, Environment: PROD_DB: db_prod'\", \"assert format_request({'PROD_DB': 'db_prod', 'DEV_DB': 'db_dev', 'API_KEY': '12345'}, 'POST', 'dev') == 'Reque... | {
"split": "train",
"index": 70035,
"acecode_id": "bigcode_python_fns_26234",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes member requests based on approval status. The function should handle whether a member request is approved or rejected and return a message indicating the status of the request. Your task is to implement the `process_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_member_request(1, True) == 'Request 1 approved'\", \"assert process_member_request(2, False) == 'Request 2 rejected'\", \"assert process_member_request(3, True) == 'Request 3 approved'\", \"assert process_member_request(4, False) == 'Request 4 reject... | {
"split": "train",
"index": 70036,
"acecode_id": "oss_32718",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine if a transition from one tower to another is valid in the classic \"Tower of Hanoi\" puzzle. In this puzzle, you have three towers, and each tower can hold a stack of disks of different sizes. The disks are represented by... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert valid_transition([[3], [], []], 0, 1) == True\", \"assert valid_transition([[3], [2], []], 0, 2) == True\", \"assert valid_transition([[3], [], [2]], 0, 2) == False\", \"assert valid_transition([[1, 2, 3], [], []], 0, 1) == True\", \"assert valid_transition(... | {
"split": "train",
"index": 70037,
"acecode_id": "oss_17195",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of strings representing module names and returns a dictionary containing the count of unique module names. The function should ignore any leading and trailing whitespaces in the module names and should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_modules(['CascadeFCBBoxHead', 'SharedFCBBoxHead', 'sharedFCBBoxHead', 'CascadeFCBBoxHead']) == {'cascadefcbboxhead': 2, 'sharedfcbboxhead': 2}\", \"assert count_unique_modules(['ModuleA', 'modulea', 'moduleB', 'ModuleC', 'modulea']) == {'modulea... | {
"split": "train",
"index": 70038,
"acecode_id": "oss_5915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a URL for accessing a specific lesson within an educational module. The function should take two parameters: the name of the module (a string) and a unique identifier for the lesson (also a string). The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_lesson_url('Python Basics', 'python-basics') == 'https://example.com/modulos_aulas/aula?slug=python-basics'\", \"assert generate_lesson_url('Data Science', 'data-science') == 'https://example.com/modulos_aulas/aula?slug=data-science'\", \"assert gen... | {
"split": "train",
"index": 70039,
"acecode_id": "oss_7912",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer `n`. An array `nums` of length `n + 1` is generated in the following way: `nums[0] = 0`, `nums[1] = 1`, `nums[2 * i] = nums[i]` when `2 <= 2 * i <= n`, `nums[2 * i + 1] = nums[i] + nums[i + 1]` when `2 <= 2 * i + 1 <= n`. Your task is to implement a fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getMaximumGenerated(0) == (0, 0)\", \"assert getMaximumGenerated(1) == (1, 1)\", \"assert getMaximumGenerated(2) == (1, 1)\", \"assert getMaximumGenerated(3) == (2, 3)\", \"assert getMaximumGenerated(5) == (3, 5)\", \"assert getMaximumGenerated(6) == (3, 5)\... | {
"split": "train",
"index": 70040,
"acecode_id": "evol_29667",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, return the sum of the three smallest numbers in the list. If the list contains fewer than three numbers, return the sum of all the numbers in the list. The function should run in linear time complexity, O(n).\nPlease reason step by step, then write a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_smallest_three([4, 2, 3, 5, 1]) == 6\", \"assert sum_smallest_three([10, 5, 2, 7, 3]) == 10\", \"assert sum_smallest_three([1]) == 1\", \"assert sum_smallest_three([1, 2]) == 3\", \"assert sum_smallest_three([1, 2, 3]) == 6\", \"assert sum_smallest_three... | {
"split": "train",
"index": 70041,
"acecode_id": "evol_18724",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes data about a course and its enrolled students. The function should take the course name, instructor name, and a list of enrolled students as input. It should return a dictionary containing the course name, instructor na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert course_info('Mathematics', 'Dr. Smith', ['Alice', 'Bob', 'Charlie']) == {'course_name': 'Mathematics', 'instructor': 'Dr. Smith', 'enrolled_students': ['Alice', 'Bob', 'Charlie'], 'total_enrolled_students': 3}\", \"assert course_info('Biology', 'Prof. Johnso... | {
"split": "train",
"index": 70042,
"acecode_id": "oss_18227",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a Python function that takes a dictionary as input, where each key-value pair represents a person and their favorite color. The function should return a new dictionary where the keys are the colors and the values are lists of all the people who have that color as their f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert favorite_colors_to_people({'Alice': 'Blue', 'Bob': 'Red', 'Charlie': 'Blue', 'David': 'Green'}) == {'Blue': ['Alice', 'Charlie'], 'Red': ['Bob'], 'Green': ['David']}\", \"assert favorite_colors_to_people({'Eve': 'Yellow', 'Frank': 'Red', 'Grace': 'Yellow', '... | {
"split": "train",
"index": 70043,
"acecode_id": "evol_13358",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that verifies if a given province or territory is 'British Columbia'. The function should take a single string input representing the user's province and return True if the input matches 'British Columbia' or 'BC' (case insensitive). If t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_province_bc('British Columbia') == True\", \"assert is_province_bc('BC') == True\", \"assert is_province_bc('british columbia') == True\", \"assert is_province_bc('bc') == True\", \"assert is_province_bc('Alberta') == False\", \"assert is_province_bc('Nov... | {
"split": "train",
"index": 70044,
"acecode_id": "bigcode_python_fns_2374",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a multi-dimensional data set represented as an array of tuples, where each tuple consists of four numerical values, implement a function that scales the entire data set to a range between 0 and 1 while preserving the relative distances between the points. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_data([(10, 10, 10, 10), (20, 20, 20, 20), (30, 30, 30, 30)]) == [[0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 0.5, 0.5], [1.0, 1.0, 1.0, 1.0]]\", \"assert normalize_data([(0, 0, 0, 0), (1, 1, 1, 1)]) == [[0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]]\", \"assert ... | {
"split": "train",
"index": 70045,
"acecode_id": "evol_22626",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a migration operation code to rename a field within a Django model named `Image`. The function should take two input parameters: the existing field name and the new field name. It should return a string representing the mig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_rename_field_migration('old_title', 'new_title') == \\\"migrations.RenameField(model_name='image', old_name='old_title', new_name='new_title')\\\"\", \"assert generate_rename_field_migration('image_url', 'url') == \\\"migrations.RenameField(model_na... | {
"split": "train",
"index": 70046,
"acecode_id": "oss_37007",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two 2D arrays, `coords` and `meds`, where each array contains points represented as [x, y, z], your task is to find all pairs of points (one from `coords` and one from `meds`) that are within a specified Euclidean distance threshold in the xy-plane. The z-coordinate of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_matches([[0, 0, 0]], [[0, 0, 0]], 1) == ([(0, 0, 0)], [0.0])\", \"assert find_matches([[1, 1, 1]], [[2, 2, 0]], 1) == ([], [])\", \"assert find_matches([[0, 0, 0]], [[1, 1, 1]], 2) == ([], [])\", \"assert find_matches([[1, 1, 0], [2, 2, 0]], [[1, 1, 0],... | {
"split": "train",
"index": 70047,
"acecode_id": "bigcode_python_fns_38078",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to generate a list of random integers. Implement a function `generate_random_integers` that takes in the following parameters: \n- `count`: an integer representing the number of random integers to generate. \n- `lower_bound`: an integer r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_integers(0, 1, 10) == []\", \"assert len(generate_random_integers(10, 1, 100)) == 10\", \"assert all(1 <= x < 100 for x in generate_random_integers(10, 1, 100))\", \"assert generate_random_integers(5, 1, 2) == [1, 1, 1, 1, 1]\", \"assert gene... | {
"split": "train",
"index": 70048,
"acecode_id": "oss_1604",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `safely_flatten(nested_list)` that takes a nested list as input and returns a flat list containing all the elements. The function should work recursively for any level of nested lists. If the input contains a non-list element that cannot be iterated (like a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert safely_flatten([[1, 2], [3, [4, [5, 6]]]]) == [1, 2, 3, 4, 5, 6]\", \"assert safely_flatten([1, [2, 3], [[4], 5]]) == [1, 2, 3, 4, 5]\", \"assert safely_flatten([[[1]], [2, [3]], 4]) == [1, 2, 3, 4]\", \"assert safely_flatten([[], [1, 2, [3, 4]]]) == [1, 2, ... | {
"split": "train",
"index": 70049,
"acecode_id": "evol_36181",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary with string keys, implement a function that returns a list of the keys in a random order. Your function should take a dictionary as input and return a list of its keys shuffled in a random order. Note that the output will vary with each execution due to the r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert random_order_dic_keys_into_list({'a': 1, 'b': 2, 'c': 3}) != ['a', 'b', 'c']\", \"assert sorted(random_order_dic_keys_into_list({'x': 10, 'y': 20})) == ['x', 'y']\", \"assert len(random_order_dic_keys_into_list({'key1': 100, 'key2': 200, 'key3': 300, 'key4':... | {
"split": "train",
"index": 70050,
"acecode_id": "bigcode_python_fns_5844",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a new list containing only the unique elements from the input list, maintaining the original order of their first occurrence. The function should ignore any duplicates and return an empty list if there are no unique elemen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4, 4, 5]) == [1, 3, 5]\", \"assert unique_elements([1, 1, 1, 1]) == []\", \"assert unique_elements([5, 6, 5, 7, 8, 6]) == [7, 8]\", \"assert unique_elements([]) == []\", \"assert unique_elements([10, 20, 30, 10, 40]) == [20, 30, ... | {
"split": "train",
"index": 70051,
"acecode_id": "bigcode_python_fns_2217",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns a list of joystick names from a predefined set of joysticks. Each joystick has a unique name. The function should not take any arguments and should return a list of strings representing the names of the joysticks. Assume that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_joysticks() == ['Logitech F310', 'Xbox One Controller', 'PlayStation DualShock 4', 'Nintendo Switch Pro Controller', 'Razer Tartarus Pro']\", \"assert len(list_joysticks()) == 5\", \"assert 'Logitech F310' in list_joysticks()\", \"assert 'Xbox One Contr... | {
"split": "train",
"index": 70052,
"acecode_id": "bigcode_python_fns_49437",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a line of text. Your task is to implement a function that concatenates all the strings in the list into a single string, with each original string separated by a space. The function should remove any leading or trail... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concat_strings(['Hello', 'world']) == 'Hello world'\", \"assert concat_strings([' Python ', 'is', ' awesome! ']) == 'Python is awesome!'\", \"assert concat_strings([' This', 'is', 'a test. ']) == 'This is a test.'\", \"assert concat_strings(['SingleLin... | {
"split": "train",
"index": 70053,
"acecode_id": "bigcode_python_fns_17519",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a nested data structure that can contain integers, strings, and lists of these types. Your task is to implement a function `check_structure_validity(data)` that validates the structure of the input data. The data is considered valid if it follows these rules: 1. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_structure_validity((1, 2, 3, ['a', 'b', 'c'])) == True\", \"assert check_structure_validity((1, 'hello', [1, 2, 3])) == True\", \"assert check_structure_validity((1, 2, [3, 'test'])) == True\", \"assert check_structure_validity((1, 2, 3, 'string', ['a'... | {
"split": "train",
"index": 70054,
"acecode_id": "bigcode_python_fns_31717",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Define the mathematical function \\( \\mathcal{I}(x,y) = (1+x+y)^2+y-x \\). Given two \\( \\mathcal{I} \\)-expressions represented as strings, your task is to compute the least simultaneous value of these two expressions for non-negative integers. If there is no solution in non... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert least_simultaneous_value('I(0, 0)', 'I(0, 0)') == 1\", \"assert least_simultaneous_value('I(x, 0)', 'I(0, x)') == 1\", \"assert least_simultaneous_value('I(x, y)', 'I(x, y)') == 1\", \"assert least_simultaneous_value('I(0, x)', 'I(y, 0)') == 1\", \"assert le... | {
"split": "train",
"index": 70055,
"acecode_id": "evol_35641",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a string expression, determine if it is a valid mathematical expression. A valid expression must satisfy the following conditions: it can only contain digits, operators (+, -, *, /), parentheses (), brackets [], braces {}, and spaces. It must not end with an operator, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_expression('3 + 5 * (2 - 8') == False\", \"assert check_expression('5 + {3 * [2 / (1 + 1)]') == False\", \"assert check_expression('3 + 5 * (2 - 8))') == False\", \"assert check_expression('3 + 5 * (2 - 8) /') == False\", \"assert check_expression('3 +... | {
"split": "train",
"index": 70056,
"acecode_id": "evol_9661",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a string `tag` that represents the text of a tag. Your task is to implement a function `is_anno_end_marker(tag: str) -> bool` that checks if the string is an annotation end marker. The string is considered an annotation end marker if it matches the pattern '^\\[EN... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_anno_end_marker('[END]') == True\", \"assert is_anno_end_marker('[START]') == False\", \"assert is_anno_end_marker('[END] ') == False\", \"assert is_anno_end_marker(' [END]') == False\", \"assert is_anno_end_marker('END') == False\", \"assert is_anno_end_... | {
"split": "train",
"index": 70057,
"acecode_id": "bigcode_python_fns_39265",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an undirected graph represented by an edge list, where each edge is defined by three integers: two nodes and the distance between them. Implement a function that checks if there is a path between two nodes such that the distance of every edge in the path is strict... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert DistanceLimitedPathsExist(6, [[0, 2, 4], [0, 3, 2], [1, 2, 3], [2, 3, 1], [4, 5, 5]]).query(1, 3, 3) == False\", \"assert DistanceLimitedPathsExist(6, [[0, 2, 4], [0, 3, 2], [1, 2, 3], [2, 3, 1], [4, 5, 5]]).query(0, 5, 6) == False\", \"assert DistanceLimite... | {
"split": "train",
"index": 70058,
"acecode_id": "evol_21586",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a text processing function that cleans up HTML content. The function should take a string of HTML content as input and perform the following operations in sequence: \n\n1. Replace all `</p>` tags with a newline character `\\n`. \n2. Replace all ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_html('<p>Hello World</p>') == 'Hello World'\", \"assert clean_html('<p> Leading spaces</p>') == 'Leading spaces'\", \"assert clean_html('<p>Trailing spaces </p>') == 'Trailing spaces'\", \"assert clean_html('<p> Multiple spaces </p>') == 'Mul... | {
"split": "train",
"index": 70059,
"acecode_id": "oss_31464",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the deletion of a document from a user's collection. Given a list of documents represented by their IDs and an ID of the document to be deleted, write a function `delete_document(documents: List[int], document_id: int) -> T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_document([1, 2, 3, 4], 2) == (True, 'Item deleted.', [1, 3, 4])\", \"assert delete_document([1, 2, 3], 4) == (False, 'Item not found.', [1, 2, 3])\", \"assert delete_document([], 1) == (False, 'Item not found.', [])\", \"assert delete_document([10, 20... | {
"split": "train",
"index": 70060,
"acecode_id": "bigcode_python_fns_19315",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the retrieval and display of information about a user's athletic activities. You will implement a function called `get_activity_details(activities, index)` that takes a list of activities and an index as input. The `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_activity_details([{'type': 'run', 'start_time': '2023-01-01T10:00:00Z', 'distance': 5.0, 'average_speed': 10.0}], 0) == 'Type: run, Start Time: 2023-01-01T10:00:00Z, Distance: 5.0 km, Average Speed: 10.0 km/h'\", \"assert get_activity_details([{'type': '... | {
"split": "train",
"index": 70061,
"acecode_id": "oss_28838",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes an optional string argument representing the name of an image collection. If the argument is provided, the function should return a message indicating that images from the specified collection will be loaded. If no argum... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_images('SummerPics') == 'Loading images from SummerPics'\", \"assert load_images('WinterPics') == 'Loading images from WinterPics'\", \"assert load_images('') == 'No images to load'\", \"assert load_images(None) == 'No images to load'\", \"assert load_i... | {
"split": "train",
"index": 70062,
"acecode_id": "oss_18871",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries, `live_parameters` and `original_parameters`. Your task is to validate the keys in `live_parameters` against the keys in `original_parameters`. If a key from `live_parameters` does not exist in `original_parameters`, it should be removed from `liv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_input_parameters({'a': 1, 'b': 2}, {'a': 0}) == {'a': 1}\", \"assert validate_input_parameters({'x': 10, 'y': 20}, {'y': 5, 'z': 15}) == {'y': 20}\", \"assert validate_input_parameters({}, {'a': 1}) == {}\", \"assert validate_input_parameters({'foo'... | {
"split": "train",
"index": 70063,
"acecode_id": "bigcode_python_fns_35442",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, create a function that separates the even and odd numbers from the list, each in reverse order of their appearance in the original list. The function should then merge these two lists alternatingly, starting with the even numbers list. Write a function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_and_merge([2, 4, 6, 8]) == [8, 6, 4, 2]\", \"assert split_and_merge([]) == []\", \"assert split_and_merge([2, 2, 2]) == [2, 2, 2]\", \"assert split_and_merge([1, 2]) == [2, 1]\", \"assert split_and_merge([2]) == [2]\", \"assert split_and_merge([3]) == ... | {
"split": "train",
"index": 70064,
"acecode_id": "evol_18879",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Create a Python function that takes a list of integers as input and returns a new list containing tuples of each element paired with its corresponding index. The function should traverse the input list and construct the output list in the format (element, index).\nPlease reason... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_indices([5, 10, 15, 20]) == [(5, 0), (10, 1), (15, 2), (20, 3)]\", \"assert print_indices([]) == []\", \"assert print_indices([1]) == [(1, 0)]\", \"assert print_indices([0, 0, 0]) == [(0, 0), (0, 1), (0, 2)]\", \"assert print_indices([-1, -2, -3]) == [... | {
"split": "train",
"index": 70065,
"acecode_id": "evol_25453",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers `start` and `target`, design an algorithm to calculate the minimum number of operations required to reach the `target` number from the `start` number. You can perform two operations: incrementing the current number by 1 or decrementing it by 1. Implement the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_operations(10, 3) == 7\", \"assert min_operations(5, 5) == 0\", \"assert min_operations(1, 10) == 9\", \"assert min_operations(0, 0) == 0\", \"assert min_operations(-5, -3) == 2\", \"assert min_operations(100, 50) == 50\", \"assert min_operations(-10, -1... | {
"split": "train",
"index": 70066,
"acecode_id": "evol_3410",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing only the characters '(' and ')'. Your task is to implement a function `count_invalid_parenthesis(string)` that takes this string as input and returns the minimum number of invalid parentheses that need to be removed to make the sequence valid. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_invalid_parenthesis('()())()') == 1\", \"assert count_invalid_parenthesis('(((') == 3\", \"assert count_invalid_parenthesis(')))') == 3\", \"assert count_invalid_parenthesis('()') == 0\", \"assert count_invalid_parenthesis('((') == 2\", \"assert count_... | {
"split": "train",
"index": 70067,
"acecode_id": "oss_24494",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that removes all duplicate entries while maintaining the original order of the elements. The function should return a new list containing only unique elements from the original list. For example, given the input ['apple', 'banana', ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates(['apple', 'banana', 'apple', 'pear', 'banana']) == ['apple', 'banana', 'pear']\", \"assert remove_duplicates(['cat', 'dog', 'cat', 'fish', 'dog']) == ['cat', 'dog', 'fish']\", \"assert remove_duplicates(['a', 'b', 'c', 'a', 'b', 'c']) == ['... | {
"split": "train",
"index": 70068,
"acecode_id": "evol_33720",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of HTTP requests made to a server, where each integer indicates the count of requests made at a specific time interval. Your task is to implement a function `calculate_successful_requests(requests: List[int]) -> int` that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_successful_requests([1, 2, 3]) == 3\", \"assert calculate_successful_requests([0, 0, 0]) == 0\", \"assert calculate_successful_requests([5, 0, 3, 0]) == 2\", \"assert calculate_successful_requests([1, 1, 1, 1]) == 4\", \"assert calculate_successful... | {
"split": "train",
"index": 70069,
"acecode_id": "bigcode_python_fns_4275",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of recordings where each recording is represented as a dictionary with the following keys: 'id', 'is_in_testset', 'formula_id', 'handwriting', and 'formula_in_latex'. You also have a list of algorithms, where each algorithm is a function that takes a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert training_set_multiplication([{'id': 1, 'is_in_testset': 0, 'formula_id': 'f1', 'handwriting': 'abc', 'formula_in_latex': 'a+b=c'}], [lambda x: [x + '1', x + '2']]) == [{'id': 1, 'is_in_testset': 0, 'formula_id': 'f1', 'handwriting': 'abc1', 'formula_in_latex... | {
"split": "train",
"index": 70070,
"acecode_id": "bigcode_python_fns_22539",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "A positive integer n is deemed squarefree if it is not divisible by any square of a prime number. Write a function that takes an integer N as input and returns the total count of squarefree numbers that exist below the value of N.\nPlease reason step by step, then write a self-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_squarefree_numbers(1) == 1\", \"assert count_squarefree_numbers(2) == 1\", \"assert count_squarefree_numbers(3) == 2\", \"assert count_squarefree_numbers(5) == 3\", \"assert count_squarefree_numbers(12) == 8\", \"assert count_squarefree_numbers(30) == ... | {
"split": "train",
"index": 70071,
"acecode_id": "evol_24744",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of equal length, `x` and `y`, where each element corresponds to a coordinate point (x[i], y[i]). Your task is to calculate the count of points that fall within the given ranges for both the x and y coordinates. You should implement a function called `cou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_points_in_range([1, 2, 3, 4, 5], [2, 3, 4, 5, 6], (1, 5), (2, 6)) == 5\", \"assert count_points_in_range([1, 2, 3, 4, 5], [2, 3, 4, 5, 6], (0, 2), (0, 3)) == 2\", \"assert count_points_in_range([1, 2, 3, 4, 5], [2, 3, 4, 5, 6], (2, 4), (4, 5)) == 2\", ... | {
"split": "train",
"index": 70072,
"acecode_id": "bigcode_python_fns_15311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `catalog_entries(dictionary)` that takes a dictionary representing a user profile and returns a list of formatted strings for each entry in the dictionary. Each formatted string should be in the format 'key: value'. For example, for the input {'name': 'John', '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert catalog_entries({'name': 'John', 'age': 20, 'location': 'London'}) == ['name: John', 'age: 20', 'location: London']\", \"assert catalog_entries({'name': 'Alice', 'age': 30, 'location': 'New York'}) == ['name: Alice', 'age: 30', 'location: New York']\", \"ass... | {
"split": "train",
"index": 70073,
"acecode_id": "evol_33726",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simplified version of a socket server that listens for incoming connections on a given socket name. Your function should take two parameters: a string `socket_name` representing the name of the socket, and a callable `acc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bind_and_listen_on_socket('my_socket', lambda x: x) == 'Listening on my_socket'\", \"assert bind_and_listen_on_socket('server_socket', print) == 'Listening on server_socket'\", \"assert bind_and_listen_on_socket('test_socket', lambda x: x * 2) == 'Listening ... | {
"split": "train",
"index": 70074,
"acecode_id": "bigcode_python_fns_35884",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats and combines two help messages into one comprehensive help message. The first help message contains general usage instructions, and the second help message contains detailed usage instructions. Your function should take two s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_help_messages('General usage instructions.', 'Detailed instructions: Use the command to earn bitcoin.') == 'General usage instructions.\\\\nFor detailed help, run 21 help --detail\\\\nDetailed instructions: Use the command to earn bitcoin.'\", \"asse... | {
"split": "train",
"index": 70075,
"acecode_id": "bigcode_python_fns_48518",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a given binary number (as a string) to its equivalent octal value. The function should also validate the input to ensure it is a valid binary number. If the input is invalid, the function should return 'Invalid input. A binary number is expected.'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_to_octal('101010') == 52\", \"assert binary_to_octal('111') == 7\", \"assert binary_to_octal('100000') == 40\", \"assert binary_to_octal('0') == 0\", \"assert binary_to_octal('11111111') == 377\", \"assert binary_to_octal('101010101') == 525\", \"asse... | {
"split": "train",
"index": 70076,
"acecode_id": "evol_31176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified banking system that can process transactions and withdrawals based on an available balance. You will implement a function called `process_transaction(amount: float, transaction_type: str) -> bool` that accepts an amount and a transa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_transaction(50.0, 'card') == True\", \"assert process_transaction(100.0, 'withdraw') == True\", \"assert process_transaction(0.0, 'card') == True\", \"assert process_transaction(0.0, 'withdraw') == True\", \"assert process_transaction(25.0, 'card') =... | {
"split": "train",
"index": 70077,
"acecode_id": "oss_9592",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function `fetch_data(quarter: str) -> str` that simulates fetching data from a marketing database for a specified quarter of the financial year. The function should check if the provided quarter is valid (i.e., one of 'Q1', 'Q2', 'Q3', 'Q4'). If the quarter i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_data('Q1') == 'Data fetched for Q1'\", \"assert fetch_data('Q2') == 'Data fetched for Q2'\", \"assert fetch_data('Q3') == 'Data fetched for Q3'\", \"assert fetch_data('Q4') == 'Data fetched for Q4'\", \"assert fetch_data('Q1') == 'Data fetched for Q1'\... | {
"split": "train",
"index": 70078,
"acecode_id": "evol_17247",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, find the smallest missing positive number and the largest missing positive number. Return a tuple containing both numbers. If there are no missing positive numbers, return (None, None).\nPlease reason step by step, then write a self-contained Python ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert missing_numbers([1, 2, 3, 4]) == (5, None)\", \"assert missing_numbers([1, 1, 1, 1]) == (2, None)\", \"assert missing_numbers([1]) == (2, None)\", \"assert missing_numbers([1, 2, 3, 4, 5, 6]) == (7, None)\", \"assert missing_numbers([1, 2, 0, -1, -2]) == (3,... | {
"split": "train",
"index": 70079,
"acecode_id": "evol_4538",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that parses a device specification string and extracts the device type and ID. The input string will be in the format: '/job:<name>/replica:<id>/task:<id>/device:<type>:<id>', where <type> can be either 'CPU' or 'GPU', and <id> is a numer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_device('/job:example/replica:1/task:1/device:CPU:0') == ('CPU', 0)\", \"assert parse_device('/job:example/replica:1/task:1/device:GPU:5') == ('GPU', 5)\", \"assert parse_device('/job:example/replica:1/task:1/device:CPU:10') == ('CPU', 10)\", \"assert p... | {
"split": "train",
"index": 70080,
"acecode_id": "bigcode_python_fns_35198",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `autocomplete_suggestions(seed_text: str, n_words: int) -> str` that generates auto-complete suggestions based on a given input text. The function should take in a string `seed_text`, which represents the user's input, and an integer `n_words`, which indica... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert autocomplete_suggestions('hello', 2) == 'hello world this'\", \"assert autocomplete_suggestions('test', 3) == 'test of autocomplete suggestions'\", \"assert autocomplete_suggestions('is', 1) == 'is a'\", \"assert autocomplete_suggestions('world', 1) == 'worl... | {
"split": "train",
"index": 70081,
"acecode_id": "evol_4967",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a value of any type, write a function that checks if the value is immutable. Immutable types include built-in types such as integers, floats, booleans, strings, tuples, ranges, and bytes. Additionally, consider custom types from a hypothetical library, such as Int, Number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_immutable_type(5) == True\", \"assert is_immutable_type(3.14) == True\", \"assert is_immutable_type(True) == True\", \"assert is_immutable_type('Hello') == True\", \"assert is_immutable_type((1, 2, 3)) == True\", \"assert is_immutable_type(range(10)) == T... | {
"split": "train",
"index": 70082,
"acecode_id": "bigcode_python_fns_1897",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `motivational_message` that takes two parameters: `team` (a string representing the name of a team) and `department` (a string representing the name of a department). The function should return a motivational message in the format: 'Keep up the great ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert motivational_message('Development Team', 'Engineering') == 'Keep up the great work, Development Team! You are a vital part of the Engineering.'\", \"assert motivational_message('Sales Team', 'Marketing') == 'Keep up the great work, Sales Team! You are a vita... | {
"split": "train",
"index": 70083,
"acecode_id": "evol_8214",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a logging system for a software application. Implement a function `dynamic_logger(level: int, logContent: str, errorContent: str, newLevel: int) -> str` that simulates a simple logging mechanism. The function accepts the following parameters: \n- `l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dynamic_logger(0, 'This is a debug message', 'This is an error message', 1) == 'Log: This is a debug message, Error: This is an error message, Current Level: 1'\", \"assert dynamic_logger(1, 'This is an info message', 'This is another error message', 2) == '... | {
"split": "train",
"index": 70084,
"acecode_id": "oss_15520",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing time steps. Your task is to calculate the total log-likelihood of these time steps, where the log-likelihood for each individual time step is defined as the natural logarithm of the time step value. Implement a function `log_likelih... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_likelihood([5]) == 1.6094379124341003\", \"assert log_likelihood([1, 1, 1]) == 0.0\", \"assert log_likelihood([8]) == 2.0794415416798357\", \"assert log_likelihood([25]) == 3.2188758248682006\", \"assert log_likelihood([3, 3, 3]) == 3.295836866004329\"]}... | {
"split": "train",
"index": 70085,
"acecode_id": "bigcode_python_fns_10022",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of different buildings in a city. Your task is to determine the number of buildings that can be seen when looking from the left side of the city. A building can be seen from the left if it is taller than all the building... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_visible_buildings([3, 1, 4, 1, 5]) == 3\", \"assert count_visible_buildings([1, 2, 3, 4, 5]) == 5\", \"assert count_visible_buildings([5, 4, 3, 2, 1]) == 1\", \"assert count_visible_buildings([2, 2, 2, 2, 2]) == 1\", \"assert count_visible_buildings([1... | {
"split": "train",
"index": 70086,
"acecode_id": "bigcode_python_fns_28944",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function in Python called 'fibonacci' that generates a Fibonacci sequence of 'n' numbers, where 'n' is a user-defined parameter. If 'n' is 0 or negative, the function should return an empty list. Otherwise, the function should return the first 'n' numbers in the Fib... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(-1) == []\", \"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 fibon... | {
"split": "train",
"index": 70087,
"acecode_id": "evol_25287",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string and an integer 'n', implement a function to find the 'n'th non-repeating character in the string. A non-repeating character is defined as a character that appears exactly once in the string. The function should return 'None' if there aren't that many non-repeatin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_nth_non_repeating_char('abcde', 1) == 'a'\", \"assert find_nth_non_repeating_char('Noon', 1) == 'N'\", \"assert find_nth_non_repeating_char('HelloWorld', 4) == 'r'\", \"assert find_nth_non_repeating_char('apple', 1) == 'a'\", \"assert find_nth_non_repea... | {
"split": "train",
"index": 70088,
"acecode_id": "evol_6855",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given two strings, `old` and `new`, implement a function `compute_edits(old: str, new: str) -> List[Tuple[int, str]]` that computes the in-place edits needed to convert the `old` string into the `new` string. The function should return a list of tuples where each tuple contains... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_edits('hello', 'hello') == []\", \"assert compute_edits('python', 'pythons') == [(6, 's')]\", \"assert compute_edits('abc', 'def') == [(0, 'def')]\", \"assert compute_edits('abcd', 'abdc') == [(2, 'd')]\", \"assert compute_edits('abcd', 'abcd') == []... | {
"split": "train",
"index": 70089,
"acecode_id": "bigcode_python_fns_46529",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the weighted harmonic mean of a series of non-zero numeric values provided in a dictionary. The keys of the dictionary are not relevant for the calculation. Your function should handle cases where values are zero or non-numeric by ignoring t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_weighted_harmonic_mean({'a': 1, 'b': 2, 'c': 3}) == 1.6363636363636365\", \"assert calculate_weighted_harmonic_mean({'a': 0, 'b': 'test', 'c': 3}) == 3.0\", \"assert calculate_weighted_harmonic_mean({'a': 1, 'b': 0, 'c': 'test'}) == 1.0\", \"assert... | {
"split": "train",
"index": 70090,
"acecode_id": "evol_29196",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a function `tri_area(base: float, height: float) -> float` that calculates the area of a triangle given its base and height. The area of a triangle can be calculated using the formula: area = 0.5 * base * height. The function should return the area as a float.\nPlease rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert(tri_area(6, 4) == 12.0)\", \"assert(tri_area(10, 5) == 25.0)\", \"assert(tri_area(0, 5) == 0.0)\", \"assert(tri_area(7, 3) == 10.5)\", \"assert(tri_area(8, 0) == 0.0)\", \"assert(tri_area(2, 2) == 2.0)\", \"assert(tri_area(1, 1) == 0.5)\", \"assert(tri_area(... | {
"split": "train",
"index": 70091,
"acecode_id": "evol_14917",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a simple linked list. The function should take a list of integers as input, representing the values to be added to the linked list. The function should return a list of integers representing the values of al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_linked_list([]) == []\", \"assert create_linked_list([1]) == [1]\", \"assert create_linked_list([1, 2]) == [1, 2]\", \"assert create_linked_list([3, 4, 5]) == [3, 4, 5]\", \"assert create_linked_list([1, 3, 5, 7]) == [1, 3, 5, 7]\", \"assert create_li... | {
"split": "train",
"index": 70092,
"acecode_id": "oss_13230",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_valid_ipv6(ip: str) -> bool` that takes a string representing an IPv6 address and returns True if it is a valid IPv6 address according to the standard format, and False otherwise. The standard format for an IPv6 address consists of eight groups of four ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_ipv6('2001:0db8:85a3:0000:0000:8a2e:0370:7334') == True\", \"assert is_valid_ipv6('::1') == True\", \"assert is_valid_ipv6('2001:db8::ff00:42:8329') == True\", \"assert is_valid_ipv6('1234:5678:9abc:def0:1234:5678:9abc:def0') == True\", \"assert is_... | {
"split": "train",
"index": 70093,
"acecode_id": "evol_28338",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that converts Polish numerals written as strings into their corresponding integer values. In Polish, numbers from 11 to 18 are represented with unique words ending in 'naście' (e.g., 'dwanaście' for 12, 'trzynaście' for 13, etc.). Your pro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert polishNumeralToInteger('jedena\\u015bcie') == 11\", \"assert polishNumeralToInteger('dwana\\u015bcie') == 12\", \"assert polishNumeralToInteger('trzyna\\u015bcie') == 13\", \"assert polishNumeralToInteger('czterna\\u015bcie') == 14\", \"assert polishNumeralT... | {
"split": "train",
"index": 70094,
"acecode_id": "oss_8586",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given string is a valid email address. An email address is considered valid if it follows the format 'local-part@domain.com', where: \n1. The 'local-part' can contain letters, digits, and the characters '.', '_', and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_email('test@example.com') == True\", \"assert is_valid_email('user.name@domain.co') == True\", \"assert is_valid_email('user-name@domain.com') == True\", \"assert is_valid_email('user_name@sub.domain.com') == True\", \"assert is_valid_email('usernam... | {
"split": "train",
"index": 70095,
"acecode_id": "bigcode_python_fns_12151",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that calculates the area of a triangle given the lengths of its three sides using Heron's formula. The function should take three parameters, a, b, and c, which represent the lengths of the sides of the triangle. It should return the area as a float. Note that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(heron_triangle_area(5, 6, 7) - 14.696938456699069) < 1e-9\", \"assert abs(heron_triangle_area(3, 4, 5) - 6.0) < 1e-9\", \"assert abs(heron_triangle_area(10, 10, 10) - 43.30127018922193) < 1e-9\", \"assert abs(heron_triangle_area(7, 8, 9) - 26.83281572999... | {
"split": "train",
"index": 70096,
"acecode_id": "evol_10708",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Develop a function named 'enhanced_vowels_count' that takes a string denoting a word as its input and returns the cumulative count of each vowel contained within that word. The vowels in question include 'a', 'e', 'i', 'o', 'u', and 'y', albeit the latter counts ONLY when it oc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enhanced_vowels_count('abcde') == 2\", \"assert enhanced_vowels_count('ACEDY') == 3\", \"assert enhanced_vowels_count('hello') == 2\", \"assert enhanced_vowels_count('rhythm') == 0\", \"assert enhanced_vowels_count('Sky') == 1\", \"assert enhanced_vowels_cou... | {
"split": "train",
"index": 70097,
"acecode_id": "evol_22319",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are working with event level labels that are stored in a list of dictionaries. Each dictionary represents an event and contains the following keys: 'event_id', 'event_name', and 'event_time'. However, some events may have missing values for 'event_name' or 'event_time'. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_event_data([]) == []\", \"assert clean_event_data([{'event_id': 1, 'event_name': 'Concert', 'event_time': '2023-12-01 19:00'}, {'event_id': 2, 'event_name': None, 'event_time': '2023-12-02 20:00'}]) == [{'event_id': 1, 'event_name': 'Concert', 'event_t... | {
"split": "train",
"index": 70098,
"acecode_id": "oss_16255",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the blinking of an LED. Write a function `simulate_blinking(frequency, duration)` that takes in two parameters: \n- `frequency`: A float representing the blinking frequency in hertz (Hz). \n- `duration`: An integer r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_blinking(1, 10) == [(0, 0.5), (1, 1.5), (2, 2.5), (3, 3.5), (4, 4.5), (5, 5.5), (6, 6.5), (7, 7.5), (8, 8.5), (9, 9.5)]\", \"assert simulate_blinking(0.5, 10) == [(0, 1.0), (2.0, 3.0), (4.0, 5.0), (6.0, 7.0), (8.0, 9.0)]\", \"assert simulate_blinkin... | {
"split": "train",
"index": 70099,
"acecode_id": "oss_28011",
"num_tests": 9
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.