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 filters out non-executable files from a list of filenames. An executable file is defined as any file that does not have the extensions '.png', '.jpg', or '.sh'. You are to implement the function `filter_executable_files(filena... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_executable_files(['file1.txt', 'image.png', 'script.sh', 'document.pdf']) == ['file1.txt', 'document.pdf']\", \"assert filter_executable_files(['test.exe', 'picture.jpg', 'data.csv', 'notes.txt']) == ['test.exe', 'data.csv', 'notes.txt']\", \"assert f... | {
"split": "train",
"index": 3500,
"acecode_id": "oss_3029",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that evaluates predictions against ground truth values for a specific dataset type. Given a dataset type identifier (as a string), a dictionary of predictions, and a dictionary of ground truths, your function should return a formatted eva... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_predictions('MNIST', {'img1': 0.9}, {'img1': 1}) == 'MNIST Evaluation: 95% Accuracy'\", \"assert evaluate_predictions('MWPose', {'img2': 0.8}, {'img2': 1}) == 'MWPose Evaluation: 90% Accuracy'\", \"assert evaluate_predictions('ModelNetHdf', {'img3':... | {
"split": "train",
"index": 3501,
"acecode_id": "bigcode_python_fns_20070",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary string `s` without leading zeros, implement a function that returns a tuple containing three values: a boolean indicating if `s` contains at most one contiguous segment of ones, an integer representing the count of zeros that separate the first and last segment o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert checkBinaryString('110') == (True, 0, 2)\", \"assert checkBinaryString('111') == (True, 0, 3)\", \"assert checkBinaryString('111111') == (True, 0, 6)\", \"assert checkBinaryString('101') == (False, 0, 1)\", \"assert checkBinaryString('10') == (True, 0, 1)\",... | {
"split": "train",
"index": 3502,
"acecode_id": "evol_18740",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that identifies matching license IDs based on a provided input text and a dictionary of potential matches. The function should return a string indicating the matched license IDs if they meet certain criteria based on a confidence threshol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_matching_license({'MIT': 1.0}, 'This is a license text.', 0.99) == 'The following license ID(s) match: MIT'\", \"assert get_matching_license({'GPL': 0.95, 'Apache': 0.85}, 'This is a license text.', 0.99) == 'There is not enough confidence threshold for ... | {
"split": "train",
"index": 3503,
"acecode_id": "bigcode_python_fns_14504",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of transactions where each transaction is represented as a dictionary containing three keys: 'item' (string), 'quantity' (integer), and 'price' (float). Your task is to implement a function `calculate_total_revenue(transactions)` that takes this list of tra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_revenue([{'item': 'grapes', 'quantity': 10, 'price': 1.0}, {'item': 'peach', 'quantity': 2, 'price': 1.5}]) == 13.0\", \"assert calculate_total_revenue([{'item': 'watermelon', 'quantity': 1, 'price': 3.0}]) == 3.0\", \"assert calculate_total_... | {
"split": "train",
"index": 3504,
"acecode_id": "oss_28381",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a string that represents the output of a Git command which includes the current branch name, write a function `get_current_branch(output: str) -> str` that extracts and returns the name of the current Git branch. The input string will follow the format 'On branch <branch_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_current_branch('On branch main') == 'main'\", \"assert get_current_branch('On branch test') == 'test'\", \"assert get_current_branch('On branch develop') == 'develop'\", \"assert get_current_branch('On branch ') == ''\", \"assert get_current_branch('Not ... | {
"split": "train",
"index": 3505,
"acecode_id": "bigcode_python_fns_19572",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `calculate_sum` that returns the sum of all the integers in the list. The function should take a single parameter, which is the list of integers. The list can be empty, and in that case, the function should return 0.\nPlease reason ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sum([]) == 0\", \"assert calculate_sum([1]) == 1\", \"assert calculate_sum([1, 2, 3]) == 6\", \"assert calculate_sum([-1, -2, -3]) == -6\", \"assert calculate_sum([5, 5, 5, 5]) == 20\", \"assert calculate_sum([10, -10]) == 0\", \"assert calculate_s... | {
"split": "train",
"index": 3506,
"acecode_id": "bigcode_python_fns_40932",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a form dictionary containing file upload information. The function should identify and return a list of filenames for all the uploaded files in the form, where each uploaded file is represented by a dictionary co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_uploaded_filenames({'file1': {'filename': 'file1_filename'}, 'file2': {'filename': 'file2_filename'}, 'text_field': 'some_text'}) == ['file1_filename', 'file2_filename']\", \"assert extract_uploaded_filenames({'file1': {'filename': 'doc.txt'}, 'file2... | {
"split": "train",
"index": 3507,
"acecode_id": "oss_28725",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a string representation of a date and time in ISO 8601 format, create a function that converts this string into a datetime object. The string may include milliseconds and a timezone offset. If the input is already a datetime object, return it as is. If the input is None o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_iso_datetime('2023-10-01T12:30:45.123+00:00') == datetime(2023, 10, 1, 12, 30, 45, 123000, tzinfo=timezone.utc)\", \"assert convert_iso_datetime('2023-10-01T12:30:45+00:00') == datetime(2023, 10, 1, 12, 30, 45, tzinfo=timezone.utc)\", \"assert conver... | {
"split": "train",
"index": 3508,
"acecode_id": "bigcode_python_fns_19824",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function called reverseWords that takes a string as input, reverses the order of each word in the string, while keeping their original position intact. For instance, the input 'Hello World' should return 'olleH dlroW'.\nPlease reason step by step, then write a self-cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverseWords('Hello World') == 'olleH dlroW'\", \"assert reverseWords('Python Programming') == 'nohtyP gnimmargorP'\", \"assert reverseWords('Leetcode is fun') == 'edocteeL si nuf'\", \"assert reverseWords('OpenAI ChatGPT') == 'IAnepO TPGtahC'\", \"assert re... | {
"split": "train",
"index": 3509,
"acecode_id": "evol_4797",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `custom_order(s: str) -> str` that takes a string 's' and sorts the letters in it based on their ASCII values, ignoring case. It then sorts them based on the count of each letter in the string, preserving the original letter casing. The function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_order('banana') == 'aaabnn'\", \"assert custom_order('apple') == 'aelpp'\", \"assert custom_order('Cherry') == 'Cehrry'\", \"assert custom_order('123abc') == '123abc'\", \"assert custom_order('single') == 'egilns'\"]}"
} | {
"split": "train",
"index": 3510,
"acecode_id": "evol_31719",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a D-Bus signal represented as a tuple. The first element of the tuple is the signal name, the second element is the path, and the third element is the interface name. Your task is to implement a function `process_dbu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_dbus_signal((':1.654', '/hfp/org/bluez/hci0/dev_94_65_2D_84_61_99', 'org.ofono.Modem')) == ('org.ofono.Modem', 'dev_94_65_2D_84_61_99')\", \"assert process_dbus_signal((':1.123', '/com/example/service/thing', 'com.example.Interface')) == ('com.exampl... | {
"split": "train",
"index": 3511,
"acecode_id": "oss_723",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two date strings in the format 'YYYY-MM-DD', write a function `calculate_days_between_dates(start_date, end_date)` that calculates the number of days between the two dates, inclusive of the start date and exclusive of the end date. It is important to note that the functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_days_between_dates('2022-01-01', '2022-01-05') == 4\", \"assert calculate_days_between_dates('2022-02-01', '2022-02-10') == 9\", \"assert calculate_days_between_dates('2020-01-01', '2020-01-02') == 1\", \"assert calculate_days_between_dates('2022-0... | {
"split": "train",
"index": 3512,
"acecode_id": "oss_13603",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines if a given integer is a palindromic prime. A palindromic prime is a number that is both a prime number and reads the same backward as forward. The function should take an integer n as input and return True if n is a palindromic prime, otherw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindromic_prime(2) == True\", \"assert is_palindromic_prime(3) == True\", \"assert is_palindromic_prime(5) == True\", \"assert is_palindromic_prime(7) == True\", \"assert is_palindromic_prime(11) == True\", \"assert is_palindromic_prime(101) == True\", ... | {
"split": "train",
"index": 3513,
"acecode_id": "evol_22966",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `s` that represents a series of words separated by spaces. Your task is to write a function `count_words(s: str) -> int` that counts the number of words in the string. A word is defined as a contiguous sequence of non-space characters. Leading and trailin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_words('Hello World') == 2\", \"assert count_words(' Hello World ') == 2\", \"assert count_words('') == 0\", \"assert count_words(' ') == 0\", \"assert count_words('SingleWord') == 1\", \"assert count_words('Multiple spaces here') == 3\", \"... | {
"split": "train",
"index": 3514,
"acecode_id": "oss_410",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `input_text` consisting of words separated by spaces. Your task is to implement a function `tokenize_text(input_text: str) -> List[str]` that splits the string into individual words (tokens) and returns them as a list. Words are defined as sequences of ch... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tokenize_text('hello world') == ['hello', 'world']\", \"assert tokenize_text(' leading spaces') == ['leading', 'spaces']\", \"assert tokenize_text('trailing spaces ') == ['trailing', 'spaces']\", \"assert tokenize_text(' both leading and trailing ') =... | {
"split": "train",
"index": 3515,
"acecode_id": "oss_4240",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers. Your goal is to find the maximum difference between any two elements in the list, where the larger element comes after the smaller element. Write a function `max_difference` that takes a list of i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_difference([5, 1, 10, 3]) == 9\", \"assert max_difference([1, 2, 3, 4, 5]) == 4\", \"assert max_difference([5, 4, 3, 2, 1]) == 0\", \"assert max_difference([10]) == 0\", \"assert max_difference([]) == 0\", \"assert max_difference([1, 2]) == 1\", \"assert... | {
"split": "train",
"index": 3516,
"acecode_id": "oss_11553",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a method that replaces all digit characters in a given string with a hash (#) character. The function should take a single string as input and return a new string with the digits replaced.\nPlease reason step by step, then write a self-contained Python solution. Give you... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_digits_with_hash('Hello World!') == 'Hello World!'\", \"assert replace_digits_with_hash('12345') == '#####'\", \"assert replace_digits_with_hash('Test 1, 2, 3!') == 'Test #, #, #!'\", \"assert replace_digits_with_hash('No digits here!') == 'No digits... | {
"split": "train",
"index": 3517,
"acecode_id": "evol_13137",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two points in a 2D plane represented as tuples (x1, y1) and (x2, y2), write a function that calculates the midpoint between these two points. The midpoint is defined as the average of the x-coordinates and the average of the y-coordinates of the two points. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert midpoint((0, 0), (2, 2)) == (1, 1)\", \"assert midpoint((1, 3), (5, 7)) == (3, 5)\", \"assert midpoint((-1, -1), (1, 1)) == (0, 0)\", \"assert midpoint((100, 200), (300, 400)) == (200, 300)\", \"assert midpoint((-5, -10), (-15, -20)) == (-10, -15)\", \"asser... | {
"split": "train",
"index": 3518,
"acecode_id": "bigcode_python_fns_1983",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer `n`, write a function `min_power_of_2_or_5(n)` that returns the minimum power of 2 or 5 that divides `n` evenly. If `n` is not divisible by either 2 or 5, the function should return 0. \n\nFor example, if `n = 30`, the function should return `1` because... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_power_of_2_or_5(30) == 1\", \"assert min_power_of_2_or_5(16) == 4\", \"assert min_power_of_2_or_5(5) == 1\", \"assert min_power_of_2_or_5(3) == 0\", \"assert min_power_of_2_or_5(100) == 2\", \"assert min_power_of_2_or_5(1) == 0\", \"assert min_power_of_2... | {
"split": "train",
"index": 3519,
"acecode_id": "oss_35685",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `cleanup_tasks()` that simulates the cleanup of asynchronous tasks in a system. The function takes two arguments: a list of boolean values `task_statuses` that indicates whether each corresponding task is done (True) or not (False), a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cleanup_tasks([True, False, True, True], 0) == {'completed': 3, 'pending': 1}\", \"assert cleanup_tasks([True, False], 0) == {'completed': 1, 'pending': 1}\", \"assert cleanup_tasks([True, False, False], 0) == {'completed': 1, 'pending': 2}\", \"assert clean... | {
"split": "train",
"index": 3520,
"acecode_id": "bigcode_python_fns_26236",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a code snippet that may contain encrypted messages. Your task is to extract the meaningful information from the code snippet. The meaningful messages are the lines that do not contain the placeholder text '<KEY>'. Your function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_decrypted_messages('DB<KEY>') == []\", \"assert extract_decrypted_messages('YCG<KEY>\\\\n<KEY>') == []\", \"assert extract_decrypted_messages('<KEY>\\\\n<KEY>\\\\n<KEY>') == []\", \"assert extract_decrypted_messages('Hello World') == ['Hello World']\... | {
"split": "train",
"index": 3521,
"acecode_id": "oss_2026",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a dataset and extracts specific variable names from it based on given constraints. Your function should take a list of variable names, a start time, an end time, and a set of constraints. It should return a list of variable... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_variables(['temperature', 'time', 'depth_qc', 'salinity'], '2023-10-01T00:00:00', '2023-10-03T00:00:00', {}) == ['temperature', 'salinity']\", \"assert filter_variables(['mooring_site_desc', 'longitude', 'latitude', 'pressure'], '2023-09-30T00:00:00',... | {
"split": "train",
"index": 3522,
"acecode_id": "bigcode_python_fns_17737",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of words as input. Your task is to implement a function that returns a list of tuples, where each tuple contains a non-empty word from the input list and the string 'string'. If the input list is empty, your function should return an empty list. Write a fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_words(['apple', '', 'banana', '']) == [('apple', 'string'), ('banana', 'string')]\", \"assert process_words(['hello', 'world']) == [('hello', 'string'), ('world', 'string')]\", \"assert process_words([]) == []\", \"assert process_words(['', '']) == [... | {
"split": "train",
"index": 3523,
"acecode_id": "oss_18935",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the desired supply line of a product based on two factors: the delivery delay and the expected customer orders. Write a function named `desired_supply_line` that takes in two integers, `delivery_delay` and `expected_customer_orders`, and returns ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert desired_supply_line(0, 0) == 0\", \"assert desired_supply_line(0, 5) == 0\", \"assert desired_supply_line(5, 0) == 0\", \"assert desired_supply_line(1, 1) == 1\", \"assert desired_supply_line(2, 3) == 6\", \"assert desired_supply_line(4, 5) == 20\", \"assert... | {
"split": "train",
"index": 3524,
"acecode_id": "bigcode_python_fns_43789",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of numbers, `array_a` and `array_b`, write a function `calculate_rmsd(array_a: List[float], array_b: List[float]) -> float` that calculates the Root Mean Square Deviation (RMSD) between the two lists. The RMSD is calculated as the square root of the average of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_rmsd([1.0, 2.0, 3.0], [1.0, 2.0, 3.0]) == 0.0\", \"assert calculate_rmsd([0.0, 0.0], [0.0, 0.0]) == 0.0\", \"assert calculate_rmsd([5.0, 5.0, 5.0], [5.0, 5.0, 5.0]) == 0.0\", \"assert calculate_rmsd([10, 10], [10, 10]) == 0.0\", \"assert calculate_... | {
"split": "train",
"index": 3525,
"acecode_id": "bigcode_python_fns_1561",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `genotypes` and `phenotypes`, where each integer represents a unique identifier, implement a function `generate_feature_matrix(genotypes: List[int], phenotypes: List[int], reg_type: int, phewas_cov: str = '') -> List[List[float]]`. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_feature_matrix([1, 2, 3], [1, 1, 2], 0) == [[1, 1, 0], [1, 2, 3], [0, 0, 0]]\", \"assert generate_feature_matrix([8], [8, 9, 8], 0) == [[1], [8], [0]]\", \"assert generate_feature_matrix([9, 10], [10, 9, 11], 1) == [[1, 1], [9, 10], [0, 0]]\", \"ass... | {
"split": "train",
"index": 3526,
"acecode_id": "bigcode_python_fns_34793",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given an array `chips` representing the positions of chips on a 1D plane. Each chip is placed at a specific position, and the value at each position represents the position of the chip. You need to move the chips to the same position. The cost of moving a chip from posi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minCostToMoveChips([1, 2, 3]) == 1\", \"assert minCostToMoveChips([2, 2, 2, 3, 3]) == 2\", \"assert minCostToMoveChips([1, 1, 1, 1]) == 0\", \"assert minCostToMoveChips([2, 4, 6, 8]) == 0\", \"assert minCostToMoveChips([3, 1, 2]) == 1\", \"assert minCostToMo... | {
"split": "train",
"index": 3527,
"acecode_id": "oss_14746",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `factorial(n: int) -> int` that calculates the factorial of a non-negative integer `n`. The function should not use recursion and must handle the calculation iteratively. Additionally, ensure that the function can handle large values of `n` without causing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 3528,
"acecode_id": "evol_11608",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of values where the first column contains unique sorted values and the rest of the columns contain corresponding data, implement a function `vlookup` that takes the following parameters: a value `x0`, the 2D list `vals`, an index `ind`, and a boolean `approx`. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert vlookup(3, [[1, 'a'], [2, 'b'], [3, 'c'], [4, 'd']], 1, True) == 'c'\", \"assert vlookup(3, [[1, 'a'], [2, 'b'], [3, 'c'], [4, 'd']], 1, False) == 'c'\", \"assert vlookup(5, [[1, 'a'], [2, 'b'], [3, 'c'], [4, 'd']], 1, True) == 'd'\", \"assert vlookup(5, [[1... | {
"split": "train",
"index": 3529,
"acecode_id": "bigcode_python_fns_23482",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a file management system that involves deleting files based on a cutoff time. The system receives file creation timestamps in epoch format and needs to delete files created before a specified cutoff time. Your task is to write a function that ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert files_to_delete([1627699200, 1627785600, 1627872000], 1627785600, 'abc123') == [{'token': 'abc123', 'file': 1627699200}]\", \"assert files_to_delete([1627699200, 1627785600, 1627872000], 1627699200, 'token1') == []\", \"assert files_to_delete([1627699200, 16... | {
"split": "train",
"index": 3530,
"acecode_id": "oss_22942",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and a specific integer value as inputs. The function should return the index of the first occurrence of the value in the list. If the value is not found, return -1.\nPlease reason step by step, then write a self-contained Pytho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pos([1, 2, 3, 4, 5], 3) == 2\", \"assert find_pos([10, 20, 30, 40], 20) == 1\", \"assert find_pos([5, 4, 3, 2, 1], 5) == 0\", \"assert find_pos([1, 1, 1, 1], 1) == 0\", \"assert find_pos([1, 2, 3, 4, 5], 6) == -1\", \"assert find_pos([], 1) == -1\", \"a... | {
"split": "train",
"index": 3531,
"acecode_id": "evol_21298",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the annual depreciation value of an asset using the straight-line depreciation method. The function should take three parameters: the initial cost of the asset, the salvage value at the end of its useful life, and the total useful life of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert straight_line_depreciation(10000, 1000, 5) == 1800.0\", \"assert straight_line_depreciation(20000, 2000, 10) == 1800.0\", \"assert straight_line_depreciation(15000, 5000, 5) == 2000.0\", \"assert straight_line_depreciation(5000, 500, 0) == 'Life span of the ... | {
"split": "train",
"index": 3532,
"acecode_id": "evol_13270",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initiates a conversation for posting photos. The function should accept a string input for the title of the post and return a formatted message indicating that the conversation has started and prompts the user to enter a title. If th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initiate_post('Vacation Photos') == 'Initiate conversation: new post Enter title'\", \"assert initiate_post('') == 'Title cannot be empty'\", \"assert initiate_post('Birthday Party') == 'Initiate conversation: new post Enter title'\", \"assert initiate_post(... | {
"split": "train",
"index": 3533,
"acecode_id": "bigcode_python_fns_16205",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to extract tokens from a given string in a specific format. The tokens are key-value pairs separated by semicolons, where the key and value are separated by a colon. Write a function `extract_tokens(input_string)` that takes a string ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_tokens('trainer:housey;course:csharp-oop-basics;lecture:polymorphism;duration:3h05m') == ['housey', 'csharp-oop-basics', 'polymorphism', '3h05m']\", \"assert extract_tokens('name:John;age:30;city:NewYork') == ['John', '30', 'NewYork']\", \"assert ext... | {
"split": "train",
"index": 3534,
"acecode_id": "oss_10239",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer k and an array arr, write a program that will swap the elements at index k and k+2. Ensure the function can handle cases where k is negative or k+2 exceeds the array bounds by raising an IndexError. You are not allowed to use any libraries or helper functions t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_k_kplus2(0, [1, 3, 5, 6, 8]) == [5, 3, 1, 6, 8]\", \"assert swap_k_kplus2(2, [10, 20, 30, 40, 50]) == [10, 20, 50, 40, 30]\", \"assert swap_k_kplus2(0, [1, 2, 3]) == [3, 2, 1]\", \"assert swap_k_kplus2(0, [1, 2, 3, 4, 5]) == [3, 2, 1, 4, 5]\", \"assert ... | {
"split": "train",
"index": 3535,
"acecode_id": "evol_36213",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a population size `pop_size`, a dictionary of tuning parameters `tune_params`, a list of valid tuning options `tuning_options`, and a maximum number of threads `max_threads`, implement a function that generates a random population of size `pop_size` where each member is a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert random_population(2, {'param1': [1, 2], 'param2': ['a', 'b']}, ['valid_option'], 4) == [[1, 'a'], [1, 'b']] or [[2, 'a'], [2, 'b']]\", \"assert random_population(1, {'param1': [1], 'param2': ['a', 'b', 'c']}, ['valid_option'], 2) == [[1, 'a']] or [[1, 'b']] ... | {
"split": "train",
"index": 3536,
"acecode_id": "bigcode_python_fns_25825",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves keywords and their aliases from a list of user-defined labels. The function should accept the following parameters: a list of strings `labels`, an optional string `query` for filtering keywords, an integer `offset` to skip ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_keywords(['apple', 'banana', 'cherry'], None, 0, None) == {'result': {'total': 3, 'items': ['apple', 'banana', 'cherry']}}\", \"assert get_keywords(['apple', 'banana', 'cherry'], 'a', 0, None) == {'result': {'total': 2, 'items': ['apple', 'banana']}}\", ... | {
"split": "train",
"index": 3537,
"acecode_id": "bigcode_python_fns_168",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of job entries, where each job is represented by a dictionary containing its title, company, and creation date. Your task is to implement a function that takes a list of such job dictionaries as input and returns a new list of job titles sorted by their cre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_jobs_by_creation_date([{'title': 'Software Engineer', 'company': 'Company A', 'created_on': '2023-01-10'}, {'title': 'Data Scientist', 'company': 'Company B', 'created_on': '2023-01-05'}, {'title': 'Project Manager', 'company': 'Company C', 'created_on'... | {
"split": "train",
"index": 3538,
"acecode_id": "bigcode_python_fns_48315",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested dictionary representing a trie structure, write a function `flatten_trie(trie: Dict[str, Any], prefix: Optional[str] = None) -> Dict[str, Any]` that flattens the trie into a single-level dictionary. Each key in the resulting dictionary should represent the full p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_trie({}, None) == {}\", \"assert flatten_trie({'a': {}}, None) == {}\", \"assert flatten_trie({'a': {'b': 'value'}}, None) == {'a/b': 'value'}\", \"assert flatten_trie({'a': {'b': {'c': 'value'}}}, None) == {'a/b/c': 'value'}\", \"assert flatten_trie... | {
"split": "train",
"index": 3539,
"acecode_id": "bigcode_python_fns_21947",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a given time in 12-hour format (HH:MM:SS AM/PM) to military (24-hour) time format. The function should handle invalid input by returning an appropriate error message. The input time is guaranteed to be a string.\nPlease reason step by step, then w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_time('02:30:45 PM') == '14:30:45'\", \"assert convert_time('12:00:00 AM') == '00:00:00'\", \"assert convert_time('12:00:00 PM') == '12:00:00'\", \"assert convert_time('01:15:20 AM') == '01:15:20'\", \"assert convert_time('11:59:59 PM') == '23:59:59'\... | {
"split": "train",
"index": 3540,
"acecode_id": "evol_30612",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function `get_well_rows` that takes no parameters and returns a list representing the well rows of an experiment. For this specific experiment, the well rows are defined as a list with a single element 0. Your function should always return this fixed list of well rows.\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_well_rows() == [0]\", \"assert get_well_rows() == [0]\", \"assert get_well_rows() == [0]\", \"assert get_well_rows() == [0]\", \"assert get_well_rows() == [0]\", \"assert get_well_rows() == [0]\", \"assert get_well_rows() == [0]\", \"assert get_well_rows... | {
"split": "train",
"index": 3541,
"acecode_id": "bigcode_python_fns_11549",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a group of people standing in a line. Your task is to implement a function that returns the index of the person who is the tallest. If there are multiple tallest people, return the index of the first one. The function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_tallest_person([1, 2, 3, 4, 5]) == 4\", \"assert find_tallest_person([5, 5, 5, 5, 5]) == 0\", \"assert find_tallest_person([3, 1, 4, 1, 5, 9]) == 5\", \"assert find_tallest_person([10, 20, 30, 40, 50]) == 4\", \"assert find_tallest_person([50, 40, 30, 2... | {
"split": "train",
"index": 3542,
"acecode_id": "bigcode_python_fns_5004",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts two lists of strings. The function should return the list that has a lower sum of Unicode values for all characters (excluding spaces) while maintaining the order of elements within each list. If both lists have an equal Unicode summation, retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_match([], []) == []\", \"assert total_match(['c', 'b'], ['a', 'b']) == ['a', 'b']\", \"assert total_match(['c', 'b'], ['a', 'a', 'b', 'z']) == ['c', 'b']\", \"assert total_match(['ab', 'c'], ['a', 'bc']) == ['ab', 'c']\", \"assert total_match(['1'], ['... | {
"split": "train",
"index": 3543,
"acecode_id": "evol_354",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_all_occurrences_and_indexes` that finds all unique numbers in the list along with their indexes. The function should return two lists: one containing the unique numbers and the other containing a list of lists, where each inner l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_all_occurrences_and_indexes([1, 2, 2, 3, 4, 4, 5]) == ([1, 2, 3, 4, 5], [[0], [1, 2], [3], [4, 5], [6]])\", \"assert find_all_occurrences_and_indexes([1]) == ([1], [[0]])\", \"assert find_all_occurrences_and_indexes([]) == ([], [])\", \"assert find_all_... | {
"split": "train",
"index": 3544,
"acecode_id": "bigcode_python_fns_35943",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_redirect_url` that handles the redirection logic based on the type of performer and whether it is being called from a popup. The function should take two parameters: a dictionary `kwargs` containing a key 'pk' which is an integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_redirect_url({'pk': 1}, 'admin', 'Troupe', False) == 'admin/troupe/update/1'\", \"assert get_redirect_url({'pk': 2}, 'admin', 'Solo', False) == 'admin/solo/update/2'\", \"assert get_redirect_url({'pk': 3}, 'normal', 'Troupe', False) == 'user/troupe/updat... | {
"split": "train",
"index": 3545,
"acecode_id": "oss_12753",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a dictionary representing an event and a Pydantic model class. The function should parse the event using the model and return an instance of the model. If the parsing fails due to validation errors, the function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_event({'name': 'Alice'}, MyModel) == MyModel(name='Alice')\", \"assert parse_event({'name': 123}, MyModel) == None\", \"assert parse_event({}, MyModel) == None\", \"assert parse_event({'name': 'Bob'}, MyModel) == MyModel(name='Bob')\", \"assert parse_e... | {
"split": "train",
"index": 3546,
"acecode_id": "evol_20590",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string represents a name. Your task is to implement a function that marks each name in the list as a 'child' by appending the suffix ' (child)' to each name. The function should return a new list containing the modified names. Write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mark_as_child(['Alice', 'Bob', 'Charlie']) == ['Alice (child)', 'Bob (child)', 'Charlie (child)']\", \"assert mark_as_child(['John']) == ['John (child)']\", \"assert mark_as_child([]) == []\", \"assert mark_as_child(['Eve', 'Mallory']) == ['Eve (child)', 'Ma... | {
"split": "train",
"index": 3547,
"acecode_id": "bigcode_python_fns_2670",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a specific quantum gate into an equivalent sequence of basic quantum gates. A quantum gate can be represented by its name and a matrix. The basic gates include the Pauli gates (X, Y, Z), the Hadamard gate (H), and the co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_basic_gates('CNOT') == ['H', 'Z', 'H']\", \"assert to_basic_gates('Toffoli') == ['H', 'H', 'CNOT', 'H', 'H', 'CNOT', 'H', 'H']\", \"assert to_basic_gates('H') == ['H']\", \"assert to_basic_gates('X') == ['X']\", \"assert to_basic_gates('Y') == ['Y']\", \"... | {
"split": "train",
"index": 3548,
"acecode_id": "oss_33271",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple video capture from a camera. The function should accept three parameters: `resolution` (a tuple of two integers representing width and height), `frame_rate` (a float representing frames per second), and `num_frames... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert capture_video((640, 480), 30.0, 100) == 'Captured 100 frames at 30.0 FPS with resolution 640x480'\", \"assert capture_video((1280, 720), 60.0, 50) == 'Captured 50 frames at 60.0 FPS with resolution 1280x720'\", \"assert capture_video((1920, 1080), 24.0, 200)... | {
"split": "train",
"index": 3549,
"acecode_id": "oss_14123",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of words. Your task is to determine whether the words can be chained to form a circle. A word X can be placed in front of another word Y in a circle if the last character of X is the same as the first character of Y. Write a function that takes the list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_form_circle(['cat', 'tiger', 'rat', 'bat']) == False\", \"assert can_form_circle(['car', 'race', 'elephant', 'trailer']) == False\", \"assert can_form_circle(['a', 'b', 'c', 'd', 'a']) == False\", \"assert can_form_circle(['test', 'star', 'rose', 'eagle'... | {
"split": "train",
"index": 3550,
"acecode_id": "oss_20766",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a task object that has a method `call` which takes a callback function and a success handler function, implement a function `execute_task(task)` that changes the `on_success` attribute of the task object to True when the success handler is called and then invokes the call... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_task(task) == True\", \"assert execute_task(task) == True\", \"assert execute_task(task) == True\", \"assert execute_task(task) == True\", \"assert execute_task(task) == True\", \"assert execute_task(task) == True\", \"assert execute_task(task) == Tr... | {
"split": "train",
"index": 3551,
"acecode_id": "bigcode_python_fns_5442",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples, your task is to convert it into a string representation of a nested Lua table. Each tuple in the list should be represented as a Lua table, and the outer table should contain these inner tables. The Lua tables should be formatted using curly braces and s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tuple_list_to_lua([(1, 2), (3, 4)]) == '{{1,2},{3,4}}'\", \"assert tuple_list_to_lua([(0, 0), (1, 1)]) == '{{0,0},{1,1}}'\", \"assert tuple_list_to_lua([(5, 6), (7, 8), (9, 10)]) == '{{5,6},{7,8},{9,10}}'\", \"assert tuple_list_to_lua([]) == '{}'\", \"assert... | {
"split": "train",
"index": 3552,
"acecode_id": "bigcode_python_fns_19918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns a dictionary containing the occurrence rate of each distinct alphabetic character, considering both uppercase and lowercase letters. The occurrence rate for each character should be calculated as the number of times ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_chars('Hello World!') == {'H': 0.1, 'e': 0.1, 'l': 0.3, 'o': 0.2, 'W': 0.1, 'r': 0.1, 'd': 0.1}\", \"assert count_chars('') == {}\", \"assert count_chars('A') == {'A': 1.0}\", \"assert count_chars('ABABAB') == {'A': 0.5, 'B': 0.5}\", \"assert count_cha... | {
"split": "train",
"index": 3553,
"acecode_id": "evol_34791",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Construct a Python function that determines whether the count of factors for a given integer is even, compiles a list of these factors, computes the sum of these factors, identifies the largest prime number among the factors, and finds the least common multiple (LCM) and the gr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numbers(-10) == {-10: (True, [1, 2, 5, 10], 18, 5, (10, 1))}\", \"assert process_numbers(7) == {7: (True, [1, 7], 8, 7, (7, 1))}\", \"assert process_numbers(25) == {25: (False, [1, 5, 25], 31, 5, (25, 1))}\", \"assert process_numbers(30) == {30: (Tru... | {
"split": "train",
"index": 3554,
"acecode_id": "evol_23581",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a package name, write a function `undeploy(package_name: str) -> str` that simulates the uninstallation of a package from remote hosts. The function should return a message indicating whether the package was successfully uninstalled or if the package... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert undeploy('slacm') == 'Package slacm has been successfully uninstalled.'\", \"assert undeploy('numpy') == 'Package not found'\", \"assert undeploy('pandas') == 'Package not found'\", \"assert undeploy('requests') == 'Package not found'\", \"assert undeploy('s... | {
"split": "train",
"index": 3555,
"acecode_id": "bigcode_python_fns_10021",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `overdraft_times(operations: List[int], limit: int) -> int` that accepts a list of banking transaction operations and a limit. The function should return the count of total instances the balance dipped below the specified limit after performing each o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert overdraft_times([0, 0, 0, 0], 0) == 0\", \"assert overdraft_times([-10, 5, 3, 2], -5) == 1\", \"assert overdraft_times([1, 2, 3, -1, -2, -3], -6) == 0\", \"assert overdraft_times([10, -10, 10, -10], -5) == 0\", \"assert overdraft_times([4, -3, -2, -1], -5) =... | {
"split": "train",
"index": 3556,
"acecode_id": "evol_13521",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function that receives an array of integers and returns the largest number in the array. If the array is empty, the function should return None.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_largest_num([1, 7, 2, 11, 4]) == 11\", \"assert find_largest_num([-1, -5, -3, -2]) == -1\", \"assert find_largest_num([10, 20, 30, 40]) == 40\", \"assert find_largest_num([5]) == 5\", \"assert find_largest_num([0, 0, 0]) == 0\", \"assert find_largest_nu... | {
"split": "train",
"index": 3557,
"acecode_id": "evol_9115",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a dictionary containing package information and returns a new dictionary with the count of occurrences for each unique value in the original dictionary. The input dictionary will have keys representing different attr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_package_info_occurrences({'a': 1, 'b': 2, 'c': 3}) == {1: 1, 2: 1, 3: 1}\", \"assert count_package_info_occurrences({'maintainer': 1000, 'homepage': 1020, 'comment': 1000}) == {1000: 2, 1020: 1}\", \"assert count_package_info_occurrences({'x': 5, 'y': ... | {
"split": "train",
"index": 3558,
"acecode_id": "oss_1476",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a starting number `start`, an ending number `end`, and a step size `step`, write a function that generates a list of numbers starting from `start` to `end`, inclusive, incrementing by `step`. The function should round each number to the same number of decimal places as th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_range(1, 5, 1) == [1, 2, 3, 4, 5]\", \"assert generate_range(0, 1, 0.1) == [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]\", \"assert generate_range(5, 5, 1) == [5]\", \"assert generate_range(1, 5, 0) == [1]\", \"assert generate_range(10, 2... | {
"split": "train",
"index": 3559,
"acecode_id": "bigcode_python_fns_4456",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a search query. Your task is to determine whether the query is marked as 'NSFW' (Not Safe For Work) or not, based on whether it ends with the substring ' nsfw'. If the query does end with ' nsfw', you should remove this substring and return t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_query('What is the weather today?') == ('what is the weather today?', False)\", \"assert clean_query('How to make a cake?') == ('how to make a cake?', False)\", \"assert clean_query('latest technology news nsfw') == ('latest technology news', True)\", ... | {
"split": "train",
"index": 3560,
"acecode_id": "bigcode_python_fns_9604",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a set of training parameters for a machine learning model and returns a dictionary containing those parameters properly formatted. The function should accept the following parameters: batch_size (int), use_lemniscate (str), ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_parameter_dict(1, '', '', '336,336', 1234, 2, True, True, 0.00025, 0.9, 0.0005, 1000, 300, True, True, True, 10, [40], 0.1, 0.6, 0.4, 32, '', 10000, 20, '', False) == {'batch_size': 1, 'use_lemniscate': '', 'data_dir': '', 'input_size': '336,336', 'ra... | {
"split": "train",
"index": 3561,
"acecode_id": "bigcode_python_fns_304",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that calculates the sum of all prime numbers less than a given positive integer, considering only those primes that end with the digit 3. If the input is not a positive integer greater than 3, raise a ValueError. Implement the function `sum_of_primes(num... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_primes(10) == 3\", \"assert sum_of_primes(5) == 3\", \"assert sum_of_primes(10) == 3\", \"assert sum_of_primes(11) == 3\", \"assert sum_of_primes(12) == 3\"]}"
} | {
"split": "train",
"index": 3562,
"acecode_id": "evol_6567",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates an echo system. The function `echo_handler` should accept a variable number of arguments and return a string that concatenates all the arguments passed to it, separated by a comma. If no arguments are provided, it shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert echo_handler('Hello', 'World') == 'Hello, World'\", \"assert echo_handler(1, 2, 3) == '1, 2, 3'\", \"assert echo_handler('Test', 123, True) == 'Test, 123, True'\", \"assert echo_handler() == ''\", \"assert echo_handler('SingleArg') == 'SingleArg'\", \"assert... | {
"split": "train",
"index": 3563,
"acecode_id": "bigcode_python_fns_46068",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that counts the occurrences of each individual vowel (a, e, i, o, u - not case sensitive) in a given string and identifies the positions at which they occur. The function should return a dictionary where the keys are the vowels and the values are lists of p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vowels_positions('!@#$%^&*()_+') == {'a': [], 'e': [], 'i': [], 'o': [], 'u': []}\", \"assert count_vowels_positions('AEIOU') == {'a': [1], 'e': [2], 'i': [3], 'o': [4], 'u': [5]}\", \"assert count_vowels_positions('abcdefg') == {'a': [1], 'e': [5], 'i... | {
"split": "train",
"index": 3564,
"acecode_id": "evol_26930",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries where each dictionary contains information about a species and its associated counts. Each dictionary has the following structure: {'species': str, 'spc': int, 'catcnts': int, 'biocnts': int}. Your task is to implement a function that proces... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert summarize_catch_counts([{'species': 'Salmon', 'spc': 1, 'catcnts': 5, 'biocnts': 2}]) == ['Salmon (1): 5 (2)']\", \"assert summarize_catch_counts([{'species': 'Trout', 'spc': 2, 'catcnts': 3, 'biocnts': 0}]) == ['Trout (2): 3 (No samples)']\", \"assert summa... | {
"split": "train",
"index": 3565,
"acecode_id": "bigcode_python_fns_26201",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes input parameters for a custom lookup plugin. Write a function `process_params` that takes in two arguments: 1. `term` (any type) - the parameter to be processed. 2. `params` (dict) - a dictionary containing parameter... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_params('example', {'url': 'http://example.com'}) == 'http://example.com'\", \"assert process_params(42, {'url': None, '_raw_params': ['http://', 'example.com']}) == 'http://example.com'\", \"assert process_params(3.14, {'_raw_params': ['http://', 'ex... | {
"split": "train",
"index": 3566,
"acecode_id": "oss_28884",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves all aliases associated with a given NetCDF-CF name of a variable from a predefined collection of variables and their aliases. The data is structured in two lists: one for variables and another for aliases. Each variable... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_aliases_for_variable('temperature') == ['temp', 'temp_celsius']\", \"assert get_aliases_for_variable('pressure') == ['press']\", \"assert get_aliases_for_variable('humidity') == []\", \"assert get_aliases_for_variable('temperature') == ['temp', 'temp_cel... | {
"split": "train",
"index": 3567,
"acecode_id": "oss_18283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of traces, where each trace is represented as a dictionary containing 'x' and 'y' keys with lists of numerical values, and a layout dictionary containing 'annotations' which is also a list of dictionaries with 'x' and 'y' keys, write a function `make_waterfall_hori... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_waterfall_horizontal([{'x': [1], 'y': [2]}, {'x': [3], 'y': [4]}], {'annotations': [{'x': 5, 'y': 6}]} ) == ([{'x': [2], 'y': [1], 'orientation': 'h', 'hoverinfo': None}, {'x': [4], 'y': [3], 'orientation': 'h', 'hoverinfo': None}], {'annotations': [{'x... | {
"split": "train",
"index": 3568,
"acecode_id": "bigcode_python_fns_18958",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function that verifies if a given character sequence consists solely of numerical values and checks if the sequence is a valid integer or a float number. If the sequence is valid, return the type of sequence ('Integer' or 'Float'). If the sequence is not a valid num... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_numerical_type('123') == 'Integer'\", \"assert verify_numerical_type('-123') == 'Integer'\", \"assert verify_numerical_type('0') == 'Integer'\", \"assert verify_numerical_type('123.456') == 'Float'\", \"assert verify_numerical_type('-123.456') == 'Flo... | {
"split": "train",
"index": 3569,
"acecode_id": "evol_34088",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes and configures a machine learning ensemble model using three classifiers: `SimClassifier`, `PCR`, and `FiDEL`. The function `initialize_ensemble_model` should take three dictionaries as parameters, each containing configu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_ensemble_model({'learning_rate': 0.01, 'n_estimators': 100}, {'threshold': 0.5}, {'max_depth': 5}) == \\\"EnsembleModel(SimClassifier: {'learning_rate': 0.01, 'n_estimators': 100}, PCR: {'threshold': 0.5}, FiDEL: {'max_depth': 5})\\\"\", \"assert ... | {
"split": "train",
"index": 3570,
"acecode_id": "oss_24111",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a data structure that allows for the insertion and deletion of integer elements, while providing constant time access to the minimum and maximum elements. The data structure should support the following operations: `insert(val)` to add an integer `val`, `delete(val)` to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert data_structure.get_min() is None\", \"assert data_structure.get_max() is None\", \"assert data_structure.get_min() is None\", \"assert data_structure.get_max() is None\", \"assert data_structure.get_min() is None\", \"assert data_structure.get_max() is None\... | {
"split": "train",
"index": 3571,
"acecode_id": "evol_23222",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the training of a machine learning model using a dataset and a set of parameters. Given a list of numerical features and a set of hyperparameters, your function should return the average of the features multiplied by th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert train_model([1.0, 2.0, 3.0], [2.0, 0.5]) == 4.0\", \"assert train_model([10.0, 20.0, 30.0, 40.0], [1.0, 0.1]) == 25.0\", \"assert train_model([5.0], [3.0]) == 15.0\", \"assert train_model([0.0, 0.0, 0.0], [10.0]) == 0.0\", \"assert train_model([1.0, 2.0, 3.0... | {
"split": "train",
"index": 3572,
"acecode_id": "bigcode_python_fns_48303",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that finds the first non-repeating alphabetic character in a given string and returns its index position. If all characters are repeating or if the string is empty, return -1. The function should ignore non-alphabetic characters. The input string can contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_nonrepeating_char('aabbcc') == -1\", \"assert first_nonrepeating_char('abcde') == (0, 'a')\", \"assert first_nonrepeating_char('') == -1\", \"assert first_nonrepeating_char('1234!@#') == -1\", \"assert first_nonrepeating_char('!@#$%^&*()') == -1\", \"a... | {
"split": "train",
"index": 3573,
"acecode_id": "evol_13208",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of floating-point numbers, implement a function `find_furthest_elements` that identifies and returns the two non-continuous elements with the greatest difference from the list. The returned pair should be in ascending order. If there are fewer than two unique eleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_furthest_elements([1.0, 2.0, 3.0, 4.0]) == (1.0, 4.0)\", \"assert find_furthest_elements([5.0, 3.0, 1.0, 2.0, 4.0]) == (1.0, 5.0)\", \"assert find_furthest_elements([10.0, 20.0, 30.0, 40.0]) == (10.0, 40.0)\", \"assert find_furthest_elements([2.5, 3.5, ... | {
"split": "train",
"index": 3574,
"acecode_id": "evol_10756",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function to manage the setup of a Vagrant environment. The function, `setup_env_vagrant`, takes three parameters: `machine` (default value 'magma'), `apply_to_env` (default value True), and `force_provision` (default value False). The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_env_vagrant() == {'machine': 'magma', 'apply_to_env': True, 'force_provision': False}\", \"assert setup_env_vagrant('test_machine') == {'machine': 'test_machine', 'apply_to_env': True, 'force_provision': False}\", \"assert setup_env_vagrant(apply_to_en... | {
"split": "train",
"index": 3575,
"acecode_id": "oss_2196",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, compute the number of beneficial divisions of the string. A division is deemed beneficial if you can partition `s` into two non-empty substrings `p` and `q` such that their concatenation equals `s` and the number of unique characters in `p` is equal to the n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert beneficial_divisions('aacaba') == 2\", \"assert beneficial_divisions('abcd') == 1\", \"assert beneficial_divisions('aaaaa') == 4\", \"assert beneficial_divisions('acbadbaada') == 2\", \"assert beneficial_divisions('abc') == 0\", \"assert beneficial_divisions... | {
"split": "train",
"index": 3576,
"acecode_id": "evol_4267",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates setting a variable in a simple key-value store. The function should take three parameters: a string `key`, a value `value`, and a character `type` that indicates the type of the value. The `type` can be one of the following... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_variable('age', 30, 'i') == {'age': 30}\", \"assert set_variable('name', 'Alice', 's') == {'name': 'Alice'}\", \"assert set_variable('height', 5.9, 'f') == {'height': 5.9}\", \"assert set_variable('weight', '70kg', 's') == {'weight': '70kg'}\", \"assert ... | {
"split": "train",
"index": 3577,
"acecode_id": "bigcode_python_fns_8709",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an initial speed, acceleration, and distance travelled, write a function that calculates the final speed of an object. The final speed can be computed using the formula: v_f = sqrt(2 * d * a + v_i^2), where v_i is the initial speed, a is the acceleration, and d is the dis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_final_speed(0, 9.8, 10) == 14.0\", \"assert calc_final_speed(10, 0, 10) == 10.0\", \"assert calc_final_speed(0, 0, 0) == 0.0\", \"assert calc_final_speed(7, 0, 50) == 7.0\", \"assert calc_final_speed(10, -2, 30) == 0.0\", \"assert calc_final_speed(8, 2,... | {
"split": "train",
"index": 3578,
"acecode_id": "bigcode_python_fns_43901",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sort_array_descending(array)` that takes a list of integers as input and returns a new list containing the integers sorted in descending order. The original list should remain unchanged. For example, if the input is [2, 4, 1, 6, 5], the output should be [6... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_array_descending([2, 4, 1, 6, 5]) == [6, 5, 4, 2, 1]\", \"assert sort_array_descending([10, 2, 8, 3]) == [10, 8, 3, 2]\", \"assert sort_array_descending([5, 5, 5]) == [5, 5, 5]\", \"assert sort_array_descending([0, -1, 2, 1]) == [2, 1, 0, -1]\", \"asser... | {
"split": "train",
"index": 3579,
"acecode_id": "evol_2525",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function called `create_instance` that takes a dictionary called `settings`. This dictionary contains a key called `class` which is a string representing the fully qualified name of a class you want to instantiate. The dictionary may contain addit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_instance({'class': 'non_existent.ClassName'}) is None\", \"assert create_instance({'class': 'datetime.datetime', 'year': 2023, 'month': 10, 'day': 1}) is not None\", \"assert create_instance({'class': 'collections.Counter', 'iterable': 'aabbcc'}) is n... | {
"split": "train",
"index": 3580,
"acecode_id": "bigcode_python_fns_17073",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a serialized Protocol Buffers message. The function should take the following parameters: a boolean `is_extendable`, a string `syntax`, an integer `serialized_start`, and an integer `serialized_end`. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_protocol_message(False, 'proto3', 192, 398) == {'is_extendable': False, 'syntax': 'proto3', 'extension_ranges': [], 'oneofs': [], 'serialized_size': 206}\", \"assert process_protocol_message(True, 'proto2', 10, 20) == {'is_extendable': True, 'syntax'... | {
"split": "train",
"index": 3581,
"acecode_id": "oss_7859",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a membership system for a club. You need to implement a function named `add_member` that takes in three parameters: `name` (a string representing the name of the member), `age` (an integer representing the age of the member), and `email` (a string r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_member('John Doe', 30, 'john.doe@example.com') == 'Member added: Name: John Doe, Age: 30, Email: john.doe@example.com'\", \"assert add_member('Jane Smith', 25, 'jane.smith@example.com') == 'Member added: Name: Jane Smith, Age: 25, Email: jane.smith@examp... | {
"split": "train",
"index": 3582,
"acecode_id": "oss_12625",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, implement a function that returns a list of all prime numbers less than or equal to n. You should use an efficient algorithm to find the prime numbers.\nPlease reason step by step, then write a self-contained Python solution. Give your final program ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sieve_of_eratosthenes(10) == [2, 3, 5, 7]\", \"assert sieve_of_eratosthenes(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert sieve_of_eratosthenes(1) == []\", \"assert sieve_of_eratosthenes(2) == [2]\", \"assert sieve_of_eratosthenes(3) == [2, 3]\", \"assert ... | {
"split": "train",
"index": 3583,
"acecode_id": "evol_19422",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a positive integer to its lowercase Roman numeral representation or converts a Roman numeral back to its corresponding integer value. The function should take two parameters: 'number' and 'conversion_type'. The 'number' parameter can be either... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_number(19, 'int_to_roman') == 'xix'\", \"assert convert_number(152, 'int_to_roman') == 'clii'\", \"assert convert_number(1, 'int_to_roman') == 'i'\", \"assert convert_number(1000, 'int_to_roman') == 'm'\", \"assert convert_number(4, 'int_to_roman') =... | {
"split": "train",
"index": 3584,
"acecode_id": "evol_20204",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string message and a server address, which consists of a hostname and a port number. Your task is to implement a function `send_message(message: str, hostname: str, port: int) -> str` that simulates sending the message to the server and receiving a response. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_message('Hello, server!', 'localhost', 8080) == 'Message received: Hello, server!'\", \"assert send_message('Test message', 'localhost', 8080) == 'Message received: Test message'\", \"assert send_message('Goodbye', 'localhost', 8080) == 'Message receive... | {
"split": "train",
"index": 3585,
"acecode_id": "oss_13537",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 3D grid represented by its nodes in the x, y, and z directions. Your task is to downsample this grid based on a specified semi-coarsening direction. The semi-coarsening direction is an integer that indicates which dimensions to coarsen (1 for x, 2 for y, 3 for z... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert restrict_grid([0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4], 1) == ([0, 2, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4])\", \"assert restrict_grid([0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4], 2) == ([0, 1, 2, 3, 4], [0, 2, 4], [0, 1, 2, 3, 4])\", \"assert ... | {
"split": "train",
"index": 3586,
"acecode_id": "bigcode_python_fns_42406",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given object can be serialized using a specific protocol. The function should take two parameters: an object and a protocol instance. The function should return True if the protocol is of type 'TBinaryProtocol.TBinary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_serialize(YourClass(thrift_spec=None), TBinaryProtocol.TBinaryProtocolAccelerated()) == False\", \"assert can_serialize(YourClass(thrift_spec=''), TBinaryProtocol.TBinaryProtocolAccelerated()) == False\", \"assert can_serialize(YourClass(thrift_spec='exa... | {
"split": "train",
"index": 3587,
"acecode_id": "oss_36301",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing quality classifications of various items. Your task is to implement a function that returns the index of the item with the lowest quality score. In the case of a tie (multiple items with the same lowest score), return the index that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_best_quality_index([4, 4, 4, 4, 4]) == 2\", \"assert get_best_quality_index([1, 2, 3, 4, 0]) == 4\", \"assert get_best_quality_index([5, 3, 1, 1, 2]) == 2\", \"assert get_best_quality_index([1, 3, 2, 1]) == 3\", \"assert get_best_quality_index([8, 8, 2, ... | {
"split": "train",
"index": 3588,
"acecode_id": "bigcode_python_fns_11060",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of readings represented as tuples, where each tuple contains a session ID and a timestamp (in 'YYYY-MM-DD HH:MM:SS' format). Your task is to implement a function `get_last_reading(readings: List[Tuple[int, str]]) -> str` that returns the timestamp of the la... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_last_reading([(1, '2023-10-01 10:00:00'), (2, '2023-10-02 12:00:00'), (1, '2023-10-01 11:00:00')]) == '2023-10-02 12:00:00'\", \"assert get_last_reading([(3, '2023-10-01 09:00:00'), (2, '2023-10-01 10:00:00'), (3, '2023-10-01 11:00:00')]) == '2023-10-01 ... | {
"split": "train",
"index": 3589,
"acecode_id": "bigcode_python_fns_17872",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given the definition of a binary tree node and a function that performs a specific operation on the tree. Your task is to implement a function named `sum_of_leaf_grandparent` that takes the root of a binary tree as input and returns the sum of all the values of the left... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_leaf_grandparent(TreeNode(2, TreeNode(4, TreeNode(8), TreeNode(9)), TreeNode(5))) == 8\", \"assert sum_of_leaf_grandparent(TreeNode(3, TreeNode(4, TreeNode(8), TreeNode(9)), TreeNode(5))) == 0\", \"assert sum_of_leaf_grandparent(TreeNode(4, TreeNode(5... | {
"split": "train",
"index": 3590,
"acecode_id": "oss_12626",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a parser for a simplified instruction set language. The language consists of three types of instructions: 'ADD x y', 'SUB x y', and 'MUL x y', where x and y are integer operands. Your goal is to write a function that takes a string input represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse('ADD 1 2\\\\nSUB 3 4\\\\nMUL 5 6') == [('ADD', 1, 2), ('SUB', 3, 4), ('MUL', 5, 6)]\", \"assert parse('ADD 10 20\\\\nSUB 30 40') == [('ADD', 10, 20), ('SUB', 30, 40)]\", \"assert parse('MUL 7 8\\\\nADD 9 10') == [('MUL', 7, 8), ('ADD', 9, 10)]\", \"ass... | {
"split": "train",
"index": 3591,
"acecode_id": "oss_757",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a random sequence of characters from the ASCII printable characters, which include space (' '), punctuation, uppercase letters (A-Z), lowercase letters (a-z), and tilde ('~'). The function should generate a sequence of char... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_sequence(5) != generate_random_sequence(5)\", \"assert len(generate_random_sequence(10)) == 10\", \"assert len(generate_random_sequence(1)) == 1\", \"assert all(32 <= ord(c) <= 126 for c in generate_random_sequence(10))\", \"assert generate_r... | {
"split": "train",
"index": 3592,
"acecode_id": "bigcode_python_fns_8519",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates a serializer used in a web application for handling expiring links for images. The function should ensure that the serializer contains the expected fields and their corresponding data types. The serializer should hav... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_expiring_link_serializer({'image_id': 123, 'expiration_time': '2023-12-31 23:59:59'}) == True\", \"assert validate_expiring_link_serializer({'image_id': 1, 'expiration_time': '2023-01-01 00:00:00'}) == True\", \"assert validate_expiring_link_seriali... | {
"split": "train",
"index": 3593,
"acecode_id": "oss_37082",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary string, implement a function that returns a tuple containing the decimal equivalent of the binary number and the decimal equivalent of the reversed binary number. The function should be defined as follows: def binary_to_decimal_and_reverse(binary: str) -> tuple: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_to_decimal_and_reverse('11100011') == (227, 199)\", \"assert binary_to_decimal_and_reverse('0000') == (0, 0)\", \"assert binary_to_decimal_and_reverse('101010') == (42, 21)\", \"assert binary_to_decimal_and_reverse('1111') == (15, 15)\", \"assert bina... | {
"split": "train",
"index": 3594,
"acecode_id": "evol_34454",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, your task is to compute the average of the integers in the list. If the list is empty, return 0. Implement a function named 'calculate_average' that takes a list of integers as input and returns the average as a float. The average is defined as the sum... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average([-1, -2, -3, -4, -5]) == -3.0\", \"assert calculate_average([10, 20, 30]) == 20.0\", \"assert calculate_average([-10, 0, 10]) == 0.0\", \"assert calculate_average([0, 0, 0, 0]) == 0.0\",... | {
"split": "train",
"index": 3595,
"acecode_id": "bigcode_python_fns_48485",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of user credentials, where each credential is represented as a dictionary containing 'user', 'password', 'xdvbf', 'cookie', and 'session'. Implement a function `send_requests(credentials: List[Dict[str, Any]], url: str) -> List[str]` that sends a POST reque... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_requests([{'user': 'user1', 'password': 'pwd1', 'xdvbf': 'code1', 'cookie': {}, 'session': mock_session}], 'http://example.com') == ['Success']\", \"assert send_requests([{'user': 'user2', 'password': 'pwd2', 'xdvbf': 'code2', 'cookie': {}, 'session': m... | {
"split": "train",
"index": 3596,
"acecode_id": "bigcode_python_fns_10917",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a dictionary of game states and returns a modified version of the dictionary based on certain conditions. The function should remove specific game states from the dictionary and update another set with those removed sta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_states({((1, 20), (1, 19)): 10, ((1, 21), (1, 20)): 5}) == {((1, 20), (1, 19)): 10}\", \"assert process_states({((1, 19), (1, 19)): 10, ((1, 20), (1, 20)): 0, ((1, 21), (1, 22)): 15}) == {((1, 19), (1, 19)): 10}\", \"assert process_states({((2, 15), ... | {
"split": "train",
"index": 3597,
"acecode_id": "oss_34261",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `filter_consonants` that takes a string as input and returns a new string consisting only of the consonants from the input string. The function should ignore vowels, digits, punctuation marks, and whitespace characters while preserving the order of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_consonants('') == ''\", \"assert filter_consonants('abcdefghij#&*123\\\\nklmnopqr89') == 'bcdfghjklmnpqr'\", \"assert filter_consonants('abcdefghi456') == 'bcdfgh'\", \"assert filter_consonants('aaaaaeeI!?') == ''\", \"assert filter_consonants('aaCDEF... | {
"split": "train",
"index": 3598,
"acecode_id": "evol_28841",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to update the status of articles based on their type. The function `update_finish_status` takes two parameters: `type` (an integer) and `id` (an integer). The `type` parameter represents the type of update to be performed, and the `id` pa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_finish_status(1, 101) == 'banner_status updated to Y for article_id 101'\", \"assert update_finish_status(2, 202) == 'text_status updated to Y for article_id 202'\", \"assert update_finish_status(3, 303) == 'style_status updated to Y for article_id 30... | {
"split": "train",
"index": 3599,
"acecode_id": "oss_21614",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.