data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are given a Python function that checks whether a given data structure, represented as a dictionary, is valid according to a specified schema. The schema is defined as another dictionary. You need to implement a function `is_valid(data: Dict[str, Any], schema: Dict[str, Any... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid({'name': 'Alice', 'age': 30, 'is_student': False}, {'name': 'string', 'age': 'integer', 'is_student': 'boolean'}) == True\", \"assert is_valid({'name': 'Bob', 'age': '25', 'is_student': True}, {'name': 'string', 'age': 'integer', 'is_student': 'bool... | {
"split": "train",
"index": 75200,
"acecode_id": "bigcode_python_fns_29604",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two pre-sorted lists of integers, implement a function that merges them into a single sorted list while removing all duplicate values. The function should not use any built-in sort() method or set() method for removing duplicates. Additionally, it should modify the first ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_and_remove_duplicates([1, 1, 2], [2, 3, 3]) == [1, 2, 3]\", \"assert merge_and_remove_duplicates([], []) == []\", \"assert merge_and_remove_duplicates([1, 2, 3], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_and_remove_duplicates([1, 2], []) == [1, 2]\", \... | {
"split": "train",
"index": 75201,
"acecode_id": "evol_2533",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of numbers representing the heights of different bars in a bar chart. Your task is to implement a function `patch_bar_chart(heights: List[int]) -> List[int]` that modifies the heights of the bars according to the following rules: If a bar is taller than its... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert patch_bar_chart([3, 1, 4, 1, 5]) == [3, 1, 1, 1, 5]\", \"assert patch_bar_chart([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert patch_bar_chart([10, 6, 8, 6, 10]) == [10, 6, 6, 6, 10]\", \"assert patch_bar_chart([7, 1, 5, 1, 7]) == [7, 1, 1, 1, 7]\", \"asser... | {
"split": "train",
"index": 75202,
"acecode_id": "bigcode_python_fns_27058",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `simulate_car_operations(operations: List[Tuple[str, Union[int, str]]]) -> Dict[str, Union[str, int]]` that simulates operations on a car object. The car has properties `color` (default 'red'), `speed` (default 0), and `mileage` (default 0). The operations ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_car_operations([('accelerate', 20)]) == {'color': 'red', 'speed': 20, 'mileage': 0}\", \"assert simulate_car_operations([('decelerate', 10)]) == {'color': 'red', 'speed': 0, 'mileage': 0}\", \"assert simulate_car_operations([('drive', 200)]) == {'co... | {
"split": "train",
"index": 75203,
"acecode_id": "evol_17069",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers sorted in ascending order, write a function that returns a list of tuples representing the ranges of consecutive integers in the input list. Each tuple should contain two integers: the start and end of the range. If a number is not part of a range, it s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rangify([1, 2, 3, 4]) == [(1, 4)]\", \"assert rangify([1, 2, 2, 3, 4, 5]) == [(1, 5)]\", \"assert rangify([5, 6, 7, 8, 10, 11]) == [(5, 8), (10, 11)]\", \"assert rangify([1]) == [(1, 1)]\", \"assert rangify([]) == []\", \"assert rangify([1, 3, 4, 5, 6, 8]) =... | {
"split": "train",
"index": 75204,
"acecode_id": "bigcode_python_fns_46941",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs an in-order traversal of a binary search tree (BST) and returns the values in a list. The function should take the root node of the BST as input and output a list of values in ascending order. The tree nodes are represented as instances of a c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert in_order_traversal(None) == []\", \"assert in_order_traversal(Node(10)) == [10]\", \"assert in_order_traversal(Node(10, Node(5), Node(15))) == [5, 10, 15]\", \"assert in_order_traversal(Node(10, Node(5, Node(3), Node(7)), Node(15))) == [3, 5, 7, 10, 15]\", \... | {
"split": "train",
"index": 75205,
"acecode_id": "evol_13799",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a series of buildings. Write a function `max_building_height(buildings: List[int]) -> int` that calculates the maximum height of a building after it has been modified by the following rules: you can increase the heigh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_building_height([5, 5, 5]) == 6\", \"assert max_building_height([1, 1, 1, 1]) == 2\", \"assert max_building_height([1, 2, 1]) == 3\", \"assert max_building_height([1, 1, 1, 1, 1]) == 2\", \"assert max_building_height([2, 2, 2, 2, 2]) == 3\", \"assert max... | {
"split": "train",
"index": 75206,
"acecode_id": "bigcode_python_fns_33428",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a string `project_name`, write a function `validate_project` that checks whether the provided project name is valid. A valid project name must satisfy the following conditions: it should not be an empty string, it should not be a Python keyword, it should not clash with a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_project('my_project') == 'my_project'\", \"assert validate_project('') == None\", \"assert validate_project('def') == None\", \"assert validate_project('list') == None\", \"assert validate_project('my_list') == 'my_list'\", \"assert validate_project... | {
"split": "train",
"index": 75207,
"acecode_id": "bigcode_python_fns_19665",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string of text, count the occurrences of each word in the string. Your program should ignore case sensitivity and punctuation, and only consider alphanumeric characters as part of a word. Additionally, your program should return the top N most frequently occurring words... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert top_n_words(\\\"This is a test. This test is only a test.\\\", 2) == [('test', 3), ('this', 2)]\", \"assert top_n_words(\\\"Hello, hello! How are you? Hello.\\\", 2) == [('hello', 3), ('how', 1)]\", \"assert top_n_words(\\\"word word word test test\\\", 5) =... | {
"split": "train",
"index": 75208,
"acecode_id": "oss_30153",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple game state transition system. The game has three states: 1, 2, and 3. When the game is in state 1, pressing the '1' key transitions the game to state 2. When the game is in state 2, pressing the '2' key transitions the game to state 3. Yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_game_state_transition(1, {'type': 'KEYDOWN', 'key': 'K_1'}) == 2\", \"assert handle_game_state_transition(2, {'type': 'KEYDOWN', 'key': 'K_2'}) == 3\", \"assert handle_game_state_transition(1, {'type': 'KEYDOWN', 'key': 'K_2'}) == 1\", \"assert handle... | {
"split": "train",
"index": 75209,
"acecode_id": "oss_25598",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the creation of a membership in a project management system. When a new membership is created, it should only be pushed to the project timeline if the user who created the membership is not the owner of the project. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert membership_push_to_timeline(True, 'user1', 'owner1', 'ProjectA') == 'Membership created and pushed to timeline for project: ProjectA'\", \"assert membership_push_to_timeline(True, 'owner1', 'owner1', 'ProjectB') == 'Membership creation skipped for project: P... | {
"split": "train",
"index": 75210,
"acecode_id": "bigcode_python_fns_2314",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the coordinates of the maximum and minimum latitude and longitude values along with lists of latitude and longitude points, write a function `findSubsetIndices` that returns the indices of the latitude and longitude points that are closest to the specified maximum and min... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findSubsetIndices(10, 20, 30, 40, [10, 15, 20], [30, 35, 40]) == [0, 2, 0, 2]\", \"assert findSubsetIndices(5, 15, 25, 35, [5, 10, 15], [25, 30, 35]) == [0, 2, 0, 2]\", \"assert findSubsetIndices(1, 3, 2, 4, [1, 1.5, 2.5], [2, 3, 4]) == [0, 2, 0, 2]\", \"ass... | {
"split": "train",
"index": 75211,
"acecode_id": "bigcode_python_fns_29000",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a programming language (e.g., 'python', 'java', 'cpp') and an optional string representing a country (e.g., 'us', 'uk', 'in'), return a formatted string that combines the language and country in the following format: 'language.country' if a country i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert import_processor('python', 'us', False) == 'python.us'\", \"assert import_processor('java', None, False) == 'java.any'\", \"assert import_processor('cpp', 'uk', True) == 'cpp.uk [DEBUG]'\", \"assert import_processor('ruby', None, True) == 'ruby.any [DEBUG]'\... | {
"split": "train",
"index": 75212,
"acecode_id": "bigcode_python_fns_46118",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a given string according to a specific set of rules. The function should take a string as input and remove the first character of the string. Then, it should stop processing the string once it encounters a comma ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_string('abc,def,ghi') == 'bc'\", \"assert process_string('hello,world') == 'ello'\", \"assert process_string('python') == 'ython'\", \"assert process_string('') == ''\", \"assert process_string('test') == 'est'\", \"assert process_string('example,cas... | {
"split": "train",
"index": 75213,
"acecode_id": "oss_31500",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a program that can count the occurrences of a given word in a provided input text string. Your program should be able to handle large strings and return the count of occurrences for the given word. Write a function `countWordOccurrences` that ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countWordOccurrences('Hello, hello, how low can you go?', 'hello') == 2\", \"assert countWordOccurrences('Python is great. Python is fun.', 'python') == 2\", \"assert countWordOccurrences('One fish, two fish, red fish, blue fish.', 'fish') == 4\", \"assert c... | {
"split": "train",
"index": 75214,
"acecode_id": "oss_4043",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns a default configuration for a hypothetical library. The configuration should be a dictionary with the following properties: 1) 'allow_growth' should be set to True. 2) 'max_memory' should be set to 4096. 3) 'num_threads' shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_default_config() == {'allow_growth': True, 'max_memory': 4096, 'num_threads': 4}\", \"assert get_default_config()['allow_growth'] == True\", \"assert get_default_config()['max_memory'] == 4096\", \"assert get_default_config()['num_threads'] == 4\", \"ass... | {
"split": "train",
"index": 75215,
"acecode_id": "bigcode_python_fns_43440",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `x_or_y(n: int, x: Any, y: Any) -> Any` that takes an integer `n` and two values `x` and `y`. The function should return `x` if `n` is a prime number, and `y` otherwise. A prime number is defined as a number greater than 1 that cannot be formed by multiplyi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert x_or_y(2, 'Prime', 'Not Prime') == 'Prime'\", \"assert x_or_y(4, 'Prime', 'Not Prime') == 'Not Prime'\", \"assert x_or_y(1, 'Prime', 'Not Prime') == 'Not Prime'\", \"assert x_or_y(7, 'Yes', 'No') == 'Yes'\", \"assert x_or_y(9, 'Yes', 'No') == 'No'\", \"asser... | {
"split": "train",
"index": 75216,
"acecode_id": "evol_33042",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes geographical shape data represented as a dictionary. The shape data contains a key 'features', which is a list of dictionaries, each representing a geographical feature. Each feature dictionary contains a 'properties... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_shape_data({'features': [{'properties': {'RKI_ID': '001', 'RKI_NameDE': 'CountyA'}}, {'properties': {'RKI_ID': '002', 'RKI_NameDE': 'CountyB'}}]}) == {'CountyA': '001', 'CountyB': '002'}\", \"assert extract_shape_data({'features': []}) == {}\", \"ass... | {
"split": "train",
"index": 75217,
"acecode_id": "oss_30383",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a grid of size N x M, where each cell contains a non-negative integer. You have to implement a function that swaps the values of two adjacent cells in the grid (horizontally or vertically) and returns the updated grid. The function should ensure that the provided ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_cells([[1, 2, 3], [4, 5, 6]], 0, 0, 0, 1) == [[2, 1, 3], [4, 5, 6]]\", \"assert swap_cells([[1, 2], [3, 4]], 1, 0, 0, 0) == [[3, 2], [1, 4]]\", \"assert swap_cells([[0]], 0, 0, 0, 0) == [[0]]\", \"assert swap_cells([[1, 2]], 0, 0, 0, 1) == [[2, 1]]\", \... | {
"split": "train",
"index": 75218,
"acecode_id": "oss_1708",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a linear address, implement a function `get_next_segment(ea: int) -> int` that returns the start address of the next segment. If there is no next segment, the function should return -1. A segment is defined as a range of linear addresses, and the segments are represented ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_next_segment(5) == 10\", \"assert get_next_segment(10) == 20\", \"assert get_next_segment(15) == 20\", \"assert get_next_segment(35) == -1\", \"assert get_next_segment(50) == -1\", \"assert get_next_segment(100) == -1\", \"assert get_next_segment(10) == ... | {
"split": "train",
"index": 75219,
"acecode_id": "bigcode_python_fns_32591",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a series of inputs using multiple validation functions. Your function should take in a list of validation functions and an input value, and return True if the input passes all validation functions, or False if it fails any.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_input([lambda x: isinstance(x, int), lambda x: x > 0], 5) == True\", \"assert validate_input([lambda x: isinstance(x, int), lambda x: x > 0], -2) == False\", \"assert validate_input([lambda x: isinstance(x, str), lambda x: len(x) > 0], 'hello') == T... | {
"split": "train",
"index": 75220,
"acecode_id": "bigcode_python_fns_34620",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function `make_palindrome(string: str) -> str` that appends the shortest suffix of the string that can be added to make the whole string a palindrome. The appended suffix should be a reversed substring of the original string. The function should igno... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_palindrome('') == ''\", \"assert make_palindrome('cat') == 'catac'\", \"assert make_palindrome('race') == 'racecar'\", \"assert make_palindrome('12321') == '12321'\", \"assert make_palindrome('') == ''\", \"assert make_palindrome('a') == 'a'\", \"assert... | {
"split": "train",
"index": 75221,
"acecode_id": "evol_33060",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that takes a list of integers and returns the maximum sum of a contiguous subarray within that list. The function should handle both positive and negative integers. The input will be a list of integers and the output will be a single integer rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([1, -2, 3, 4, -1]) == 7\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([2, 3, -2, 4]) == 7\", \"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) =... | {
"split": "train",
"index": 75222,
"acecode_id": "oss_19370",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that updates a given language dictionary with a new translation for a specified key. The function should take three parameters: the current language dictionary, a string representing the translation key, and a string representing the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_translation({'hello': 'hola'}, 'hello', 'salut') == {'hello': 'salut'}\", \"assert update_translation({}, 'greeting', 'hello') == {'greeting': 'hello'}\", \"assert update_translation({'goodbye': 'adios'}, 'goodbye', 'au revoir') == {'goodbye': 'au rev... | {
"split": "train",
"index": 75223,
"acecode_id": "oss_30137",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers and an integer K, write a function `max_k_sum(arr, k)` that returns the sum of the highest K integers from the array. If K is greater than the length of the array, return the sum of all elements in the array. The function should handle both positive a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_k_sum([1, 2, 3, 4, 5], 3) == 12\", \"assert max_k_sum([5, 5, 5, 5, 5], 2) == 10\", \"assert max_k_sum([-1, -2, -3, -4, -5], 3) == -6\", \"assert max_k_sum([10, 20, 30, 40, 50], 5) == 150\", \"assert max_k_sum([1], 1) == 1\", \"assert max_k_sum([], 3) == ... | {
"split": "train",
"index": 75224,
"acecode_id": "evol_9703",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `process_list(lst, predicates, transform)` that takes a list of integers `lst`, a list of predicate functions `predicates`, and a transformation function `transform`. The function should filter the input list based on all provided predicates and then apply ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_list([1, 2, 3, 4, 5, 6], [lambda x: x % 3 == 0], lambda x: x**2) == [9, 36]\", \"assert process_list([1, 2, 3, 4, 5, 6], [lambda x: x % 2 == 0, lambda x: x % 3 == 0], lambda x: x**2) == [36]\", \"assert process_list([1, 3, 5, 7, 9], [lambda x: x % 2 ... | {
"split": "train",
"index": 75225,
"acecode_id": "evol_5243",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_primes` that takes a list of integers and returns a list of all prime numbers present in that list. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. The input list may contain duplicat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_primes([2, 3, 5, 7, 8, 9, 10]) == [2, 3, 5, 7]\", \"assert find_primes([11, 13, 17, 19, 20]) == [11, 13, 17, 19]\", \"assert find_primes([4, 6, 8, 9, 10]) == []\", \"assert find_primes([-1, -3, -5, 0, 1]) == []\", \"assert find_primes([]) == []\", \"ass... | {
"split": "train",
"index": 75226,
"acecode_id": "evol_14673",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a sequence of numbers. Your task is to implement a function that returns the sum of all the integers in the list. If the list is empty, return 0. Write a function `sum_of_integers(nums: List[int]) -> int` that takes a list of intege... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_integers([1, 2, 3, 4, 5]) == 15\", \"assert sum_of_integers([-1, -2, -3, -4, -5]) == -15\", \"assert sum_of_integers([0, 0, 0, 0]) == 0\", \"assert sum_of_integers([]) == 0\", \"assert sum_of_integers([10, -10]) == 0\", \"assert sum_of_integers([1000,... | {
"split": "train",
"index": 75227,
"acecode_id": "bigcode_python_fns_10846",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `error_message` representing an error description and an integer `threshold` representing the maximum allowed length for this error message, implement a function that determines if the length of `error_message` exceeds the specified `threshold`. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_error_message_long('Error occurred while processing the request.', 50) == False\", \"assert is_error_message_long('This is a critical error that needs immediate attention!', 40) == True\", \"assert is_error_message_long('Short message', 20) == False\", \"... | {
"split": "train",
"index": 75228,
"acecode_id": "oss_12179",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining the number of large and small trucks needed to transport a specified tonnage of goods, under the constraint that an equal number of large and small trucks must be used. Based on the company's records, with 4 large trucks and 7 small trucks, they ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_trucks(34) == -1\", \"assert calculate_trucks(80) == -1\", \"assert calculate_trucks(100) == -1\", \"assert calculate_trucks(68) == -1\", \"assert calculate_trucks(34) == -1\", \"assert calculate_trucks(10) == -1\", \"assert calculate_trucks(50) ==... | {
"split": "train",
"index": 75229,
"acecode_id": "evol_7325",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a single character and a dictionary as arguments. The function should extract entries from the dictionary where the keys begin with the specified character, compute the square of each corresponding value, and return a new dictionary with the orig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_dict('c', {'cat': 1, 'dog': 2, 'mouse': 3}) == {'cat': 1}\", \"assert process_dict('d', {'cat': 1, 'dog': 2, 'mouse': 3}) == {'dog': 4}\", \"assert process_dict('m', {'cat': 1, 'dog': 2, 'mouse': 3}) == {'mouse': 9}\", \"assert process_dict('x', {'ca... | {
"split": "train",
"index": 75230,
"acecode_id": "evol_11691",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the downloading of subtitles from a public repository based on a given video ID and language. The function should take three parameters: 'video_id' (a string representing the video's unique identifier), 'language' (a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert download_subtitles('vid123', 'English', {'vid123': ['English', 'Spanish']}) == ('Subtitles downloaded in English', 'English')\", \"assert download_subtitles('vid456', 'Spanish', {'vid456': ['English', 'Spanish']}) == ('Subtitles downloaded in Spanish', 'Span... | {
"split": "train",
"index": 75231,
"acecode_id": "bigcode_python_fns_37967",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that helps manage a collection of namespaces and their associated prefixes. Given a list of tuples, where each tuple contains a namespace and its corresponding prefix, your function should return a list of registered prefixes. If a prefix... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_namespaces([('ns1', 'p1'), ('ns2', 'p2'), ('ns1', 'p3'), ('ns3', 'p1')]) == ['p1', 'p2']\", \"assert register_namespaces([('ns1', 'p1'), ('ns2', 'p1'), ('ns3', 'p3')]) == ['p1', 'p3']\", \"assert register_namespaces([('ns1', 'prefix1'), ('ns2', 'pre... | {
"split": "train",
"index": 75232,
"acecode_id": "bigcode_python_fns_7851",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that formats a log entry based on given parameters. Write a function called `create_log_entry` that takes in two parameters: 1. `log_level` (string) - representing the log level (e.g., 'INFO', 'ERROR', 'WARNING'). 2. `log_message` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_log_entry('INFO', 'System started') == '2023-10-01 12:00:00 - example.py[line:42] - INFO: System started'\", \"assert create_log_entry('ERROR', 'An error occurred') == '2023-10-01 12:00:00 - example.py[line:42] - ERROR: An error occurred'\", \"assert ... | {
"split": "train",
"index": 75233,
"acecode_id": "oss_36259",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_password(password: str) -> bool` that checks if a given password meets the following criteria: it must be at least 8 characters long, contain at least one uppercase letter, one lowercase letter, one numeric digit, and one special character from th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_password('Abcdef1!') == True\", \"assert validate_password('abcdefg1') == False\", \"assert validate_password('ABCDEFG1') == False\", \"assert validate_password('Abcdefg!') == False\", \"assert validate_password('Abcd1!') == False\", \"assert valida... | {
"split": "train",
"index": 75234,
"acecode_id": "evol_3630",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of animals and generates a TRACES compatible import format based on their species. The input will be a list of animals, each represented as a dictionary with the following keys: 'animal_id', 'species', 'passport_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_animals([]) == 'No data'\", \"assert process_animals([{'animal_id': 'C1', 'species': 'cattle', 'passport_id': 'P1'}]) == '[COLUMNS]\\\\nofficial_ident;numpassportemp\\\\n\\\\n[DATA]\\\\nC1;P1\\\\n[DATA]'\", \"assert process_animals([{'animal_id': 'C1... | {
"split": "train",
"index": 75235,
"acecode_id": "bigcode_python_fns_39833",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a Bayesian inference algorithm for a medical diagnosis system. The function `bayesian_inference(name, args)` takes in the patient's name as a string `name` and a dictionary `args` containing command-line arguments. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bayesian_inference('John Doe', {'--test': True}) == 0.85\", \"assert bayesian_inference('Jane Smith', {'--test': False}) == 0.65\", \"assert bayesian_inference('Alice Johnson', {'--test': True}) == 0.85\", \"assert bayesian_inference('Bob Brown', {'--test': ... | {
"split": "train",
"index": 75236,
"acecode_id": "oss_13821",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers called `x_vector` and an integer `size`. Write a function `check_vector_size(x_vector: List[int], size: int) -> None` that checks if the length of `x_vector` is equal to `size`. If the length of `x_vector` is not equal to `size`, raise a `ValueE... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_vector_size([1, 2, 3], 3) is None\", \"assert check_vector_size([], 0) is None\", \"assert check_vector_size([1, 2], 2) is None\", \"assert check_vector_size([1, 2, 3, 4, 5], 5) is None\", \"assert check_vector_size([1], 1) is None\", \"assert check_ve... | {
"split": "train",
"index": 75237,
"acecode_id": "bigcode_python_fns_33367",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given two lists, `amplitude` and `phase`, representing the amplitude and phase of a complex field respectively. Your task is to implement a function `mean_amplitude(amplitude: List[float], phase: List[float]) -> float` that calculates the mean amplitude of the complex f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mean_amplitude([1, 2, 3], [0, 0, 0]) == 2.0\", \"assert mean_amplitude([0, 0, 0], [1, 2, 3]) == 0.0\", \"assert mean_amplitude([2, 4, 6], [0, 0, 0]) == 4.0\", \"assert mean_amplitude([1, 1, 1], [0, 1, 2]) == 1.0\", \"assert mean_amplitude([5, 5, 5, 5], [0, 1... | {
"split": "train",
"index": 75238,
"acecode_id": "oss_24500",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function that checks if a given string is a palindrome. A palindrome is a word, phrase, or sequence that reads the same backward as forward. The function should ignore case and non-alphanumeric characters. You need to implement the function `is_palindrome_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome_recursive('A man, a plan, a canal, Panama!') == True\", \"assert is_palindrome_recursive('racecar') == True\", \"assert is_palindrome_recursive('deified') == True\", \"assert is_palindrome_recursive('hello') == False\", \"assert is_palindrome_r... | {
"split": "train",
"index": 75239,
"acecode_id": "evol_31150",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of five distinct integers, write a function that finds the smallest product of any two distinct integers from the list. The function should take a list as input and return the smallest product as an integer.\nPlease reason step by step, then write a self-contained ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_smallest_product([-5, 7, 0, 12, 3]) == -60\", \"assert find_smallest_product([1, 2, 3, 4, 5]) == 2\", \"assert find_smallest_product([-10, 5, 2, 7, 1]) == -70\", \"assert find_smallest_product([100, 50, 25, -25, -50]) == -5000\", \"assert find_smallest_... | {
"split": "train",
"index": 75240,
"acecode_id": "evol_24748",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a command-line tool that can handle a basic 'test' command with specific subcommands. The 'test' command should support the following subcommands: 'help' and 'nose'. Implement a function named 'handle_test_command' that takes two parameters: a strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_test_command('test', 'help') == 'Displaying help information for the test command.'\", \"assert handle_test_command('test', 'nose') == 'Executing unit tests using the Nose testing framework.'\", \"assert handle_test_command('test', 'pytest') == 'Inval... | {
"split": "train",
"index": 75241,
"acecode_id": "oss_16376",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a two-dimensional list representing a matrix of integers. Implement a function that copies a specified rectangular submatrix from the source matrix to a target position in the same matrix. The function should take the following parameters: \n- `matrix`: a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert copy_submatrix([[1,1,1],[1,1,1],[1,1,1]], 1, 1, 2, 2, 0, 0) == [[1, 1, 1], [1, 1, 1], [1, 1, 1]]\", \"assert copy_submatrix([[1,2,3],[4,5,6]], 0, 0, 0, 2, 1, 0) == [[1, 2, 3], [1, 2, 3]]\", \"assert copy_submatrix([[1,1,1],[1,1,1],[1,1,1]], 0, 1, 2, 2, 0, 0)... | {
"split": "train",
"index": 75242,
"acecode_id": "bigcode_python_fns_42652",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes an array of numerical values with decimal precision as input and returns the second smallest numerical value present in that array. If the array has fewer than two distinct values, the function should return None.\nPlease reason step by step, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert second_least_value([14.1, 25.2, 120.6, 66.9, 5.3]) == 14.1\", \"assert second_least_value([5.1, 5.1, 5.1]) == None\", \"assert second_least_value([1.0, 2.0, 3.0]) == 2.0\", \"assert second_least_value([0.1, 0.2, 0.3, 0.4]) == 0.2\", \"assert second_least_val... | {
"split": "train",
"index": 75243,
"acecode_id": "evol_4635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Write a function that returns a list containing the square of each integer from the input list. The output list should maintain the same order as the input list. Your function should handle an empty list as well. \n\nFunction signature: `def sq... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_numbers([1, 2, 3]) == [1, 4, 9]\", \"assert square_numbers([-1, -2, -3]) == [1, 4, 9]\", \"assert square_numbers([0]) == [0]\", \"assert square_numbers([]) == []\", \"assert square_numbers([10, -10]) == [100, 100]\", \"assert square_numbers([1000]) ==... | {
"split": "train",
"index": 75244,
"acecode_id": "bigcode_python_fns_5738",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `bf(planet1: str, planet2: str) -> Tuple[str]` that accepts two input strings representing planet names in our solar system. The function should return a tuple containing the names of the planets that are situated orbitally closer to the sun between planet1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bf('Jupiter', 'Neptune') == ('Saturn', 'Uranus')\", \"assert bf('Uranus', 'Saturn') == ()\", \"assert bf('Neptune', 'Earth') == ('Mars', 'Jupiter', 'Saturn', 'Uranus')\", \"assert bf('Earth', 'Neptune') == ('Mars', 'Jupiter', 'Saturn', 'Uranus')\", \"assert ... | {
"split": "train",
"index": 75245,
"acecode_id": "evol_9404",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `word_count` that takes a string input representing the content of a document and returns a dictionary with the counts of each word in the document. The function should be case-insensitive, meaning that 'Word' and 'word' should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_count('Hello world!') == {'hello': 1, 'world': 1}\", \"assert word_count('Hello hello') == {'hello': 2}\", \"assert word_count('Word123 word123') == {'word123': 2}\", \"assert word_count('One two three. One two?') == {'one': 2, 'two': 2, 'three': 1}\", ... | {
"split": "train",
"index": 75246,
"acecode_id": "oss_33771",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given key vault name exists in a predefined list of key vaults. The function takes in the name of the key vault as a string and returns a boolean value indicating whether the key vault exists in the list. If the input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_key_vault_existence('vault1') == True\", \"assert check_key_vault_existence('vault2') == True\", \"assert check_key_vault_existence('vault3') == True\", \"assert check_key_vault_existence('vault4') == True\", \"assert check_key_vault_existence('vault5'... | {
"split": "train",
"index": 75247,
"acecode_id": "oss_5800",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters tweets based on specific keywords. The function should take a list of tweets, where each tweet is represented as a dictionary with at least a 'text' key. Your goal is to create a function called `filter_tweets_by_keywords... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_tweets_by_keywords([{'text': 'I love programming'}, {'text': 'Python is great'}, {'text': 'Hello World'}], ['Python', 'Java']) == [{'text': 'Python is great'}]\", \"assert filter_tweets_by_keywords([{'text': 'I love programming'}, {'text': 'Python is ... | {
"split": "train",
"index": 75248,
"acecode_id": "oss_35329",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of expressions represented as strings, implement a function `expr_list_not_empty(expr_list: List[str]) -> List[str]` that returns a new list containing all non-empty expressions from the input list. The expressions are separated by commas in the input list, and the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert expr_list_not_empty(['expr1', ' ', 'expr2', '', 'expr3']) == ['expr1', 'expr2', 'expr3']\", \"assert expr_list_not_empty(['', ' ', '']) == []\", \"assert expr_list_not_empty(['single_expr']) == ['single_expr']\", \"assert expr_list_not_empty([]) == []\", \"a... | {
"split": "train",
"index": 75249,
"acecode_id": "bigcode_python_fns_18744",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to parse a list of tuples representing station data and return a tuple containing the first element of each tuple in the input list. Write a function `parse_stations` that takes a list of tuples `input_data` as input, where each tuple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_stations([(1,)]) == (1,)\", \"assert parse_stations([(2,), (3,)]) == (2, 3)\", \"assert parse_stations([(5,), (10,), (15,)]) == (5, 10, 15)\", \"assert parse_stations([(0,)]) == (0,)\", \"assert parse_stations([(7,), (8,), (9,), (10,)]) == (7, 8, 9, 10... | {
"split": "train",
"index": 75250,
"acecode_id": "oss_37559",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given the dimensions of an image as two integers, width and height. Write a function that checks if the image is oriented horizontally (i.e., if the width is greater than the height). If the image is horizontal, the function should return the new dimensions of the image... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rotate_image_dimensions(800, 600) == (600, 800)\", \"assert rotate_image_dimensions(1200, 1200) == (1200, 1200)\", \"assert rotate_image_dimensions(1024, 768) == (768, 1024)\", \"assert rotate_image_dimensions(500, 300) == (300, 500)\", \"assert rotate_image... | {
"split": "train",
"index": 75251,
"acecode_id": "bigcode_python_fns_38842",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents an entry of data. Your task is to implement a Python function `extract_feature(data, feature_key)` that takes in two parameters: - `data`: A list of dictionaries representing the data entries. - `feature_key... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_feature([{ 'id': 1, 'name': 'Alice'}, { 'id': 2, 'name': 'Bob'}, { 'id': 3, 'name': 'Charlie'}], 'name') == ['Alice', 'Bob', 'Charlie']\", \"assert extract_feature([{ 'id': 1, 'age': 25 }, { 'id': 2, 'age': 30 }, { 'id': 3, 'age': 28 }], 'age') == [2... | {
"split": "train",
"index": 75252,
"acecode_id": "oss_30145",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `sentence`, write a function `check_sentence_ending(sentence: str) -> bool` that checks if the sentence ends with a period ('.'). If the sentence ends with a period, return `True`, otherwise return `False`. The input will be a single string that may contain any c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_sentence_ending('Hello, world.') == True\", \"assert check_sentence_ending('This is a test.') == True\", \"assert check_sentence_ending('No period here') == False\", \"assert check_sentence_ending('Another test case.') == True\", \"assert check_sentenc... | {
"split": "train",
"index": 75253,
"acecode_id": "bigcode_python_fns_13694",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `multi_auth_required(auth_methods: List[str], headers: Dict[str, str], cookies: Dict[str, str], data: Any) -> bool` that simulates the behavior of a Flask route protection mechanism using multiple authentication methods. The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multi_auth_required(['bearer'], {'Authorization': 'Bearer valid_token'}, {}, '') == True\", \"assert multi_auth_required(['session'], {}, {'session_id': 'valid_session'}, '') == True\", \"assert multi_auth_required(['signedgrant'], {}, {}, 'valid_grant') == ... | {
"split": "train",
"index": 75254,
"acecode_id": "oss_32616",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that finds the closest symbol to a given position in a text editor. The function takes in a list of tuples, where each tuple contains a region (represented as a pair of integers) and a symbol (a string). The region represents the star... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_closest_symbol([((1, 3), 'x'), ((4, 6), 'y'), ((7, 9), 'z')], 5) == 'y'\", \"assert find_closest_symbol([((0, 2), 'A'), ((3, 5), 'B'), ((6, 8), 'C')], 4) == 'B'\", \"assert find_closest_symbol([((10, 12), 'W'), ((20, 22), 'X'), ((30, 32), 'Y')], 21) == ... | {
"split": "train",
"index": 75255,
"acecode_id": "oss_19160",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D matrix consisting of integer elements, implement a function `search(matrix, element)` that searches for a specific integer element in the matrix. If the element is found, return its index as a tuple (row, column). If the element is not present in the matrix, return -... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 5) == (1, 1)\", \"assert search([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 1) == (0, 0)\", \"assert search([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 9) == (2, 2)\", \"assert search([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 10) == -1\", \"... | {
"split": "train",
"index": 75256,
"acecode_id": "evol_12210",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts decision trees from a list of strings, where each string represents a decision tree. The function should also validate the feature names associated with each tree. If a list of feature names is provided, the function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_trees(['tree1', 'tree2', 'tree3'], []) == ['tree1', 'tree2', 'tree3']\", \"assert extract_trees(['treeA', 'treeB'], ['feature1', 'feature2']) == ['treeA', 'treeB']\", \"assert extract_trees(['single_tree'], []) == ['single_tree']\", \"assert extract_... | {
"split": "train",
"index": 75257,
"acecode_id": "oss_23028",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, return the length of the longest substring between two equal characters, excluding the two characters. If there is no such substring return `-1`. Additionally, the substring should not contain any repeating characters. If there are multiple substrings satisf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxLengthBetweenEqualCharacters('aa') == 0\", \"assert maxLengthBetweenEqualCharacters('abca') == 2\", \"assert maxLengthBetweenEqualCharacters('cbzxy') == -1\", \"assert maxLengthBetweenEqualCharacters('abcabc') == 2\", \"assert maxLengthBetweenEqualCharact... | {
"split": "train",
"index": 75258,
"acecode_id": "evol_20075",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of strings, where each string represents a command or argument. Your function should return a single string that concatenates all the elements of the list, enclosing each element in double quotes and separating them with... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_command(['ls', '-l', '/home/user']) == '\\\"ls\\\" \\\"-l\\\" \\\"/home/user\\\"'\", \"assert format_command(['echo', 'Hello, World!']) == '\\\"echo\\\" \\\"Hello, World!\\\"'\", \"assert format_command(['git', 'commit', '-m', 'Initial commit']) == '\... | {
"split": "train",
"index": 75259,
"acecode_id": "bigcode_python_fns_16332",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a temperature in Fahrenheit. Implement a function `convert_temperature(fahrenheit: float, to_celsius: bool) -> float` that converts the given temperature to either Celsius or Kelvin based on the value of the `to_celsius` flag. If `to_celsius` is True, convert the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_temperature(32, True) == 0.0\", \"assert convert_temperature(32, False) == 273.15\", \"assert convert_temperature(212, True) == 100.0\", \"assert convert_temperature(212, False) == 373.15\", \"assert convert_temperature(0, True) == -17.77777777777778... | {
"split": "train",
"index": 75260,
"acecode_id": "bigcode_python_fns_29172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the preprocessing steps for a question-answering system based on a specified step name. The function should take a single argument, `step`, which is a string that can be one of the following: \"prepare_corenlp\", \"prep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert preprocess_data('prepare_corenlp') == 'CoreNLP preprocessing completed.'\", \"assert preprocess_data('prepare_raw_input') == 'Raw input preprocessing completed.'\", \"assert preprocess_data('cache_data') == 'Data caching completed.'\", \"assert preprocess_da... | {
"split": "train",
"index": 75261,
"acecode_id": "oss_26180",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `modify_list(arr: List[int]) -> List[int]` that returns a new list containing only the even numbers from the input list. If the input list is empty, the function should return an empty list. Your implementation should ensure that the o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_list([]) == []\", \"assert modify_list([1, 3, 5]) == []\", \"assert modify_list([2, 4, 6]) == [2, 4, 6]\", \"assert modify_list([1, 2, 3, 4]) == [2, 4]\", \"assert modify_list([10, 15, 20, 25]) == [10, 20]\", \"assert modify_list([0, -1, -2, -3]) == [... | {
"split": "train",
"index": 75262,
"acecode_id": "oss_21410",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simplified backup process. This function will take a directory structure represented as a list of tuples, where each tuple contains a directory name and a list of files within that directory. The function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert backup_directories([('dir1', ['file1.txt', 'file2.txt']), ('dir2', ['file3.txt']), ('dir3', ['file4.txt', 'file5.txt'])], ['dir2'], ['file2.txt']) == ['dir1', 'dir3']\", \"assert backup_directories([('dir1', ['file1.txt']), ('dir2', []), ('dir3', ['file4.txt... | {
"split": "train",
"index": 75263,
"acecode_id": "bigcode_python_fns_23431",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a one-dimensional array of integers, implement a function that returns a list of unique palindromic pairs found in the array. A palindromic pair is defined as a tuple (x, x) where x is an integer that appears at least twice in the array. The output should be a list of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_palindromic_pairs([1, 1, 2, 2, 3, 4]) == [(1, 1), (2, 2)]\", \"assert find_palindromic_pairs([3, 3, 3, 4, 4, 4]) == [(3, 3), (4, 4)]\", \"assert find_palindromic_pairs([5, 6, 7, 8]) == []\", \"assert find_palindromic_pairs([1, 1, 1, 2, 2]) == [(1, 1), (... | {
"split": "train",
"index": 75264,
"acecode_id": "evol_22411",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the movement of a drone in a 3D space based on a set of movement commands. The drone's position is represented by a tuple `(x, y, z)`, where `x` represents the left-right position, `y` represents the front-back position, and `z` represents the up-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_drone_movement((0, 0, 0), [(10, 5, 20, 15), (-3, 8, 5, -10), (0, 0, 0, 5)]) == (7, 13, 10)\", \"assert simulate_drone_movement((0, 0, 0), [(5, 5, 0, 0), (5, 5, 0, 0)]) == (10, 10, 0)\", \"assert simulate_drone_movement((0, 0, 0), [(0, 0, 0, 0)]) == ... | {
"split": "train",
"index": 75265,
"acecode_id": "oss_10950",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing an executor with the following structure: `{'input_arguments': {...}, 'executor': {'name': 'string', 'command': 'string'}}`. Your task is to implement a function `apply_executor(executor: Dict[str, Any], path: str, parameters: Dict[str, A... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_executor({'input_arguments': {'param1': 'value1'}, 'executor': {'name': 'executor1', 'command': 'run'}} , '/path/to/execute', {'param2': 'value2'}) == 'executor1 run param1=value1 param2=value2'\", \"assert apply_executor({'executor': {'name': 'executo... | {
"split": "train",
"index": 75266,
"acecode_id": "bigcode_python_fns_16141",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `max_subarray_sum` that returns the maximum sum of a contiguous subarray within the input list. A contiguous subarray is defined as a sequence of elements that are adjacent in the array. The function should run in O(n) time complexity,... | 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([0,0,0,0]) == 0\", \"assert max_subarray_sum... | {
"split": "train",
"index": 75267,
"acecode_id": "oss_6668",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom exception class for handling validation errors in a web application. Define a custom exception class called `ValidationException` that takes a dictionary of errors as its argument. This exception should represent validation errors in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_validation_exception(ValidationException({'username': 'Username is required'})) == ({'status': 400, 'errors': {'username': 'Username is required'}}, 400)\", \"assert handle_validation_exception(ValidationException({'email': 'Invalid email format'})) =... | {
"split": "train",
"index": 75268,
"acecode_id": "oss_858",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing quantities (zeros_quantity_list) and a list of communicators (communicator_list) that have a method to start a halo update with a given quantity. Your task is to implement a function that checks if each communicator successfully per... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_halo_update([0, 0, 0], [Communicator(1), Communicator(2), Communicator(3)]) == True\", \"assert check_halo_update([0, 1], [Communicator(1), Communicator(2)]) == False\", \"assert check_halo_update([1, 2, 3, 0], [Communicator(1), Communicator(2), Commun... | {
"split": "train",
"index": 75269,
"acecode_id": "bigcode_python_fns_27616",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `cross_multiply(list_1, list_2)` that accepts two lists of numerical values and returns a new list containing the result of the element-wise multiplication of the two input lists. If the input lists are of unequal lengths, raise a ValueError. If either list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cross_multiply([1, 2, 3], [4, 5, 6]) == [4, 10, 18]\", \"assert cross_multiply([10.5, 2.5], [2, 4]) == [21.0, 10.0]\", \"assert cross_multiply([-1, -2], [3, 4]) == [-3, -8]\", \"assert cross_multiply([0, 2], [5, 0]) == [0, 0]\", \"assert cross_multiply([1, 0... | {
"split": "train",
"index": 75270,
"acecode_id": "evol_13230",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that simulates a simple build system for software components. Your function should take a list of targets, where each target contains a name and a list of its dependencies. The function should return the correct order in which the targets ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_order([{'target_name': 'A', 'dependencies': []}, {'target_name': 'B', 'dependencies': ['A']}, {'target_name': 'C', 'dependencies': ['A', 'B']}]) == ['A', 'B', 'C']\", \"assert build_order([{'target_name': 'A', 'dependencies': []}, {'target_name': 'B', ... | {
"split": "train",
"index": 75271,
"acecode_id": "oss_7587",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a parser for a simple domain-specific language (DSL). The DSL consists of blocks and statements, each with specific syntax and semantics. A block is defined by a 'BEGIN' token, followed by multiple statements, and terminated by an 'END' token. E... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_dsl('BEGIN\\\\n entry1 value1\\\\n entry2 value2\\\\nEND') == [{'entry1': 'value1'}, {'entry2': 'value2'}]\", \"assert parse_dsl('BEGIN\\\\n entry1 value1\\\\n entry2 value2\\\\nEND\\\\n# This is a comment') == [{'entry1': 'value1'}, {'entr... | {
"split": "train",
"index": 75272,
"acecode_id": "oss_27992",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of edges representing a graph. Each edge is represented as a tuple (u, v) where u and v are the endpoints of the edge. Your task is to determine if the graph is bipartite. A graph is bipartite if you can color the graph using two colors such that no two adj... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_bipartite([(1, 2), (2, 3), (1, 3)]) == False\", \"assert is_bipartite([(1, 2), (2, 3), (3, 4), (4, 1)]) == True\", \"assert is_bipartite([(1, 2), (2, 3), (3, 1)]) == False\", \"assert is_bipartite([(1, 2)]) == True\", \"assert is_bipartite([(1, 2), (3, 4)... | {
"split": "train",
"index": 75273,
"acecode_id": "bigcode_python_fns_14524",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of bot configurations, each represented as a dictionary with keys 'bot_id', 'prefix', 'description', and 'state', write a function `get_bot_queue(bots: List[Dict[str, Union[str, int]]], state: str) -> List[Dict[str, Union[str, int]]]` that retrieves a list of bots ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_bot_queue([{'bot_id': '1', 'prefix': 'alpha', 'description': 'First bot', 'state': 'active'}, {'bot_id': '2', 'prefix': 'beta', 'description': 'Second bot', 'state': 'inactive'}, {'bot_id': '3', 'prefix': 'gamma', 'description': 'Third bot', 'state': 'ac... | {
"split": "train",
"index": 75274,
"acecode_id": "bigcode_python_fns_22513",
"num_tests": 10
} |
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([]) == 0\", \"assert max_profit([5]) == 0\", \"assert max_profit([10, 20, 10]) == 10\", \"assert max_profit([... | {
"split": "train",
"index": 75275,
"acecode_id": "oss_26268",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that receives a city name, temperature in Kelvin, and a wind speed in meters per second. The function should return a formatted string with the following information: the city name, temperature in Celsius and Fahrenheit, wind speed in kil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert weather_info('New York', 293.15, 5) == 'City: New York, Temperature: 20.0\\u00b0C | 68.0\\u00b0F, Wind: 18.0 km/h | 11.2 mph, Weather: Warm'\", \"assert weather_info('Los Angeles', 303.15, 3) == 'City: Los Angeles, Temperature: 30.0\\u00b0C | 86.0\\u00b0F, W... | {
"split": "train",
"index": 75276,
"acecode_id": "bigcode_python_fns_20739",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `long_write` that takes an integer as input and returns a byte string representing the input integer in a specific format. The format is as follows: \n- For positive integers, the byte string should represent the integer in little-end... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert long_write(1) == b'\\\\x01'\", \"assert long_write(255) == b'\\\\xff'\", \"assert long_write(256) == b'\\\\x00\\\\x01'\", \"assert long_write(65536) == b'\\\\x00\\\\x00\\\\x01'\", \"assert long_write(1000) == b'\\\\xe8\\\\x03'\", \"assert long_write(-1000) =... | {
"split": "train",
"index": 75277,
"acecode_id": "oss_21181",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names. Each file name can either be a regular file or a folder. Your task is to write a function that returns a sorted list of tuples, where each tuple contains the file name without its extension and the file name itself, but only for those files t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_xlsx_files(['file1.xlsx', 'document.docx', 'image.png']) == [('file1', 'file1.xlsx')]\", \"assert find_xlsx_files(['folder1', 'notes.txt', 'presentation.pptx']) == []\", \"assert find_xlsx_files(['archive.zip', 'file4.xlsx', 'readme.md']) == [('file4', ... | {
"split": "train",
"index": 75278,
"acecode_id": "bigcode_python_fns_36281",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a time in Greenwich Mean Time (GMT), write a function that converts it to Indian Standard Time (IST). The function should be able to handle various input formats such as '6:00', '6am', and '06:00:00'. If the input is invalid, return 'Invalid time format'. You may use the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_ist('6:00') == '11:30 AM'\", \"assert convert_to_ist('6am') == '11:30 AM'\", \"assert convert_to_ist('00:00') == '05:30 AM'\", \"assert convert_to_ist('23:59') == '05:29 AM'\", \"assert convert_to_ist('12:00:00') == '05:30 PM'\", \"assert convert_... | {
"split": "train",
"index": 75279,
"acecode_id": "evol_28699",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are required to implement a function that takes two integers as input parameters and returns their sum. The function should be named 'add' and accept two parameters, 'a' and 'b', which represent the integers to be summed. For example, if the inputs are 5 and 7, the output s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add(5, 7) == 12\", \"assert add(0, 0) == 0\", \"assert add(-1, 1) == 0\", \"assert add(-5, -10) == -15\", \"assert add(100, 200) == 300\", \"assert add(-50, 50) == 0\", \"assert add(1, 1) == 2\", \"assert add(999, 1) == 1000\", \"assert add(10, 15) == 25\", ... | {
"split": "train",
"index": 75280,
"acecode_id": "evol_2282",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `tokenize(input_string: str) -> List[Tuple[str, str]]` that takes a string `input_string` as input and returns a list of tokens based on the following rules: \n1. Identifiers are sequences of alphabetic characters (a-z, A-Z) and should be returned as ('IDEN... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tokenize('abc\\\\n123') == [('IDENTIFIER', 'abc'), ('LINE_FEED', '\\\\n'), ('ERROR', '1'), ('ERROR', '2'), ('ERROR', '3')]\", \"assert tokenize('xyz') == [('IDENTIFIER', 'xyz')]\", \"assert tokenize('hello\\\\nworld') == [('IDENTIFIER', 'hello'), ('LINE_FEED... | {
"split": "train",
"index": 75281,
"acecode_id": "oss_3375",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function called `run_tests` that simulates the behavior of a test runner. The function will take two optional parameters: `args` and `plugins`. If `args` is not provided, the function should set `args` to a default list containing the string '-x' ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_tests() == (['-x', 'test_directory'], None)\", \"assert run_tests(['--verbose']) == (['--verbose'], None)\", \"assert run_tests(plugins=['pytest_cov']) == (['-x', 'test_directory'], ['pytest_cov'])\", \"assert run_tests(['--maxfail=1'], ['pytest_mock']) ... | {
"split": "train",
"index": 75282,
"acecode_id": "bigcode_python_fns_49118",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given three integers. Your task is to implement a function named `largest` that returns the largest of the three integers. The function should take three parameters: `number1`, `number2`, and `number3`. You need to ensure that the function handles both positive and nega... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest(1, 2, 3) == 3\", \"assert largest(-1, -2, -3) == -1\", \"assert largest(0, 0, 0) == 0\", \"assert largest(-5, 5, 0) == 5\", \"assert largest(100, 50, 75) == 100\", \"assert largest(-10, -20, -5) == -5\", \"assert largest(7, 7, 7) == 7\", \"assert lar... | {
"split": "train",
"index": 75283,
"acecode_id": "oss_6495",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that generates commands to configure a Virtual Routing and Forwarding (VRF) instance. The function should accept a list of VRF names and a configuration action ('add' or 'delete'). Based on the action, it should return a list of command st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_vrf_commands(['Vrf1', 'Vrf2'], 'add') == ['sudo config vrf add Vrf1', 'sudo config vrf add Vrf2']\", \"assert generate_vrf_commands(['Vrf1'], 'add') == ['sudo config vrf add Vrf1']\", \"assert generate_vrf_commands(['Vrf1', 'Vrf2'], 'delete') == ['s... | {
"split": "train",
"index": 75284,
"acecode_id": "bigcode_python_fns_28156",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that constructs a sequence of layers for a simplified version of a neural network block. The function `build_conv_block` takes in the following parameters: \n- `dim`: An integer representing the input and output channel dimensions for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_conv_block(64, True, False) == ['ReflectionPad2d', 'Conv2d', 'Dropout']\", \"assert build_conv_block(32, False, True) == ['ReflectionPad2d', 'Conv2d']\", \"assert build_conv_block(128, True, True) == ['ReflectionPad2d', 'Conv2d', 'Dropout']\", \"assert... | {
"split": "train",
"index": 75285,
"acecode_id": "oss_34502",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that calculates the GPA based on a given letter grade and the number of credits for a course. The function should take two parameters: 'grade' (a string, which can be 'A+', 'A', 'A-', 'B+', 'B', 'B-', 'C+', 'C', 'C-', 'D+', 'D', 'D-', and 'F') and 'credits' (... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_gpa('A+', 3) == 12.0\", \"assert calculate_gpa('B', 3) == 9.0\", \"assert calculate_gpa('F', 3) == 0.0\", \"assert calculate_gpa('A-', 4) == 14.8\", \"assert calculate_gpa('C+', 2) == 4.6\", \"assert calculate_gpa('C', 5) == 10.0\", \"assert calcul... | {
"split": "train",
"index": 75286,
"acecode_id": "evol_29081",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing amounts of rewards earned by different delegators in a staking pool. Your task is to implement a function `calculate_average_rewards(rewards: List[int]) -> float` that calculates the average rewards earned by the delegators. The ave... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_rewards([1000000, 2000000, 3000000]) == 2000000.0\", \"assert calculate_average_rewards([-500000, -1500000, -2500000]) == -1500000.0\", \"assert calculate_average_rewards([500000]) == 500000.0\", \"assert calculate_average_rewards([]) == 0.... | {
"split": "train",
"index": 75287,
"acecode_id": "bigcode_python_fns_22098",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of torrent entries and calculates the size of each torrent file in megabytes, updating each entry's content_size attribute accordingly. Each torrent entry is represented as a dictionary that may or may not contain a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_torrent_entries([{'title': 'File1', 'torrent': {'size': 52428800}}, {'title': 'File2', 'torrent': {'size': 104857600}}, {'title': 'File3'}]) == [{'title': 'File1', 'torrent': {'size': 52428800}, 'content_size': 50.0}, {'title': 'File2', 'torrent': {'... | {
"split": "train",
"index": 75288,
"acecode_id": "oss_9733",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function to manage bookings for a tutoring center. The function should accept a list of bookings, where each booking is represented as a tuple containing the day index, hour, room name, and type of booking (either 'tutorial' or 'pool'). The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_bookings([(1, 10, 'Room A', 'tutorial'), (1, 10, 'Room B', 'tutorial'), (1, 11, 'Room C', 'pool')]) == ({(1, 10): ['Room A', 'Room B']}, {(1, 11): ['Room C']})\", \"assert manage_bookings([]) == ({}, {})\", \"assert manage_bookings([(4, 12, 'Room K', ... | {
"split": "train",
"index": 75289,
"acecode_id": "oss_28782",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a data structure that can be a tuple, a list, or any other type. Your task is to implement a function `access_length(data)` that returns the length of the data if it's a tuple or a list. However, if the first element of the tuple or list is not of type float, int,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert access_length([1, 2, 3]) == 3\", \"assert access_length((1, 2, 3)) == 3\", \"assert access_length('hello') == 5\", \"assert access_length([]) == 0\", \"assert access_length([(1, 2), (3, 4)]) == 2\", \"assert access_length(('a', 'b', 'c')) == 3\", \"assert ac... | {
"split": "train",
"index": 75290,
"acecode_id": "bigcode_python_fns_17885",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that filters out invalid DNS names from a list of partner node identifiers for a specific appliance type. The function should return a list containing only the DNS resolvable names of the partner nodes, which are defined as those c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_replication_partners('vSphere', ['node1', 'node2', 'node3']) == []\", \"assert filter_replication_partners('vSphere', []) == []\", \"assert filter_replication_partners('vSphere', ['single_dot.']) == ['single_dot.']\", \"assert filter_replication_partn... | {
"split": "train",
"index": 75291,
"acecode_id": "oss_34049",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of classifiers that describe various aspects of software. Your task is to implement a function `count_programming_languages(classifiers)` that takes a list of classifiers as input and returns a dictionary. The dictionary should contain the count of each uni... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_programming_languages(['Programming Language :: Python :: 3', 'Programming Language :: Python :: 3', 'Programming Language :: Java']) == {'Python': 2, 'Java': 1}\", \"assert count_programming_languages(['Programming Language :: C++', 'Programming Langu... | {
"split": "train",
"index": 75292,
"acecode_id": "oss_15231",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `is_palindrome` that checks if a given input string is a palindrome. A string is considered a palindrome if it reads the same backward as forward. The function should return True if the input string is a palindrome and False otherwise. For example, `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('level') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('A man a plan a canal Panama') == False\", \"assert is_palindrome('No lemon no melon') == False\", \"assert is_palindrome('racecar') == True\", \"assert is_p... | {
"split": "train",
"index": 75293,
"acecode_id": "evol_12240",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining the winner of a game played between two players, Takahashi and Aoki. The game starts with a given integer `n`, and the total number of turns is specified by `row`. The game alternates between the two players, with Takahashi going first. The winne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert game_winner(5, 3) == 'Aoki'\", \"assert game_winner(10, 5) == 'Aoki'\", \"assert game_winner(15, 4) == 'Aoki'\", \"assert game_winner(20, 6) == 'Aoki'\", \"assert game_winner(30, 8) == 'Takahashi'\", \"assert game_winner(100, 10) == 'Aoki'\", \"assert game_w... | {
"split": "train",
"index": 75294,
"acecode_id": "oss_12890",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with converting a decimal number in string format to its hexadecimal representation. Your function should handle both integer and decimal parts of the number. The hexadecimal representation should be returned as a string, without any leading zeros and without any... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decimal_to_hexadecimal('10') == 'A'\", \"assert decimal_to_hexadecimal('255') == 'FF'\", \"assert decimal_to_hexadecimal('0') == '0'\", \"assert decimal_to_hexadecimal('1.5') == '1.8'\", \"assert decimal_to_hexadecimal('2.75') == '2.C'\", \"assert decimal_to... | {
"split": "train",
"index": 75295,
"acecode_id": "bigcode_python_fns_5031",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple banking operation. The function should take an initial balance, a list of transactions, and return the final balance after processing all transactions. Each transaction is represented as a tuple where the first ele... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_operations(100, [('deposit', 50), ('withdraw', 30), ('withdraw', 150)]) == 120\", \"assert bank_operations(0, [('deposit', 100), ('withdraw', 50)]) == 50\", \"assert bank_operations(200, [('withdraw', 100), ('withdraw', 50), ('deposit', 30)]) == 80\", \... | {
"split": "train",
"index": 75296,
"acecode_id": "oss_30609",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are an expert burglar intending to loot residences situated in a linear arrangement. Each dwelling has a specific sum of money hidden, but there's a catch - the security systems of neighboring houses are interconnected, triggering an automatic police alert if two contiguous... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rob([1,2,3,1]) == 4\", \"assert rob([0,0,0,0]) == 0\", \"assert rob([50, 50, 100]) == 100\", \"assert rob([1, 3, 1, 3, 100]) == 103\", \"assert rob([5, 3, 4, 11, 2]) == 16\", \"assert rob([5, 5, 10, 100, 10, 5]) == 110\", \"assert rob([2, 4, 6, 2, 5]) == 11\... | {
"split": "train",
"index": 75297,
"acecode_id": "evol_6258",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a URL, write a function that counts the number of top-level parameters and the number of nested parameters present in the URL. A top-level parameter is a key that does not have any brackets in its name, while a nested parameter is a key that is part of a top-level paramet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_parameters('https://www.example.com?param1=value1¶m2=value2') == (2, 0)\", \"assert count_parameters('https://www.example.com?') == (0, 0)\", \"assert count_parameters('https://www.example.com?param1=value1&nested[param1]=value1') == (1, 1)\", \"as... | {
"split": "train",
"index": 75298,
"acecode_id": "evol_19140",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a simple optimizer for a machine learning model. The function should manage an optimizer and keep track of the learning rate and the number of optimization steps taken. The function will take in three parame... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_optimizer({'type': 'SGD'}, 0.01, [('update', 0.02), ('step', None), ('step', None)]) == (0.02, 2)\", \"assert manage_optimizer({'type': 'Adam'}, 0.1, [('step', None), ('update', 0.05), ('step', None), ('step', None)]) == (0.05, 3)\", \"assert manage_o... | {
"split": "train",
"index": 75299,
"acecode_id": "oss_31487",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.