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": "Write a function `triple_list_elements(lst)` that takes a list of integers `lst` and returns a new list where each element in `lst` is multiplied by 3.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert triple_list_elements([1, 2, 3]) == [3, 6, 9]\", \"assert triple_list_elements([-1, -2, -3]) == [-3, -6, -9]\", \"assert triple_list_elements([0]) == [0]\", \"assert triple_list_elements([4, 5, 6]) == [12, 15, 18]\", \"assert triple_list_elements([10, 20, 30]... | {
"split": "train",
"index": 4600,
"acecode_id": "evol_5756",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of logical clauses represented as strings. Each clause may contain logical operators such as 'AND' and 'OR'. Your function should check for the presence of conflicting logical operators within each clause. If a c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_clauses(['A AND B', 'C OR D']) is None\", \"assert process_clauses(['A AND B', 'C AND D']) is None\", \"assert process_clauses(['A OR B', 'C OR D']) is None\", \"assert process_clauses(['X AND Y', 'Z OR W']) is None\", \"assert process_clauses(['A OR... | {
"split": "train",
"index": 4601,
"acecode_id": "oss_30189",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of floating-point numbers, you need to implement a function `rank_data(data)` that returns a list of integers representing the ranks of the elements in the input list. The ranks should be assigned based on the following rules: 1) Elements should be ranked in increa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rank_data([0.5, 1.2, 3.4, 1.2, 1.2]) == [1, 2, 5, 2, 2]\", \"assert rank_data([3.4, 2.2, 1.1, 2.2]) == [4, 2, 1, 2]\", \"assert rank_data([1.0, 1.0, 1.0, 1.0]) == [1, 1, 1, 1]\", \"assert rank_data([1.5, 2.5, 3.5, 2.5]) == [1, 2, 4, 2]\", \"assert rank_data(... | {
"split": "train",
"index": 4602,
"acecode_id": "bigcode_python_fns_25983",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `custom_concatenate` that takes a list of strings and concatenates them in a specific manner. The function should interleave characters from the strings, starting from the last string in the list and moving to the first, while also reversing the order of ch... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_concatenate([]) == ''\", \"assert custom_concatenate(['a', 'b', 'c']) == 'cba'\", \"assert custom_concatenate(['a', 'b', 'c', 'd', 'e']) == 'edcba'\", \"assert custom_concatenate(['single']) == 'elgnis'\", \"assert custom_concatenate(['x', 'y', 'z']) ... | {
"split": "train",
"index": 4603,
"acecode_id": "evol_6125",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that identifies prime numbers from a given list of integers, including negative numbers and zero. The function should handle exceptions for inputs that are not integers. The output should be a tuple: the first component being a sorted list of prime numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_prime_numbers([2, 3, 5, 7]) == ([2, 3, 5, 7], 210)\", \"assert find_prime_numbers([-1, 0, 1, 4, 6]) == ([], 1)\", \"assert find_prime_numbers([10, 12, 14]) == ([], 1)\", \"assert find_prime_numbers([11, 13, 17]) == ([11, 13, 17], 2431)\", \"assert find_... | {
"split": "train",
"index": 4604,
"acecode_id": "evol_3201",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to calculate the cross section for the semihadronic, semileptonic process $pp \\to t\\overline{t} \\; Z', Z' \\to b\\overline{b}$ at different masses of the hypothetical particle $Z'$. Write a function `calculate_cross_section(mass... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_cross_section(100) == 10.0\", \"assert calculate_cross_section(200) == 20.0\", \"assert calculate_cross_section(300) == 30.0\", \"assert calculate_cross_section(400) == 40.0\", \"assert calculate_cross_section(500) == 50.0\", \"assert calculate_cro... | {
"split": "train",
"index": 4605,
"acecode_id": "oss_1669",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary that may contain a list of wildcard strings in the format 'key=value'. Your task is to write a function that extracts these wildcard strings and returns them as a dictionary where each key is the part before the '=' and each value is the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_wildcard_values({'wildcards': ['a=1', 'b=2', 'c=3']}) == {'a': '1', 'b': '2', 'c': '3'}\", \"assert get_wildcard_values({'wildcards': ['x=10', 'y=20']}) == {'x': '10', 'y': '20'}\", \"assert get_wildcard_values({'wildcards': []}) == {}\", \"assert get_wi... | {
"split": "train",
"index": 4606,
"acecode_id": "bigcode_python_fns_1369",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a weighted undirected graph represented as an adjacency matrix, transform it into its corresponding adjacency list representation. The graph may contain negative weights. Implement a function `adjacency_matrix_to_list(matrix)` that takes in a 2D list `matrix` representing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjacency_matrix_to_list([[0, 1, -3, 0], [1, 0, 2, -1], [-3, 2, 0, 1], [0, -1, 1, 0]]) == {'0': {'1': 1, '2': -3}, '1': {'0': 1, '2': 2, '3': -1}, '2': {'0': -3, '1': 2, '3': 1}, '3': {'1': -1, '2': 1}}\", \"assert adjacency_matrix_to_list([[0]]) == {'0': {}... | {
"split": "train",
"index": 4607,
"acecode_id": "evol_22318",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a graph represented as an adjacency list, where each vertex is identified by a unique integer ID. You need to implement a function `perform_operation(graph: Dict[int, List[int]], identifier: str, input_vertex_id: int, data: List[str]) -> Dict[int, List[int]]` that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perform_operation({1: [2]}, 'f', 1, ['3', '4']) == {1: [3, 4]}\", \"assert perform_operation({1: [2, 3]}, 'i', 1, []) == {2: [2, 3]}\", \"assert perform_operation({2: [1]}, 'f', 2, ['0']) == {2: [0]}\", \"assert perform_operation({1: [2]}, 'f', 1, ['5']) == ... | {
"split": "train",
"index": 4608,
"acecode_id": "oss_13219",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string of text and a numerical figure as input parameters. The function should return a new string where each individual word in the original text is repeated according to the given numerical figure. For example, if the input text is 'Hello World' ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert duplicate_words('Hello World', 2) == 'HelloHello WorldWorld'\", \"assert duplicate_words('Python is fun', 1) == 'Python is fun'\", \"assert duplicate_words('LeetCode', 3) == 'LeetCodeLeetCodeLeetCode'\", \"assert duplicate_words('', 5) == ''\", \"assert dupl... | {
"split": "train",
"index": 4609,
"acecode_id": "evol_21741",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple login authentication function. The function should accept two parameters: `username` and `password`. It should authenticate the user based on a predefined set of valid usernames and passwords. If the username and password match a valid ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert login_auth('user1', 'pass1') == {'success': True, 'message': 'Login successful'}\", \"assert login_auth('user2', 'pass2') == {'success': True, 'message': 'Login successful'}\", \"assert login_auth('', 'pass1') == {'success': False, 'message': 'Both username ... | {
"split": "train",
"index": 4610,
"acecode_id": "oss_773",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns a list of all prime numbers within the Fibonacci sequence up to a specified number p. For example, if p is 20, the function should identify all prime numbers in the Fibonacci sequence that are less than or equal to 20.\nPlease reason step by st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibo_primes(20) == [2, 3, 5, 13]\", \"assert fibo_primes(10) == [2, 3, 5]\", \"assert fibo_primes(1) == []\", \"assert fibo_primes(0) == []\", \"assert fibo_primes(21) == [2, 3, 5, 13]\", \"assert fibo_primes(8) == [2, 3, 5]\", \"assert fibo_primes(15) == [2... | {
"split": "train",
"index": 4611,
"acecode_id": "evol_19655",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `handle_error` that takes an error code as input and handles specific error scenarios. The function should accept an integer representing the error code and return a corresponding string message based on the following rules: \n\n- If the e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_error(1) == 'Connection Lost'\", \"assert handle_error(2) == 'Packets Buffer Full'\", \"assert handle_error(3) == 'Content Too Long'\", \"assert handle_error(4) == 'System Exit'\", \"assert handle_error(5) == 'Unknown Error'\", \"assert handle_error(0... | {
"split": "train",
"index": 4612,
"acecode_id": "bigcode_python_fns_47058",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two integers, `a` and `b`, and a string representing a mathematical operation. Your task is to implement a function `perform_operation(a: int, b: int, operation: str) -> Union[int, float, str]` that performs the specified operation on `a` and `b`. The supported op... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perform_operation(5, 3, 'add') == 8\", \"assert perform_operation(5, 3, 'subtract') == 2\", \"assert perform_operation(5, 3, 'multiply') == 15\", \"assert perform_operation(5, 3, 'divide') == 1.6666666666666667\", \"assert perform_operation(5, 0, 'divide') =... | {
"split": "train",
"index": 4613,
"acecode_id": "oss_191",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have `n` bulbs that are initially off. You first turn on all the bulbs, then you turn off every second bulb. On the third round, you toggle every third bulb. For the `ith` round, you toggle every `i` bulb. For the `nth` round, you only toggle the last bulb. Additionally, fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bulbSwitch(0) == 0\", \"assert bulbSwitch(1) == 1\", \"assert bulbSwitch(2) == 1\", \"assert bulbSwitch(4) == 2\", \"assert bulbSwitch(9) == 3\"]}"
} | {
"split": "train",
"index": 4614,
"acecode_id": "evol_17331",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `month_summary(year: int, month: int) -> Tuple[int, int, int, List[int]]` that takes a year and a month as input and returns a tuple containing the total number of days in that month, the number of weekdays, the number of weekends, and a list of all the dat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert month_summary(2023, 2) == (28, 20, 8, [7, 14, 21, 28])\", \"assert month_summary(2023, 4) == (30, 20, 10, [4, 11, 18, 25])\", \"assert month_summary(2023, 5) == (31, 23, 8, [2, 9, 16, 23, 30])\", \"assert month_summary(2023, 8) == (31, 23, 8, [1, 8, 15, 22, ... | {
"split": "train",
"index": 4615,
"acecode_id": "evol_1519",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a nested data structure consisting of dictionaries and lists, write a function `concatenate_attributes(data: Union[dict, list]) -> dict` that flattens this structure. The function should concatenate the keys of dictionaries and the indices of lists to create a single-leve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate_attributes({'a': [1, 2], 'b': {'c': 3}}) == {'a_0': 1, 'a_1': 2, 'b_c': 3}\", \"assert concatenate_attributes([]) == {}\", \"assert concatenate_attributes({'x': {'y': {'z': 1}}}) == {'x_y_z': 1}\", \"assert concatenate_attributes({'key': [10, 20,... | {
"split": "train",
"index": 4616,
"acecode_id": "bigcode_python_fns_38748",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `replace_last_three_fruits(words: List[str], new_fruit: str) -> List[str]` that replaces the last three elements of a given list of fruit names with a specified new fruit. If the list contains fewer than three elements, return the original list unchanged.\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_last_three_fruits(['apple', 'banana', 'cherry', 'dates', 'elderberry'], 'kiwi') == ['apple', 'banana', 'kiwi', 'kiwi', 'kiwi']\", \"assert replace_last_three_fruits(['apple', 'banana'], 'kiwi') == ['apple', 'banana']\", \"assert replace_last_three_fr... | {
"split": "train",
"index": 4617,
"acecode_id": "evol_26038",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function named `partition_list` that partitions the list into two distinct parts based on the median of the list. The first part should contain all the elements less than or equal to the median, while the second part... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert partition_list([1, 3, 2]) == ([1, 2], [3])\", \"assert partition_list([10, 20, 30, 40]) == ([10, 20], [30, 40])\", \"assert partition_list([2, 2, 2, 2]) == ([2, 2, 2, 2], [])\", \"assert partition_list([1]) == ([1], [])\", \"assert partition_list([1, 1, 1]) ... | {
"split": "train",
"index": 4618,
"acecode_id": "oss_26153",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to test the functionality of a cache system. The function `test_cache` takes in four parameters: `src_data`, `content_type`, `checkout_bucket`, and `replica`. Your goal is to simulate the process of uploading `src_data` to a cache sto... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert test_cache('sample_data', 'application/json', 'my_bucket', 'aws') == 'Upload successful'\", \"assert test_cache('sample_data', 'text/plain', None, 'gcp') == 'Upload successful'\", \"assert test_cache('test_data_1', 'image/png', 'bucket_1', 'aws') == 'Upload ... | {
"split": "train",
"index": 4619,
"acecode_id": "oss_33702",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of products, where each product is represented by a list containing two elements: the product ID (a string) and the revenue generated by that product (a float). Your task is to implement a function that calculates the total revenue generated by all products... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_total_revenue([['p1', 100.0], ['p2', 200.5]]) == 300.5\", \"assert get_total_revenue([['p1', 50.0], ['p2', 150.0], ['p3', 200.0]]) == 400.0\", \"assert get_total_revenue([['p1', 0.0], ['p2', 0.0]]) == 0.0\", \"assert get_total_revenue([['p1', -50.0], ['p... | {
"split": "train",
"index": 4620,
"acecode_id": "bigcode_python_fns_40751",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a code snippet where each line follows the format: `<line_number> <action_type> <action_name> <action_details>`. Your task is to write a function `parse_code_snippet(code_snippet: str) -> List[Tuple[int, str, str, str]]` that takes this code ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_code_snippet('1 Var variables.assign a') == [(1, 'Var', 'variables.assign', 'a')]\", \"assert parse_code_snippet('2 Expression expression.create b') == [(2, 'Expression', 'expression.create', 'b')]\", \"assert parse_code_snippet('3 Var variables.assign... | {
"split": "train",
"index": 4621,
"acecode_id": "oss_31146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `subtract_five(nums)` that subtracts 5 from each integer in the list and returns a new list containing the results. The function should be able to handle any list of integers provided as input.\nPlease reason step by step, then wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subtract_five([17, 22, 30, 45, 52]) == [12, 17, 25, 40, 47]\", \"assert subtract_five([5, 10, 15]) == [0, 5, 10]\", \"assert subtract_five([-1, -5, -10]) == [-6, -10, -15]\", \"assert subtract_five([0]) == [-5]\", \"assert subtract_five([5]) == [0]\", \"asse... | {
"split": "train",
"index": 4622,
"acecode_id": "evol_33981",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string of text. Your task is to implement a function that calculates the frequency of each word in the text and returns a dictionary containing each word as the key and its frequency as the value. In addition, you should implement a function that identifies the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_text('This is a test text. This text is just a test.', 2, 'test') == ({'this': 2, 'is': 2, 'a': 2, 'test': 2, 'text': 2, 'just': 1}, ['this', 'is'], 2)\", \"assert analyze_text('Hello world! Hello everyone.', 1, 'world') == ({'hello': 2, 'world': 1, ... | {
"split": "train",
"index": 4623,
"acecode_id": "oss_23384",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing metadata of a data product, which contains the keys 'data_product_name' and 'sensingStart'. Your task is to implement a function that takes in this metadata dictionary and a version string, then returns a new dictionary with the following... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_dataset_json({'data_product_name': 'Product A', 'sensingStart': '2023-01-01T00:00:00Z'}, 'v1.0') == {'version': 'v1.0', 'label': 'Product A', 'starttime': '2023-01-01T00:00:00Z'}\", \"assert get_dataset_json({'data_product_name': 'Product B', 'sensingSta... | {
"split": "train",
"index": 4624,
"acecode_id": "bigcode_python_fns_37197",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of temperature readings from multiple DS18X20 sensors. Each sensor has a unique identification code (ROM code) associated with it. Your task is to implement a function `average_temperature(readings: List[Tuple[str, float]]) -> Dict[str, float]` that calcula... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_temperature([('28-000007600a1', 22.5), ('28-000007600a1', 23.0), ('28-000007600b2', 21.0)]) == {'28-000007600a1': 22.75, '28-000007600b2': 21.0}\", \"assert average_temperature([('28-000007600a1', 30.0), ('28-000007600a1', 32.0), ('28-000007600a1', 3... | {
"split": "train",
"index": 4625,
"acecode_id": "oss_35286",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with monitoring the status of a specific virtual machine (VM) based on its name. The function `monitor_vm_status(vm_name: str, running_vms: list)` takes two parameters: a string `vm_name` representing the name of the virtual machine, and a list `running_vms` cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert monitor_vm_status('vm1', ['vm1', 'vm2', 'vm3']) == True\", \"assert monitor_vm_status('vm2', ['vm1', 'vm3']) == False\", \"assert monitor_vm_status('vm1', ['vm1']) == True\", \"assert monitor_vm_status('vm4', ['vm1', 'vm2', 'vm3']) == False\", \"assert monit... | {
"split": "train",
"index": 4626,
"acecode_id": "bigcode_python_fns_41349",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list representing a matrix of integers, write a function `transpose_matrix(matrix)` that returns the transpose of the given matrix. The transpose of a matrix is obtained by swapping the rows and columns of the matrix. Your function should handle non-square matrices a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transpose_matrix([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]\", \"assert transpose_matrix([[1]]) == [[1]]\", \"assert transpose_matrix([[1, 2], [3, 4], [5, 6]]) == [[1, 3, 5], [2, 4, 6]]\", \"assert transpose_matrix([[1, 2, 3]]) == [[1], [2], [3]]\",... | {
"split": "train",
"index": 4627,
"acecode_id": "oss_10900",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of floating-point numbers representing uncertainty scores of instances in a dataset. Your task is to implement a function that selects the indices of the top 'n' least certain instances (those with the highest uncertainty scores) from the list and returns a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_least_certain_instances([0.1, 0.4, 0.3, 0.2], 2) == ([0, 3], [0.1, 0.2])\", \"assert select_least_certain_instances([0.5, 0.7, 0.6], 1) == ([0], [0.5])\", \"assert select_least_certain_instances([0.3, 0.2, 0.1], 5) == ([2, 1, 0], [0.1, 0.2, 0.3])\", \... | {
"split": "train",
"index": 4628,
"acecode_id": "bigcode_python_fns_7900",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that calculates and returns the area of a circle given its radius as an input. If the radius is negative, return an appropriate error message. Implement the value of π on your own without using any built-in math functions. Use the formula for area where ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_circle_area(5) == 78.53975\", \"assert calculate_circle_area(0) == 0.0\", \"assert calculate_circle_area(1) == 3.14159\", \"assert calculate_circle_area(10) == 314.159\", \"assert calculate_circle_area(2.5) == 19.6349375\"]}"
} | {
"split": "train",
"index": 4629,
"acecode_id": "evol_18772",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the sum of all prime numbers within a given inclusive range. A prime number is defined as a natural number greater than 1 that has no positive divisors other than 1 and itself. The function should take two integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_primes(10, 20) == 60\", \"assert sum_of_primes(1, 10) == 17\", \"assert sum_of_primes(0, 5) == 10\", \"assert sum_of_primes(20, 20) == 0\", \"assert sum_of_primes(7, 7) == 7\", \"assert sum_of_primes(2, 2) == 2\", \"assert sum_of_primes(5, 5) == 5\", ... | {
"split": "train",
"index": 4630,
"acecode_id": "oss_4171",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n)` that generates the Fibonacci sequence up to the nth term. The function should take a single integer parameter `n`, which represents the number of terms to include in the Fibonacci sequence. If `n` is not a positive integer, the function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1... | {
"split": "train",
"index": 4631,
"acecode_id": "evol_23169",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file hashes represented as strings. Your task is to validate these hashes and return a list of valid hashes along with their types. The file hash can be of type SHA-256, SHA-1, or MD5. If a hash is invalid (not one of these types), it should not be inclu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_file_hashes(['d41d8cd98f00b204e9800998ecf8427e', '5d41402abc4b2a76b9719d911017c592', 'invalidhash123']) == [{'hash': 'd41d8cd98f00b204e9800998ecf8427e', 'type': 'md5'}, {'hash': '5d41402abc4b2a76b9719d911017c592', 'type': 'md5'}]\", \"assert validat... | {
"split": "train",
"index": 4632,
"acecode_id": "bigcode_python_fns_3374",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of particles represented as a list of dictionaries and a list of column names, write a function that removes the specified columns from the particle data and updates the metadata accordingly. The function should return a new list of particles without the specified ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delcolumn([{'a': 1, 'b': 2, 'c': 3}, {'a': 4, 'b': 5, 'c': 6}], ['b'], [['info'], ['details'], ['more'], ['a', 'b', 'c']]) == ([{'a': 1, 'c': 3}, {'a': 4, 'c': 6}], [['info'], ['details'], ['more'], ['a', 'c']])\", \"assert delcolumn([{'x': 10, 'y': 20}, {'x... | {
"split": "train",
"index": 4633,
"acecode_id": "bigcode_python_fns_35478",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `password_strength(password: str) -> bool` that takes a string `password` as input and checks if it meets the following criteria: 1) It contains at least one uppercase letter, 2) It contains at least one lowercase letter, 3) It contains at least one digit, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert password_strength('A1b!2345') == True\", \"assert password_strength('abcd1234') == False\", \"assert password_strength('Abcdefg!') == False\", \"assert password_strength('1234!@#$') == False\", \"assert password_strength('NoSpecialChar1') == False\", \"asser... | {
"split": "train",
"index": 4634,
"acecode_id": "evol_1486",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of URL patterns and returns a dictionary containing the view names and their corresponding regular expressions. The URL patterns are represented as a list of tuples, where each tuple contains a regular express... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_view_patterns([(r'^$', 'list'), (r'^create/$', 'create'), (r'^(?P<id>\\\\d+)/$', 'detail'), (r'^(?P<id>\\\\d+)/delete/$', 'delete'), (r'^(?P<id>\\\\d+)/edit/$', 'update')]) == {'list': r'^$', 'create': r'^create/$', 'detail': r'^(?P<id>\\\\d+)/$', 'd... | {
"split": "train",
"index": 4635,
"acecode_id": "oss_3999",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a node's name in a specific format. The node name can contain multiple levels separated by the '|' character, and each level can be further divided by the ':' character. Your task is to write a function that extracts the namespace from the gi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_namespace_from_node('level1|level2:namespace') == 'level2'\", \"assert get_namespace_from_node('level1|level2:') == 'level2'\", \"assert get_namespace_from_node('level1|level2') == ':'\", \"assert get_namespace_from_node('|level2:namespace') == 'level2'\... | {
"split": "train",
"index": 4636,
"acecode_id": "bigcode_python_fns_22359",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the tokens of a training instance, and a maximum sequence length. Your task is to process this list so that it meets a specific format for training. You must create a function that takes the following parameters: `tokens` (a list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_tokens([1, 2, 3], 5) == {'input_ids': [1, 2, 3, 0, 0], 'input_mask': [1, 1, 1, 0, 0], 'segment_ids': [1, 1, 1, 0, 0], 'aligned_lm_positions_a': [0, 0], 'aligned_lm_positions_b': [0, 0], 'aligned_lm_mask': [0.0, 0.0]}\", \"assert process_tokens([4, 5]... | {
"split": "train",
"index": 4637,
"acecode_id": "bigcode_python_fns_37410",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that takes two lists of equal length and returns a new list containing the elementwise multiplication of the two input lists. The function should handle lists of integers or floats. You may assume that both input lists are of the same length.\nPlease ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_arrays([1, 2, 3], [3, 4, 5]) == [3, 8, 15]\", \"assert multiply_arrays([0, 1, 2], [2, 3, 4]) == [0, 3, 8]\", \"assert multiply_arrays([-1, -2, -3], [3, 4, 5]) == [-3, -8, -15]\", \"assert multiply_arrays([1.5, 2.5, 3.5], [2, 4, 6]) == [3.0, 10.0, 21... | {
"split": "train",
"index": 4638,
"acecode_id": "evol_117",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an unsorted list of integers, which may include duplicate values, implement a function that retrieves both the highest and lowest unique numerical values within this list. The function should ignore any duplicate values. The function should return a tuple containing the h... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_high_low([]) == (None, None)\", \"assert find_high_low([10, 20, 30, 40, 50]) == (50, 10)\", \"assert find_high_low([-5, -10, -1, -3]) == (-1, -10)\", \"assert find_high_low([1, 2, 3, 4, 5, 6]) == (6, 1)\", \"assert find_high_low([1, -1, 0]) == (1, -1)\"... | {
"split": "train",
"index": 4639,
"acecode_id": "evol_19836",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Create a function that processes a given string. The function should return a list of words separated by either periods ('.') or semi-colons (';'). If neither of these characters exist in the string, return the count of upper-case alphabetic characters that are located at even ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manipulate_string('Hello. World!') == ['Hello', ' World!']\", \"assert manipulate_string('Hello;World!') == ['Hello', 'World!']\", \"assert manipulate_string('ABCDEF') == 3\", \"assert manipulate_string('A;B;C;D;E;F') == ['A', 'B', 'C', 'D', 'E', 'F']\", \"a... | {
"split": "train",
"index": 4640,
"acecode_id": "evol_25483",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that reverses the string without using any built-in functions. The function should take a single string input and return a new string that is the reverse of the input string.\nPlease reason step by step, then write a self-contained Python so... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('world') == 'dlrow'\", \"assert reverse_string('abcde') == 'edcba'\", \"assert reverse_string('') == ''\", \"assert reverse_string('a') == 'a'\", \"assert reverse_string('12345') == '54321'\", \"a... | {
"split": "train",
"index": 4641,
"acecode_id": "evol_18155",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the pixel values of a patch of a groundtruth image, implement a function that determines whether the patch is classified as foreground or background based on a predefined threshold. The function should return 1 if the sum of the pixel value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_patch([0, 0, 0, 0], 10) == 0\", \"assert classify_patch([5, 5, 5], 10) == 1\", \"assert classify_patch([3, 2, 1], 10) == 0\", \"assert classify_patch([10, 20, 30], 40) == 1\", \"assert classify_patch([0, 0, 0, 0, 0], 1) == 0\", \"assert classify_pat... | {
"split": "train",
"index": 4642,
"acecode_id": "bigcode_python_fns_2116",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that allows instructors to customize a specific setting for an instructor plugin in a web application. The function `plugin_settings` takes two parameters: `settings`, an object representing the settings for the instructor plugin, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert plugin_settings(SettingsObject(), None) == None and SettingsObject().ANALYTICS_DASHBOARD_URL is None\", \"assert plugin_settings(SettingsObject(), None) == None and SettingsObject().ANALYTICS_DASHBOARD_URL is None\", \"assert plugin_settings(SettingsObject()... | {
"split": "train",
"index": 4643,
"acecode_id": "oss_12370",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the weights of different items and a maximum weight capacity of a knapsack. Your task is to determine the maximum weight that can be achieved without exceeding the capacity of the knapsack. Write a function `max_knapsack_weight(weig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_knapsack_weight([1, 2, 3, 4, 5], 5) == 5\", \"assert max_knapsack_weight([1, 2, 3, 4, 5], 10) == 10\", \"assert max_knapsack_weight([1, 3, 4, 5], 7) == 7\", \"assert max_knapsack_weight([2, 3, 4, 5], 5) == 5\", \"assert max_knapsack_weight([4, 5, 6], 8) ... | {
"split": "train",
"index": 4644,
"acecode_id": "bigcode_python_fns_37664",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are developing a role-playing game where characters can consume various types of food to gain abilities. Each food item has specific attributes associated with it, including attack power, health points, and a type of effect. Implement a function `consume_food(food_name: str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert consume_food('food1', {'foods': {'food1': {'ability': {'attackAmount': 10, 'healthAmount': 20, 'effect': {'kind': 'strength'}}}}}) == (10, 20, 'strength')\", \"assert consume_food('food2', {'foods': {'food2': {'ability': {'healthAmount': 30, 'effect': {'kind... | {
"split": "train",
"index": 4645,
"acecode_id": "oss_21251",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `max_prime_in_array(numbers)` that returns the largest prime number in the list. If there are no prime numbers, the function should return -1.\nPlease reason step by step, then write a self-contained Python solution. Give your final pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_prime_in_array([10, 15, 3, 7, 22]) == 7\", \"assert max_prime_in_array([4, 6, 8, 10]) == -1\", \"assert max_prime_in_array([2, 3, 5, 7, 11]) == 11\", \"assert max_prime_in_array([17, 18, 19, 20]) == 19\", \"assert max_prime_in_array([-3, -5, -7]) == -1\"... | {
"split": "train",
"index": 4646,
"acecode_id": "evol_14287",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that determines if a given string is a palindrome. The function should check if the input is a string and return an error message if it is not. Additionally, it should ignore spaces, punctuation, and consider the string case-insensitively. Implement a fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('race a car') == False\", \"assert is_palindrome('') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') =... | {
"split": "train",
"index": 4647,
"acecode_id": "evol_32219",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `character_frequency(text: str) -> dict` that takes a string `text` as input and returns a dictionary containing the frequency of each alphanumeric character in the string. The keys of the dictionary should be the unique characters, and the values should be the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert character_frequency('Hello World') == {'H': 1, 'e': 1, 'l': 3, 'o': 2, 'W': 1, 'r': 1, 'd': 1}\", \"assert character_frequency('') == {}\", \"assert character_frequency('abc123abc') == {'a': 2, 'b': 2, 'c': 2, '1': 1, '2': 1, '3': 1}\", \"assert character_fr... | {
"split": "train",
"index": 4648,
"acecode_id": "evol_25225",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to manage a list of administrators and their email addresses for a web application. Your function should allow for adding new administrators, removing existing ones, and displaying the current list of administrators. The function should t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_admins([], [('add', 'John', 'john@example.com'), ('add', 'Alice', 'alice@example.com'), ('display',)]) == 'John: john@example.com\\\\nAlice: alice@example.com'\", \"assert manage_admins([('Bob', 'bob@example.com')], [('remove', 'Bob'), ('display',)]) ... | {
"split": "train",
"index": 4649,
"acecode_id": "oss_36198",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of mathematical function types represented as strings. Your task is to implement a function called `count_function_types` that takes this list as input and returns a dictionary. The dictionary should contain the counts of each unique function type in the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_function_types(['liht', 'linear', 'liht', 'piecewise_linear']) == {'liht': 2, 'piecewise_linear': 1, 'linear': 1}\", \"assert count_function_types(['piecewise_linear', 'piecewise_linear', 'linear']) == {'liht': 0, 'piecewise_linear': 2, 'linear': 1}\",... | {
"split": "train",
"index": 4650,
"acecode_id": "oss_30116",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given string is a valid email address. A valid email address must follow these rules: 1. It must contain exactly one '@' symbol. 2. The part before the '@' symbol (the local part) must only contain alphanumeric charac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_email('test@example.com') == True\", \"assert is_valid_email('user.name@domain.co') == True\", \"assert is_valid_email('user-name@domain.com') == True\", \"assert is_valid_email('user_name@domain.com') == True\", \"assert is_valid_email('user@sub.do... | {
"split": "train",
"index": 4651,
"acecode_id": "bigcode_python_fns_10440",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that serializes an `Option` object. The `Option` object has the following attributes: `uri`, `uri_prefix`, and `optionset` (which is an object with a `uri` attribute). Your function should return a dictionary containing the keys `uri`, `u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_option(Option('http://example.com/option1', 'prefix1', Optionset('http://example.com/optionset1'))) == {'uri': 'http://example.com/option1', 'uri_prefix': 'prefix1', 'optionset_uri': 'http://example.com/optionset1'}\", \"assert serialize_option(Opt... | {
"split": "train",
"index": 4652,
"acecode_id": "oss_29797",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a guest list for a party. The function should accept a list of guest names as input and return a sorted list of those names in alphabetical order. The function must stop processing names when the name 'arif' is encountered, m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_guest_list(['Alice', 'Bob', 'Charlie', 'arif', 'David']) == ['Alice', 'Bob', 'Charlie']\", \"assert manage_guest_list(['Eva', 'Frank', 'arif', 'George']) == ['Eva', 'Frank']\", \"assert manage_guest_list(['arif', 'Hannah', 'Ian']) == []\", \"assert ma... | {
"split": "train",
"index": 4653,
"acecode_id": "oss_31318",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the n-th number in the Fibonacci sequence using matrix exponentiation. The function should take a single integer parameter n and return the n-th Fibonacci number. If n is not a positive integer, the function should return an error message: '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_fibonacci(0) == 'Error: input should be a positive integer'\", \"assert calculate_fibonacci(-1) == 'Error: input should be a positive integer'\", \"assert calculate_fibonacci(2) == 1\", \"assert calculate_fibonacci(3) == 2\", \"assert calculate_fib... | {
"split": "train",
"index": 4654,
"acecode_id": "evol_2520",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing telemetry data from a satellite. The telemetry data is represented as a list of dictionaries, where each dictionary contains the following keys: 'path', 'row', 'creation_time', and 'region_id'. Your goal is to compute the following statistics from ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_telemetry([{'path': 1, 'row': 1, 'creation_time': datetime(2016, 1, 1, 0, 0), 'region_id': '91'}, {'path': 1, 'row': 1, 'creation_time': datetime(2017, 1, 1, 0, 0), 'region_id': '92'}]) == {'dataset_count': 2, 'footprint_count': 1, 'time_range': (dat... | {
"split": "train",
"index": 4655,
"acecode_id": "bigcode_python_fns_48077",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `make_palindrome` that constructs the shortest palindrome starting with the given input string. The function should follow these steps: 1. Identify the longest palindromic suffix of the input string. 2. Append the reverse of the non-palindromic prefix to th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_palindrome('') == ''\", \"assert make_palindrome('a') == 'a'\", \"assert make_palindrome('ab') == 'aba'\", \"assert make_palindrome('abc') == 'abcba'\", \"assert make_palindrome('race') == 'racecar'\", \"assert make_palindrome('madam') == 'madam'\", \"a... | {
"split": "train",
"index": 4656,
"acecode_id": "evol_20818",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `fibonacci_primes(N)` that takes an integer N as input and returns a list of all prime numbers that are present in the first N numbers of the Fibonacci sequence. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_primes(0) == []\", \"assert fibonacci_primes(1) == []\", \"assert fibonacci_primes(2) == []\", \"assert fibonacci_primes(4) == [2]\", \"assert fibonacci_primes(5) == [2, 3]\"]}"
} | {
"split": "train",
"index": 4657,
"acecode_id": "evol_24778",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `extract_metadata` that takes a string representing a range of commits and returns a list of metadata extracted from those commits. The metadata is represented as a dictionary with keys 'commit_id', 'author', and 'message'. Each commit in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_metadata('abc123,John Doe,Fixed issue\\\\ndef456,Jane Smith,Added feature') == [{'commit_id': 'abc123', 'author': 'John Doe', 'message': 'Fixed issue'}, {'commit_id': 'def456', 'author': 'Jane Smith', 'message': 'Added feature'}]\", \"assert extract_... | {
"split": "train",
"index": 4658,
"acecode_id": "bigcode_python_fns_15863",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that verifies if a list of users are present in a key policy. The key policy is represented as a dictionary and contains a list of administrators and users. Given a key policy dictionary and two lists of administrators and users, return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_key_policy({'Statement': [{'Principal': {'AWS': ['arn:aws:iam::111122223333:user/admin1']}}, {'Principal': {'AWS': ['arn:aws:iam::111122223333:user/user1', 'arn:aws:iam::444455556666:user/user2']}}]}, ['arn:aws:iam::111122223333:user/admin1'], ['arn:a... | {
"split": "train",
"index": 4659,
"acecode_id": "bigcode_python_fns_7667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `test_password_strength(password: str) -> str` that evaluates the strength of a given password based on the following criteria: The password must be at least 8 characters long, contain at least one uppercase letter, one lowercase letter, one digit, and one ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert test_password_strength('Short1!') == 'Password too short'\", \"assert test_password_strength('password1!') == 'Password should include at least 1 uppercase letter'\", \"assert test_password_strength('PASSWORD1!') == 'Password should include at least 1 lowerc... | {
"split": "train",
"index": 4660,
"acecode_id": "evol_12487",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a square matrix (grid) of integers and an integer k, write a function `maxSumPath(grid, k)` that returns the maximum sum of the k highest distinct values from the grid and the list of those values in descending order. If the grid is invalid (not a non-empty square matrix)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxSumPath([[1]], 1) == (1, [1])\", \"assert maxSumPath([[1, 2], [3, 4]], 2) == (7, [4, 3])\", \"assert maxSumPath([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 3) == (24, [9, 8, 7])\", \"assert maxSumPath([[5, 5, 5], [5, 5, 5], [5, 5, 5]], 1) == (5, [5])\", \"assert m... | {
"split": "train",
"index": 4661,
"acecode_id": "evol_27243",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a deployment configuration for a software application based on the given module details and port information. The function should take the module details and port information as input and return a dictionary represen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_deployment_config({\\\"name\\\": \\\"My Application\\\", \\\"description\\\": \\\"My Application deployment\\\", \\\"logo-url\\\": \\\"https://example.com/logo.svg\\\", \\\"subtype\\\": \\\"component\\\", \\\"path\\\": \\\"apps/myapp\\\", \\\"parent... | {
"split": "train",
"index": 4662,
"acecode_id": "oss_29092",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a string containing a sentence, implement a function that counts the occurrences of each word in the sentence. The function should return a dictionary where the keys are the unique words in the sentence, and the values are the counts of each word. Punctuation and case sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_word_occurrences('This is a sample text. This text contains sample words.') == {'this': 2, 'is': 1, 'a': 1, 'sample': 2, 'text': 2, 'contains': 1, 'words': 1}\", \"assert count_word_occurrences('Hello world! Hello everyone.') == {'hello': 2, 'world': 1... | {
"split": "train",
"index": 4663,
"acecode_id": "oss_18395",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that fills a database with measurement inputs and settings based on specific parameters. The function `fill_database` takes the following parameters: a file path (string), a settings configuration (dict), measurement inputs (dict), a grid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fill_database('path/to/database', {'setting1': 'value1'}, {'input1': 10}, {'grid1': 'value1'}, 1, 2, {'child_prior1': {'key1': [1, 2, 3]}}, {('mulcov1', 'mulcov2', 'mulcov3'): 'prior_value'}) == {'path': 'path/to/database', 'settings': {'setting1': 'value1'}... | {
"split": "train",
"index": 4664,
"acecode_id": "bigcode_python_fns_44174",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary of custom options and a set of default options specified as keyword arguments. Your task is to create a function `merge_options(custom_options: Dict[str, Any], **default_options: Any) -> Dict[str, Any]` that merges the custom options with the default ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_options({'a': 5, 'b': 3}, a=1, c=4) == {'a': 5, 'b': 3, 'c': 4}\", \"assert merge_options({'x': 10}, a=1, b=2, c=3) == {'x': 10, 'a': 1, 'b': 2, 'c': 3}\", \"assert merge_options({}, a=1, b=2) == {'a': 1, 'b': 2}\", \"assert merge_options({'a': 5}, a=1... | {
"split": "train",
"index": 4665,
"acecode_id": "bigcode_python_fns_21670",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer array `nums` that is sorted in non-decreasing order and then rotated at an unknown pivot index. The array may contain duplicate values. Write a function `search(nums: List[int], target: int) -> int` that returns the index of `target` if it is present in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search([2,5,6,0,0,1,2], 0) == 3\", \"assert search([2,5,6,0,0,1,2], 3) == -1\", \"assert search([1,0,1,1,1], 0) == 1\", \"assert search([1,1,3,1], 3) == 2\", \"assert search([1,1,1,1,1], 2) == -1\", \"assert search([5,1,3], 5) == 0\", \"assert search([2,2,2,... | {
"split": "train",
"index": 4666,
"acecode_id": "evol_27542",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that calculates and returns the median value of the list. The median is the middle value when the numbers are sorted. If there is an even number of elements, return the average of the two middle values.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_median([12, 30, 4, 18, 24]) == 18\", \"assert find_median([1, 2, 3]) == 2\", \"assert find_median([1, 2, 3, 4]) == 2.5\", \"assert find_median([5, 1, 3, 2]) == 2.5\", \"assert find_median([9]) == 9\", \"assert find_median([2, 3]) == 2.5\", \"assert find... | {
"split": "train",
"index": 4667,
"acecode_id": "evol_26427",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_of_squares(nums)` that returns the sum of the squares of all the integers in the list. The input list may contain both positive and negative integers. If the input list is empty, return 0. \n\nFor example:\n- If the input is [1, 2... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares([1, 2, 3]) == 14\", \"assert sum_of_squares([-1, -2, -3]) == 14\", \"assert sum_of_squares([0]) == 0\", \"assert sum_of_squares([]) == 0\", \"assert sum_of_squares([-5, 5]) == 50\", \"assert sum_of_squares([7]) == 49\", \"assert sum_of_squares... | {
"split": "train",
"index": 4668,
"acecode_id": "bigcode_python_fns_8334",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of posts, where each post is represented by a dictionary containing 'id', 'author_id', and 'content'. Implement a function `get_post_by_id(posts: List[Dict[str, Union[int, str]]], post_id: int, check_author: bool, current_user_id: int) -> Dict[str, Union[in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_post_by_id([{'id': 1, 'author_id': 101, 'content': 'Hello World'}], 1, True, 101) == {'id': 1, 'author_id': 101, 'content': 'Hello World'}\", \"assert get_post_by_id([{'id': 2, 'author_id': 102, 'content': 'Python is great!'}], 2, False, 201) == {'id': 2... | {
"split": "train",
"index": 4669,
"acecode_id": "bigcode_python_fns_25311",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of detection records where each record consists of a start time, end time, the number of stations triggered, and the number of phases triggered. Your task is to implement a function that processes this list of records and returns a dictionary containing the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_detection_records([('2023-10-01T12:00:00', '2023-10-01T12:30:00', 3.0, 2.0)]) == {'starttime': [datetime.datetime(2023, 10, 1, 12, 0)], 'endtime': [datetime.datetime(2023, 10, 1, 12, 30)], 'station': [3.0], 'phase': [2.0]}\", \"assert process_detecti... | {
"split": "train",
"index": 4670,
"acecode_id": "bigcode_python_fns_25757",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts specific information from a package's metadata. The metadata is represented as a dictionary containing various details about the package. Your function should extract the URL, license, and description from the metadat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_package_info({'url': 'https://github.com/mcspring/XML2Dict', 'license': 'http://www.apache.org/licenses/LICENSE-2.0.html', 'description': 'Convert between XML String and Python Dict'}) == ('https://github.com/mcspring/XML2Dict', 'http://www.apache.or... | {
"split": "train",
"index": 4671,
"acecode_id": "oss_15379",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns precomputed statistics for a specific model. The function should return two lists: the first list contains the center of mass values, and the second list contains the object size values. Each value in the lists should be a fl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_model_statistics() == ([0.537, 0.498], [0.835, 0.824])\", \"assert len(get_model_statistics()[0]) == 2\", \"assert len(get_model_statistics()[1]) == 2\", \"assert get_model_statistics()[0][0] == 0.537\", \"assert get_model_statistics()[0][1] == 0.498\", ... | {
"split": "train",
"index": 4672,
"acecode_id": "bigcode_python_fns_35514",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that determines the branch to merge based on the current branch being built in a version control system. The function should take in one parameter, `TRAVIS_BRANCH`, which is a string representing the current branch. You need to use... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_branch_to_merge('feature/1.0') == 'release/1.0'\", \"assert get_branch_to_merge('bugfix/2.5') == 'release/2.5'\", \"assert get_branch_to_merge('hotfix/3.1') == 'release/3.1'\", \"assert get_branch_to_merge('feature/0.1') == 'release/0.1'\", \"assert get_... | {
"split": "train",
"index": 4673,
"acecode_id": "oss_34380",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the logging of time taken to process a request in a web application. Your function should take the time taken to process a request (in seconds) as input and return a string that logs the processing time in milliseconds. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_request_time(0.001) == 'Request processed in 1 ms'\", \"assert log_request_time(0.002) == 'Request processed in 2 ms'\", \"assert log_request_time(0.005) == 'Request processed in 5 ms'\", \"assert log_request_time(0.010) == 'Request processed in 10 ms'\"... | {
"split": "train",
"index": 4674,
"acecode_id": "oss_35919",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains the name of a GitHub repository and its star count. Your task is to implement a function that filters the repositories based on a specified star count range. The function should take three parameters: a list of tuples `r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_repositories([('repo1', 100), ('repo2', 50), ('repo3', 300)], 50, 150) == [('repo1', 100), ('repo2', 50)]\", \"assert filter_repositories([('repo1', 10), ('repo2', 20), ('repo3', 30)], 5, 25) == [('repo1', 10), ('repo2', 20)]\", \"assert filter_reposi... | {
"split": "train",
"index": 4675,
"acecode_id": "oss_30129",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a list of numbers based on two different types of sequences: arithmetic and geometric. The function should take the following parameters: an integer `start`, an integer `step`, an integer `n`, and a string `sequence_typ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_sequence(1, 2, 5, 'arithmetic') == [1, 3, 5, 7, 9]\", \"assert generate_sequence(2, 3, 4, 'arithmetic') == [2, 5, 8, 11]\", \"assert generate_sequence(5, 2, 3, 'arithmetic') == [5, 7, 9]\", \"assert generate_sequence(0, 1, 10, 'arithmetic') == [0, 1... | {
"split": "train",
"index": 4676,
"acecode_id": "oss_31683",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to perform arithmetic operations in the Galois field GF(p), where p is a prime number. Implement the `prod` function, which calculates the product of multiple elements in the Galois field. The function should take a variable number of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prod(1, 2, 3, p=7) == 6\", \"assert prod(4, 5, p=11) == 9\", \"assert prod(10, 10, p=13) == 9\", \"assert prod(3, 3, 3, p=7) == 6\", \"assert prod(1, 1, 1, p=3) == 1\", \"assert prod(4, 4, 4, p=11) == 9\", \"assert prod(0, 1, 2, p=5) == 0\", \"assert prod(1,... | {
"split": "train",
"index": 4677,
"acecode_id": "oss_29381",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a tweet and extracts a Twitter handle if it exists at the beginning of the tweet. The function should look for a handle that is preceded by either 'RT @' or '@' at the start of the tweet. If a handle is found, it should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_handle('@user This is a tweet') == ('user', ' This is a tweet')\", \"assert extract_handle('This is a tweet without a handle') == ('', 'This is a tweet without a handle')\", \"assert extract_handle('@single_word') == ('single_word', '')\", \"assert e... | {
"split": "train",
"index": 4678,
"acecode_id": "bigcode_python_fns_25574",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that reads arrays based on their type and dimension. The function will take in two parameters: `array_type` (which can be either 'dense' or 'sparse') and `array_dim` (which can be either 1 or 2). Depending on these parameters, your fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_array_reader('dense', 1) == tick_float_array_from_file\", \"assert get_array_reader('dense', 2) == tick_float_array2d_from_file\", \"assert get_array_reader('dense', 1) == tick_float_array_from_file\", \"assert get_array_reader('dense', 2) == tick_float_... | {
"split": "train",
"index": 4679,
"acecode_id": "oss_433",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a function `multiplication_table(n)` that returns a list containing the multiplication table of the given number n from 1 to 10. The function should return a list of integers representing the products of n with each integer from 1 to 10.\nPlease reason step by step, then ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiplication_table(1) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", \"assert multiplication_table(2) == [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]\", \"assert multiplication_table(3) == [3, 6, 9, 12, 15, 18, 21, 24, 27, 30]\", \"assert multiplication_table(4) == [4, 8, ... | {
"split": "train",
"index": 4680,
"acecode_id": "evol_8468",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing an asset code. Your task is to implement a function that determines the category of the asset and returns it. The asset codes and their corresponding categories are as follows: 'DOVL11B' corresponds to 'FII', 'PETR3' corresponds to 'Stock', '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_asset_category('DOVL11B') == 'FII'\", \"assert get_asset_category('PETR3') == 'Stock'\", \"assert get_asset_category('ITUB4') == 'Stock'\", \"assert get_asset_category('MGLU3') == 'Stock'\", \"assert get_asset_category('XYZ123') == 'Unknown'\", \"assert ... | {
"split": "train",
"index": 4681,
"acecode_id": "bigcode_python_fns_35642",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the monitoring status of a sensor system. The function should take in a series of commands and return the final monitoring status of the system. The commands are represented as a list of strings, where each command can ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert monitoring_status(['start', 'status']) == True\", \"assert monitoring_status(['start', 'stop', 'status']) == False\", \"assert monitoring_status(['start', 'start', 'status']) == True\", \"assert monitoring_status(['stop', 'status']) == False\", \"assert moni... | {
"split": "train",
"index": 4682,
"acecode_id": "oss_221",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the dot product of two 1D arrays using recursion. The function should take two lists of integers as inputs and return the dot product. If the lists are not of equal length, return 'Error: lists should have the same length'.\nPlease reason st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dot_product([1, 2, 3], [4, 5, 6]) == 32\", \"assert dot_product([0, 0, 0], [1, 2, 3]) == 0\", \"assert dot_product([-1, -2, -3], [1, 2, 3]) == -14\", \"assert dot_product([5], [5]) == 25\", \"assert dot_product([], []) == 0\", \"assert dot_product([1, 2, 3],... | {
"split": "train",
"index": 4683,
"acecode_id": "evol_9618",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `separate_paren_groups(paren_string: str) -> List[str]` that takes a string of distinct and balanced parentheses clusters, possibly with embedded ones, and separates them into individual strings. The separated clusters should be returned as a list of string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert separate_paren_groups('( ) (( )) (( )( ))') == ['()', '(())', '(()())']\", \"assert separate_paren_groups('()') == ['()']\", \"assert separate_paren_groups('() ()') == ['()', '()']\", \"assert separate_paren_groups('()()()') == ['()', '()', '()']\", \"assert... | {
"split": "train",
"index": 4684,
"acecode_id": "evol_30308",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple consists of a name (a string), an integer value, and a function that returns a dictionary when called. Your task is to create a function `get_configuration` that takes this list of tuples as input and returns a dictionary. The di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_configuration([('config1', 1, lambda: {'key1': 'value1'}), ('config2', 2, lambda: {'key2': 'value2'})]) == {'config1': {'key1': 'value1'}, 'config2': {'key2': 'value2'}}\", \"assert get_configuration([('configA', 10, lambda: {'a': 1, 'b': 2}), ('configB'... | {
"split": "train",
"index": 4685,
"acecode_id": "bigcode_python_fns_48002",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves shader codes based on the component name and render method from a predefined dictionary. Given a `component_name` and a `render_method`, your function should return a dictionary containing the vertex, fragment, and geom... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_shader_codes('component1', 'render_method1') == {'vertex': 'vertex_shader_code1', 'fragment': 'fragment_shader_code1', 'geometry': 'geometry_shader_code1'}\", \"assert get_shader_codes('component1', 'render_method2') == {'vertex': 'vertex_shader_code2', ... | {
"split": "train",
"index": 4686,
"acecode_id": "oss_27787",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that receives five input parameters: two strings (string1 and string2), two characters (char1 and char2), and a number. The function should return true if: 1. The first character (char1) appears in the first string (string1) exactly the specified number of tim... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_chars('hello', 'world', 'l', 'o', 1) == False\", \"assert check_chars('abc', 'def', 'a', 'd', 1) == True\", \"assert check_chars('aaa', 'bbb', 'a', 'b', 3) == True\", \"assert check_chars('aaaa', 'bbbb', 'a', 'b', 4) == True\", \"assert check_chars('aa... | {
"split": "train",
"index": 4687,
"acecode_id": "evol_2641",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the average radius of a rectangle based on its corner positions given in a 2D coordinate system. The function should take a 2D array of shape (2, 2) where each element represents the coordinates of the rectangle's corn... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_radius([[0, 0], [0, 4]]) == 2.0\", \"assert calculate_average_radius([[1, 1], [5, 1]]) == 2.0\", \"assert calculate_average_radius([[0, 0], [3, 4]]) == 3.5\", \"assert calculate_average_radius([[2, 2], [2, 6]]) == 2.0\", \"assert calculate_... | {
"split": "train",
"index": 4688,
"acecode_id": "bigcode_python_fns_26991",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple resource management system. You are given a list of resources and need to implement a function `resource_manager` that takes the list of resources and a list of operations. Each operation can either be an alloc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resource_manager(['resourceX'], ['allocate', 'allocate']) == ['resourceX', None]\", \"assert resource_manager([], ['allocate']) == [None]\", \"assert resource_manager(['resA', 'resB'], ['deallocate resA']) == [False]\", \"assert resource_manager(['res1'], ['... | {
"split": "train",
"index": 4689,
"acecode_id": "oss_35710",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a list of integers in ascending order. The list can contain both positive and negative integers, and the sorting algorithm should adapt its complexity based on the number of negative integers in the list. If there are negative integers present, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adaptive_sort([3, -1, 2, -4, 5]) == [-4, -1, 2, 3, 5]\", \"assert adaptive_sort([-5, -2, -1]) == [-5, -2, -1]\", \"assert adaptive_sort([1, 2, 3]) == [1, 2, 3]\", \"assert adaptive_sort([1, -1, 0, 2]) == [-1, 0, 1, 2]\", \"assert adaptive_sort([-3, -2, 0, 1,... | {
"split": "train",
"index": 4690,
"acecode_id": "evol_26352",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of integers. Implement a function that checks if the array can be sorted in ascending order by performing at most two rotations. A rotation is defined as swapping an even indexed element with a prime number from the array. The function should return True ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rotate_array_elements([1, 4, 6, 5]) == False\", \"assert rotate_array_elements([2, 3, 5, 7]) == True\", \"assert rotate_array_elements([8, 7, 3, 2]) == False\", \"assert rotate_array_elements([10, 1, 4, 3]) == False\", \"assert rotate_array_elements([3, 5, 7... | {
"split": "train",
"index": 4691,
"acecode_id": "evol_22703",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of floating point numbers, where each inner list represents log importance weights for a number of trials. Your task is to write a function that computes the log evidence estimate for each trial. The log evidence for each trial is calculated using the fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_evidence_estimate([[1.0], [2.0], [3.0]]) == [1.0, 2.0, 3.0]\", \"assert log_evidence_estimate([[3.0, 3.0], [2.0, 2.0, 2.0]]) == [3.0, 2.0]\", \"assert log_evidence_estimate([[10.0], [20.0], [30.0]]) == [10.0, 20.0, 30.0]\", \"assert log_evidence_estimate... | {
"split": "train",
"index": 4692,
"acecode_id": "bigcode_python_fns_502",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a unique tag ID for a content management system. The system stores the latest tag ID as a string in the variable `latestTagID`. Your job is to implement a function `generateTagID(latestTagID)` that takes this string as input and returns a new uniq... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generateTagID('0') == 1\", \"assert generateTagID('1') == 2\", \"assert generateTagID('9') == 10\", \"assert generateTagID('10') == 11\", \"assert generateTagID('123') == 124\", \"assert generateTagID('999') == 1000\", \"assert generateTagID('1000') == 1001\... | {
"split": "train",
"index": 4693,
"acecode_id": "oss_22318",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates the Fibonacci sequence up to the first 'n' numbers and calculates the sum of the sequence after replacing all multiples of a predetermined value 'val' with 0. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_fibonacci(1, 2) == 0\", \"assert sum_fibonacci(7, 1) == 0\", \"assert sum_fibonacci(6, 2) == 8\", \"assert sum_fibonacci(4, 1) == 0\", \"assert sum_fibonacci(2, 2) == 1\"]}"
} | {
"split": "train",
"index": 4694,
"acecode_id": "evol_19821",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to compare two database dictionaries and determine if they are identical. Each database is represented as a dictionary where the keys are table names (strings) and the values are lists of records (dictionaries). Each record is repr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert db_diff({'employees': [{'id': 1, 'name': 'Alice', 'age': 25}, {'id': 2, 'name': 'Bob', 'age': 30}]}, {'employees': [{'id': 1, 'name': 'Alice', 'age': 25}, {'id': 2, 'name': 'Bob', 'age': 30}]} ) == True\", \"assert db_diff({'employees': [{'id': 1, 'name': 'A... | {
"split": "train",
"index": 4695,
"acecode_id": "oss_7488",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `initialize_repositories(repos: List[Dict[str, Union[str, bool]]]) -> List[str]` that takes a list of repositories and returns a list of commands for setting up cron jobs for each repository. Each repository is represented as a dictionary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_repositories([{'repo': 'https://github.com/user/repo1', 'crontab': '0 5 * * *', 'sha': 'abc123', 'plugins': ['plugin1'], 'baseline': 'baseline1.txt', 'exclude_regex': '.*\\\\.tmp$', 'is_local_repo': False}]) == ['Add https://github.com/user/repo1 ... | {
"split": "train",
"index": 4696,
"acecode_id": "bigcode_python_fns_38214",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that performs a binary search-based insertion sort on a list of n integers. The function should return the sorted list. The input list can contain both positive and negative integers, as well as zeros. You should implement only one function named `binar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search_insertion_sort([8, -6, 1, 0, -9, 4]) == [-9, -6, 0, 1, 4, 8]\", \"assert binary_search_insertion_sort([3, 1, 2]) == [1, 2, 3]\", \"assert binary_search_insertion_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert binary_search_insertion_sort(... | {
"split": "train",
"index": 4697,
"acecode_id": "evol_23109",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with defining a user schema for an application that manages user information. You need to create a function that returns a dictionary representing the user schema based on the following specifications: 1. The schema should have an 'id' key, which is an integer an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_schema() == {'id': 'Integer', 'username': 'String(100)', 'olx_user_slug': 'String(100)', 'on_olx_since': 'DateTime', 'phone_number': 'String(20)', 'agency_otodom_id': 'Integer', 'agency_name': 'String(100)', 'agency_address': 'String(100)'}\", \"ass... | {
"split": "train",
"index": 4698,
"acecode_id": "oss_16198",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid of integers representing elevation points. Each cell in the grid represents the elevation at that point. Your task is to implement a function `lowPoints(grid)` that returns the coordinates of all the points in the grid that are lower than all their neigh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lowPoints([[9, 8, 7], [6, 5, 4], [3, 2, 1]]) == [(2, 2)]\", \"assert lowPoints([[1, 1, 1], [1, 1, 1], [1, 1, 1]]) == []\", \"assert lowPoints([[2, 1], [1, 2]]) == [(0, 1), (1, 0)]\", \"assert lowPoints([[1]]) == [(0, 0)]\", \"assert lowPoints([[1, 2], [2, 1]... | {
"split": "train",
"index": 4699,
"acecode_id": "oss_35024",
"num_tests": 10
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.