data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a user's session status in a system. The possible statuses are 'active', 'inactive', and 'expired'. Your task is to implement a function `count_statuses(statuses: List[str]) -> Dict[str, int]` that counts the occurre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_statuses(['active', 'inactive', 'active', 'expired']) == {'active': 2, 'inactive': 1, 'expired': 1}\", \"assert count_statuses(['inactive', 'inactive', 'inactive']) == {'inactive': 3}\", \"assert count_statuses(['expired', 'expired', 'active']) == {'ex...
{ "split": "train", "index": 64200, "acecode_id": "bigcode_python_fns_26500", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of course runs and a company name, write a function `generate_voucher_details(course_runs: List[str], company: str) -> Dict[str, Any]` that processes the provided course runs and the company name to create a dictionary containing the following details: 1. A list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_voucher_details(['Math 101', 'Science 102'], 'Tech Corp') == {'course_runs': ['Math 101', 'Science 102'], 'company': 'Tech Corp', 'products': ['Product(Math 101)', 'Product(Science 102)'], 'coupon_eligibility_list': ['CouponEligibility(Product(Math ...
{ "split": "train", "index": 64201, "acecode_id": "bigcode_python_fns_20391", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that creates a boolean mask from a list of sequence lengths. The function should take in a list of sequence lengths and an optional maximum length, and return a boolean mask indicating which elements in the sequences are valid based o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sequence_mask([], 3) == []\", \"assert sequence_mask([3, 1], 3) == [True, True, True]\", \"assert sequence_mask([6, 6, 6], 3) == [True, True, True]\", \"assert sequence_mask([10], None) == [True, True, True, True, True, True, True, True, True, True]\", \"ass...
{ "split": "train", "index": 64202, "acecode_id": "oss_3625", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with validating a dictionary of parameters used for a coastal carbon analysis. Your function should take in a dictionary with specific keys and return a list of warnings based on certain validation rules. The dictionary contains the following keys: 'landcover_sna...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate({'landcover_snapshot_csv': 'valid_path.csv', 'analysis_year': '2022'}) == []\", \"assert validate({'landcover_snapshot_csv': 'valid_path.csv', 'analysis_year': '2021'}) == []\", \"assert validate({'landcover_snapshot_csv': 'valid_path.csv', 'analysi...
{ "split": "train", "index": 64203, "acecode_id": "bigcode_python_fns_47182", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of connected components, where each component is represented as a set of integers. Additionally, you have two dictionaries: one representing the ingoing connections and the other representing the outgoing connections between these components. Your task is t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_connected_components([{1, 2}, {3}, {4, 5}], {}, {}) == [{1, 2}, {3}, {4, 5}]\", \"assert merge_connected_components([{1}, {2}, {3}, {4}], {1: [2]}, {2: [1]}) == [{1, 2}, {3}, {4}]\", \"assert merge_connected_components([{1}, {2, 3}, {4}], {1: [], 2: []...
{ "split": "train", "index": 64204, "acecode_id": "bigcode_python_fns_49364", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple representation of a graph using a unique identifier. Implement a function `create_graph(graph_id: str) -> dict` that takes in a string `graph_id` representing the unique identifier for the graph and returns a dictionary representing the gra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_graph('g1') == {'id': 'g1', 'nodes': [], 'edges': []}\", \"assert create_graph('g2') == {'id': 'g2', 'nodes': [], 'edges': []}\", \"assert create_graph('graph_123') == {'id': 'graph_123', 'nodes': [], 'edges': []}\", \"assert create_graph('main_graph'...
{ "split": "train", "index": 64205, "acecode_id": "bigcode_python_fns_37261", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a generator function `fibonacci(start: int, end: int) -> Generator[int, None, None]` that yields the Fibonacci sequence numbers within the specified range defined by two positive integers `start` and `end`. The function should yield Fibonacci numbers that are greater ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list(fibonacci(3, 5)) == [3, 5]\", \"assert list(fibonacci(5, 8)) == [5, 8]\", \"assert list(fibonacci(8, 13)) == [8, 13]\", \"assert list(fibonacci(0, 5)) == [0, 1, 1, 2, 3, 5]\", \"assert list(fibonacci(5, 5)) == [5]\", \"assert list(fibonacci(8, 15)) == [...
{ "split": "train", "index": 64206, "acecode_id": "evol_1601", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given an array of integers representing the power flow values for different branches in a network. Your task is to create a function that takes this array and an array of PTDF (Power Transfer Distribution Factor) values and returns a new array where each element is calc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_power_flow([10, 20, 30], [0.1, 0.2, 0.3]) == [1.0, 4.0, 9.0]\", \"assert calculate_power_flow([5, 15, 25], [0.5, 1.0, 1.5]) == [2.5, 15.0, 37.5]\", \"assert calculate_power_flow([0, 0, 0], [1, 2, 3]) == [0.0, 0.0, 0.0]\", \"assert calculate_power_f...
{ "split": "train", "index": 64207, "acecode_id": "bigcode_python_fns_6796", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function named ``filter_and_sort`` that receives two parameters: a list of numbers called ``old_list`` and a number called ``threshold``. This function should create a new list named ``new_list`` that contains all elements from ``old_list`` which are strictly greater t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_and_sort([2, 3, 5, 7, 9], 5) == [7, 9]\", \"assert filter_and_sort([10, 15, 20, 25], 12) == [15, 20, 25]\", \"assert filter_and_sort([1, 2, 3], 3) == []\", \"assert filter_and_sort([], 5) == []\", \"assert filter_and_sort([-1, -2, -3], -2) == [-1]\", ...
{ "split": "train", "index": 64208, "acecode_id": "evol_15439", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a Fibonacci heap represented as a list of nodes, implement a function `find_min` that returns the minimum key from the heap. Each node in the heap is represented as a dictionary with a single key-value pair, where the key is 'key' and the value is the node's integer value...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_min([{'key': 3}, {'key': 5}, {'key': 1}, {'key': 4}]) == 1\", \"assert find_min([{'key': 10}, {'key': 20}, {'key': 15}]) == 10\", \"assert find_min([{'key': -1}, {'key': -5}, {'key': 0}]) == -5\", \"assert find_min([{'key': 100}, {'key': 99}, {'key': 10...
{ "split": "train", "index": 64209, "acecode_id": "evol_560", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of distinct integers, implement a function that returns the indices of two numbers such that they sum up to a specific target. The function should not use any built-in array methods or libraries to pre-process or sort the array. If no such indices exist, the func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert two_sum([2, 5, 7, 11], 9) in [[0, 2], [2, 0]]\", \"assert two_sum([1, 2, 3, 7], 10) in [[2, 3], [3, 2]]\", \"assert two_sum([2, 3, 5], 8) in [[1, 2], [2, 1]]\", \"assert two_sum([0, 1, 2], 3) in [[1, 2], [2, 1]]\", \"assert two_sum([1, 2, 3, 4, 5, 6], 10) in...
{ "split": "train", "index": 64210, "acecode_id": "evol_24411", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns the sum of all the integers in the list that have an even value. The function should take in a single parameter, 'numbers', which is a list of integers. Your function should return an integer representing the sum of th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_even_integers([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_even_integers([10, 15, 20, 25]) == 30\", \"assert sum_of_even_integers([7, 9, 11]) == 0\", \"assert sum_of_even_integers([-2, -4, -6]) == -12\", \"assert sum_of_even_integers([0, 1, 2, 3]) == 2\",...
{ "split": "train", "index": 64211, "acecode_id": "bigcode_python_fns_1495", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two sorted arrays, write a function `merge_sorted_arrays` that merges them into a single sorted array. The function should take two arrays as input and return a new array that contains all the elements from both arrays in sorted order.\nPlease reason step by step, then wr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sorted_arrays([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sorted_arrays([], [2, 5, 8]) == [2, 5, 8]\", \"assert merge_sorted_arrays([7, 8, 9], []) == [7, 8, 9]\", \"assert merge_sorted_arrays([1], [2]) == [1, 2]\", \"assert merge_sort...
{ "split": "train", "index": 64212, "acecode_id": "evol_16658", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `match_string(s: str) -> bool` that checks if the input string `s` contains exactly two uppercase letters followed by exactly three digits, and ends with exactly one lowercase letter. The function should return True if the string matches this pattern, and False...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert match_string('AB123c') == True\", \"assert match_string('XY456z') == True\", \"assert match_string('CD789d') == True\", \"assert match_string('EF012e') == True\", \"assert match_string('GH345f') == True\", \"assert match_string('A123b') == False\", \"assert ...
{ "split": "train", "index": 64213, "acecode_id": "evol_24387", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a triangular matrix A of size n x n. Implement a function `invert_triangular_matrix(A: List[List[float]], lower: bool) -> List[List[float]]` that returns the inverse of the triangular matrix A. The parameter `lower` indicates whether the matrix A is lower triangul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert invert_triangular_matrix([[1]], False) == [[1]]\", \"assert invert_triangular_matrix([[2]], True) == [[0.5]]\", \"assert invert_triangular_matrix([[1, 2], [0, 0]], False) == []\", \"assert invert_triangular_matrix([[2, 1], [0, 0]], False) == []\", \"assert i...
{ "split": "train", "index": 64214, "acecode_id": "bigcode_python_fns_20489", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function that multiplies two matrices. The function should take two 2D lists (matrices) as input and return a new 2D list that represents the product of the two matrices. If the matrices cannot be multiplied (due to incompatible dimensions), the function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_matrices([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\", \"assert multiply_matrices([[1, 0], [0, 1]], [[1, 2], [3, 4]]) == [[1, 2], [3, 4]]\", \"assert multiply_matrices([[1, 2]], [[1], [2]]) == [[5]]\", \"assert multiply_matrices([[1...
{ "split": "train", "index": 64215, "acecode_id": "evol_26501", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that replaces all instances of a specific character in a given string with a new character, while preserving the original capitalization. The function should handle multilingual characters and emojis, and the replacement should be case sensitive. Write a fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_char('\\ud83d\\ude0a Hello \\ud83d\\ude0a', '\\ud83d\\ude0a', '\\ud83d\\ude22') == '\\ud83d\\ude22 Hello \\ud83d\\ude22'\", \"assert replace_char('abcABCabc', 'A', 'X') == 'abcXBCabc'\", \"assert replace_char('1234567890', '5', '0') == '1234067890'\"...
{ "split": "train", "index": 64216, "acecode_id": "evol_9227", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of DNA sequences, where each sequence is represented as a string containing characters 'A', 'C', 'G', and 'T'. Write a function `count_nucleotides(sequences: List[str]) -> Dict[str, int]` that counts the total number of occurrences of each nucleotide ('A', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_nucleotides(['ACGT', 'ACGT', 'ACGT']) == {'A': 3, 'C': 3, 'G': 3, 'T': 3}\", \"assert count_nucleotides(['A', 'C', 'G', 'T']) == {'A': 1, 'C': 1, 'G': 1, 'T': 1}\", \"assert count_nucleotides(['AA', 'CC', 'GG', 'TT']) == {'A': 2, 'C': 2, 'G': 2, 'T': 2...
{ "split": "train", "index": 64217, "acecode_id": "bigcode_python_fns_38975", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the sum of two numbers. The function should take two parameters, which can be either integers or floating-point numbers, and return their sum. Implement a function named `calculate_sum` that meets the following requirement...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum(5, 3.5) == 8.5\", \"assert calculate_sum(0, 0) == 0\", \"assert calculate_sum(-1, 1) == 0\", \"assert calculate_sum(2.5, 2.5) == 5.0\", \"assert calculate_sum(-2, -3) == -5\", \"assert calculate_sum(10, 15) == 25\", \"assert calculate_sum(7, 2....
{ "split": "train", "index": 64218, "acecode_id": "oss_26451", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a screen loading process where a user is presented with a list of options and selects one of them. Your function should take a list of strings (options) as input and return the index of the selected option. The selection is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_screen(['Option A', 'Option B', 'Option C']) >= 0 and load_screen(['Option A', 'Option B', 'Option C']) < 3\", \"assert load_screen(['Single Option']) == 0\", \"assert load_screen(['First', 'Second', 'Third', 'Fourth']) >= 0 and load_screen(['First', 'S...
{ "split": "train", "index": 64219, "acecode_id": "bigcode_python_fns_32402", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a log level filter function in Python. The function should be able to determine if a given log message should be logged based on its severity level compared to a specified log level. The log levels are defined as follows: CRITICAL, ERROR, WARNIN...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert should_log('DEBUG', 'INFO') == True\", \"assert should_log('INFO', 'DEBUG') == False\", \"assert should_log('WARNING', 'ERROR') == True\", \"assert should_log('ERROR', 'ERROR') == True\", \"assert should_log('CRITICAL', 'WARNING') == False\", \"assert should...
{ "split": "train", "index": 64220, "acecode_id": "oss_31952", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string 's' and a character 'c', write a function that returns the number of times 'c' appears in 's'. The function should be case-sensitive. You can assume that 's' only contains printable ASCII characters. \n\nFunction Signature: `def count_character(s: str, c: str) ->...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_character('hello world', 'o') == 2\", \"assert count_character('Hello World', 'h') == 0\", \"assert count_character('Data Science', 'a') == 2\", \"assert count_character('algorithm', 'g') == 1\", \"assert count_character('aaaaa', 'a') == 5\", \"assert ...
{ "split": "train", "index": 64221, "acecode_id": "bigcode_python_fns_35254", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that sorts the array in descending order, removes all elements that are multiples of 5, converts the resulting array into a string with elements separated by commas, and adds surrounding square brackets to the string. Return the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve_problem([5, 10, 15, 20]) == '[]'\", \"assert solve_problem([99, 85, 70, 60, 45]) == '[99]'\", \"assert solve_problem([100, 95, 90]) == '[]'\", \"assert solve_problem([30, 20, 10]) == '[]'\", \"assert solve_problem([5, 25, 35, 45, 55]) == '[]'\", \"asse...
{ "split": "train", "index": 64222, "acecode_id": "evol_29133", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines whether a given string qualifies as a 'go view'. A 'go view' is defined as a string that contains the word 'go' (case insensitive) and ends with the word 'view' (case insensitive). Implement the function `is_go_view(s: str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_go_view('the movie was a great view') == False\", \"assert is_go_view('go view') == True\", \"assert is_go_view('GO to the beautiful VIEW') == True\", \"assert is_go_view('The view was amazing, let\\u2019s go!') == False\", \"assert is_go_view('We should ...
{ "split": "train", "index": 64223, "acecode_id": "oss_21807", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a robot that moves in a 2D plane. The robot starts at the position [0, 0] and can execute a series of movement commands represented by a string. The commands consist of the characters 'U' (up), 'D' (down), 'L' (left), and 'R' (right). Your task is to determine if ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isRobotBounded('GGLLGG') == True\", \"assert isRobotBounded('GG') == False\", \"assert isRobotBounded('GL') == True\", \"assert isRobotBounded('GRGRGRGR') == True\", \"assert isRobotBounded('UUDD') == False\", \"assert isRobotBounded('UURRDDLL') == True\", \...
{ "split": "train", "index": 64224, "acecode_id": "oss_7806", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of audio samples represented as integers and a limit value. Write a function `is_clipped(audio_data: List[int], limit: int) -> bool` that determines if any audio sample exceeds the given limit in absolute value. The function should return True if at least o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_clipped([1, 2, 3, 4, 5], 5) == False\", \"assert is_clipped([-1, -2, -3, -4, -5], 5) == False\", \"assert is_clipped([10, 2, 3, -4, 5], 5) == True\", \"assert is_clipped([-10, 2, 3, 4, 5], 5) == True\", \"assert is_clipped([0, 0, 0, 0, 0], 5) == False\", ...
{ "split": "train", "index": 64225, "acecode_id": "evol_21605", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `transform_array`. This function takes a list of floating-point numbers as input and modifies the elements based on specific conditions. The transformation rules are as follows: 1. If an element is greater than 0.5, it should b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_array([0.6, -0.6, 0.4, -0.4, 0.5, -0.5]) == [1, -1, 0, 0, 0, 0]\", \"assert transform_array([1.0, 0.75, 0.0, -0.1, -1.0]) == [1, 1, 0, 0, -1]\", \"assert transform_array([-0.8, 0.2, 0.1, 0.5, 0.55]) == [-1, 0, 0, 0, 1]\", \"assert transform_array([...
{ "split": "train", "index": 64226, "acecode_id": "oss_1620", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with converting a list of temperatures given in deci-degrees Celsius to Kelvin. Each temperature value is represented as an integer in a list. Write a function `decicelsius_to_kelvins(temperatures_decicelsius: List[int]) -> List[float]` that takes a list of tempe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decicelsius_to_kelvins([0]) == [273.15]\", \"assert decicelsius_to_kelvins([123, 456, -789]) == [273.15 + 12.3, 273.15 + 45.6, 273.15 - 78.9]\", \"assert decicelsius_to_kelvins([]) == []\", \"assert decicelsius_to_kelvins([200, 300]) == [273.15 + 20.0, 273.1...
{ "split": "train", "index": 64227, "acecode_id": "bigcode_python_fns_41329", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a binary tree data structure in Python. Your task is to implement a function `binary_tree_preorder(data, left_data, right_data)` that constructs a binary tree with a root node containing the `data`, and inserts two child nodes: the left child wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_tree_preorder(1, 2, 3) == [1, 2, 3]\", \"assert binary_tree_preorder(10, 5, 15) == [10, 5, 15]\", \"assert binary_tree_preorder(-1, -2, -3) == [-1, -2, -3]\", \"assert binary_tree_preorder(0, 0, 0) == [0, 0, 0]\", \"assert binary_tree_preorder(7, 14, ...
{ "split": "train", "index": 64228, "acecode_id": "oss_15269", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of classifier strings and returns a dictionary containing the count of each unique classifier category. Each classifier is a string that represents a category for a Python package and should follow the format ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_classifiers(['Development Status :: 2 - Pre-Alpha', 'Development Status :: 2 - Pre-Alpha', 'Development Status :: 1 - Planning']) == {'Development Status': 3}\", \"assert count_classifiers(['Invalid Classifier', 'Another Invalid Classifier']) == {}\", ...
{ "split": "train", "index": 64229, "acecode_id": "oss_12527", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given an integer variable `cont` that is initialized to 0. Your task is to write a function `increment_cont()` that increments the value of `cont` by 1 and returns the updated value. The function should have no parameters and should not use any external resources. The i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert increment_cont() == 1\", \"assert increment_cont() == 1\", \"assert increment_cont() == 1\", \"assert increment_cont() == 1\", \"assert increment_cont() == 1\", \"assert increment_cont() == 1\", \"assert increment_cont() == 1\", \"assert increment_cont() == ...
{ "split": "train", "index": 64230, "acecode_id": "oss_9893", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `permutation_function(s: str) -> str` that takes a string `s` consisting of alphanumeric characters and returns the string with its characters reversed. The function should raise a `TypeError` if the input is `None`, and a `ValueError` if the input contains...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert permutation_function('abc123') == '321cba'\", \"assert permutation_function('DEF456') == '654FED'\", \"assert permutation_function('123abc') == 'cba321'\", \"assert permutation_function('A1B2C3') == '3C2B1A'\", \"assert permutation_function('xyz789') == '987...
{ "split": "train", "index": 64231, "acecode_id": "evol_5855", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a Python function that generates the Fibonacci series up to n numbers. The function should take an integer n as input and return a list containing the first n numbers of the Fibonacci series. For example, if n = 10, the output should be [0, 1, 1, 2, 3, 5, 8, 13, 21, 34].\...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\",...
{ "split": "train", "index": 64232, "acecode_id": "evol_20104", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes two integers Y and Z as inputs and returns a list of all common positive factors of these two numbers. The returned list should be sorted in ascending order. For example, if Y = 16 and Z = 24, the function should return [1, 2, 4, 8].\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_common_factors(16, 24) == [1, 2, 4, 8]\", \"assert find_common_factors(10, 5) == [1, 5]\", \"assert find_common_factors(30, 12) == [1, 2, 3, 6]\", \"assert find_common_factors(7, 14) == [1, 7]\", \"assert find_common_factors(15, 45) == [1, 3, 5, 15]\", ...
{ "split": "train", "index": 64233, "acecode_id": "evol_21259", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of mixed elements, implement a function `print_even_numbers(lst)` that returns a list of even integers from the input list. The function should filter out any non-integer elements and only include even integers in the result. The input list may contain integers and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_even_numbers([1, 2, 3, 4, 5, 'a']) == [2, 4]\", \"assert print_even_numbers([10, 15, 20, 'b', 22]) == [10, 20, 22]\", \"assert print_even_numbers([1.5, 2.5, 3.5, 4.0]) == []\", \"assert print_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert print...
{ "split": "train", "index": 64234, "acecode_id": "evol_19132", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a database query. The function, `get_item`, takes no parameters and returns a specific item in the form of a dictionary. The expected item is a dictionary with two fields: 'field1' and 'field2'. Your functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_item() == {'field1': '1', 'field2': '2'}\", \"assert get_item() != {'field1': '2', 'field2': '1'}\", \"assert get_item()['field1'] == '1'\", \"assert get_item()['field2'] == '2'\", \"assert isinstance(get_item(), dict)\", \"assert 'field1' in get_item()\...
{ "split": "train", "index": 64235, "acecode_id": "oss_23981", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `filter_numbers(lst: List[int], threshold: int) -> List[int]` that takes a list of integers and an integer threshold as input, and returns a new list containing only the integers from the input list that are less than or equal to the threshold.\nPlease reas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_numbers([1, 6, 4, 9, 5, 8, 2], 7) == [1, 6, 4, 5, 2]\", \"assert filter_numbers([5, 3, 8, 1, 2], 3) == [3, 1, 2]\", \"assert filter_numbers([0, -1, -5, 3, 2], 2) == [0, -1, -5, 2]\", \"assert filter_numbers([], 5) == []\", \"assert filter_numbers([15,...
{ "split": "train", "index": 64236, "acecode_id": "evol_1177", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the volume of a pyramid given its base area and height. The volume of a pyramid can be calculated using the formula: volume = (base_area * height) / 3. Write a function `volume_of_pyramid(base_area: float, height: float) -> float` that takes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert volume_of_pyramid(15, 10) == 50.0\", \"assert volume_of_pyramid(0, 10) == 0.0\", \"assert volume_of_pyramid(15, 0) == 0.0\", \"assert volume_of_pyramid(1, 1) == 0.3333333333333333\", \"assert volume_of_pyramid(3, 9) == 9.0\", \"assert volume_of_pyramid(100, ...
{ "split": "train", "index": 64237, "acecode_id": "evol_20647", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of dictionaries representing ground truth (gts) and tracking results (ts) for multiple cameras. Each dictionary has the following keys: 'CameraId', 'FrameId', 'Id', 'X', 'Y', 'Width', 'Height'. Your task is to implement a function that compares the two l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_tracking_metrics([{'CameraId': 1, 'FrameId': 1, 'Id': 1, 'X': 10, 'Y': 20, 'Width': 5, 'Height': 5}], [{'CameraId': 1, 'FrameId': 1, 'Id': 1, 'X': 10, 'Y': 20, 'Width': 5, 'Height': 5}]) == {'idf1': 1.0, 'idp': 1.0, 'idr': 1.0, 'num_frames': 1, 'idfp...
{ "split": "train", "index": 64238, "acecode_id": "bigcode_python_fns_21723", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given two lists `din` and `sec_opnd`, write a function `data_processing(din, sec_opnd, f, max_size)` that performs the following operations: First, combine the two lists into a list of tuples using `zip`. Then, apply the function `f` to each element in the resulting list of tup...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert data_processing([], [], lambda x: x[0] + x[1], 5) == []\", \"assert data_processing([1], ['a'], lambda x: str(x[0]) + x[1], 1) == ['1a']\", \"assert data_processing([1, 2], ['a', 'b'], lambda x: x[0] * 2, 3) == [2, 4]\", \"assert data_processing([1, 2, 3], [...
{ "split": "train", "index": 64239, "acecode_id": "oss_2480", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_perfect_square(n)` that determines whether a given non-negative integer n is a perfect square. A perfect square is an integer that is the square of an integer. The function should return True if n is a perfect square, and False otherwise. The input shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_perfect_square(1) == True\", \"assert is_perfect_square(4) == True\", \"assert is_perfect_square(9) == True\", \"assert is_perfect_square(16) == True\", \"assert is_perfect_square(25) == True\", \"assert is_perfect_square(36) == True\", \"assert is_perfec...
{ "split": "train", "index": 64240, "acecode_id": "evol_7858", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that determines the platform and execution path based on a given cross tool. The function should take a string representing the cross tool as input and return a tuple containing the platform and execution path according to the foll...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_platform_and_path('armcc') == ('armcc', 'C:/Keil_v5')\", \"assert determine_platform_and_path('iar') == ('iar', None)\", \"assert determine_platform_and_path('gcc') == (None, None)\", \"assert determine_platform_and_path('') == (None, None)\", \"as...
{ "split": "train", "index": 64241, "acecode_id": "oss_30434", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple bank account. Create a function `manage_account` that takes a list of operations and returns the final balance and the total number of transactions made on the account. Each operation in the list can be a deposit (represented by a positiv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_account([1000, -400]) == (600, 2)\", \"assert manage_account([500, -200, -100]) == (200, 3)\", \"assert manage_account([-100]) == (0, 0)\", \"assert manage_account([1000, 200, -300, -400]) == (500, 4)\", \"assert manage_account([-1, -2]) == (0, 0)\", ...
{ "split": "train", "index": 64242, "acecode_id": "oss_35990", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a tuple that represents a virtual environment prefix. The first element of the tuple is a string that indicates the type of prefix ('sys.real_prefix' or 'sys.base_prefix'), and the second element is the new prefix string to be set. Implement a function `set_virtua...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_virtualenv_prefix(('sys.real_prefix', 'new_real_prefix')) == 'new_real_prefix'\", \"assert set_virtualenv_prefix(('sys.base_prefix', 'new_base_prefix')) == 'new_base_prefix'\", \"assert set_virtualenv_prefix(('sys.real_prefix', 'new_real_prefix')) == 'ne...
{ "split": "train", "index": 64243, "acecode_id": "bigcode_python_fns_21467", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You need to write a function that takes a string of text and a word as input, and returns the count of occurrences of that word in the text. The function should ignore case sensitivity when counting the occurrences. Implement the following function: \n\n```python\ndef count_wor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_word_occurrences('This is a sample text file. This file contains sample text for testing purposes.', 'sample') == 2\", \"assert count_word_occurrences('Hello world! Hello everyone!', 'hello') == 2\", \"assert count_word_occurrences('Test test TEST teSt...
{ "split": "train", "index": 64244, "acecode_id": "oss_10611", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing file sizes in bytes, write a function `analyze_file_sizes(file_sizes: List[int]) -> Tuple[int, int, float]` that computes the following statistics: the number of files, the total size of all files, and the average file size. Your function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_file_sizes([100, 200, 300]) == (3, 600, 200.0)\", \"assert analyze_file_sizes([50]) == (1, 50, 50.0)\", \"assert analyze_file_sizes([]) == (0, 0, 0)\", \"assert analyze_file_sizes([0]) == (1, 0, 0.0)\", \"assert analyze_file_sizes([10, 20, 30, 40, 50...
{ "split": "train", "index": 64245, "acecode_id": "oss_30801", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Devise a function that classifies a four-sided polygon, or quadrilateral, based on the angles A, B, C, and D. The function must process any given quartet of angles, validate their ability to form a legitimate quadrilateral, and then return the specific category of the quadrilat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_quadrilateral(90, 90, 90, 90) == 'Square'\", \"assert classify_quadrilateral(80.5, 99.5, 80.5, 99.5) == 'Parallelogram'\", \"assert classify_quadrilateral(45, 135, 45, 135) == 'Parallelogram'\", \"assert classify_quadrilateral(60, 120, 60, 120) == '...
{ "split": "train", "index": 64246, "acecode_id": "evol_15954", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `a_star(graph: Dict[int, Dict[int, int]], start: int, goal: int) -> Tuple[int, List[int]]` that finds the shortest path from a starting node to a goal node in a given sparse graph represented as an adjacency list. The function should utilize the A* algorith...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert a_star({1: {2: 1}, 2: {3: 2}, 3: {4: 1}, 4: {}}, 1, 4) == (4, [1, 2, 3, 4])\", \"assert a_star({1: {2: 1, 3: 4}, 2: {4: 2}, 3: {4: 1}, 4: {}}, 1, 4) == (3, [1, 2, 4])\", \"assert a_star({1: {2: 2}, 2: {3: 2, 4: 1}, 3: {5: 5}, 4: {5: 2}, 5: {}}, 1, 5) == (5, ...
{ "split": "train", "index": 64247, "acecode_id": "evol_2288", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of Pokémon names. Your task is to write a function that takes this list as input and returns a new list containing only the Pokémon names that contain the substring 'ron' in them. The function should be case-insensitive, meaning it should consider both uppe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pokemon_with_ron(['Aron', 'Lairon', 'Aggron', 'Meditite', 'Electrode', 'Gastrodon', 'Girafarig']) == ['Aron', 'Lairon', 'Aggron']\", \"assert find_pokemon_with_ron(['ronin', 'Saron', 'Blaron']) == ['ronin', 'Saron', 'Blaron']\", \"assert find_pokemon_wi...
{ "split": "train", "index": 64248, "acecode_id": "oss_5032", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given two lists: `y_pred`, a list of predicted binary class labels (either 0 or 1), and `y_true`, a list of true binary class labels (either 0 or 1). Your task is to implement a function that calculates the accuracy score of the predictions. The accuracy score is define...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_class_accuracy_score([1, 0, 1, 1], [1, 0, 1, 0]) == ('accuracy', 0.75, True)\", \"assert binary_class_accuracy_score([1, 1, 1, 1], [1, 1, 1, 1]) == ('accuracy', 1.0, True)\", \"assert binary_class_accuracy_score([0, 0, 0, 0], [0, 0, 0, 0]) == ('accura...
{ "split": "train", "index": 64249, "acecode_id": "bigcode_python_fns_28492", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with processing log messages that can either contain an error message or not. Each log entry has a specific format and rules for what is logged. Your function should take a list of log messages as input, where each message is a string formatted as '<index> test'....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_logs(['0 test', '1 test', '2 test', '3 test', '4 test', '5 test', '6 test', '7 test']) == [{'event': '0 test', 'error_message': None}, {'event': '1 test', 'error_message': None}, {'event': '2 test', 'error_message': 'OVERRIDDEN MESSAGE'}, {'event': '...
{ "split": "train", "index": 64250, "acecode_id": "bigcode_python_fns_707", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a TLS cipher. Your task is to implement a function that returns a list of unique ciphers sorted in alphabetical order. Write a function `get_unique_sorted_ciphers(ciphers: List[str]) -> List[str]:` that takes a list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_sorted_ciphers(['TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256', 'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384']) == ['TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256', 'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384']\", \"assert get_unique_sorted_ciphers(['TLS_ECDHE_RSA_WITH_AES...
{ "split": "train", "index": 64251, "acecode_id": "bigcode_python_fns_39666", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a Python function that computes the arithmetic mean of the smallest, largest, and the middle numerical values from a distinct array of numbers. The middle value is defined as the value located at the index obtained by integer division of the array length by 2. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_mean([1, 2, 3, 4, 5]) == 3.0\", \"assert compute_mean([10, 20, 30, 40, 50]) == 30.0\", \"assert compute_mean([5, 1, 3, 2, 4]) == 3.0\", \"assert compute_mean([100, 200, 300, 400, 500]) == 300.0\", \"assert compute_mean([15, 25, 35]) == 25.0\", \"asse...
{ "split": "train", "index": 64252, "acecode_id": "evol_11579", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the installation of a software package. The function, `install(package_name: str) -> str`, should take a string representing the name of the package to install. If the package installation is successful, it should return a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert install('djangocms_blog') == 'Package djangocms_blog installed successfully.'\", \"assert install('flask') == 'Package flask installed successfully.'\", \"assert install('numpy') == 'Package numpy installed successfully.'\", \"assert install('successful_pack...
{ "split": "train", "index": 64253, "acecode_id": "bigcode_python_fns_41152", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total price of items in a shopping cart after applying applicable discounts. Each product has a name, price, and category, while each discount has a percentage and can apply to specific products. Create a function `calculate_final_price(produ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_final_price([{'name': 'apple', 'price': 100, 'category': 'fruit'}, {'name': 'banana', 'price': 50, 'category': 'fruit'}], []) == 150\", \"assert calculate_final_price([{'name': 'apple', 'price': 100, 'category': 'fruit'}], [{'percentage': 20, 'appl...
{ "split": "train", "index": 64254, "acecode_id": "oss_34654", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of task configurations and an optional pool identifier, and returns a list of formatted task dictionaries. Each task configuration can be a dictionary with keys 'id' and 'description'. If a pool identifier is provided, i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_tasks([{'id': 'task1', 'description': 'First task'}, {'id': 'task2', 'description': 'Second task'}]) == [{'id': 'task1', 'description': 'First task'}, {'id': 'task2', 'description': 'Second task'}]\", \"assert create_tasks([{'id': 'task1', 'descriptio...
{ "split": "train", "index": 64255, "acecode_id": "bigcode_python_fns_14557", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the interest earned on a bank account balance over a specified number of years using a given annual interest rate. Implement a function `calculate_interest(balance: float, interest_rate: float, years: int) -> float` that takes in three parameters...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_interest(2500.0, 0.04, 3) == 312.16\", \"assert calculate_interest(100.0, 0.1, 2) == 21.0\", \"assert calculate_interest(0.0, 0.05, 10) == 0.0\", \"assert calculate_interest(1500.0, 0.0, 5) == 0.0\", \"assert calculate_interest(500.0, 0.1, 1) == 50...
{ "split": "train", "index": 64256, "acecode_id": "oss_21847", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `validate_email(email: str) -> bool` that checks if the provided email address adheres to a standard format. The email should have the following characteristics: it consists of alphanumeric characters, underscores, periods, or hyphens before the '@' symbol,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_email('email@example.com') == True\", \"assert validate_email('user.name@domain.co') == True\", \"assert validate_email('user-name@domain.com') == True\", \"assert validate_email('user_name@domain.org') == True\", \"assert validate_email('user123@do...
{ "split": "train", "index": 64257, "acecode_id": "evol_10433", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `echo_value` that takes a single parameter, `input_value`, and returns the exact same value. The function should handle any data type, including strings, integers, floats, lists, and dictionaries.\nPlease reason step by step, then write a self-contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert echo_value(42) == 42\", \"assert echo_value('Hello') == 'Hello'\", \"assert echo_value(3.14) == 3.14\", \"assert echo_value([1, 2, 3]) == [1, 2, 3]\", \"assert echo_value({'key': 'value'}) == {'key': 'value'}\", \"assert echo_value(None) == None\", \"assert ...
{ "split": "train", "index": 64258, "acecode_id": "evol_15721", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the execution of a command and returns a predefined output based on the command provided. Implement the function `simulate_command_output(cmd: str) -> str` that takes a command as a string and returns a predefined st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_command_output('hello') == 'Hello, World!'\", \"assert simulate_command_output('date') == '2023-10-01'\", \"assert simulate_command_output('echo test') == 'test'\", \"assert simulate_command_output('ls') == 'Unknown command'\", \"assert simulate_com...
{ "split": "train", "index": 64259, "acecode_id": "oss_24574", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a non-negative integer from decimal to binary using a custom recursive algorithm. The function should take a non-negative integer as input and return a tuple. The first item in the tuple should be the binary representation of the input integer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decimal_to_binary(0) == ('0', 0)\", \"assert decimal_to_binary(1) == ('1', 1)\", \"assert decimal_to_binary(2) == ('10', 1)\", \"assert decimal_to_binary(3) == ('11', 2)\", \"assert decimal_to_binary(4) == ('100', 1)\", \"assert decimal_to_binary(5) == ('101...
{ "split": "train", "index": 64260, "acecode_id": "evol_7644", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that represents a series of commands. The commands can be either 'U' (up), 'D' (down), 'L' (left), or 'R' (right). Each command moves a point starting from the origin (0, 0) in the specified direction. Your task is to implement a function called `final_po...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert final_position('U') == (0, 1)\", \"assert final_position('D') == (0, -1)\", \"assert final_position('L') == (-1, 0)\", \"assert final_position('R') == (1, 0)\", \"assert final_position('UUDD') == (0, 0)\", \"assert final_position('UUURRR') == (3, 3)\", \"ass...
{ "split": "train", "index": 64261, "acecode_id": "bigcode_python_fns_19048", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that performs both encryption and decryption using the Caesar Cipher. The function should take a string `text`, an integer `shift`, and a character `mode` ('e' for encryption and 'd' for decryption). It should return the transformed string. If an invalid mo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert(caesar('hello', 3, 'e') == 'khoor')\", \"assert(caesar('HELLO', 3, 'e') == 'KHOOR')\", \"assert(caesar('khoor', 3, 'd') == 'hello')\", \"assert(caesar('KHOOR', 3, 'd') == 'HELLO')\", \"assert(caesar('Hello World!', 3, 'e') == 'Khoor Zruog!')\", \"assert(caes...
{ "split": "train", "index": 64262, "acecode_id": "evol_34907", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two strings `word1` and `word2`. You want to construct a string `merge` by appending characters from `word1` and `word2` in such a way that the resulting `merge` string is lexicographically the largest possible. You can choose to append the first character from ei...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largestMerge('cabaa', 'bcaaa') == 'cbcabaaaaa'\", \"assert largestMerge('abcabc', 'abdcaba') == 'abdcabcabcaba'\", \"assert largestMerge('xyz', 'abc') == 'xyzabc'\", \"assert largestMerge('a', 'b') == 'ba'\", \"assert largestMerge('aaa', 'aa') == 'aaaaa'\", ...
{ "split": "train", "index": 64263, "acecode_id": "evol_32567", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that accepts a string, a list of indices, and a case type ('UPPERCASE' or 'lowercase'). The function should change the case of the characters at the specified indices according to the given case type. If an index is out of range, it should be ignored without th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert change_case('abcdefg', [0, 1, 2], 'UPPERCASE') == 'ABCdefg'\", \"assert change_case('abcdefg', [0, 1, 2], 'lowercase') == 'abcdefg'\", \"assert change_case('abcdefg', [7], 'UPPERCASE') == 'abcdefg'\", \"assert change_case('abcdefg', [-1], 'UPPERCASE') == 'ab...
{ "split": "train", "index": 64264, "acecode_id": "evol_31858", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that swaps the positions of two specified elements in a list and returns the number of elements that were swapped during the process. The function should be able to handle lists containing duplicates and should maintain the original order of elements that a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert swap_and_count_operations([1, 2, 3, 4], 1, 4) == (2, [4, 2, 3, 1])\", \"assert swap_and_count_operations([], 1, 2) == (0, [])\", \"assert swap_and_count_operations([1, 2, 3, 4], 2, 3) == (2, [1, 3, 2, 4])\", \"assert swap_and_count_operations([1, 1, 2, 2, 3,...
{ "split": "train", "index": 64265, "acecode_id": "evol_7596", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given two strings representing descriptions of programming languages, determine if they are identical. If they are identical, return 'Verity'; otherwise, return 'Falsehood'. Write a function named check_identical that takes in two parameters: java_description and javascript_des...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_identical('Statically-typed, object-oriented programming language', 'Statically-typed, object-oriented programming language') == 'Verity'\", \"assert check_identical('Dynamically-typed, prototype-based language', 'Dynamically-typed, prototype-based lan...
{ "split": "train", "index": 64266, "acecode_id": "evol_35581", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Construct a function that calculates the total weight of groceries in a shopping basket. The groceries are represented as a list of dictionaries, where each dictionary contains the item's name, weight, and category. Some items may be sold in packets without individual weights, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_weight([{'item':'banana', 'weight':1.2, 'category':'fruit'}, {'item':'milk', 'total_weight':2.0, 'category':'dairy'}, {'item':'bread', 'weight':0.5, 'category':'bakery'}]) == 3.7\", \"assert total_weight([{'item':'chicken', 'total_weight':1.5, 'categor...
{ "split": "train", "index": 64267, "acecode_id": "evol_22301", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple instructor management system. Your goal is to create a function `manage_instructors` that takes a list of instructor names and returns a dictionary with the following information: the total number of instructors, a list of all unique in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_instructors(['Charlie', 'Charlie', 'Charlie']) == {'total_instructors': 1, 'instructor_names': ['Charlie'], 'name_to_id': {'Charlie': 1}}\", \"assert manage_instructors([]) == {}\", \"assert manage_instructors(['David']) == {'total_instructors': 1, 'i...
{ "split": "train", "index": 64268, "acecode_id": "oss_20985", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `y_true` and `y_pred`, representing the true labels and predicted labels respectively for a multi-label classification problem. Your task is to implement a function `precision(y_true, y_pred)` that computes the precision of the predictions. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert precision([1, 1, 1, 1], [1, 1, 1, 1]) == 1.0\", \"assert precision([0, 0, 0, 0], [0, 0, 0, 0]) == 0.0\", \"assert precision([1, 0, 0, 1], [0, 1, 1, 1]) == 0.3333333333333333\", \"assert precision([1, 1, 0, 0], [0, 1, 1, 1]) == 0.3333333333333333\", \"assert ...
{ "split": "train", "index": 64269, "acecode_id": "bigcode_python_fns_6665", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of numbers, implement a function that finds all the modes in the list, where a mode is defined as a number that appears most frequently. If no number appears more than once, return an empty list. Your solution should not use the statistics module. Additionally, han...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_modes([1, 1, 2, 2, 3, 3]) == [1, 2, 3]\", \"assert find_modes([1, 2, 3, 4, 5]) == []\", \"assert find_modes([1]) == []\", \"assert find_modes([1, 1, 1, 2, 2]) == [1]\", \"assert find_modes([4, 4, 5, 5, 6, 6]) == [4, 5, 6]\", \"assert find_modes([7, 8, 9...
{ "split": "train", "index": 64270, "acecode_id": "evol_16841", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a generator function that iterates over a given list and returns only the prime numbers from it. The function should handle negative numbers and floats by skipping them and returning only the prime integers. If the input is not a list or contains non-numeric types, it...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list(primes_from_list([-23, 45.56, 7, -18, 9, 11.5, 14, 39, -22, 29])) == [7, 29]\", \"assert list(primes_from_list([2, 3, 5, 7, 11, 13])) == [2, 3, 5, 7, 11, 13]\", \"assert list(primes_from_list([])) == []\", \"assert list(primes_from_list([-1, -2, -3])) =...
{ "split": "train", "index": 64271, "acecode_id": "evol_31503", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a personalized message based on a user's preferences. The function should take a dictionary as input, which contains the user's theme preference and return a suitable message. The themes can include 'travel', 'food', or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_msg({'theme': 'travel'}) == 'Exploring new destinations! #travel'\", \"assert create_msg({'theme': 'food'}) == 'Indulging in delicious cuisines! #foodie'\", \"assert create_msg({'theme': 'lifestyle'}) == 'Enjoying the day! #lifestyle'\", \"assert crea...
{ "split": "train", "index": 64272, "acecode_id": "oss_9849", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `vowel_count(string: str) -> int` that takes a string as input and returns the total number of vowels (a, e, i, o, u) present in the string. The function should be case insensitive. For example, given the input 'hello world', the function should return 3 si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert vowel_count('hello world') == 3\", \"assert vowel_count('AEIOU') == 5\", \"assert vowel_count('bcdfghjklmnpqrstvwxyz') == 0\", \"assert vowel_count('a quick brown fox') == 5\", \"assert vowel_count('') == 0\", \"assert vowel_count('The quick brown fox jumps ...
{ "split": "train", "index": 64273, "acecode_id": "evol_15257", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that filters a list of connected devices based on specific attributes. The function, `filter_devices`, should take a list of devices and apply multiple optional filters to return a list of matching devices. The filters are as follows: \n\...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_devices([{'name': 'Keyboard', 'serial_number': '1234', 'vid': '1234', 'pid': '5678', 'device_id': '1', 'chip_id': 'A'}, {'name': 'Mouse', 'serial_number': '5678', 'vid': '1234', 'pid': '5678', 'device_id': '2', 'chip_id': 'B'}], name='Keyboard') == [{...
{ "split": "train", "index": 64274, "acecode_id": "bigcode_python_fns_48314", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates adding and removing products from a shopping cart. You are given a list of products, each represented by a dictionary with 'id', 'name', and 'price'. Your function should take the following inputs: a list of products, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_remove_products([{'id': 1, 'name': 'Product A', 'price': 10.0}, {'id': 2, 'name': 'Product B', 'price': 20.0}], [{'action': 'add', 'product_id': 1}, {'action': 'add', 'product_id': 2}, {'action': 'remove', 'product_id': 1}]) == [2]\", \"assert add_remove...
{ "split": "train", "index": 64275, "acecode_id": "oss_10929", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string consisting of words separated by spaces. Your task is to implement a function that returns the number of unique words in the string. A word is defined as a sequence of characters that is separated by spaces. Punctuation should be ignored, and words are ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_words('Hello world!') == 2\", \"assert count_unique_words('hello world') == 2\", \"assert count_unique_words('This is a test') == 4\", \"assert count_unique_words('This is a test test') == 4\", \"assert count_unique_words('Python is great and py...
{ "split": "train", "index": 64276, "acecode_id": "bigcode_python_fns_32266", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes in a particle beam represented as a dictionary and outputs a list of formatted particles according to specified units. The beam dictionary contains the following keys: 'n_particle' (int), 'species' (str), 'x' (list of floats), '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_particles({'n_particle': 1, 'species': 'electron', 'x': [0.0], 'y': [0.0], 'z': [0.0], 'px': [0.0], 'py': [0.0], 'pz': [0.0], 'w': 1.0}) == [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, -1.6e-19, 1.0]]\", \"assert format_particles({'n_particle': 3, 'species': 'p...
{ "split": "train", "index": 64277, "acecode_id": "bigcode_python_fns_31569", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates updating a package dependency in a project management system. The function should take the following parameters: \n\n- `name` (str): the name of the package to update. \n- `git` (bool): whether the package is a Git-base...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update('numpy') == {'updated': False, 'message': 'Package not found.'}\", \"assert update('requests', git=True) == {'updated': True, 'message': 'Package updated successfully.'}\", \"assert update('matplotlib', git=True, url='https://github.com/matplotlib/mat...
{ "split": "train", "index": 64278, "acecode_id": "bigcode_python_fns_16666", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `setup_logging` that initializes a logger for a training engine. This function will take the following parameters: a `trainer` (a string representing the name of the training engine), an optional `optimizers` parameter (which can be e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_logging('TrainerA') == {'trainer': 'TrainerA', 'optimizers': None, 'evaluators': None, 'log_every_iters': 100, 'kwargs': {}}\", \"assert setup_logging('TrainerB', optimizers='Optimizer1') == {'trainer': 'TrainerB', 'optimizers': 'Optimizer1', 'evaluato...
{ "split": "train", "index": 64279, "acecode_id": "bigcode_python_fns_47578", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a file path. Your task is to create a function that simulates loading data from this path and returns a string indicating the success of the operation. If the path ends with '.txt', return 'Data loaded successfully from text file'. If it ends...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_file_data('data/file.txt') == 'Data loaded successfully from text file'\", \"assert load_file_data('data/file.csv') == 'Data loaded successfully from CSV file'\", \"assert load_file_data('data/file.json') == 'Unsupported file format'\", \"assert load_fi...
{ "split": "train", "index": 64280, "acecode_id": "bigcode_python_fns_30218", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that filters a list of integers based on a given predicate function. Your function should take a predicate and a list as input and return a new list containing only the elements that satisfy the predicate, maintaining their original o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_filter(lambda x: x > 0, [3, 1, -4, 0, 5, 9, -2, 7]) == [3, 1, 5, 9, 7]\", \"assert custom_filter(lambda x: x % 2 == 0, [1, 2, 3, 4, 5]) == [2, 4]\", \"assert custom_filter(lambda x: x < 0, [3, -1, -4, 0, 5, -9, 2]) == [-1, -4, -9]\", \"assert custom_f...
{ "split": "train", "index": 64281, "acecode_id": "bigcode_python_fns_28760", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with predicting the popularity score of a book based on its attributes: title, publication year, number of pages, barcode, and an additional field that represents a specific grade. Implement a function `predict_book_popularity(titulo: Optional[str], ano_lanzamien...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_book_popularity(None, None, None, None, None) == {'prediction': 1.82, 'error': 5.53698}\", \"assert predict_book_popularity('test', 2009, 95, 9789872414341, 'Elsa Pizzi') == {'prediction': 9, 'error': 5.26764}\", \"assert predict_book_popularity('tes...
{ "split": "train", "index": 64282, "acecode_id": "bigcode_python_fns_2344", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a function `generateVerificationStatement` that produces a unique verification statement composed of four distinct words randomly selected from a predefined list. The generated statement must include at least one special character and a random digit at the end to enhance ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generateVerificationStatement() != generateVerificationStatement()\", \"assert len(generateVerificationStatement()) > 0\", \"assert any(char in generateVerificationStatement() for char in string.punctuation)\", \"assert any(char.isdigit() for char in generat...
{ "split": "train", "index": 64283, "acecode_id": "evol_2109", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You have been tasked with creating a function that simulates a device that ignores its input. Implement a function called `null_input()` that takes no parameters and returns a string 'null' to represent the ignored input. This function will be used in a system where certain inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert null_input() == 'null'\", \"assert null_input() == 'null'\", \"assert null_input() == 'null'\", \"assert null_input() == 'null'\", \"assert null_input() == 'null'\", \"assert null_input() == 'null'\", \"assert null_input() == 'null'\", \"assert null_input() ...
{ "split": "train", "index": 64284, "acecode_id": "bigcode_python_fns_23091", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of dictionaries representing females and males. Each dictionary contains the following keys: 'hid' (household ID), 'east' (an integer representing some attribute), and 'hhweight' (an integer representing household weight). Your task is to implement a fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert adjust_values([{'hid': 1, 'east': 10, 'hhweight': 5}], [{'hid': 2, 'east': 20, 'hhweight': 10}]) == ([{'hid': 1, 'east': 10, 'hhweight': 5, 'in_couple': 1, 'hhv': 0}], [{'hid': 1, 'east': 10, 'hhweight': 5, 'in_couple': 1, 'hhv': 1}])\", \"assert adjust_valu...
{ "split": "train", "index": 64285, "acecode_id": "bigcode_python_fns_39500", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the addition of tags to various submissions. Each user can add tags to their submissions, but certain tags may be restricted for specific users. Write a function that takes in a list of tags to be added, a list of restr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_tags(['science', 'art', 'history'], ['art'], ['sub1', 'sub2']) == [{'science', 'history'}, {'science', 'history'}]\", \"assert add_tags(['a', 'b', 'c'], [], ['sub1']) == [{'a', 'b', 'c'}]\", \"assert add_tags(['tag1', 'tag2'], ['tag1'], ['sub1', 'sub2', ...
{ "split": "train", "index": 64286, "acecode_id": "bigcode_python_fns_37786", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of strings, `a` and `b`, write a function `find_best_matches(a: List[str], b: List[str], threshold: int) -> List[int]` that returns a list of indices from list `b` that best match the strings in list `a` based on n-gram overlap. The parameter `threshold` defines...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_best_matches(['hello world', 'foo bar'], ['bar foo', 'world hello'], 3) == [1, 0]\", \"assert find_best_matches(['aaa', 'bbb', 'ccc'], ['ddd', 'eee', 'fff'], 2) == [-1, -1, -1]\", \"assert find_best_matches([], ['a', 'b'], 1) == []\", \"assert find_best...
{ "split": "train", "index": 64287, "acecode_id": "bigcode_python_fns_24889", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `add(a, b)` that takes two parameters, `a` and `b`, and returns their summation. Before performing the summation, the function should validate that both `a` and `b` are positive integers. If either of the inputs is not a positive integer, the function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add(2, 3) == 5\", \"assert add(1, 1) == 2\", \"assert add(5, 10) == 15\", \"assert add(0, 5) == 'Error: both a and b need to be positive integers.'\", \"assert add(-1, 3) == 'Error: both a and b need to be positive integers.'\", \"assert add(3, -3) == 'Error...
{ "split": "train", "index": 64288, "acecode_id": "evol_16146", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of entries, where each entry is represented as a dictionary containing 'tipo', 'description', and 'date'. Your function should return a list of strings formatted as \"Tipo: {tipo}, Description: {description}, Date: {date...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_entries([{'tipo': 'Expense', 'description': 'Lunch', 'date': '2023-10-01'}, {'tipo': 'Income', 'description': 'Salary', 'date': '2023-10-02'}]) == ['Tipo: Expense, Description: Lunch, Date: 2023-10-01', 'Tipo: Income, Description: Salary, Date: 2023-1...
{ "split": "train", "index": 64289, "acecode_id": "oss_19509", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a positive integer as input and returns the sum of its digits. The function should handle any positive integer value and should not take any additional parameters.\nPlease reason step by step, then write a self-contained Python solution. Give you...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cumulative_sum(123) == 6\", \"assert cumulative_sum(999) == 27\", \"assert cumulative_sum(0) == 0\", \"assert cumulative_sum(1) == 1\", \"assert cumulative_sum(4567) == 22\", \"assert cumulative_sum(100) == 1\", \"assert cumulative_sum(205) == 7\", \"assert ...
{ "split": "train", "index": 64290, "acecode_id": "evol_16096", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `validate_string_collection(collection: Union[List[str], Tuple[str]]) -> None` that checks if the input is a list or tuple containing only string elements. The function should raise a TypeError if the input is neither a list nor a tuple, or if any of the el...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_string_collection(['hello', 'world']) is None\", \"assert validate_string_collection(('hello', 'world')) is None\", \"assert validate_string_collection(None) is None\", \"assert validate_string_collection(['']) is None\", \"assert validate_string_co...
{ "split": "train", "index": 64291, "acecode_id": "bigcode_python_fns_41384", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that takes three integers as input and rotates their values in a specific order. The function should return the values such that the first value becomes the second, the second value becomes the third, and the third value becomes the first. For example, i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_values(1, 2, 3) == (3, 1, 2)\", \"assert rotate_values(5, 10, 15) == (15, 5, 10)\", \"assert rotate_values(0, 0, 0) == (0, 0, 0)\", \"assert rotate_values(-1, -2, -3) == (-3, -1, -2)\", \"assert rotate_values(7, 8, 9) == (9, 7, 8)\", \"assert rotate_v...
{ "split": "train", "index": 64292, "acecode_id": "evol_3526", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers representing points in a 2D plane, each list containing an even number of elements, write a function `draw_polygons(points1: List[int], points2: List[int]) -> List[Tuple[int, int]]` that returns the vertices of the polygons formed by connecting the p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert draw_polygons([0, 0, 1, 1, 1, 0], [2, 2, 3, 3, 3, 2]) == [(0, 0), (1, 1), (1, 0), (2, 2), (3, 3), (3, 2)]\", \"assert draw_polygons([1, 1, 2, 2], [3, 3, 4, 4]) == [(1, 1), (2, 2), (3, 3), (4, 4)]\", \"assert draw_polygons([0, 0, 2, 0, 2, 2, 0, 2], [1, 1, 3, ...
{ "split": "train", "index": 64293, "acecode_id": "bigcode_python_fns_45623", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a unique deployment key based on a given project name and a timestamp. The deployment key should be a string that combines the project name, the current timestamp, and a random number between 1000 and 9999. The format o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_deployment_key('ProjectA', '2023-10-01T12:00:00Z').startswith('ProjectA_')\", \"assert len(generate_deployment_key('ProjectB', '2023-10-02T12:30:00Z').split('_')) == 3\", \"assert generate_deployment_key('ProjectD', '2023-10-04T15:30:00Z').count('_'...
{ "split": "train", "index": 64294, "acecode_id": "oss_17071", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a character creation system for a role-playing game. The system should allow players to select a race and then display the corresponding stat modifiers for that race. The stat modifiers are applied to the base stats of Strength (Str), Dexterity (Dex...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_modified_stats('human') == {'Str': 10, 'Dex': 10, 'Con': 10, 'Int': 10, 'Wis': 10, 'Cha': 10}\", \"assert get_modified_stats('half-orc') == {'Str': 12, 'Dex': 10, 'Con': 10, 'Int': 8, 'Wis': 10, 'Cha': 10}\", \"assert get_modified_stats('elf') == {'Str':...
{ "split": "train", "index": 64295, "acecode_id": "oss_19024", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `initialize_mnist_env` that initializes a simple representation of the MNIST dataset environment. The function takes the following parameters: \n- `num_classes` (int): an integer representing the number of classes in the datase...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_mnist_env(2) == {'num_classes': 2, 'procs': None, 'proc_id': None, 'train': True}\", \"assert initialize_mnist_env(3, procs=4, proc_id=1) == {'num_classes': 3, 'procs': 4, 'proc_id': 1, 'train': True}\", \"assert initialize_mnist_env(5, train=Fals...
{ "split": "train", "index": 64296, "acecode_id": "oss_27505", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `switch_case(idx)` that returns a specific string based on the value of the input index `idx`. The function should return 'zero' if `idx` is 0, 'one' if `idx` is 1, 'two' if `idx` is 2, and 'Invalid index' for any other value of `idx'.\nPlease reason step b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert switch_case(0) == 'zero'\", \"assert switch_case(1) == 'one'\", \"assert switch_case(2) == 'two'\", \"assert switch_case(3) == 'Invalid index'\", \"assert switch_case(-1) == 'Invalid index'\", \"assert switch_case(100) == 'Invalid index'\", \"assert switch_c...
{ "split": "train", "index": 64297, "acecode_id": "evol_1225", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings, implement a function that fuses them by interweaving their letters and then reversing the unified result. If one string is longer than the other, append the remaining characters of the longer string after interweaving. The function should take two strings as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_mix_strings('', '') == ''\", \"assert custom_mix_strings('a', 'b') == 'ba'\", \"assert custom_mix_strings('abc', '') == 'cba'\", \"assert custom_mix_strings('', 'xyz') == 'zyx'\", \"assert custom_mix_strings('a', '123456') == '654321a'\", \"assert cus...
{ "split": "train", "index": 64298, "acecode_id": "evol_22813", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes energy consumption data from a smart meter. You need to decode an input value representing energy consumption and return the corresponding status of the energy consumption. The possible statuses are represented b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_energy_consumption(1) == ErdTumbleStatus.NORMAL\", \"assert process_energy_consumption(2) == ErdTumbleStatus.HIGH_CONSUMPTION\", \"assert process_energy_consumption(3) == ErdTumbleStatus.LOW_CONSUMPTION\", \"assert process_energy_consumption('invalid...
{ "split": "train", "index": 64299, "acecode_id": "oss_33395", "num_tests": 16 }