data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a start date in the format 'dd-mm-yyyy' and calculates the end date after a given number of days. The function should return the end date in the same format. Create a function called `calculate_end_date` that takes two p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_end_date('28-04-2013', 10) == '08-05-2013'\", \"assert calculate_end_date('31-12-2020', 1) == '01-01-2021'\", \"assert calculate_end_date('01-01-2021', 365) == '01-01-2022'\", \"assert calculate_end_date('28-02-2020', 1) == '29-02-2020'\", \"assert...
{ "split": "train", "index": 6000, "acecode_id": "oss_32251", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates switching a Heroku app offline. The function takes one parameter, 'app', which is a string representing the name of the Heroku app. The function should return a dictionary that contains the name of the app and its current s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert switch_app_offline('my_app') == {'app_name': 'my_app', 'status': 'offline'}\", \"assert switch_app_offline('test_app') == {'app_name': 'test_app', 'status': 'offline'}\", \"assert switch_app_offline('demo_app') == {'app_name': 'demo_app', 'status': 'offline'...
{ "split": "train", "index": 6001, "acecode_id": "bigcode_python_fns_13912", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that encodes a given input. The function should take a single input parameter, which can be either a string or a byte sequence. If the input is a string, your function should convert it into a byte sequence using UTF-8 encoding and then s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_input(' Hello World ') == b'Hello World'\", \"assert encode_input('') == b''\", \"assert encode_input(' Python ') == b'Python'\", \"assert encode_input(' Test String ') == b'Test String'\", \"assert encode_input(b'Hello World') == b'Hello World'...
{ "split": "train", "index": 6002, "acecode_id": "bigcode_python_fns_41763", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a string `s` consisting of only lowercase letters, write a function to determine the length of the longest substring without repeating characters. A substring is a contiguous sequence of characters within a string. Return the length of this substring. For example, given t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_unique_substring('abcabcbb') == 3\", \"assert longest_unique_substring('bbbbb') == 1\", \"assert longest_unique_substring('pwwkew') == 3\", \"assert longest_unique_substring('') == 0\", \"assert longest_unique_substring('a') == 1\", \"assert longest_...
{ "split": "train", "index": 6003, "acecode_id": "bigcode_python_fns_19524", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a custom exception handling mechanism in Python. Write a function called `check_positive` that takes an integer input `value`. If `value` is less than zero, the function should raise a custom exception called `MyError`, which inherits from the base `Except...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_positive(5) == 5\", \"assert check_positive(0) == 0\", \"assert check_positive(100) == 100\", \"assert check_positive(50) == 50\", \"assert check_positive(1) == 1\", \"assert check_positive(10) == 10\", \"assert check_positive(20) == 20\", \"assert che...
{ "split": "train", "index": 6004, "acecode_id": "oss_27382", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that simulates the behavior of dense solvers in computing eigenpairs for a diagonal eigenproblem. The function should take two parameters: `N` (an integer representing the size of the matrix, where N >= 1) and an optional `num` (an inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_eigenpairs(10) == ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0,...
{ "split": "train", "index": 6005, "acecode_id": "bigcode_python_fns_35348", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a recursive function `sum_from_one_to_n(n: int) -> int` that calculates the sum of all numbers from 1 to N, where N is a non-negative integer. If N is negative, the function should raise a ValueError. The function should be efficient enough to handle large values of N...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_from_one_to_n(0) == 0\", \"assert sum_from_one_to_n(1) == 1\", \"assert sum_from_one_to_n(2) == 3\", \"assert sum_from_one_to_n(3) == 6\", \"assert sum_from_one_to_n(4) == 10\", \"assert sum_from_one_to_n(5) == 15\", \"assert sum_from_one_to_n(10) == 55\...
{ "split": "train", "index": 6006, "acecode_id": "evol_25433", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `advanced_monotonic(l: list, strict: bool = False) -> bool` that checks if the elements of the list `l` are monotonically ascending or descending. The function should ignore non-integer or non-float elements, converting strings that represent numbers into t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_monotonic([1, '2', 4, 20]) == True\", \"assert advanced_monotonic([1, 20, None, 4, 10]) == False\", \"assert advanced_monotonic([4, 1, '1', 0, -10], strict=True) == False\", \"assert advanced_monotonic([1, 1, 'one', 1, 1], strict=False) == True\", \...
{ "split": "train", "index": 6007, "acecode_id": "evol_445", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a scheduling system to determine if a new session can be booked in a venue at a specific date and time. Implement a function `can_book_session(date: str, start_time: str, end_time: str, venue: str, booked_sessions: List[Tuple[str, str, str]]) -> str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_book_session('2023-10-15', '10:00', '11:00', 'Room A', [('2023-10-15', '09:00', '10:00'), ('2023-10-15', '11:00', '12:00')]) == 'success'\", \"assert can_book_session('2023-10-15', '10:30', '11:30', 'Room A', [('2023-10-15', '09:00', '10:00'), ('2023-10-...
{ "split": "train", "index": 6008, "acecode_id": "bigcode_python_fns_34736", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates the width class of a font represented in the OpenType OS/2 Table format. The width class is an integer that must be within a valid range of 1 to 9 (inclusive). Your function should take an integer input `usWidthClass` and r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_width_class(1) == True\", \"assert validate_width_class(5) == True\", \"assert validate_width_class(9) == True\", \"assert validate_width_class(0) == False\", \"assert validate_width_class(10) == False\", \"assert validate_width_class(-1) == False\"...
{ "split": "train", "index": 6009, "acecode_id": "oss_19317", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns a list of replica IDs for a given protocol manager instance. The function takes an integer `count` which represents the total number of protocol instances, including the master instance. The function should return a list of i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_backup_ids(5) == [1, 2, 3, 4]\", \"assert get_backup_ids(1) == []\", \"assert get_backup_ids(2) == [1]\", \"assert get_backup_ids(3) == [1, 2]\", \"assert get_backup_ids(4) == [1, 2, 3]\", \"assert get_backup_ids(6) == [1, 2, 3, 4, 5]\", \"assert get_bac...
{ "split": "train", "index": 6010, "acecode_id": "oss_28468", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of transactions between a group of people, where each transaction is represented as a tuple (x, y, z, t). Here, x is the person who lent money, y is the person who borrowed money, z is the amount lent, and t is the time of the transaction. The money lent ac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minTransfers([[0, 1, 10, 1], [2, 0, 5, 2]]) == 2\", \"assert minTransfers([[0, 1, 20, 1], [1, 0, 10, 2]]) == 1\", \"assert minTransfers([[0, 1, 10, 1], [0, 2, 20, 2], [1, 2, 5, 3]]) == 2\", \"assert minTransfers([[0, 1, 50, 1], [1, 2, 60, 2], [2, 3, 70, 3], ...
{ "split": "train", "index": 6011, "acecode_id": "evol_25576", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings. Your task is to implement a function that returns the maximum area of a rectangle that can be formed using consecutive buildings in the list. The width of the rectangle is determined by the number of consec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_rectangle_area([1, 2, 3, 4, 5]) == 9\", \"assert max_rectangle_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_rectangle_area([5, 4, 1, 2]) == 8\", \"assert max_rectangle_area([0, 0, 0, 0]) == 0\", \"assert max_rectangle_area([2, 2, 2, 2]) == 8\", \"asser...
{ "split": "train", "index": 6012, "acecode_id": "bigcode_python_fns_10830", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given an array of integers `A`, consider all non-empty subsequences of `A`. For any sequence S, let the width of S be the difference between the maximum and minimum element of S. Implement a function `sumSubseqWidths(A: List[int]) -> int` that returns the sum of the widths of a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sumSubseqWidths([2, 1, 3]) == 6\", \"assert sumSubseqWidths([1]) == 0\", \"assert sumSubseqWidths([1, 2]) == 1\", \"assert sumSubseqWidths([2, 2, 2]) == 0\", \"assert sumSubseqWidths([100, 200]) == 100\", \"assert sumSubseqWidths([0, 0, 0, 0]) == 0\", \"asse...
{ "split": "train", "index": 6013, "acecode_id": "evol_27410", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the sub-hourly energy delivered from providing upward reserves based on a set of parameters. Implement the function `subtimepoint_delivered_energy_expression_rule(mod, prj, tmp)` which takes three parameters: `mod` (an integer representing the op...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert subtimepoint_delivered_energy_expression_rule(1, 2, 3) == 5\", \"assert subtimepoint_delivered_energy_expression_rule(0, 0, 0) == 0\", \"assert subtimepoint_delivered_energy_expression_rule(2, 3, 4) == 10\", \"assert subtimepoint_delivered_energy_expression_...
{ "split": "train", "index": 6014, "acecode_id": "oss_7316", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with translating a string of JavaScript code that contains calls to the `parseInt` function into a new format using a custom function named `__ee_extrafunc_parseInt`. Your function should identify all instances of `parseInt` with arguments in the string and repla...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate_fun_parseInt('parseInt(1010101, 2)') == '__ee_extrafunc_parseInt(1010101, 2)'\", \"assert translate_fun_parseInt('var num = parseInt(value) + 1;') == 'var num = __ee_extrafunc_parseInt(value) + 1;'\", \"assert translate_fun_parseInt('console.log(pa...
{ "split": "train", "index": 6015, "acecode_id": "bigcode_python_fns_41230", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `list_sorter` that takes a single argument, `lst`, which is expected to be a list containing mixed numerical and string values. The function should return a tuple with two lists: the first list should contain all the numeric values sorted in increasi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_sorter([3, 1, 'apple', 2, 'banana']) == ([1, 2, 3], ['apple', 'banana'])\", \"assert list_sorter(['zebra', 5, 2, 'apple', 1]) == ([1, 2, 5], ['apple', 'zebra'])\", \"assert list_sorter([]) == ([], [])\", \"assert list_sorter(['cat', 'dog', 'elephant']) ...
{ "split": "train", "index": 6016, "acecode_id": "evol_24841", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the outputs of a supervised machine learning model on a batch of data. Your task is to compute the average of these outputs. If the average is greater than a specified threshold, return 'Above Threshold'. Otherwise, return 'Below Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_model_output([5, 5, 5], 10) == 'Below Threshold'\", \"assert evaluate_model_output([0, 0, 0], 0) == 'Below Threshold'\", \"assert evaluate_model_output([1, 1, 1, 1], 1) == 'Below Threshold'\", \"assert evaluate_model_output([100, 200, 300], 150) == ...
{ "split": "train", "index": 6017, "acecode_id": "bigcode_python_fns_34154", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the adjustment of lengths of input arrays based on new evaluations for a Bayesian optimization algorithm. The function, named `adjust_length`, takes in the following parameters: a list of existing input points `X`, a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert adjust_length([], [], [], 10, 0) == ([0], [10], [0], 1)\", \"assert adjust_length([0], [10], [0], 15, 1) == ([0, 1], [10, 15], [0, 1], 2)\", \"assert adjust_length([0, 1], [10, 15], [0, 1], 20, 2) == ([0, 1, 2], [10, 15, 20], [0, 1, 2], 3)\", \"assert adjust...
{ "split": "train", "index": 6018, "acecode_id": "oss_18939", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries where each dictionary represents a user's heart rate log with the following keys: 'Time', 'Heartrate', and 'Gamemode'. Your task is to normalize the heart rate values for each log entry based on the minimum heart rate recorded before the end...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_heartrate([{'Time': 1, 'Heartrate': 120, 'Gamemode': 'MOVEMENTTUTORIAL'}, {'Time': 2, 'Heartrate': 150, 'Gamemode': 'PLAY'}, {'Time': 3, 'Heartrate': 180, 'Gamemode': 'PLAY'}]) == [{'Time': 1, 'Heartrate': 1.0, 'Gamemode': 'MOVEMENTTUTORIAL'}, {'Ti...
{ "split": "train", "index": 6019, "acecode_id": "bigcode_python_fns_28318", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given an integer n, compute the number of derangements of a numerical sequence composed of integers from 1 to n, where no element retains its original position. Return the result modulo 10^9 + 7.\nPlease reason step by step, then write a self-contained Python solution. Give you...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert derangement(1) == 0\", \"assert derangement(2) == 1\", \"assert derangement(3) == 2\", \"assert derangement(4) == 9\", \"assert derangement(5) == 44\", \"assert derangement(6) == 265\", \"assert derangement(7) == 1854\", \"assert derangement(8) == 14833\", \...
{ "split": "train", "index": 6020, "acecode_id": "evol_2305", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a function that computes the greatest common divisor (GCD) of two given integers a and b. The GCD is the largest positive integer that divides both a and b without leaving a remainder. You may assume that both integers are non-negative and at least one of them is non-zero...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gcd(48, 18) == 6\", \"assert gcd(56, 98) == 14\", \"assert gcd(101, 10) == 1\", \"assert gcd(0, 5) == 5\", \"assert gcd(5, 0) == 5\", \"assert gcd(15, 0) == 15\", \"assert gcd(0, 0) == 0\", \"assert gcd(27, 9) == 9\", \"assert gcd(100, 25) == 25\", \"assert ...
{ "split": "train", "index": 6021, "acecode_id": "evol_24749", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string and returns a new string with the characters in reverse order. The function should handle empty strings and strings with special characters appropriately.\nPlease reason step by step, then write a self-contained Python solution. Give you...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('') == ''\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('!@#$%^&*()') == ')(*&^%$#@!'\", \"assert reverse_string('abc def') == 'fed cba'\", \"assert reverse_string('Pyt...
{ "split": "train", "index": 6022, "acecode_id": "evol_20748", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that assembles an FTP (File Transfer Protocol) URL based on the provided details. The function should take a dictionary with optional keys: 'username', 'password', and 'port'. It should generate a valid FTP URL in the format 'ftp://username:password@myserver:p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert assemble_ftp_url({'username': 'ftpUser', 'password': 'pass123', 'port': '21'}) == 'ftp://ftpUser:pass123@myserver:21/download/datafile'\", \"assert assemble_ftp_url({'username': 'user@domain.com', 'password': 'pass123', 'port': '21'}) == 'ftp://user%40domain...
{ "split": "train", "index": 6023, "acecode_id": "evol_20012", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a string containing key-value pairs in a specific format and returns a dictionary with the extracted key-value pairs. You are given a string `inpStr` in the following format: The string contains key-value pairs e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_key_value_pairs('[name]=[John],[age]=[30],[city]=[New York]') == {'name': 'John', 'age': '30', 'city': 'New York'}\", \"assert extract_key_value_pairs('[fruit]=[apple],[color]=[red]') == {'fruit': 'apple', 'color': 'red'}\", \"assert extract_key_valu...
{ "split": "train", "index": 6024, "acecode_id": "oss_37511", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `daemonize_process()` that simulates the process of daemonizing an application. The function should take a boolean parameter `stream` and return a string indicating the output destination. If `stream` is `True`, return 'sillystream server started'; otherwis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert daemonize_process(True) == 'sillystream server started'\", \"assert daemonize_process(False) == 'output redirected to /dev/null'\", \"assert daemonize_process(True) == 'sillystream server started'\", \"assert daemonize_process(False) == 'output redirected to...
{ "split": "train", "index": 6025, "acecode_id": "bigcode_python_fns_22006", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a series of numbers. Your task is to implement a function that returns a new list containing the doubled values of the input integers. The function should take the list of integers as input and output a list of integers where each i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert double_series([1, 2, 3]) == [2, 4, 6]\", \"assert double_series([0, -1, -2]) == [0, -2, -4]\", \"assert double_series([5, 10, 15]) == [10, 20, 30]\", \"assert double_series([]) == []\", \"assert double_series([10]) == [20]\", \"assert double_series([-5, -10,...
{ "split": "train", "index": 6026, "acecode_id": "bigcode_python_fns_10992", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of votes. Each vote is represented as a dictionary with 'voter_id' and 'candidate_id'. Your function should take a list of these vote dictionaries and return a dictionary that counts the total votes for each cand...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_votes([]) == {}\", \"assert process_votes([{'voter_id': 'v1', 'candidate_id': 'c1'}]) == {'c1': 1}\", \"assert process_votes([{'voter_id': 'v1', 'candidate_id': 'c1'}, {'voter_id': 'v2', 'candidate_id': 'c1'}]) == {'c1': 2}\", \"assert process_votes(...
{ "split": "train", "index": 6027, "acecode_id": "oss_1204", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a line from a logfile. Each line may contain energy values formatted as 'energy: -XX.XX', where 'XX.XX' can be any floating point number. Write a function that extracts all the energy values from the list of strings ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_energy(['energy: -5.67', 'Some other text', 'energy: -3.42']) == [-5.67, -3.42]\", \"assert extract_energy(['No energy here', 'energy: -1.23']) == [-1.23]\", \"assert extract_energy(['energy: -10.00', 'energy: -20.00', 'energy: -30.00']) == [-10.00, ...
{ "split": "train", "index": 6028, "acecode_id": "bigcode_python_fns_6098", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `get_optimums(model: List[int], size: int, excludes: List[int]) -> List[int]` that retrieves the top 'size' optimum values from a given score model represented as a list of integers. The function must exclude any values at the indices...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_optimums([10, 20, 30, 40, 50], 3, [0, 1]) == [50, 40, 30]\", \"assert get_optimums([1, 1, 1, 1, 1], 2, [0, 1, 2, 3]) == [1]\", \"assert get_optimums([100, 200, 300], 2, []) == [300, 200]\", \"assert get_optimums([7, 5, 3, 9], 1, [1]) == [9]\", \"assert g...
{ "split": "train", "index": 6029, "acecode_id": "oss_33364", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a string containing a series of words separated by spaces. Your task is to write a function that counts the frequency of each unique word in the string and returns a dictionary where the keys are the unique words and the values are their respective counts. The wor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_word_frequency('Hello, world! Hello.') == {'hello': 2, 'world': 1}\", \"assert count_word_frequency('Python is great; python is fun.') == {'python': 2, 'is': 2, 'great': 1, 'fun': 1}\", \"assert count_word_frequency('The quick brown fox jumps over the ...
{ "split": "train", "index": 6030, "acecode_id": "bigcode_python_fns_16799", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D list of integers. Each sub-list can be of varying length, including being empty. Your task is to write a function that finds the maximum number in each sub-list and then returns the maximum of these maximum numbers. If a sub-list is empty, it should be treate...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_in_2D([[3, 4, 7, 1], [7, 5, 2], [1, 9, 5, 8]]) == 9\", \"assert find_max_in_2D([[2, 3], [5, 1], [0]]) == 5\", \"assert find_max_in_2D([[1], [2], [3]]) == 3\", \"assert find_max_in_2D([[], [], []]) == 0\", \"assert find_max_in_2D([[10], [], [2, 4]]) ...
{ "split": "train", "index": 6031, "acecode_id": "evol_33775", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `setup_pen_kw(penkw={}, **kw)` that builds a pen object from a given set of keywords. The function takes two arguments: a dictionary `penkw` which contains pre-translated keywords for a pen, and a variable number of keyword arguments `kw`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_pen_kw({}, linewidth=2) == {'width': 2}\", \"assert setup_pen_kw({}, linewidth=3, color='red') == {'width': 3, 'color': 'red'}\", \"assert setup_pen_kw({'style': 'dashed'}, linewidth=1) == {'width': 1, 'style': 'dashed'}\", \"assert setup_pen_kw({}, li...
{ "split": "train", "index": 6032, "acecode_id": "bigcode_python_fns_32154", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing data from a hypothetical NFL stadium dataset. The dataset contains information about various NFL stadiums, including their names, locations, and seating capacities. Write a function `get_top_stadiums(stadiums: List[Tuple[str, str, int]], n: int) ->...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_top_stadiums([], 5) == []\", \"assert get_top_stadiums([('Stadium A', 'Location A', 50000)], 1) == [('Stadium A', 'Location A', 50000)]\", \"assert get_top_stadiums([('Stadium A', 'Location A', 50000), ('Stadium B', 'Location B', 60000)], 1) == [('Stadiu...
{ "split": "train", "index": 6033, "acecode_id": "oss_5815", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a list of cofractions based on input data. The input is a list of floating-point numbers representing fractions. The function should take two parameters: 'is_time_lag' (a boolean indicating whether to consider time lag) and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generateCofractions([0.1, 0.5, 0.7, 0.3], False, 0.5) == [0.5, 0.7]\", \"assert generateCofractions([0.8, 0.9, 0.4, 0.2], False, 0.5) == [0.8, 0.9]\", \"assert generateCofractions([0.0, 0.2, 0.3, 0.4], True, 0.1) == [None, 0.2, 0.3]\", \"assert generateCofra...
{ "split": "train", "index": 6034, "acecode_id": "oss_20269", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given an absolute URL and a form dictionary representing an HTTP POST request, implement a function `get_post_url(absolute_url: str, form: dict) -> str` that returns the absolute URL to which the POST request should be submitted. The form dictionary will contain two keys: 'meth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_post_url('http://example.com', {'method': 'POST', 'action': '/submit'}) == 'http://example.com/submit'\", \"assert get_post_url('http://example.com/path/', {'method': 'POST', 'action': 'submit'}) == 'http://example.com/path/submit'\", \"assert get_post_u...
{ "split": "train", "index": 6035, "acecode_id": "bigcode_python_fns_41148", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the padding for a given number of properties in a logical specification. The function should take two integer inputs: `property_pad` which represents the padding for properties, and `num_properties` which represents the nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_padding(5, 3) == 15\", \"assert calculate_total_padding(0, 10) == 0\", \"assert calculate_total_padding(2, 0) == 0\", \"assert calculate_total_padding(7, 1) == 7\", \"assert calculate_total_padding(4, 4) == 16\", \"assert calculate_total_padd...
{ "split": "train", "index": 6036, "acecode_id": "oss_8182", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simplified version of a job submission system. Each job has a unique identifier, a priority level, and a time estimate for completion. Your function should accept a list of job submissions, each represented by a tuple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert next_job([('job1', 2, 5), ('job2', 1, 3), ('job3', 3, 1)]) == 'job3'\", \"assert next_job([('job4', 1, 2), ('job5', 1, 5), ('job6', 2, 3)]) == 'job6'\", \"assert next_job([]) == None\", \"assert next_job([('job7', 5, 10), ('job8', 4, 1)]) == 'job7'\", \"asse...
{ "split": "train", "index": 6037, "acecode_id": "oss_22668", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a Kubernetes synchronizer based on a given namespace and a boolean flag indicating whether to use 'rsync' or 'kubectl cp' for synchronization. Your function should return a dictionary that contains the names...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_kubernetes_syncer('default', True) == {'namespace': 'default', 'sync_method': 'rsync'}\", \"assert create_kubernetes_syncer('development', False) == {'namespace': 'development', 'sync_method': 'kubectl cp'}\", \"assert create_kubernetes_syncer('produc...
{ "split": "train", "index": 6038, "acecode_id": "bigcode_python_fns_11416", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a unique revision ID for a database migration tool. The revision ID should be a 12-character hexadecimal string, and it should be different from any previously generated revision IDs. Write a function `generate_revis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_revision_id([]) not in []\", \"assert generate_revision_id(['000000000000']) not in ['000000000000']\", \"assert generate_revision_id(['000000000000', '000000000001']) not in ['000000000000', '000000000001']\", \"assert generate_revision_id(['aaaaaa...
{ "split": "train", "index": 6039, "acecode_id": "oss_18287", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings representing a person's first name and last name, implement a function `get_full_name(first_name: str, last_name: str) -> str` that returns the full name formatted as 'last_name, first_name'. The function should take the first name and last name as input param...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_full_name('John', 'Doe') == 'Doe, John'\", \"assert get_full_name('Jane', 'Smith') == 'Smith, Jane'\", \"assert get_full_name('Alice', 'Johnson') == 'Johnson, Alice'\", \"assert get_full_name('Bob', 'Brown') == 'Brown, Bob'\", \"assert get_full_name('Cha...
{ "split": "train", "index": 6040, "acecode_id": "oss_33572", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and a list of indices, return the elements at the specified indices from the original list. If the index is out of bounds, simply ignore that index. The function should handle both scalar indices and a list of indices. Write a function `get_elements_at_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_elements_at_indices([10, 20, 30, 40, 50], [0, 2, 4]) == [10, 30, 50]\", \"assert get_elements_at_indices([1, 2, 3, 4, 5], [1, 3]) == [2, 4]\", \"assert get_elements_at_indices([5, 10, 15], [-1, 1, 5]) == [10]\", \"assert get_elements_at_indices([0, 1, 2,...
{ "split": "train", "index": 6041, "acecode_id": "bigcode_python_fns_28288", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an upper triangular matrix A represented as a list of lists and a vector B represented as a list of floats. Your task is to implement a function `backsubstitution(A: List[List[float]], B: List[float]) -> List[float]` that solves the equation A . x = B using the ba...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert backsubstitution([[1]], [5]) == [5.0]\", \"assert backsubstitution([[3, 2, 1], [0, 1, 4], [0, 0, 2]], [9, 10, 4]) == [1.0, 2.0, 2.0]\", \"assert backsubstitution([[2, 0], [0, 3]], [4, 9]) == [2.0, 3.0]\", \"assert backsubstitution([[1, 1, 1], [0, 1, 1], [0, ...
{ "split": "train", "index": 6042, "acecode_id": "bigcode_python_fns_13286", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a skyline. Your task is to find the maximum area of a rectangle that can be formed within the skyline, where the rectangle's height is defined by the shortest building in that rectangle and the width is d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxRectangleArea([2, 1, 5, 6, 2, 3]) == 10\", \"assert maxRectangleArea([1, 1, 1, 1]) == 4\", \"assert maxRectangleArea([4, 2, 0, 3, 2, 5]) == 6\", \"assert maxRectangleArea([1, 2, 3, 4]) == 6\", \"assert maxRectangleArea([5, 4, 3, 2, 1]) == 9\", \"assert ma...
{ "split": "train", "index": 6043, "acecode_id": "bigcode_python_fns_3547", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two sorted lists of integers, implement a function that returns a list of unique elements that are present in either of the two lists. The output list should also be sorted in ascending order.\nPlease reason step by step, then write a self-contained Python solution. Give ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3, 4, 5, 7], [2, 4, 6, 7, 8]) == [1, 2, 3, 4, 5, 6, 7, 8]\", \"assert unique_elements([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert unique_elements([], []) == []\", \"assert unique_elements([1, 2, 3], []) == [1, 2, 3]\", \"as...
{ "split": "train", "index": 6044, "acecode_id": "evol_32848", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of points in Cartesian coordinates, convert each point to celestial coordinates and return the list of transformed points. The celestial coordinates can be derived using the following transformation: if a point in Cartesian coordinates is (x, y), then its correspon...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_celestial([(1, 1)]) == [(1.4142135623730951, 0.7853981633974483)]\", \"assert convert_to_celestial([(0, 0)]) == [(0.0, 0.0)]\", \"assert convert_to_celestial([(1, 0)]) == [(1.0, 0.0)]\", \"assert convert_to_celestial([(0, 1)]) == [(1.0, 1.57079632...
{ "split": "train", "index": 6045, "acecode_id": "bigcode_python_fns_23813", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if two given 2D arrays (matrices) are equal. Two matrices are considered equal if they have the same dimensions and all their corresponding elements are equal. Write a function `are_matrices_equal(matrix1, matrix2)` that t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_matrices_equal([[1, 2], [3, 4]], [[1, 2], [3, 4]]) == True\", \"assert are_matrices_equal([[1, 2, 3], [4, 5, 6]], [[1, 2, 3], [4, 5, 6]]) == True\", \"assert are_matrices_equal([[1]], [[1]]) == True\", \"assert are_matrices_equal([[1, 2]], [[1, 2]]) == T...
{ "split": "train", "index": 6046, "acecode_id": "bigcode_python_fns_11900", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of angles in degrees: `ra` (right ascension) and `dec` (declination), along with a list of Modified Julian Dates `mjd`. Your task is to convert these angles from degrees to radians. The function should return two lists containing the converted values for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_angles([0, 90, 180], [0, 45, 90]) == ([0.0, 1.5707963267948966, 3.141592653589793], [0.0, 0.7853981633974483, 1.5707963267948966])\", \"assert convert_angles([30, 60, 90], [10, 20, 30]) == ([0.5235987755982988, 1.0471975511965976, 1.5707963267948966]...
{ "split": "train", "index": 6047, "acecode_id": "bigcode_python_fns_42547", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple custom operator system that processes a list of integers. Each operator can perform a specific transformation on the list, and you need to implement a function that registers these operators and applies them sequentially to an input lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_pipeline([], [1, 2, 3]) == [1, 2, 3]\", \"assert apply_pipeline([lambda x: [i + 1 for i in x]], [1, 2, 3]) == [2, 3, 4]\", \"assert apply_pipeline([lambda x: [i * 2 for i in x]], [1, 2, 3]) == [2, 4, 6]\", \"assert apply_pipeline([lambda x: [i + 1 for ...
{ "split": "train", "index": 6048, "acecode_id": "oss_9731", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function `length_of_LIS(nums)` that returns the length of the longest increasing subsequence in the array. An increasing subsequence is a sequence of numbers where each number is greater than the previous one. If the array is empty, the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert length_of_LIS([10, 9, 2, 5, 3, 7, 101, 18]) == 4\", \"assert length_of_LIS([0, 1, 0, 3, 2, 3]) == 4\", \"assert length_of_LIS([7, 7, 7, 7, 7, 7, 7]) == 1\", \"assert length_of_LIS([]) == 0\", \"assert length_of_LIS([1]) == 1\", \"assert length_of_LIS([3, 2])...
{ "split": "train", "index": 6049, "acecode_id": "evol_16301", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that converts a given amount of cryptocurrency to another using a static conversion rate. Write a function `convert_crypto` that takes the following parameters: \n - `amount` (float): The amount of cryptocurrency to be converted. \n - `co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_crypto(100, 1.5) == 150.0\", \"assert convert_crypto(50, 2.0) == 100.0\", \"assert convert_crypto(0, 1.0) == 0.0\", \"assert convert_crypto(100, 0) == 0.0\", \"assert convert_crypto(75, 3.25) == 243.75\", \"assert convert_crypto(200, 0.5) == 100.0\",...
{ "split": "train", "index": 6050, "acecode_id": "oss_27655", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines whether a user is allowed to access a specific page based on their login status and the number of times they have logged in. The function should take two parameters: a boolean `logged_in` that indicates if the user is logg...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert access_control(True, 1) == 'Access Granted'\", \"assert access_control(True, 0) == 'Access Denied'\", \"assert access_control(False, 1) == 'Access Denied'\", \"assert access_control(False, 0) == 'Access Denied'\", \"assert access_control(True, 5) == 'Access ...
{ "split": "train", "index": 6051, "acecode_id": "bigcode_python_fns_21924", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the signing of a list of artifacts using a provided signing key. The function should take two parameters: a list of strings representing the artifacts and a string representing the signing key. The function should return a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sign_artifacts(['artifact1', 'artifact2'], 'key123') == ['artifact1_key123', 'artifact2_key123']\", \"assert sign_artifacts(['binary.exe', 'config.yaml'], 'secretKey') == ['binary.exe_secretKey', 'config.yaml_secretKey']\", \"assert sign_artifacts(['lib.so']...
{ "split": "train", "index": 6052, "acecode_id": "oss_8306", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a nested data structure represented as a dictionary, where some keys may contain nested dictionaries, lists, or integers. Your task is to implement a function that retrieves all integers from the nested structure. The integers should be returned as a list in the o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_integers({'a': 1, 'b': {'c': 2, 'd': [3, 4]}, 'e': 5}) == [1, 2, 3, 4, 5]\", \"assert extract_integers({'x': [1, 2, {'y': 3}], 'z': 4}) == [1, 2, 3, 4]\", \"assert extract_integers({'key': {'inner_key': {'deep_key': 10, 'list': [20, 30]}}}) == [10, 2...
{ "split": "train", "index": 6053, "acecode_id": "bigcode_python_fns_3438", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates retrieving information about different layers in a Geographic Information System (GIS) application. The function should take a layer name as input and return a dictionary containing predefined details about the speci...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_layer_info('population_density') == {'layer_name': 'population_density', 'type': 'raster', 'source': 'satellite', 'projection': 'WGS84'}\", \"assert get_layer_info('land_use') == {'layer_name': 'land_use', 'type': 'vector', 'source': 'census', 'projectio...
{ "split": "train", "index": 6054, "acecode_id": "oss_35458", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the process of estimating the honesty of sources based on claims about objects. The function should take in a list of sources, a list of claims made by those sources, and return a list of probabilities indicating the estima...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert estimate_honesty(['A', 'B', 'C'], [('A', 'obj1'), ('A', 'obj2'), ('B', 'obj1')]) == [1.0, 1.0, 0.0]\", \"assert estimate_honesty(['A', 'B'], [('A', 'obj1'), ('B', 'obj1'), ('B', 'obj2')]) == [1.0, 1.0]\", \"assert estimate_honesty(['A'], []) == [0.0]\", \"as...
{ "split": "train", "index": 6055, "acecode_id": "bigcode_python_fns_49799", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates a list of image URLs. The function should take a list of URLs as input and return a list of boolean values indicating whether each URL is valid. A URL is considered valid if it starts with 'http://' or 'https://'. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_image_urls(['http://example.com/image.png', 'https://example.com/image.jpg']) == [True, True]\", \"assert validate_image_urls(['ftp://example.com/image.png', 'http://example.com/image.jpg']) == [False, True]\", \"assert validate_image_urls(['http://...
{ "split": "train", "index": 6056, "acecode_id": "bigcode_python_fns_32249", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Construct a function that finds the length of the longest common subsequence present in a triplet of string sequences. The function must handle special characters, numerical values, and Unicode characters embedded within the string sequences. Additionally, it should raise a Typ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_common_subsequence('abc', 'abc', 'abc') == 3\", \"assert longest_common_subsequence('abc', 'def', 'ghi') == 0\", \"assert longest_common_subsequence('hello', 'world', 'hold') == 1\", \"assert longest_common_subsequence('123', '321', '231') == 1\", \"...
{ "split": "train", "index": 6057, "acecode_id": "evol_11844", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function `print_primes_up_to(n)` that takes an integer n as input and returns a list of all prime numbers between 0 and n, inclusive. A prime number is defined as a number greater than 1 that has no divisors other than 1 and itself. The function should not print the num...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_primes_up_to(0) == []\", \"assert print_primes_up_to(1) == []\", \"assert print_primes_up_to(2) == [2]\", \"assert print_primes_up_to(3) == [2, 3]\", \"assert print_primes_up_to(4) == [2, 3]\", \"assert print_primes_up_to(5) == [2, 3, 5]\", \"assert pr...
{ "split": "train", "index": 6058, "acecode_id": "evol_25674", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with initializing a database by executing a given SQL schema. Write a function `init_database(schema: str) -> None` that takes a string `schema` representing the SQL commands and executes them to initialize the database. The function should simulate executing the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert init_database('CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT);') == None\", \"assert init_database('CREATE TABLE products (id INTEGER, price REAL);') == None\", \"assert init_database('DROP TABLE IF EXISTS orders;') == None\", \"assert init_database(...
{ "split": "train", "index": 6059, "acecode_id": "bigcode_python_fns_17208", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that sorts the list in decreasing order without using any inbuilt sorting functions. Do not modify the original list, instead return a new list that contains the sorted elements. Write a function `sort_in_decreasing_order(arr: List...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_in_decreasing_order([4, 7, 2, 9, 6, 3, 1, 8, 0]) == [9, 8, 7, 6, 4, 3, 2, 1, 0]\", \"assert sort_in_decreasing_order([1, 1, 1, 1]) == [1, 1, 1, 1]\", \"assert sort_in_decreasing_order([-1, -3, -2, 0, 2]) == [2, 0, -1, -2, -3]\", \"assert sort_in_decreas...
{ "split": "train", "index": 6060, "acecode_id": "evol_24640", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a random IP address based on certain criteria. The function should take in two boolean parameters, `ipv6` and `ip3`, which indicate whether the address should be IPv6 and whether it should have 3 sections (for IPv4) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random_ip(False, False).count('.') == 3\", \"assert generate_random_ip(False, True).count('.') == 2\", \"assert generate_random_ip(True, False).count(':') == 7\", \"assert generate_random_ip(True, True).count(':') == 7\", \"assert all(0 <= int(part)...
{ "split": "train", "index": 6061, "acecode_id": "oss_27060", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `majority_label(values)` that returns the most common element in the list. If there are multiple elements that are equally common, return them as a set. If the list is empty, return an empty set. The input list may contain negative and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert majority_label([0] * 30 + [1] * 10 + [2] * 20) == 0\", \"assert majority_label([0] * 10 + [1] * 30 + [2] * 20) == 1\", \"assert majority_label([0] * 10 + [1] * 20 + [2] * 30) == 2\", \"assert majority_label([0] * 30 + [1] * 20 + [2] * 30) == {0, 2}\", \"asse...
{ "split": "train", "index": 6062, "acecode_id": "bigcode_python_fns_11152", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function in Python that takes four numerical parameters (which can be integers or floats) and returns the smallest numerical value among the four. The function should handle both positive and negative values correctly.\nPlease reason step by step, then write a self-con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smallest_number(1, 2, 3, 4) == 1\", \"assert smallest_number(-1, -2, -3, -4) == -4\", \"assert smallest_number(5.5, 2.2, 3.3, 4.4) == 2.2\", \"assert smallest_number(3, 3, 3, 3) == 3\", \"assert smallest_number(0, 0, 0, 0) == 0\", \"assert smallest_number(1....
{ "split": "train", "index": 6063, "acecode_id": "evol_12189", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `check_string(s)` that checks whether the given string starts with a vowel and ends with a consonant, ignoring any non-alphabetic characters at the start and end of the string. The function should handle case sensitivity. If the string meets these conditions, r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_string(' 1234! Eel$% ') == ('E', 'l')\", \"assert check_string('%% 0 ! U . x') == ('U', 'x')\", \"assert check_string(' 9 i ! G ') == ('i', 'G')\", \"assert check_string(' ! Owl @#') == ('O', 'l')\", \"assert check_string(' ! Aardv...
{ "split": "train", "index": 6064, "acecode_id": "evol_11582", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given an array of colors, where each color name is a string of lowercase letters and has a length greater than 0, implement a function that removes all occurrences of the color 'red' from the array. If the array does not contain the color 'red', the function should raise a Valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_red(['red', 'blue', 'green']) == ['blue', 'green']\", \"assert remove_red(['red', 'red', 'red']) == []\", \"assert remove_red(['red', 'blue']) == ['blue']\", \"assert remove_red(['green', 'red', 'yellow', 'red']) == ['green', 'yellow']\", \"assert rem...
{ "split": "train", "index": 6065, "acecode_id": "evol_24500", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a python function to calculate the product of the per-digit difference between two decimal numbers. The function should take two integer inputs and return the product of the absolute differences of their corresponding digits. If the numbers do not have the same number of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_digit_product_difference(0, 0) == 0\", \"assert binary_digit_product_difference(100, 200) == 0\", \"assert binary_digit_product_difference(5, 5) == 0\", \"assert binary_digit_product_difference(999, 000) == 729\", \"assert binary_digit_product_differe...
{ "split": "train", "index": 6066, "acecode_id": "evol_8078", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Create a function `get_github_emoji_names()` that returns a list of all GitHub emoji names available in the GitHub emoji API. The function should not require any input parameters. If the API cannot be reached or returns an error, the function should return an empty list. The AP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert 'smile' in get_github_emoji_names()\", \"assert 'tada' in get_github_emoji_names()\", \"assert 'eyes' in get_github_emoji_names()\", \"assert 'scream' in get_github_emoji_names()\", \"assert 'star' in get_github_emoji_names()\", \"assert get_github_emoji_nam...
{ "split": "train", "index": 6067, "acecode_id": "bigcode_python_fns_26402", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that extracts information about loaded files and their memory addresses from a given input string. The input string contains lines of text, with each line representing a file and its corresponding memory address in hexadecimal format....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_file_addresses('invalid_line\\\\nfile4: 0x123456') == [('file4', 1193046)]\", \"assert extract_file_addresses('file5: 0x0\\\\nfile6: 0xFFFFFFFF') == [('file5', 0), ('file6', 4294967295)]\", \"assert extract_file_addresses('file7: 0x1\\\\nfile8: 0x2\\...
{ "split": "train", "index": 6068, "acecode_id": "bigcode_python_fns_48966", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that simulates a simple reward system for a game. Your goal is to implement a Python function `generate_reward()` that randomly selects a reward from a predefined list of rewards and returns it as a string. The rewards can be of various ty...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_reward() in ['Gold Coin', 'Silver Coin', 'Health Potion', 'Double Damage']\", \"assert generate_reward() in ['Gold Coin', 'Silver Coin', 'Health Potion', 'Double Damage']\", \"assert generate_reward() in ['Gold Coin', 'Silver Coin', 'Health Potion',...
{ "split": "train", "index": 6069, "acecode_id": "oss_35125", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that generates a personalized greeting message and a string of favorite numbers. The function should take a single parameter, `name`, which is a string representing the person's name. The output should be a string that first greets the person with 'Hello <name...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_message('Alice') == 'Hello Alice!\\\\nMy favorite numbers: 1 2 3 4 5 6 7 8 9'\", \"assert generate_message('Bob') == 'Hello Bob!\\\\nMy favorite numbers: 1 2 3 4 5 6 7 8 9'\", \"assert generate_message('Charlie') == 'Hello Charlie!\\\\nMy favorite n...
{ "split": "train", "index": 6070, "acecode_id": "oss_4683", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages event sources. The function should accept an event source identifier and a position, and it should register the event source at the given position. However, the following rules must be followed: 1) Only a single event sou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_event_source('SRC1', 1) == None\", \"assert register_event_source('SRC2', 2) == None\", \"assert register_event_source('SRC3', 3) == None\", \"assert register_event_source('SRC4', 1) == None\", \"assert register_event_source('SRC1', 4) == None\", \"...
{ "split": "train", "index": 6071, "acecode_id": "bigcode_python_fns_16983", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple zone listing system. The function `list_zones` should take a list of zone names and return a dictionary containing the first three zones from the list, along with a 'nextId' which is the name of the last zone r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_zones(['zone1', 'zone2', 'zone3', 'zone4'], '123') == {'zones': [{'name': 'zone1'}, {'name': 'zone2'}, {'name': 'zone3'}], 'nextId': 'zone3', 'maxItems': 3, 'nameFilter': '*123'}\", \"assert list_zones(['zoneA', 'zoneB'], '456') == {'zones': [{'name': '...
{ "split": "train", "index": 6072, "acecode_id": "bigcode_python_fns_21061", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `disallowed` consisting of distinct characters and an array of strings `words`. A string is inconsistent if any character in the string appears in the string `disallowed`. Write a function `countInconsistentStrings(disallowed: str, words: list[str]) -> in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert countInconsistentStrings('abc', ['a','b','c','ab','ac','bc','abc']) == 7\", \"assert countInconsistentStrings('xyz', ['hello','world','test']) == 0\", \"assert countInconsistentStrings('mno', ['mn','no','om','mo','on']) == 5\", \"assert countInconsistentStri...
{ "split": "train", "index": 6073, "acecode_id": "evol_23212", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given two non-zero integers, `a` and `b`. Your task is to implement a function `find_ratio(a, b)` that calculates the ratio of `b` to `a`. The ratio is defined as `b / a`. You need to return this ratio as a float. For example, if `a` is 4 and `b` is 8, the ratio would b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_ratio(3, 9) == 3.0\", \"assert find_ratio(1, 1) == 1.0\", \"assert find_ratio(5, 10) == 2.0\", \"assert find_ratio(-2, 6) == -3.0\", \"assert find_ratio(7, -14) == -2.0\", \"assert find_ratio(-3, -9) == 3.0\", \"assert find_ratio(10, 5) == 0.5\", \"asse...
{ "split": "train", "index": 6074, "acecode_id": "oss_34445", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves user information based on a unique user ID. Given an integer user_id, the function should return a dictionary containing user details. If the user_id does not exist, the function should return None. Implement a single funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_info(1) == {'user_id': 1, 'name': 'Alice', 'email': 'alice@example.com'}\", \"assert get_user_info(2) == {'user_id': 2, 'name': 'Bob', 'email': 'bob@example.com'}\", \"assert get_user_info(6) == None\", \"assert get_user_info(7) == None\", \"assert ...
{ "split": "train", "index": 6075, "acecode_id": "bigcode_python_fns_12447", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of user dictionaries, each containing a 'name' (string), 'is_admin' (boolean), and 'is_active' (boolean), implement a function that returns a list of names of all active admin users. An active admin user is defined as a user who has 'is_admin' set to True and 'is_a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_active_admins([{'name': 'Alice', 'is_admin': True, 'is_active': True}, {'name': 'Bob', 'is_admin': False, 'is_active': True}, {'name': 'Charlie', 'is_admin': True, 'is_active': False}, {'name': 'Diana', 'is_admin': True, 'is_active': True}]) == ['Alice',...
{ "split": "train", "index": 6076, "acecode_id": "bigcode_python_fns_17160", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that allows users to create new posts in a social media application. The function should accept three parameters: `user_authenticated` (a boolean indicating if the user is authenticated), `is_member` (a boolean indicating if the user ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_post_view(True, True, 'POST') == 'Post created successfully'\", \"assert create_post_view(True, False, 'POST') == 'User is not a member of the group'\", \"assert create_post_view(False, True, 'POST') == 'User is not authenticated'\", \"assert create_p...
{ "split": "train", "index": 6077, "acecode_id": "oss_12799", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified version of the Hyperband algorithm for hyperparameter optimization of a machine learning model. Your function should take a list of hyperparameter configurations and a scoring function as input. The scoring function will evaluate th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hyperband_optimize([{'C': 1, 'kernel': 'linear'}, {'C': 5, 'kernel': 'rbf'}, {'C': 0.5, 'kernel': 'sigmoid'}], lambda config: config['C']) == {'C': 5, 'kernel': 'rbf'}\", \"assert hyperband_optimize([{'C': 1, 'kernel': 'linear'}, {'C': 1, 'kernel': 'rbf'}, {...
{ "split": "train", "index": 6078, "acecode_id": "oss_14738", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, write a function that replaces every character in the string (except for the last character) with a combination of its corresponding ASCII code and the UTF-16 code for the next character in the string. The combinations should be separated by a hyphen ('-'). If t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ascii_utf16_combination('A') == ''\", \"assert ascii_utf16_combination('') == ''\", \"assert ascii_utf16_combination('ab') == '97-98'\", \"assert ascii_utf16_combination('!') == ''\", \"assert ascii_utf16_combination('') == ''\", \"assert ascii_utf16_combina...
{ "split": "train", "index": 6079, "acecode_id": "evol_7942", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of repository names represented as strings. Write a function `compile_repo_info(repos: List[str], all: bool = False, fetch: bool = False) -> List[str]` that compiles information about the repositories. The function should return a sorted list of repository ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compile_repo_info(['repo1', 'repo3', 'repo2']) == ['repo1', 'repo2', 'repo3']\", \"assert compile_repo_info(['a', 'c', 'b'], all=True) == ['a', 'b', 'c']\", \"assert compile_repo_info(['alpha', 'gamma', 'beta']) == ['alpha', 'beta', 'gamma']\", \"assert comp...
{ "split": "train", "index": 6080, "acecode_id": "bigcode_python_fns_41635", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with handling a three-dimensional matrix with dimensions of p height, m rows, and n columns, where the elements could be of various types (numbers, strings, lists, etc). Your task is to construct a function that computes and returns a flattened version of this 3D...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_3D_matrix([[[1, 2, 'Apple'], [4, [10,11,12], 6], [7, 8, 9]], [[10, 11, 'Banana'], [13, 'Pineapple', 15], [16, [13,14,16], 18]]]) == [1, 2, 'Apple', 4, 10, 11, 12, 6, 7, 8, 9, 10, 11, 'Banana', 13, 'Pineapple', 15, 16, 13, 14, 16, 18]\", \"assert flat...
{ "split": "train", "index": 6081, "acecode_id": "evol_30696", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents a JSON object. Write a function `parse_json_value(data: Dict[str, Any], key: str, desired_type: Type = None) -> Any` that retrieves the value associated with the specified key from the dictionary. If the key does not exist, or if the v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_json_value({'name': 'Alice', 'age': 30}, 'name', str) == 'Alice'\", \"assert parse_json_value({'name': 'Alice', 'age': 30}, 'age', int) == 30\", \"assert parse_json_value({'name': 'Alice', 'age': 30}, 'age') == 30\", \"assert parse_json_value({'name': ...
{ "split": "train", "index": 6082, "acecode_id": "bigcode_python_fns_6399", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified version of a card scoring system. In this system, players collect cards from a deck and the goal is to determine which player has the lowest score at the end of the game. Each player can collect cards with values ranging from 3 to 3...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_winner(['Alice', 'Bob', 'Charlie'], [[5, 7, 3], [8, 10], [12, 15]], [1, 2, 1]) == 'Alice'\", \"assert calculate_winner(['Alice', 'Bob', 'Charlie'], [[6, 9], [10, 12, 5], [3, 4]], [2, 1, 0]) == 'Charlie'\", \"assert calculate_winner(['Alice', 'Bob',...
{ "split": "train", "index": 6083, "acecode_id": "oss_28209", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called loopSuminator which takes an array of integers and an integer n. The function should loop over the array for n times and calculate the sum of the elements during each iteration. If n exceeds the length of the array, the function should continue loopi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert loopSuminator([], 5) == 0\", \"assert loopSuminator([1, 2, 3], 0) == 0\", \"assert loopSuminator([1, 2, 3], 1) == 1\", \"assert loopSuminator([1, 2, 3], 2) == 3\", \"assert loopSuminator([1, 2, 3], 3) == 6\", \"assert loopSuminator([1, 2, 3], 4) == 7\", \"as...
{ "split": "train", "index": 6084, "acecode_id": "evol_14990", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array consisting of positive integers, implement a function that generates a sorted array containing all unique elements whose digits sum up to an odd number. Additionally, include one unique element from the input that sums up to an even number. The output array shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert elusive_odd_and_even_totals([1, 3, 5, 7]) == [1, 3, 5, 7]\", \"assert elusive_odd_and_even_totals([99, 88, 77, 66]) == [99]\", \"assert elusive_odd_and_even_totals([123, 456, 789]) == [123, 456]\", \"assert elusive_odd_and_even_totals([9, 9, 9, 9]) == [9]\",...
{ "split": "train", "index": 6085, "acecode_id": "evol_31613", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `filter_events` that filters a list of events based on a specified date range. Each event is represented as a dictionary with the following keys: 'id' (an integer), 'user_id' (an integer), 'name' (a string), and 'date' (a date object). Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_events([], None, None) == []\", \"assert filter_events([{'id': 1, 'user_id': 1, 'name': 'Event 1', 'date': date(2023, 1, 1)}], None, None) == [{'id': 1, 'user_id': 1, 'name': 'Event 1', 'date': date(2023, 1, 1)}]\", \"assert filter_events([{'id': 1, '...
{ "split": "train", "index": 6086, "acecode_id": "oss_4965", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of elements, implement a function `find_evens(lst)` that returns a list of all even integers from the input list. The function should only include integers that are even (i.e., divisible by 2). If there are no even integers or if the list is empty, the function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_evens([1, 2, 3, 4, 5, 6, 7, 8, 9]) == [2, 4, 6, 8]\", \"assert find_evens([1, 3, 5, 7, 9]) == []\", \"assert find_evens([]) == []\", \"assert find_evens([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert find_evens([1, 2, 'a', None, 4]) == [2, 4]\", \"assert fin...
{ "split": "train", "index": 6087, "acecode_id": "evol_29412", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `fib(n)` that returns the first `n` numbers of the Fibonacci series. The Fibonacci series is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. If `n` is less than or equal to 0, the function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fib(0) == []\", \"assert fib(1) == [0]\", \"assert fib(2) == [0, 1]\", \"assert fib(3) == [0, 1, 1]\", \"assert fib(4) == [0, 1, 1, 2]\", \"assert fib(5) == [0, 1, 1, 2, 3]\", \"assert fib(6) == [0, 1, 1, 2, 3, 5]\", \"assert fib(7) == [0, 1, 1, 2, 3, 5, 8]\...
{ "split": "train", "index": 6088, "acecode_id": "evol_23584", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a dataset represented as a list of integers. Your goal is to implement a function that doubles each element in the list. Write a function `double_elements(data)` where: \n- `data` (list): A list of integers you need to process. \n\nThe function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert double_elements([1, 2, 3]) == [2, 4, 6]\", \"assert double_elements([0]) == [0]\", \"assert double_elements([-1, -2, -3]) == [-2, -4, -6]\", \"assert double_elements([10, 20, 30]) == [20, 40, 60]\", \"assert double_elements([5]) == [10]\", \"assert double_el...
{ "split": "train", "index": 6089, "acecode_id": "oss_10913", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of calculation module registration strings, where each registration string may either be valid or invalid. Your task is to implement a function that takes a list of these registration strings and returns a dictionary mapping valid calculation module names t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_valid_modules(['module1:value1', 'module2:value2', 'module3:value3']) == {'module1': 'module1:value1', 'module2': 'module2:value2', 'module3': 'module3:value3'}\", \"assert extract_valid_modules(['module1:value1', 'invalid_module', 'module3:value3'])...
{ "split": "train", "index": 6090, "acecode_id": "bigcode_python_fns_18477", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the sum of two numbers and their squared sum. The function should take two integers as input and return a tuple containing the sum and the squared sum. Ensure that the calculations are accurate and that you are reusing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_and_square(1, 2) == (3, 9)\", \"assert sum_and_square(-1, 1) == (0, 0)\", \"assert sum_and_square(0, 0) == (0, 0)\", \"assert sum_and_square(3, 4) == (7, 49)\", \"assert sum_and_square(10, 5) == (15, 225)\", \"assert sum_and_square(-3, -2) == (-5, 25)\",...
{ "split": "train", "index": 6091, "acecode_id": "evol_33747", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that computes the geometric mean of all positive prime numbers present in a list containing integers and nested lists. The function should not use arithmetic or built-in math operations. If there are no positive prime numbers, the function should return Non...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_geomean([[1, 4, -2], [-5, -10, [6, 8]]]) == None\", \"assert prime_geomean([[0, -1, -3], [4, 6, 8, [9, 10]]]) == None\", \"assert prime_geomean([[1, 1, 1], [1, 1, [1]]]) == None\", \"assert prime_geomean([[4, -4, -4], [-2, -2, [-2]]]) == None\", \"asse...
{ "split": "train", "index": 6092, "acecode_id": "evol_26994", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks whether a given integer is a prime number. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your task is to create a function `is_prime(n: int) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime(0) == False\", \"assert is_prime(1) == False\", \"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(10) == False\", \"assert is_prime(11) == True\", \"ass...
{ "split": "train", "index": 6093, "acecode_id": "oss_446", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that constructs a dictionary representing a logical OR operation for given input selectors. Your function should take any number of selectors as arguments and return a dictionary with a key 'or' that contains a list of dictionaries, each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert or_selectors('sports', 'business') == {'or': [{'tag': 'sports'}, {'tag': 'business'}]}\", \"assert or_selectors('news', 'entertainment', 'lifestyle') == {'or': [{'tag': 'news'}, {'tag': 'entertainment'}, {'tag': 'lifestyle'}]}\", \"assert or_selectors('healt...
{ "split": "train", "index": 6094, "acecode_id": "bigcode_python_fns_2703", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of positive integers, each in the range of 0 to 9, write a function that converts this list into a decimal integer. The first element of the list should represent the highest place value, and the last element should represent the lowest place value. For example, if...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_to_decimal([1, 2, 3]) == 123\", \"assert list_to_decimal([9, 0, 1]) == 901\", \"assert list_to_decimal([0, 0, 5, 7]) == 57\", \"assert list_to_decimal([3]) == 3\", \"assert list_to_decimal([0]) == 0\", \"assert list_to_decimal([7, 8]) == 78\", \"assert ...
{ "split": "train", "index": 6095, "acecode_id": "bigcode_python_fns_3550", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the dual norm of a given vector. The dual norm of a vector x in a vector space is defined as the supremum of the dot product of x and any vector y in the space, such that the norm of y is less than or equal to 1...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dual_norm([3, 4]) == 5.0\", \"assert dual_norm([-1, -1, -1]) == 1.7320508075688772\", \"assert dual_norm([0, 0, 0]) == 0.0\", \"assert dual_norm([5, 5]) == 7.0710678118654755\", \"assert dual_norm([1]) == 1.0\", \"assert dual_norm([-3, 4]) == 5.0\", \"assert...
{ "split": "train", "index": 6096, "acecode_id": "oss_35482", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that returns a list of predefined execution state constants for a specific application. The function, named `get_execution_states`, should return the following execution states: 'initialized', 'running', 'paused', and 'stopped'. Your ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_execution_states() == ['initialized', 'running', 'paused', 'stopped']\", \"assert len(get_execution_states()) == 4\", \"assert 'initialized' in get_execution_states()\", \"assert 'running' in get_execution_states()\", \"assert 'paused' in get_execution_s...
{ "split": "train", "index": 6097, "acecode_id": "oss_10090", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a team of members, where each member has a unique username, and a string representing the name of the team. Implement a function `format_team_row(members: dict, team_name: str) -> dict` that takes in the dictionary of members and the team...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_team_row({'edges': [{'node': {'login': 'user1'}}, {'node': {'login': 'user2'}}]}, 'TeamA') == {'user1': 'TeamA', 'user2': 'TeamA'}\", \"assert format_team_row({'edges': [{'node': {'login': 'alice'}}, {'node': {'login': 'bob'}}]}, 'TeamB') == {'alice':...
{ "split": "train", "index": 6098, "acecode_id": "bigcode_python_fns_37252", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a dictionary of directories, where each directory contains information about a time series of quantities such as 'stage' and 'speed'. The input to your function is a dictionary where the keys are directory names and the val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_time_series({'dir1':['Label1',0,1.5], 'dir2':['Label2',0,0]}, ['stage', 'speed']) == [('dir1', {'stage': [1.5], 'speed': []}), ('dir2', {'stage': [0], 'speed': []})]\", \"assert process_time_series({'dirX':['LabelX',0], 'dirY':['LabelY',10]}, ['stage...
{ "split": "train", "index": 6099, "acecode_id": "bigcode_python_fns_23905", "num_tests": 14 }