data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Implement a function `median_expenditure(expenditures: List[float]) -> float` that takes a list of expenditures (as floating-point numbers) and returns the median of those expenditures. The list may contain zero or more expenditures. If the list is empty, return 0.0.\nPlease re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median_expenditure([]) == 0.0\", \"assert median_expenditure([1000.0]) == 1000.0\", \"assert median_expenditure([1000.0, 2000.0]) == 1500.0\", \"assert median_expenditure([1000.0, 2000.0, 3000.0]) == 2000.0\", \"assert median_expenditure([1000.0, 2000.0, 300... | {
"split": "train",
"index": 84700,
"acecode_id": "evol_27791",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an array of complex numbers and returns their sum.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_complex([complex(1, 2), complex(3, 4)]) == complex(4, 6)\", \"assert sum_of_complex([complex(0, 0), complex(0, 0)]) == complex(0, 0)\", \"assert sum_of_complex([complex(1, 1), complex(1, 1), complex(1, 1)]) == complex(3, 3)\", \"assert sum_of_complex(... | {
"split": "train",
"index": 84701,
"acecode_id": "evol_21059",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function `MostCommon(arr)` that returns a dictionary containing the most frequent number(s) and their corresponding count(s). If there are two or more numbers with the same highest frequency, return all of those numbers with their counts ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert MostCommon([1, 2, 2, 3, 3, 3]) == {3: 3}\", \"assert MostCommon([1, 1, 2, 2, 3]) == {1: 2, 2: 2}\", \"assert MostCommon([7, 8, 9, 7, 8, 9]) == {7: 2, 8: 2, 9: 2}\", \"assert MostCommon([]) == {}\", \"assert MostCommon([10, 20, 10, 30, 20, 10]) == {10: 3}\", ... | {
"split": "train",
"index": 84702,
"acecode_id": "evol_30405",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a stack represented as a list of integers, where the top of the stack is at the end of the list. Implement a function `do_OP_2SWAP(stack)` that swaps the top two elements of the stack with the two elements that are fourth from the top. If there are fewer than four... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert do_OP_2SWAP([1, 2, 3, 4]) == None and [3, 4, 1, 2] == [3, 4, 1, 2]\", \"assert do_OP_2SWAP([5, 6, 7, 8]) == None and [7, 8, 5, 6] == [7, 8, 5, 6]\", \"assert do_OP_2SWAP([10, 20, 30]) == None and [10, 20, 30] == [10, 20, 30]\", \"assert do_OP_2SWAP([1]) == N... | {
"split": "train",
"index": 84703,
"acecode_id": "bigcode_python_fns_4351",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array A of N integers. Your task is to find the minimum value of the function C(X) for all possible values of X, where C(X) is defined as the sum of absolute differences between each element of A and X. Formally, C(X) = |A[0] - X| + |A[1] - X| + ... + |A[N-1] -... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minCValue([1, 2, 3, 4, 5]) == 6\", \"assert minCValue([5, 5, 5, 5, 5]) == 0\", \"assert minCValue([-1, 0, 1]) == 2\", \"assert minCValue([1]) == 0\", \"assert minCValue([2, 2, 2, 2]) == 0\", \"assert minCValue([100, 200, 300]) == 200\", \"assert minCValue([-... | {
"split": "train",
"index": 84704,
"acecode_id": "oss_29779",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Create a function that constructs a numerical distribution table, representing the frequency of each integer within a given input list of integers. Your function should return the distribution table in the form of a nested list where each sublist contains the integer and its fr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dist_frequency([1, 1, 1, 1, 1]) == [[1, 100.0]]\", \"assert dist_frequency([0, 0, 0, 0, 0]) == [[0, 100.0]]\", \"assert dist_frequency([-1, -1, -1, 0, 0]) == [[-1, 60.0], [0, 40.0]]\", \"assert dist_frequency([10, 20, 10, 30, 20]) == [[10, 40.0], [20, 40.0],... | {
"split": "train",
"index": 84705,
"acecode_id": "evol_33369",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `print_message(n: int) -> List[str]` that takes an integer `n` as an argument and returns a list containing the string \"Goodbye Universe\" printed `n` times. The order of the printed messages should be guaranteed to be in the order of their generation (1 t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_message(1) == ['Goodbye Universe']\", \"assert print_message(2) == ['Goodbye Universe', 'Goodbye Universe']\", \"assert print_message(3) == ['Goodbye Universe', 'Goodbye Universe', 'Goodbye Universe']\", \"assert print_message(4) == ['Goodbye Universe'... | {
"split": "train",
"index": 84706,
"acecode_id": "evol_24423",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of objects that need to be closed after their use. Implement a function `closing_all(objects: List[ContextManager]) -> None` that takes a list of context managers and ensures that each one is properly closed after being used. The function should not return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert closing_all([open('file1.txt', 'w'), open('file2.txt', 'w')]) == None\", \"assert closing_all([open('file3.txt', 'w'), open('file4.txt', 'w')]) == None\", \"assert closing_all([open('file5.txt', 'w')]) == None\", \"assert closing_all([open('file6.txt', 'w'),... | {
"split": "train",
"index": 84707,
"acecode_id": "bigcode_python_fns_24026",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that translates a given integrator method name into a corresponding integer code. The function should accept a string representing the integrator method and return an integer according to the following mapping: 'rk4_c' -> 1, 'rk6_c' -> 2,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_integrator('rk4_c') == 1\", \"assert parse_integrator('RK4_C') == 1\", \"assert parse_integrator('rk6_c') == 2\", \"assert parse_integrator('RK6_C') == 2\", \"assert parse_integrator('symplec4_c') == 3\", \"assert parse_integrator('SYMPLEC4_C') == 3\",... | {
"split": "train",
"index": 84708,
"acecode_id": "bigcode_python_fns_1166",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two matrices, matrixA and matrixB, both of size rows x cols, where each element in the matrices is an integer. Your task is to write a Python function that takes these two matrices as input and returns the resultant matrix, which is the element-wise product of mat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_matrices([[1]], [[1]]) == [[1]]\", \"assert multiply_matrices([[1, 2]], [[3, 4]]) == [[3, 8]]\", \"assert multiply_matrices([[2, 3], [4, 5]], [[1, 0], [0, 1]]) == [[2, 0], [0, 5]]\", \"assert multiply_matrices([[0, 0], [0, 0]], [[1, 1], [1, 1]]) == ... | {
"split": "train",
"index": 84709,
"acecode_id": "oss_14131",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates an error message based on a provided file path and a source identifier. Write a Python function `generate_error_message(path: str, source: int) -> str` that takes a file path `path` as a string and a source identifier `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_error_message('/usr/local/', 123) == 'Error encountered while traversing source /usr/local/[123] and '\", \"assert generate_error_message('/home/user/', 456) == 'Error encountered while traversing source /home/user/[456] and '\", \"assert generate_e... | {
"split": "train",
"index": 84710,
"acecode_id": "oss_19243",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and sorts it using the Bubble Sort algorithm. The function should return the sorted list. Bubble Sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([5, 1, 4, 2, 8]) == [1, 2, 4, 5, 8]\", \"assert bubble_sort([3, 0, 2, 5, -1, 4, 1]) == [-1, 0, 1, 2, 3, 4, 5]\", \"assert bubble_sort([]) == []\", \"assert bubble_sort([1]) == [1]\", \"assert bubble_sort([2, 1]) == [1, 2]\", \"assert bubble_sort(... | {
"split": "train",
"index": 84711,
"acecode_id": "evol_5703",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a data validation function for a configuration model in a Python application. You need to create a function `validate_configuration` that takes four parameters: `label` (a string), `key` (a string), `value` (a string representing a JSON object),... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_configuration('Valid Label', 'key1', '{\\\"key\\\": \\\"value\\\"}', 'on') == []\", \"assert validate_configuration('', 'key1', '{\\\"key\\\": \\\"value\\\"}', 'on') == ['Label must not be empty and should not exceed 200 characters.']\", \"assert va... | {
"split": "train",
"index": 84712,
"acecode_id": "oss_6264",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple consists of a style string and a corresponding text. Your task is to create a function that formats the text according to the provided styles. The function should take the following parameters: a list of tuples `fragments`, where... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_text([('bold', 'Hello\\\\nWorld'), ('italic', 'This is a test\\\\r\\\\nwith carriage return.')]) == 'Hello\\\\r\\\\nWorldThis is a test\\\\r\\\\nwith carriage return.'\", \"assert format_text([('underline', 'Line 1\\\\nLine 2\\\\r'), ('bold', 'Line 3\... | {
"split": "train",
"index": 84713,
"acecode_id": "bigcode_python_fns_27485",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the daily stock prices of a company. Your task is to write a function that calculates the maximum profit that can be obtained by buying and selling the stock at most once. If it is not possible to make any profit, the function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([1, 2, 3, 4, 5]) == 4\", \"assert max_profit([5, 4, 3, 2, 1]) == 0\", \"assert max_profit([3, 2, 6, 5, 0, 3]) == 4\", \"assert max_profit([1]) == 0\", \"a... | {
"split": "train",
"index": 84714,
"acecode_id": "oss_13810",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a positive integer N. Your task is to write a function `minIterationsToReduceToOne(N)` that calculates the minimum number of iterations required to reduce N to 1 using the following rules: If N is even, divide it by 2. If N is odd, subtract 1 from it. Return the m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minIterationsToReduceToOne(1) == 0\", \"assert minIterationsToReduceToOne(2) == 1\", \"assert minIterationsToReduceToOne(3) == 2\", \"assert minIterationsToReduceToOne(4) == 2\", \"assert minIterationsToReduceToOne(6) == 3\", \"assert minIterationsToReduceTo... | {
"split": "train",
"index": 84715,
"acecode_id": "oss_34148",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given two strings, `first_name` and `last_name`, write a function `get_duplicated_members(first_name: str, last_name: str) -> bool` that checks if both strings are not empty after trimming whitespace. The function should return `True` if both strings are non-empty, indicating t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_duplicated_members('John', 'Doe') == True\", \"assert get_duplicated_members(' ', 'Doe') == False\", \"assert get_duplicated_members('John', ' ') == False\", \"assert get_duplicated_members(None, 'Doe') == False\", \"assert get_duplicated_members('Jo... | {
"split": "train",
"index": 84716,
"acecode_id": "bigcode_python_fns_13347",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of operations, where each operation is represented as a dictionary containing the keys 'type' and 'gate'. The 'type' represents the type of operation (e.g., 'GateOperation') and the 'gate' represents the gate used in the operation (e.g., 'H', 'CNOT'). Imple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_native_xmon_op({'type': 'GateOperation', 'gate': 'H'}) == True\", \"assert is_native_xmon_op({'type': 'GateOperation', 'gate': 'CNOT'}) == True\", \"assert is_native_xmon_op({'type': 'GateOperation', 'gate': 'T'}) == True\", \"assert is_native_xmon_op({'t... | {
"split": "train",
"index": 84717,
"acecode_id": "bigcode_python_fns_49824",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `card_value_equality(card1_value, card2_value)` that determines if two card values are equal. Each card value is represented as a string, but they can also be compared to integers that represent their face values. The function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert card_value_equality('5', '5') == True\", \"assert card_value_equality(5, 5) == True\", \"assert card_value_equality('5', 5) == True\", \"assert card_value_equality('6', '6') == True\", \"assert card_value_equality(6, 6) == True\", \"assert card_value_equalit... | {
"split": "train",
"index": 84718,
"acecode_id": "bigcode_python_fns_29842",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the version number of a software application from a given string. The input will be a string containing version information in the format 'Version: x.x.x', where 'x.x.x' represents the version number. Your function should e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_version_number('Version: 1.0.0') == '1.0.0'\", \"assert get_version_number('Version: 2.1.3') == '2.1.3'\", \"assert get_version_number('Version: 0.9.8') == '0.9.8'\", \"assert get_version_number('Version: 3.14.159') == '3.14.159'\", \"assert get_version_... | {
"split": "train",
"index": 84719,
"acecode_id": "bigcode_python_fns_42950",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given two lists of closed intervals, where each list of intervals is pairwise disjoint and sorted in ascending order, write a function `interval_intersection` that returns the intersection of these two interval lists. The intersection of two intervals [a, b] and [c, d] is defin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert interval_intersection([[0, 2], [5, 10], [13, 23], [24, 25]], [[1, 5], [8, 12], [15, 24], [25, 26]]) == [[1, 2], [5, 5], [8, 10], [15, 23], [24, 24], [25, 25]]\", \"assert interval_intersection([[1, 3], [4, 6]], [[2, 5], [6, 8]]) == [[2, 3], [4, 5], [6, 6]]\"... | {
"split": "train",
"index": 84720,
"acecode_id": "bigcode_python_fns_8987",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing the names of users who have sent messages in a chat application. Each name is separated by a comma. Your task is to implement a function that counts how many unique users have sent messages. The function should ignore any leading or trailing wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_users('Alice, Bob, Charlie, Alice') == 3\", \"assert count_unique_users('Alice, Alice, Alice') == 1\", \"assert count_unique_users(' Alice, Bob, Charlie ') == 3\", \"assert count_unique_users(' Bob, Bob, Bob ') == 1\", \"assert count... | {
"split": "train",
"index": 84721,
"acecode_id": "bigcode_python_fns_25809",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of stock prices where each price is represented as a float. Write a function `max_profit(prices: List[float]) -> float` that calculates the maximum profit you can achieve by buying and selling the stock once. If no profit is possible, return 0. The function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_profit([7.0, 1.0, 5.0, 3.0, 6.0, 4.0]) == 5.0\", \"assert max_profit([7.0, 6.0, 4.0, 3.0, 1.0]) == 0.0\", \"assert max_profit([2.0, 4.0, 1.0, 3.0]) == 2.0\", \"assert max_profit([3.0, 2.0]) == 0.0\", \"assert max_profit([1.0, 2.0, 3.0, 4.0]) == 3.0\", \"... | {
"split": "train",
"index": 84722,
"acecode_id": "bigcode_python_fns_34212",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `int_to_roman(num)` that takes an integer `num` (1 <= num <= 3999) as input and returns the Roman numeral representation of that number. The Roman numeral system uses the following letters to represent numbers: I: 1, IV: 4, V: 5, IX: 9, X: 10, XL: 40, L: 50, XC... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert int_to_roman(1) == 'I'\", \"assert int_to_roman(4) == 'IV'\", \"assert int_to_roman(5) == 'V'\", \"assert int_to_roman(9) == 'IX'\", \"assert int_to_roman(10) == 'X'\", \"assert int_to_roman(40) == 'XL'\", \"assert int_to_roman(50) == 'L'\", \"assert int_to_... | {
"split": "train",
"index": 84723,
"acecode_id": "oss_1066",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that processes a list of alignment strings representing sequences from various viruses and condenses them into a single string by concatenating the sequences, separated by a semicolon. Each alignment string is guaranteed to be non-empty. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert condense_alignment(['ATGC', 'CGTA', 'TACG']) == 'ATGC;CGTA;TACG'\", \"assert condense_alignment(['A', 'B', 'C']) == 'A;B;C'\", \"assert condense_alignment(['Virus1', 'Virus2']) == 'Virus1;Virus2'\", \"assert condense_alignment(['M', 'N', 'O', 'P']) == 'M;N;O... | {
"split": "train",
"index": 84724,
"acecode_id": "bigcode_python_fns_5954",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a GPIO (General Purpose Input/Output) sequence point for a microcontroller. Your goal is to create a function `GPIO_seq_point` that takes three parameters: an integer `address`, an integer `time`, and a hexadecimal `output`. The function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert GPIO_seq_point(4, 0, 0x00000000) == {'address': 4, 'time': 0, 'output': 0}\", \"assert GPIO_seq_point(1, 10, 0xFFFFFFFF) == {'address': 1, 'time': 10, 'output': 4294967295}\", \"assert GPIO_seq_point(255, 100, 0x00000001) == {'address': 255, 'time': 100, 'ou... | {
"split": "train",
"index": 84725,
"acecode_id": "oss_27997",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `check_string` that takes a string as input and returns True if the string starts with 'hello', followed by two positive integer numbers separated by a comma and a space. Otherwise, return False.\nPlease reason step by step, then write a self-contained Python s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_string('hello 1, 2') == True\", \"assert check_string('hello 25, 30') == True\", \"assert check_string('hello 100, 200') == True\", \"assert check_string('hello 99, 1') == True\", \"assert check_string('hello 12, 34') == True\", \"assert check_string('... | {
"split": "train",
"index": 84726,
"acecode_id": "evol_26019",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given three integers x, y, and z representing the coordinates of a vector in a 3D space. Implement a function that takes these three integers and returns a new vector where each component is the result of dividing 0 by the corresponding component of the input vector. If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divide_zero_by_vector(1, 2, 3) == (0.0, 0.0, 0.0)\", \"assert divide_zero_by_vector(-1, -2, -3) == (0.0, 0.0, 0.0)\", \"assert divide_zero_by_vector(4, 5, 6) == (0.0, 0.0, 0.0)\", \"assert divide_zero_by_vector(10, 20, 30) == (0.0, 0.0, 0.0)\", \"assert divi... | {
"split": "train",
"index": 84727,
"acecode_id": "bigcode_python_fns_30385",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are working with tabular data and need to ensure that a specific column in a dataset contains only valid numeric values. Your task is to write a function that takes a list of dictionaries, each representing a row in a table, and a key representing the column to be coerced. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert coerce_to_numeric([{'id': 1, 'number': '123'}, {'id': 2, 'number': 'abc'}, {'id': 3, 'number': '456'}, {'id': 4, 'number': '789'}, {'id': 5, 'number': None}], 'number') == [{'id': 1, 'number': 123.0}, {'id': 2, 'number': None}, {'id': 3, 'number': 456.0}, {'... | {
"split": "train",
"index": 84728,
"acecode_id": "oss_36840",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function that checks if a given string is a valid MAC address. A valid MAC address is defined as a string that consists of six groups of two hexadecimal digits, separated by either colons (:) or hyphens (-). The hexadecimal digits can be uppercase (A-F) or lowercase (a-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_mac_address('00:1A:2B:3C:4D:5E') == True\", \"assert is_valid_mac_address('00-1A-2B-3C-4D-5E') == True\", \"assert is_valid_mac_address('00:1A:2B:3C:4D:5E:6F') == False\", \"assert is_valid_mac_address('001A2B3C4D5E') == False\", \"assert is_valid_m... | {
"split": "train",
"index": 84729,
"acecode_id": "evol_3790",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters out specific warning messages from a log record. The function should take a dictionary representing a log record as input and return a boolean value indicating whether the log record should be filtered out. A log record s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_warnings({'name': 'azure.identity.service', 'levelno': 30, 'message': 'Token retrieval failed at .get_token'}) == False\", \"assert filter_warnings({'name': 'azure.identity.service', 'levelno': 30, 'message': 'No issues detected'}) == True\", \"assert... | {
"split": "train",
"index": 84730,
"acecode_id": "bigcode_python_fns_40011",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simplified version of the game 'Rock, Paper, Scissors'. The function will take a user's choice as input and randomly generate a computer's choice. Your function should return a string that indicates whether the user w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rock_paper_scissors('rock') in ['win', 'lose', 'draw', 'Invalid choice']\", \"assert rock_paper_scissors('paper') in ['win', 'lose', 'draw', 'Invalid choice']\", \"assert rock_paper_scissors('scissors') in ['win', 'lose', 'draw', 'Invalid choice']\", \"asser... | {
"split": "train",
"index": 84731,
"acecode_id": "oss_37025",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of property records, where each record is represented as a dictionary containing various attributes such as 'PIN', 'Status', 'AIN', 'Property Type', 'Neighborhood', 'Subdivision Name', 'Adjusted Year Built', 'Year Built', 'owners', 'sales_history', and 'pro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_property_summary([]) == []\", \"assert get_property_summary([{'PIN': '123', 'Status': 'active', 'Property Type': 'Residential', 'Year Built': '1990'}]) == [{'PIN': '123', 'Status': 'active', 'Property Type': 'Residential', 'Year Built': '1990'}]\", \"ass... | {
"split": "train",
"index": 84732,
"acecode_id": "bigcode_python_fns_46880",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given two strings representing image version IDs, `current_image_version_id` and `candidate_image_version_id`. Your task is to determine if the candidate version is a valid upgrade from the current version. A valid upgrade must satisfy the following conditions: 1) The c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_upgrade('composer_1.0.0_airflow_1.10.0', 'composer_1.1.0_airflow_1.10.1') == True\", \"assert is_valid_upgrade('composer_1.0.0_airflow_1.10.0', 'composer_1.0.0_airflow_1.10.0') == False\", \"assert is_valid_upgrade('composer_1.0.0_airflow_1.10.0', '... | {
"split": "train",
"index": 84733,
"acecode_id": "bigcode_python_fns_44687",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a project name. Your task is to validate whether the project name is valid or not based on the following criteria: 1. The project name must not be empty. 2. The project name must not contain any special characters except for hyphens (-) and u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_project_name('My_Project-1') == True\", \"assert is_valid_project_name('1InvalidName') == False\", \"assert is_valid_project_name('') == False\", \"assert is_valid_project_name('Valid-Name') == True\", \"assert is_valid_project_name('Invalid@Name') ... | {
"split": "train",
"index": 84734,
"acecode_id": "bigcode_python_fns_28748",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a configuration represented as a dictionary. The function should take a dictionary of options where each key represents a section of the configuration and its value is another dictionary containing options and their corresp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_config({'Database': {'host': 'localhost', 'port': 5432}, 'Server': {'host': '0.0.0.0', 'port': 8080}}) == {'Database': {'host': 'localhost', 'port': 5432}, 'Server': {'host': '0.0.0.0', 'port': 8080}}\", \"assert generate_config({'App': {'name': 'My... | {
"split": "train",
"index": 84735,
"acecode_id": "bigcode_python_fns_29978",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a sequential array 'arr' consisting of integers from one through five, arranged in ascending order, implement a function `get_num_at_index(arr: List[int], index: int) -> int` that retrieves the number associated with a specified index. If the index is out of bounds (negat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_num_at_index([1, 2, 3, 4, 5], 0) == 1\", \"assert get_num_at_index([1, 2, 3, 4, 5], 1) == 2\", \"assert get_num_at_index([1, 2, 3, 4, 5], 2) == 3\", \"assert get_num_at_index([1, 2, 3, 4, 5], 3) == 4\", \"assert get_num_at_index([1, 2, 3, 4, 5], 4) == 5\... | {
"split": "train",
"index": 84736,
"acecode_id": "evol_2375",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple system information manager in Python. The manager should allow you to store a system's information and retrieve it later. You need to implement a single function `manage_system_info(sysinfo: List[Tuple[str, str]], load: str) -> Dict[str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_system_info([('OS', 'Linux'), ('Version', '5.4.0')], '1.23') == {'OS': 'Linux', 'Version': '5.4.0', 'System load': '1.23'}\", \"assert manage_system_info([('OS', 'Windows'), ('Version', '10')], '2.34') == {'OS': 'Windows', 'Version': '10', 'System loa... | {
"split": "train",
"index": 84737,
"acecode_id": "oss_28325",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that accepts a list of rate plans, where each rate plan is represented as a dictionary containing details about the plan. Your function should return a list of names of the plans that have a fixed_recurring_fee greater than a specified th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_rate_plans([{'name': 'Basic Plan', 'fixed_recurring_fee': 10.0}, {'name': 'Premium Plan', 'fixed_recurring_fee': 20.0}, {'name': 'Enterprise Plan', 'fixed_recurring_fee': 30.0}], 15.0) == ['Premium Plan', 'Enterprise Plan']\", \"assert filter_rate_pla... | {
"split": "train",
"index": 84738,
"acecode_id": "bigcode_python_fns_34023",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a time duration represented by hours, minutes, and seconds, write a function that takes the number of hours, minutes, and seconds as input and returns a formatted string displaying the time duration in a human-readable format. The output string should indicate the number ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_time_duration(1, 0, 5) == '1 hour 5 seconds'\", \"assert format_time_duration(0, 1, 3) == '1 minute 3 seconds'\", \"assert format_time_duration(0, 0, 10) == '10 seconds'\", \"assert format_time_duration(2, 3, 0) == '2 hours 3 minutes'\", \"assert form... | {
"split": "train",
"index": 84739,
"acecode_id": "bigcode_python_fns_47526",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a JSON data set as input and retrieves the country, capital, and population from it. The population should be converted into a numerical value if given in the form of a string (in millions). If the data set is missing any required keys or cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_country_capital_population({\\\"country\\\": \\\"Brazil\\\", \\\"capital\\\": \\\"Bras\\u00edlia\\\", \\\"population\\\": \\\"208 million\\\"}) == (\\\"Brazil\\\", \\\"Bras\\u00edlia\\\", 208000000)\", \"assert get_country_capital_population({\\\"country... | {
"split": "train",
"index": 84740,
"acecode_id": "evol_4915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a program to manage account transactions. Each transaction consists of a date (in the format 'YYYY-MM-DD'), a description, and an amount (which can be positive for deposits or negative for withdrawals). Your program should implement a function `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_balance([('2022-01-01', 'Initial deposit', 1000), ('2022-01-05', 'Groceries', -50), ('2022-01-10', 'Salary', 2000)], '2022-01-01', '2022-01-15') == 2950\", \"assert calculate_balance([('2022-01-01', 'Initial deposit', 1000), ('2022-01-05', 'Groceri... | {
"split": "train",
"index": 84741,
"acecode_id": "oss_35771",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `frase` containing a sentence in Portuguese. Your task is to write a Python function that extracts the third character of each word in the sentence and returns a new string containing these characters in the order they appear in the original sentence. If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_third_chars('A') == ''\", \"assert extract_third_chars('apenas') == 'e'\", \"assert extract_third_chars('Testando') == 's'\", \"assert extract_third_chars('Desenvolvendo') == 's'\", \"assert extract_third_chars('') == ''\"]}"
} | {
"split": "train",
"index": 84742,
"acecode_id": "oss_22748",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of assignments represented as tuples. Each tuple contains a target variable name and a dictionary of function aliases, where the key is the function name and the value is its alias. Your task is to create a function `get_function_aliases(assignments: List[T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_function_aliases([('__func_alias__', {'func1': 'f1', 'func2': 'f2'})]) == {'func1': 'f1', 'func2': 'f2'}\", \"assert get_function_aliases([('__func_alias__', {'func1': 'f1'}), ('__func_alias__', {'func2': 'f2'})]) == {'func1': 'f1', 'func2': 'f2'}\", \"a... | {
"split": "train",
"index": 84743,
"acecode_id": "bigcode_python_fns_41717",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that processes a list of strings, where each string starts with a '#' symbol followed by a title. Your program should extract the titles and store them in a list, removing any leading or trailing whitespaces and the '#' symbol. Implement a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_titles(['# Introduction', '# Chapter 1', '# Chapter 2', '# Conclusion']) == ['Introduction', 'Chapter 1', 'Chapter 2', 'Conclusion']\", \"assert extract_titles(['# Hello World', '# This is a test', '# Python programming']) == ['Hello World', 'This is... | {
"split": "train",
"index": 84744,
"acecode_id": "oss_29593",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of points representing the vertices of a polygon in a 2D space, return the edges of the polygon as a list of tuples. An edge is defined by the connection between consecutive vertices, and the last vertex connects back to the first vertex. The input list will contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert polygon_edges([(0, 0), (1, 1), (1, 0)]) == [((0, 0), (1, 1)), ((1, 1), (1, 0)), ((1, 0), (0, 0))]\", \"assert polygon_edges([(1, 2), (3, 4), (5, 6)]) == [((1, 2), (3, 4)), ((3, 4), (5, 6)), ((5, 6), (1, 2))]\", \"assert polygon_edges([(0, 0), (2, 2), (2, 0),... | {
"split": "train",
"index": 84745,
"acecode_id": "bigcode_python_fns_13865",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts a string as a password and returns 'Acceptable' if the password meets the appropriate criteria, 'Unacceptable' if not. The password must fulfill the following conditions: 1) Must have at least one uppercase and one lowercase letter. 2) Must con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert password_checker('CorrectPasswrd#1') == 'Acceptable'\", \"assert password_checker('ValidPassword#5') == 'Acceptable'\", \"assert password_checker('NoSpecialChar7') == 'Unacceptable'\", \"assert password_checker('short1#A') == 'Acceptable'\", \"assert passwor... | {
"split": "train",
"index": 84746,
"acecode_id": "evol_24804",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the readings from a three-axis accelerometer (x, y, z) for a device. Your task is to implement a function that calculates the tilt angle of the device in degrees. The tilt angle can be calculated using the following formula: angle =... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_tilt_angle([(1, 1, 0)]) == [45.0]\", \"assert calculate_tilt_angle([(0, 1, 0)]) == [90.0]\", \"assert calculate_tilt_angle([(1, 0, 0)]) == [0.0]\", \"assert calculate_tilt_angle([(0, -1, 0)]) == [-90.0]\", \"assert calculate_tilt_angle([(-1, 1, 0)]... | {
"split": "train",
"index": 84747,
"acecode_id": "oss_26061",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_commit_hash_prefix` that takes a full commit hash as a string and returns the first 7 characters of that hash. The input commit hash will always be a valid 40-character hexadecimal string. Your function should handle the input an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_commit_hash_prefix('a1b2c3d4e5f67890123456789abcdef01234567') == 'a1b2c3d'\", \"assert get_commit_hash_prefix('abcdef1234567890abcdef1234567890abcdef12') == 'abcdef1'\", \"assert get_commit_hash_prefix('0000000000000000000000000000000000000000') == '0000... | {
"split": "train",
"index": 84748,
"acecode_id": "oss_35682",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `print_triangle(height: int, is_right_aligned: bool) -> str` that generates a right-angled triangle pattern using asterisks. The function should take two parameters: `height`, which is a positive integer representing the height of the triangle, and `is_right_al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_triangle(1, False) == '*\\\\n'\", \"assert print_triangle(2, False) == '*\\\\n**\\\\n'\", \"assert print_triangle(2, True) == ' *\\\\n**\\\\n'\", \"assert print_triangle(3, False) == '*\\\\n**\\\\n***\\\\n'\", \"assert print_triangle(3, True) == ' *\\... | {
"split": "train",
"index": 84749,
"acecode_id": "evol_12394",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `validate_score(score)` that checks if the given score is a valid integer between 0 and 100 (inclusive). The function should return True if the score is valid and False otherwise. The input can be a string or any other type. Ensure that you handle any exception... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_score('50') == True\", \"assert validate_score('0') == True\", \"assert validate_score('100') == True\", \"assert validate_score('101') == False\", \"assert validate_score('-1') == False\", \"assert validate_score('abc') == False\", \"assert validat... | {
"split": "train",
"index": 84750,
"acecode_id": "evol_8935",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the configuration of hyperparameters for a neural network model using LSTM and attention mechanisms. Your function should return a dictionary containing the following hyperparameters: 'batch_size', 'hidden_size', 'num_hidde... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hyperparameter_configuration() == {'batch_size': 2048, 'hidden_size': 512, 'num_hidden_layers': 2, 'initializer': 'uniform_unit_scaling', 'initializer_gain': 1.0, 'weight_decay': 0.0, 'attention_layer_size': 512, 'output_attention': True, 'num_heads': 4, 'at... | {
"split": "train",
"index": 84751,
"acecode_id": "bigcode_python_fns_9083",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have been given a list of books, where each book is represented by its title and a tuple containing the following information: (price, rating, pages, publication_year, sold_copies, average_reviews, author, genre). Your task is to filter and sort these books based on a set o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_sort_books({}, [10, 4, 100, 2000, 50, 3.5, 'Author', 'Fiction']) == 'No books provided.'\", \"assert filter_and_sort_books({'Book1': (15, 5, 150, 2021, 100, 4.5, 'Author', 'Fiction')}, [10, 4, 100, 2000, 50, 3.5, 'Author', 'Fiction']) == [('Book1'... | {
"split": "train",
"index": 84752,
"acecode_id": "evol_24979",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function that returns a list of all prime numbers in a given range [start, end], inclusive. The function should handle cases where the range includes negative numbers or zero. Optimize the function to minimize the number of checks for primality. You may assume that 'sta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_primes_in_range(10, 20) == [11, 13, 17, 19]\", \"assert get_primes_in_range(0, 1) == []\", \"assert get_primes_in_range(-10, 10) == [2, 3, 5, 7]\", \"assert get_primes_in_range(15, 15) == []\", \"assert get_primes_in_range(1, 10) == [2, 3, 5, 7]\", \"ass... | {
"split": "train",
"index": 84753,
"acecode_id": "evol_10108",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that calculates the harmonic mean of the prime numbers present in the list. If there are no prime numbers in the list, the function should return 0. You may assume that the input list contains only integers.\nPlease reason step by step... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert harmonic_mean_prime([1, 4, 6, 8]) == 0\", \"assert harmonic_mean_prime([10, 12, 14, 15]) == 0\", \"assert harmonic_mean_prime([2, 4, 6, 8, 10]) == 2.0\", \"assert harmonic_mean_prime([15, 21, 25, 27]) == 0\", \"assert harmonic_mean_prime([-2, -3, -5, -7]) ==... | {
"split": "train",
"index": 84754,
"acecode_id": "evol_15018",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers as input and returns the maximum sum of any contiguous subarray. This problem is commonly known as the 'Maximum Subarray Problem'. Your function should handle both positive and negative integers. Write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2,1,-3,4,-1,2,1,-5,4]) == 6\", \"assert max_subarray_sum([1]) == 1\", \"assert max_subarray_sum([5,4,-1,7,8]) == 23\", \"assert max_subarray_sum([-1,-2,-3,-4]) == -1\", \"assert max_subarray_sum([2,1,-3,4,-1,2,1,-5,4]) == 6\", \"assert max... | {
"split": "train",
"index": 84755,
"acecode_id": "bigcode_python_fns_46967",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `validate_https_url(url: str) -> str` that checks if a given URL is correctly formatted, uses HTTPS encryption, and has a domain name with an approved top-level domain (TLD). The function should handle URLs with or without 'www' prefixes and extract the domain ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_https_url('https://www.example.com') == 'URL is correctly formatted, uses HTTPS encryption and top-level domain is approved.'\", \"assert validate_https_url('https://example.com') == 'URL is correctly formatted, uses HTTPS encryption and top-level d... | {
"split": "train",
"index": 84756,
"acecode_id": "evol_13730",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sphere_volume(r)` that calculates the volume of a sphere given its radius `r`. The function should ensure that `r` is a positive decimal number. If `r` is not a positive decimal number, the function should raise a ValueError with the message 'The radius sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sphere_volume(3) == 113.097\", \"assert sphere_volume(5) == 523.599\", \"assert sphere_volume(10) == 4188.79\", \"assert sphere_volume(0.5) == 0.524\", \"assert sphere_volume(2) == 33.51\", \"assert sphere_volume(4) == 268.083\"]}"
} | {
"split": "train",
"index": 84757,
"acecode_id": "evol_17005",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the process of adding a new landmark image to a database. The function should take in two parameters: `imageURL` (a string representing the URL of the image) and `landmark_id` (a string representing the unique identifier of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_image('http://example.com/image1.jpg', 'landmark_1') == 'Success'\", \"assert add_image('http://example.com/image2.jpg', 'landmark_2') == 'Success'\", \"assert add_image('', 'landmark_1') == 'Failure'\", \"assert add_image('http://example.com/image3.jpg'... | {
"split": "train",
"index": 84758,
"acecode_id": "bigcode_python_fns_24478",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_linked_list(values: List[int]) -> Node` that constructs a singly linked list from a list of integer values. The function should return the head of the linked list. If the input list is empty, return None. Each node in the linked list should contain ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_linked_list([]) == None\", \"assert create_linked_list([1]).data == 1\", \"assert create_linked_list([1]).next == None\", \"assert create_linked_list([1, 2]).data == 1\", \"assert create_linked_list([1, 2]).next.data == 2\", \"assert create_linked_lis... | {
"split": "train",
"index": 84759,
"acecode_id": "evol_13214",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simplified version of a neural network inference process for images. The function should take in a dictionary of hyperparameters and a list of images, and return a dictionary containing processed features from the images ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert inference({'dirs': {'data_dir': 'data'}, 'wd': 0.01, 'arch': {'fcn_in': 'pool5'}}, [[1, 2], [3, 4]]) == {'images': [[1, 2], [3, 4]], 'fcn_in': 'pool5_placeholder', 'feed2': 'pool4_placeholder', 'feed4': 'pool3_placeholder', 'fcn_logits': 'upscore32_placehold... | {
"split": "train",
"index": 84760,
"acecode_id": "bigcode_python_fns_18665",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a SQL ORDER BY clause from a list of fields and their corresponding sort orders. Implement a function `generate_order_by(fields: List[str], sort_orders: List[str], table_pre: str = '') -> str` that takes the following parameters: \n\n- `fields`: A... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_order_by(['name', 'age'], ['ASC', 'DESC'], 'users') == 'ORDER BY users.name ASC, users.age DESC'\", \"assert generate_order_by(['salary'], ['ASC'], 'employees') == 'ORDER BY employees.salary ASC'\", \"assert generate_order_by(['id'], ['DESC']) == 'O... | {
"split": "train",
"index": 84761,
"acecode_id": "bigcode_python_fns_31911",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks whether all integers in a given list are strictly less than a specified threshold. The function should return True if all integers meet this condition, and False otherwise. For example, if the input list is [3, 5, 7] and the threshold is 10, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_threshold([1, 2, 3], 4) == True\", \"assert below_threshold([1, 2, 4, 10], 100) == True\", \"assert below_threshold([1, 5, 3], 5) == False\", \"assert below_threshold([10, 20], 30) == True\", \"assert below_threshold([5, 10, 15], 5) == False\", \"asser... | {
"split": "train",
"index": 84762,
"acecode_id": "evol_5973",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the dimensions of a cuboid represented by its length, width, and height, implement a function `cuboid_properties(length: int, width: int, height: int) -> Tuple[float, float]`, that returns a tuple containing the volume and surface area of the cuboid. The volume is calcula... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cuboid_properties(1, 1, 1) == (1.0, 6.0)\", \"assert cuboid_properties(2, 3, 4) == (24.0, 52.0)\", \"assert cuboid_properties(5, 5, 5) == (125.0, 150.0)\", \"assert cuboid_properties(0, 5, 10) == (0.0, 100.0)\", \"assert cuboid_properties(3, 4, 5) == (60.0, ... | {
"split": "train",
"index": 84763,
"acecode_id": "evol_26871",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Create a function `host_new_project` that takes in a dictionary of parameters for a new project and returns a string describing the project setup. The function should concatenate the parameters provided in the dictionary into a formatted string. The parameters will include keys... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert host_new_project({'name': 'MyApp', 'language': 'Python', 'framework': 'Flask', 'version': '1.0'}) == 'Hosting a new project: MyApp using Python with Flask version 1.0'\", \"assert host_new_project({'name': 'WebService', 'language': 'JavaScript', 'framework':... | {
"split": "train",
"index": 84764,
"acecode_id": "bigcode_python_fns_37045",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that constructs a multipart/form-data request body from a list of body parts and a boundary string. The function should take a list of dictionaries, where each dictionary represents a part of the request body and contains the followin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_body([{'name': 'file', 'type': 'form-data', 'filename': 'example.txt', 'content_type': 'text/plain', 'data': 'Hello World'}], '----Boundary') == '----Boundary\\\\r\\\\nContent-Disposition: form-data; name=\\\"file\\\"; filename=\\\"example.txt\\\"\\\\r... | {
"split": "train",
"index": 84765,
"acecode_id": "oss_15196",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a list of user credentials. Each credential consists of a username and a password. Your goal is to implement a function that can handle the following operations: saving a new credential and deleting an existing credential. The function should take a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_credentials(['save user1 pass1', 'save user2 pass2']) == [('user1', 'pass1'), ('user2', 'pass2')]\", \"assert manage_credentials(['save user1 pass1', 'delete user1']) == []\", \"assert manage_credentials(['save user1 pass1', 'save user2 pass2', 'delet... | {
"split": "train",
"index": 84766,
"acecode_id": "oss_30283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `write_to_file(filename: str, data: str) -> None` that writes the given data to a file specified by the filename. The function should handle any runtime errors that may occur during the file operation. Specifically, it should implement exception handling fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert write_to_file('valid_file.txt', 'Hello World') is None\", \"assert write_to_file('non_existent_directory/file.txt', 'Hello') is None\", \"assert write_to_file('/protected_file.txt', 'Hello') is None\", \"assert write_to_file('valid_file.txt', '') is None\", ... | {
"split": "train",
"index": 84767,
"acecode_id": "evol_21648",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `product_of_primes(from_num: int, to_num: int) -> int` that takes two integers, `from_num` and `to_num`, and returns the product of all distinct prime numbers that fall within the inclusive range from `from_num` to `to_num`. If there are no prime numbers in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_primes(1, 10) == 210\", \"assert product_of_primes(0, 10) == 210\", \"assert product_of_primes(15, 15) == 1\", \"assert product_of_primes(99, 100) == 1\", \"assert product_of_primes(25, 25) == 1\", \"assert product_of_primes(2, 2) == 2\", \"assert... | {
"split": "train",
"index": 84768,
"acecode_id": "evol_23887",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of user objects, where each user has a unique user ID and a password. Your task is to create a function that updates the passwords of users in the list based on a given user ID and a new password. If the user with the specified ID does not exist in the list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_user_password([{'id': 1, 'password': 'oldpass'}], 1, 'newpass') == 'newpass'\", \"assert update_user_password([{'id': 1, 'password': 'oldpass'}], 2, 'newpass') == 'User not found'\", \"assert update_user_password([{'id': 1, 'password': 'pass1'}, {'id'... | {
"split": "train",
"index": 84769,
"acecode_id": "bigcode_python_fns_10176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining if a string contains properly matching parentheses. A string is considered well-formed if every opening parenthesis '(' has a corresponding closing parenthesis ')', and they are correctly nested. Write a function `is_valid_parentheses(s: str) -> ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_parentheses('()') == 1\", \"assert is_valid_parentheses('(())') == 1\", \"assert is_valid_parentheses('(()())') == 1\", \"assert is_valid_parentheses(')(') == 0\", \"assert is_valid_parentheses('(()') == 0\", \"assert is_valid_parentheses('())(') ==... | {
"split": "train",
"index": 84770,
"acecode_id": "bigcode_python_fns_27096",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves journal records for a specific device based on its type and title. The function should first check if the device exists using its type and title. If the device does not exist, it should return an error message indicatin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_journal_records([{'id': 1, 'type_id': 1, 'title': 'Device A'}, {'id': 2, 'type_id': 1, 'title': 'Device B'}], 'Device A', 'key1', '2023-01-01', '2023-01-31', 0, 10) == [{'device_id': 1, 'key': 'key1', 'timestamp': '2023-01-10'}, {'device_id': 1, 'ke... | {
"split": "train",
"index": 84771,
"acecode_id": "oss_14568",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that searches for a given value in a sorted array using binary search. The function should return the index of the value if it is found in the array, or -1 if it is not found. The input array will always be sorted in ascending order.\nPlease reason step by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5, 6, 7], 5) == 4\", \"assert binary_search([1, 2, 3, 4, 5, 6, 7], 1) == 0\", \"assert binary_search([1, 2, 3, 4, 5, 6, 7], 7) == 6\", \"assert binary_search([1, 2, 3, 4, 5, 6, 7], 4) == 3\", \"assert binary_search([1, 2, 3, 4, 5, ... | {
"split": "train",
"index": 84772,
"acecode_id": "evol_19804",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a list of tasks represented as strings and an optional dictionary of options. The function should simulate starting an application in GUI mode by logging the message 'Showing GUI' and ensuring that the task list is included ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert show_gui(['Task 1', 'Task 2'], {}) == {'taskList': ['Task 1', 'Task 2']}\", \"assert show_gui(['Task A'], {'option1': 'value1'}) == {'option1': 'value1', 'taskList': ['Task A']}\", \"assert show_gui([], {'key': 'value'}) == {'key': 'value', 'taskList': []}\"... | {
"split": "train",
"index": 84773,
"acecode_id": "bigcode_python_fns_47411",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of six-tuples, where each tuple contains six elements, implement a function `unzip6(xs)` that separates these tuples into six lists. Each list should correspond to the respective element of the tuples, such that the first list contains all the first elements of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unzip6([(1, 2, 3, 4, 5, 6)]) == ([1], [2], [3], [4], [5], [6])\", \"assert unzip6([(1, 2, 3, 4, 5, 6), (7, 8, 9, 10, 11, 12)]) == ([1, 7], [2, 8], [3, 9], [4, 10], [5, 11], [6, 12])\", \"assert unzip6([(0, 0, 0, 0, 0, 0)]) == ([0], [0], [0], [0], [0], [0])\"... | {
"split": "train",
"index": 84774,
"acecode_id": "bigcode_python_fns_35136",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `string_array_operations` that takes a list of strings and performs a series of operations on it. The operations are specified as a list of tuples, where each tuple contains an operation type and the necessary parameters. The function should support the fol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_array_operations(['apple', 'banana', 'cherry'], [('search', 'banana'), ('insert', 1, 'orange'), ('search', 'orange'), ('delete', 0), ('search', 'apple')]) == [True, True, False]\", \"assert string_array_operations(['x', 'y', 'z'], [('search', 'a'), ('... | {
"split": "train",
"index": 84775,
"acecode_id": "evol_9748",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of image objects, where each image object contains a unique identifier (uuid) and several attributes. Your task is to implement a function that takes a list of image objects and returns a dictionary where each key is the uuid of an image and the value is an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_image_attributes([Image('img1', 'template', 'active'), Image('img2', 'template', 'inactive')]) == {'img1': {'type': 'template', 'status': 'active'}, 'img2': {'type': 'template', 'status': 'inactive'}}\", \"assert get_image_attributes([]) == {}\", \"asser... | {
"split": "train",
"index": 84776,
"acecode_id": "bigcode_python_fns_39412",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a task to perform three specific mathematical operations: calculate the cosine of π, the sine of π, and the factorial of 2. Write a function `calculate_math_operations()` that returns these three values as a dictionary with the keys 'cosine', 'sine', and 'factoria... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_math_operations()['cosine'] == -1.0\", \"assert calculate_math_operations()['factorial'] == 2\", \"assert type(calculate_math_operations()) == dict\", \"assert 'cosine' in calculate_math_operations()\", \"assert 'sine' in calculate_math_operations(... | {
"split": "train",
"index": 84777,
"acecode_id": "oss_25086",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines which logging module should be used based on the version of the Sphinx documentation generator library. The function should accept a string representing the Sphinx version and return a string indicating which logging m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_logging_module('1.5') == 'standard logging'\", \"assert determine_logging_module('1.6') == 'sphinx.util.logging'\", \"assert determine_logging_module('1.7') == 'sphinx.util.logging'\", \"assert determine_logging_module('2.0') == 'sphinx.util.loggin... | {
"split": "train",
"index": 84778,
"acecode_id": "oss_29120",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns the total count of vowels and consonants. Vowels are defined as the letters 'a', 'e', 'i', 'o', 'u' (case insensitive), and consonants are all other alphabetic characters. Non-alphabetic characters should be ignored ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vowels_and_consonants('Hello World!') == (3, 7)\", \"assert count_vowels_and_consonants('12345!@#') == (0, 0)\", \"assert count_vowels_and_consonants('') == (0, 0)\", \"assert count_vowels_and_consonants('A E I O U') == (5, 0)\", \"assert count_vowels_... | {
"split": "train",
"index": 84779,
"acecode_id": "evol_26975",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Design a function that processes a provided nested list, where each inner list consists of string elements. The function should perform the following operations: (1) Remove any duplicate string elements within each inner list, (2) Sort each inner list in ascending lexicographic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_nested_list([['hello', 'world', 'hello'], ['level', 'test']]) == [['hello', 'world'], ['PALINDROME', 'test']]\", \"assert process_nested_list([['Python', 'java', 'C++', 'java']]) == [['C++', 'Python', 'java']]\", \"assert process_nested_list([['123',... | {
"split": "train",
"index": 84780,
"acecode_id": "evol_27191",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates the Cartesian product of multiple input sequences. The Cartesian product of two sets A and B is defined as the set of all possible ordered pairs (a, b) where a is in A and b is in B. For example, the Cartesian product o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cartesian_product(['a', 'b'], ['c', 'd']) == [('a', 'c'), ('a', 'd'), ('b', 'c'), ('b', 'd')]\", \"assert cartesian_product([1, 2], [3, 4]) == [(1, 3), (1, 4), (2, 3), (2, 4)]\", \"assert cartesian_product(['x', 'y'], [1, 2]) == [('x', 1), ('x', 2), ('y', 1)... | {
"split": "train",
"index": 84781,
"acecode_id": "oss_5232",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to generate a photo collage URL based on two landmarks. The function should take the names of the two landmarks as input and return a URL string that represents the generated collage image. The URL should be in the format 'https://example... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generateCollage('Eiffel Tower', 'Louvre Museum') == 'https://example.com/collage?landmark1=Eiffel Tower&landmark2=Louvre Museum'\", \"assert generateCollage('Statue of Liberty', 'Times Square') == 'https://example.com/collage?landmark1=Statue of Liberty&land... | {
"split": "train",
"index": 84782,
"acecode_id": "oss_4410",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given Alembic migration script and extracts the table constraints that are being dropped during the upgrade process. Your function should be defined as `extract_dropped_constraints(migration_script: str) -> List[Tu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_dropped_constraints(\\\"revision = '<KEY>'\\\\ndown_revision = '<KEY>'\\\\n\\\\ndef upgrade():\\\\n op.drop_constraint('constraint_name', 'table_name', type_='foreignkey')\\\\n op.drop_constraint('constraint_name_2', 'table_name_2', type_='uniq... | {
"split": "train",
"index": 84783,
"acecode_id": "oss_15382",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a configuration dictionary that contains database credentials, write a function that validates whether the credentials are complete and formatted correctly. The configuration dictionary will contain the following keys: 'username', 'password', 'host', and 'database'. Each ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_credentials({'username': 'user', 'password': 'pass', 'host': 'localhost', 'database': 'test_db'}) == True\", \"assert validate_credentials({'username': '', 'password': 'pass', 'host': 'localhost', 'database': 'test_db'}) == False\", \"assert validat... | {
"split": "train",
"index": 84784,
"acecode_id": "bigcode_python_fns_24896",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of integers representing pixel brightness values in a grayscale image and a brightness threshold. Your task is to create a function that finds the coordinates of the pixels which have brightness values greater than or equal to the specified threshold. Yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_bright_pixels([[0, 0, 0], [0, 255, 0], [0, 0, 0]], 255) == [(1, 1)]\", \"assert find_bright_pixels([[128, 130, 135], [140, 145, 150], [100, 90, 80]], 130) == [(0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]\", \"assert find_bright_pixels([[0, 0, 0], [0, 0, 0], ... | {
"split": "train",
"index": 84785,
"acecode_id": "bigcode_python_fns_18811",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing prefixes. Your task is to write a function that retrieves all unique prefixes from the list. A prefix is defined as a substring that appears at the start of a string in the list. For example, if the input list is ['apple', 'app', 'ap... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_prefixes(['elephant', 'eagle', 'eel']) == {'e', 'el', 'ele', 'elep', 'eleph', 'elepha', 'elephan', 'elephant', 'ea', 'eag', 'eagl', 'eagle', 'ee', 'eel'}\", \"assert get_unique_prefixes(['frog', 'frost', 'fruit']) == {'f', 'fr', 'fro', 'frog', 'fr... | {
"split": "train",
"index": 84786,
"acecode_id": "bigcode_python_fns_13238",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the movement of a particle in a 2D space based on a set of velocity vectors. Write a function `update_position` that takes the current position of the particle as a tuple (x, y) and a velocity vector as a tuple (vx, vy). The function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_position((0, 0), (1, 1)) == (1, 1)\", \"assert update_position((1, 1), (2, 3)) == (3, 4)\", \"assert update_position((2, 3), (-1, 1)) == (1, 4)\", \"assert update_position((5, 5), (0, 0)) == (5, 5)\", \"assert update_position((0, 0), (0.5, 0.5)) == (0... | {
"split": "train",
"index": 84787,
"acecode_id": "oss_7821",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given string to extract a specific job template ID. Write a function `extract_job_template_id` that takes a string as input and returns the job template ID extracted from the input string. The input string will be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_job_template_id('projects/123/locations/us-central1/jobTemplates/template-1') == 'template-1'\", \"assert extract_job_template_id('projects/456/locations/europe-west1/jobTemplates/template-2') == 'template-2'\", \"assert extract_job_template_id('proj... | {
"split": "train",
"index": 84788,
"acecode_id": "oss_2788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `create_quaternion` that takes four parameters `a`, `b`, `c`, and `d`, representing the components of a quaternion. The function should return a string representation of the quaternion in the format 'a + bi + cj + dk'.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_quaternion(1, 2, 3, 4) == '1 + 2i + 3j + 4k'\", \"assert create_quaternion(0, 0, 0, 0) == '0 + 0i + 0j + 0k'\", \"assert create_quaternion(-1, -2, -3, -4) == '-1 + -2i + -3j + -4k'\", \"assert create_quaternion(3, 5, 7, 9) == '3 + 5i + 7j + 9k'\", \"a... | {
"split": "train",
"index": 84789,
"acecode_id": "evol_22832",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that filters a predefined list of chess games based on certain criteria. The function should take in the type of chess game (e.g., bullet, rapid, blitz), the game rating (rated or unrated), and the chess variant (standard chess or ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_chess_games('bullet', 'rated', 'standard') == [{'type': 'bullet', 'rating': 'rated', 'variant': 'standard'}]\", \"assert filter_chess_games('rapid', 'unrated', 'chess960') == [{'type': 'rapid', 'rating': 'unrated', 'variant': 'chess960'}]\", \"assert ... | {
"split": "train",
"index": 84790,
"acecode_id": "oss_32766",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers 'nums' and an integer 'n'. The function should return a new list that contains the cubes of all the elements in 'nums' that are greater than 'n'. If no such elements exist, return an empty list.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_cubes([1, 2, 3, 4, 5], 3) == [64, 125]\", \"assert find_cubes([5, 6, 7], 7) == []\", \"assert find_cubes([0, -1, -2, 3, 4], 0) == [27, 64]\", \"assert find_cubes([10, 11, 12], 10) == [1331, 1728]\", \"assert find_cubes([8, 9, 10], 11) == []\", \"assert ... | {
"split": "train",
"index": 84791,
"acecode_id": "evol_20854",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates setting the color of a single LED in a pixel controller. The function should accept two parameters: an integer `led_index` representing the index of the LED (0-indexed) and a string `color` representing the color in hex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_led_color(0, 'FF0000') == 'Color set for LED at index 0'\", \"assert set_led_color(1, '00FF00') == 'Color set for LED at index 1'\", \"assert set_led_color(2, '0000FF') == 'Color set for LED at index 2'\", \"assert set_led_color(3, 'FFFF00') == 'Color se... | {
"split": "train",
"index": 84792,
"acecode_id": "oss_10694",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts specific information from a dictionary and modifies it accordingly. The function should take a dictionary as input, which contains information about a software package. The keys in the dictionary represent different a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_package_info({'name': 'example', 'version': '1.0', 'author': 'John Doe'}) == {'name': 'example', 'version': '1.0', 'author': 'John Doe', 'package_id': 'example_1.0'}\", \"assert process_package_info({'name': 'test', 'version': '2.5', 'author': 'Jane ... | {
"split": "train",
"index": 84793,
"acecode_id": "oss_26916",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `check_index(index)` that raises an `IndexError` when the provided index is greater than the highest valid index of the list. The list is defined as `arr = [1, 2, 3]`. If the index is valid, the function should return `True`.\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_index(0) == True\", \"assert check_index(1) == True\", \"assert check_index(2) == True\", \"assert check_index(2) == True\", \"assert check_index(0) == True\", \"assert check_index(1) == True\", \"assert check_index(2) == True\", \"assert check_index(0... | {
"split": "train",
"index": 84794,
"acecode_id": "evol_17344",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `show_service_group(status: str, node_name: str) -> str` that takes in two parameters: a status string and a node name string. The function should return a formatted string that combines the state of the service group and the hostname... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert show_service_group('running', 'node1') == 'active-running'\", \"assert show_service_group('stopped', 'node2') == 'active-stopped'\", \"assert show_service_group('degraded', 'node3') == 'active-degraded'\", \"assert show_service_group('unknown', 'node4') == '... | {
"split": "train",
"index": 84795,
"acecode_id": "bigcode_python_fns_17766",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of conditions where each condition is represented as a list containing three elements: a field name (string), a field value (string), and a method (string). You also need to consider a special condition for the `plan_status` which is always set to 'A' (Acti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_query([['field1', 'value1', 'method1']]) == {'filters': [{'conditions': [{'field_name': 'field1', 'value': 'value1', 'method': 'method1'}, {'field_name': 'plan_status', 'method': 'equals', 'value': 'A'}]}], 'sorts': [{'field_name': 'create_date', 't... | {
"split": "train",
"index": 84796,
"acecode_id": "bigcode_python_fns_19329",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a context for associating lights to shading groups in a 3D graphics environment. The function will accept several optional parameters to configure the context. The parameters include a flag to check if the context already... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shading_light_rel_ctx() == {'exists': False, 'history': False, 'image1': '', 'image2': '', 'image3': '', 'name': '', 'offCommand': '', 'onCommand': '', 'shadingCentric': False}\", \"assert shading_light_rel_ctx(exists=True) == {'exists': True, 'history': Fal... | {
"split": "train",
"index": 84797,
"acecode_id": "bigcode_python_fns_7408",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `ping_server()` that simulates a server's health check. The function should return a dictionary with a single key 'status' which always has the value 200, indicating that the server is healthy. The expected output format is {'status': 200}.\nPlease reason s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ping_server() == {'status': 200}\", \"assert ping_server() == {'status': 200}\", \"assert ping_server() == {'status': 200}\", \"assert ping_server() == {'status': 200}\", \"assert ping_server() == {'status': 200}\", \"assert ping_server() == {'status': 200}\... | {
"split": "train",
"index": 84798,
"acecode_id": "bigcode_python_fns_36241",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples, where each tuple contains two integers (x, y), write a function `count_points_within_radius(points: List[Tuple[int, int]], radius: int) -> int` that returns the number of points that lie within or on the boundary of a circle centered at the origin (0, 0)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_points_within_radius([(1, 1), (2, 2), (3, 3)], 2) == 1\", \"assert count_points_within_radius([(0, 0), (3, 4), (5, 5)], 5) == 2\", \"assert count_points_within_radius([(0, 0)], 1) == 1\", \"assert count_points_within_radius([(-1, -1), (-2, -2), (-3, -3... | {
"split": "train",
"index": 84799,
"acecode_id": "bigcode_python_fns_22260",
"num_tests": 11
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.