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 list of strings, each representing a key-value pair in the format 'key=value'. Your task is to implement a function that takes a list of such strings and returns a dictionary containing all the key-value pairs. If a key appears more than once, the last occurrenc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_key_value_pairs(['a=1', 'b=2', 'a=3']) == {'a': '3', 'b': '2'}\", \"assert parse_key_value_pairs(['key1=value1', 'key2=value2', 'key1=value3']) == {'key1': 'value3', 'key2': 'value2'}\", \"assert parse_key_value_pairs(['x=10', 'y=20', 'x=30', 'z=40']) ...
{ "split": "train", "index": 64500, "acecode_id": "bigcode_python_fns_8246", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries where each dictionary contains two integer keys, 'a' and 'b'. Your task is to write a function that takes this list and returns a new list of dictionaries containing the sum of 'a' and 'b' under the key 'result'. If there is any error when a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sums([{'a': 1, 'b': 2}, {'a': 3, 'b': 4}]) == [{'result': 3}, {'result': 7}]\", \"assert calculate_sums([{'a': 5, 'b': 5}, {'a': 10, 'b': 10}]) == [{'result': 10}, {'result': 20}]\", \"assert calculate_sums([{'a': -1, 'b': 1}, {'a': 0, 'b': 0}]) ==...
{ "split": "train", "index": 64501, "acecode_id": "bigcode_python_fns_15059", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of article names and a target name. Write a function `get_article_index(articles: List[str], target: str) -> int` that returns the index of the target article in the list. If the target article does not exist in the list, return -1. The articles list may co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_article_index(['Article A', 'Article B', 'Article C'], 'Article B') == 1\", \"assert get_article_index(['Article A', 'Article B', 'Article C', 'Article B'], 'Article B') == 1\", \"assert get_article_index(['Article A', 'Article B', 'Article C'], 'Article...
{ "split": "train", "index": 64502, "acecode_id": "bigcode_python_fns_20142", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and two threshold values, high_thres and low_thres, implement a function that returns an array of the same size as the input list, where each element is either 1 or 0. The value should be 1 if the corresponding element in the input list is part of a con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert double_threshold([1, 2, 3, 4, 5], 6, 2) == [0, 0, 0, 0, 0]\", \"assert double_threshold([4, 4, 4, 4, 4], 5, 3) == [0, 0, 0, 0, 0]\", \"assert double_threshold([1, 0, 1], 0, 0) == [1, 0, 1]\", \"assert double_threshold([100, 200, 300], 250, 150) == [0, 1, 1]\...
{ "split": "train", "index": 64503, "acecode_id": "bigcode_python_fns_9866", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates unique IDs for instructor sections and exam sections. The function should take two parameters: 'num_instructor_sections' and 'num_exam_sections', which represent the number of unique IDs to generate for instructor se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_unique_ids(2, 2) == [8527, 8528, 1001, 1002]\", \"assert generate_unique_ids(1, 1) == [8527, 1001]\", \"assert generate_unique_ids(0, 0) == []\", \"assert generate_unique_ids(3, 0) == [8527, 8528, 8529]\", \"assert generate_unique_ids(0, 3) == [1001...
{ "split": "train", "index": 64504, "acecode_id": "oss_25949", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that returns a list of actions based on the given input string. The function should accept a single string as input, which can either be a specific action or the string 'all' to return all available actions. If the input string is a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert define_actions('walking') == ['walking']\", \"assert define_actions('lifting') == ['lifting']\", \"assert define_actions('wiping') == ['wiping']\", \"assert define_actions('co-existing') == ['co-existing']\", \"assert define_actions('co-operating') == ['co-o...
{ "split": "train", "index": 64505, "acecode_id": "bigcode_python_fns_37464", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that merges two pre-sorted lists into a single sorted list. The function should take two lists as input parameters and return a new list that contains all the elements from both input lists, sorted in ascending order. You must not use the built-in sort() fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sorted_lists([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sorted_lists([], [2, 4, 6]) == [2, 4, 6]\", \"assert merge_sorted_lists([1, 2, 3], []) == [1, 2, 3]\", \"assert merge_sorted_lists([], []) == []\", \"assert merge_sorted_lists([...
{ "split": "train", "index": 64506, "acecode_id": "evol_21151", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a matrix represented as a list of lists and a vector represented as a list, write a function that combines them into a homogeneous transformation matrix in homogeneous coordinates. The function should take two arguments: 'matrix' which is a list of lists (NxM) representin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert from_matrix_vector([[1, 0], [0, 1]], [1, 2]) == [[1, 0, 1], [0, 1, 2], [0, 0, 1]]\", \"assert from_matrix_vector([[2, 0], [0, 2]], [3, 4]) == [[2, 0, 3], [0, 2, 4], [0, 0, 1]]\", \"assert from_matrix_vector([[1, 2]], [5]) == [[1, 2, 5], [0, 0, 1]]\", \"asser...
{ "split": "train", "index": 64507, "acecode_id": "bigcode_python_fns_16314", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple bank account. The function should accept an initial balance, a list of deposit amounts, and a list of withdrawal amounts. The function should return the final balance after processing all deposits and withdrawa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_bank_account(1000, [500], [200]) == (1300, 2)\", \"assert simulate_bank_account(1000, [500, 200], [300]) == (1400, 3)\", \"assert simulate_bank_account(0, [100], [50]) == (50, 2)\", \"assert simulate_bank_account(100, [], []) == (100, 0)\", \"assert...
{ "split": "train", "index": 64508, "acecode_id": "oss_18596", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a ciphered character sequence, implement a function that checks if the sequence matches a specified regex pattern. The regex pattern must ensure that the sequence contains at least one letter, one digit, and one non-alphanumeric character. The function should return True ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_cipher('Ab12#', r'^(?=.*[a-zA-Z])(?=.*\\\\d)(?=.*[^a-zA-Z0-9]).+$') == True\", \"assert check_cipher('abc123', r'^(?=.*[a-zA-Z])(?=.*\\\\d)(?=.*[^a-zA-Z0-9]).+$') == False\", \"assert check_cipher('12345!', r'^(?=.*[a-zA-Z])(?=.*\\\\d)(?=.*[^a-zA-Z0-9]...
{ "split": "train", "index": 64509, "acecode_id": "evol_33962", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a string representation of a version number given its major and minor components. The function should be named `format_version` and should take two integer parameters: `major` and `minor`. The output should be a string ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_version(0, 0) == 'ClassVersion(major=0, minor=0)'\", \"assert format_version(1, 0) == 'ClassVersion(major=1, minor=0)'\", \"assert format_version(2, 3) == 'ClassVersion(major=2, minor=3)'\", \"assert format_version(10, 5) == 'ClassVersion(major=10, mi...
{ "split": "train", "index": 64510, "acecode_id": "oss_1202", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of timestamps in seconds since the epoch (January 1, 1970). Your task is to write a function `format_timestamps(timestamps: List[int]) -> List[Tuple[str, str]]` that takes a list of timestamps and returns a list of tuples. Each tuple should contain the form...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_timestamps([0]) == [('00:00:00', '1970-01-01')]\", \"assert format_timestamps([1609459200]) == [('00:00:00', '2021-01-01')]\", \"assert format_timestamps([1612137600]) == [('00:00:00', '2021-02-01')]\", \"assert format_timestamps([1633046400]) == [('0...
{ "split": "train", "index": 64511, "acecode_id": "bigcode_python_fns_23239", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a ranking system for a sports competition. Your goal is to create a function that takes a list of players and their performance metrics and returns the player with the highest overall score. Each player's performance is represented by a tuple co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_top_player([(1, 2, 10), (2, 3, 15), (3, 2, 10)]) == 2\", \"assert find_top_player([(1, 0, 5), (2, 0, 5), (3, 0, 5)]) == 1\", \"assert find_top_player([(4, 2, 20), (5, 1, 20)]) == 4\", \"assert find_top_player([(1, 1, 10), (2, 1, 10), (3, 2, 15)]) == 3\"...
{ "split": "train", "index": 64512, "acecode_id": "oss_35000", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a latency test between two virtual machines (VMs). Implement a function `simulate_latency_test` that takes in the following parameters: `sending_vm_ip` (a string representing the IP address of the sending VM), `receiving_vm_ip` (a string represent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(simulate_latency_test('10.0.0.1', '10.0.0.2', True)) == 10\", \"assert len(simulate_latency_test('10.0.0.1', '10.0.0.2', False)) == 10\", \"assert all(8 <= latency <= 80 for latency in simulate_latency_test('192.168.1.1', '192.168.1.2', True))\", \"asser...
{ "split": "train", "index": 64513, "acecode_id": "bigcode_python_fns_29311", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Create a function `linked_list_to_array(head: Node) -> List[int]` that converts a singly linked list into an array. Each node of the linked list contains an integer value. The function should return an array containing the values of the linked list in the order they appear from...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linked_list_to_array(Node(4)) == [4]\", \"assert linked_list_to_array(Node(1, Node(2))) == [1, 2]\", \"assert linked_list_to_array(Node(3, Node(2, Node(1)))) == [3, 2, 1]\", \"assert linked_list_to_array(Node(10, Node(20, Node(30, Node(40))))) == [10, 20, 30...
{ "split": "train", "index": 64514, "acecode_id": "evol_9082", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to parse font data from an AppleSingle or AppleDouble container. These containers are used to store files on Apple file systems and may contain various types of data, including fonts. Write a Python function `parse_apple_container(dat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_apple_container('font:Arial;size:12;') == {'name': 'Arial', 'size': 12}\", \"assert parse_apple_container('font:Helvetica;size:14;') == {'name': 'Helvetica', 'size': 14}\", \"assert parse_apple_container('font:Times New Roman;size:16;') == {'name': 'Ti...
{ "split": "train", "index": 64515, "acecode_id": "oss_33987", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing test names in a testing repository. Write a function `find_test(test_name: str, test_list: List[str]) -> bool` that checks if a specific test name exists in the list. The function should return `True` if the test name is found, and `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_test('unit_test_1', ['unit_test_1', 'unit_test_2', 'unit_test_1']) == True\", \"assert find_test('integration_test', ['unit_test_1', 'unit_test_2']) == False\", \"assert find_test('unit_test_3', ['unit_test_1', 'unit_test_2', 'unit_test_1']) == False\",...
{ "split": "train", "index": 64516, "acecode_id": "bigcode_python_fns_28793", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of temperatures in degrees Celsius, write a function `average_temperature(temperatures: List[float]) -> float` that calculates the average temperature. The temperatures in the list can be positive or negative. The average should be returned as a float rounded to tw...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_temperature([20.0, 30.0, 25.0]) == 25.0\", \"assert average_temperature([-10.0, 0.0, 10.0]) == 0.0\", \"assert average_temperature([100.0, 200.0, 300.0]) == 200.0\", \"assert average_temperature([-5.0, -10.0, -15.0]) == -10.0\", \"assert average_temp...
{ "split": "train", "index": 64517, "acecode_id": "bigcode_python_fns_40257", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function to calculate the sum, average, median, and mode of an array of integers. The function should handle any missing or None values in the array. You should not use any built-in functions or libraries for calculating these values. Implement a single function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_statistics([5, 5, None, 5]) == {'sum': 15, 'average': 5.0, 'median': 5, 'mode': [5]}\", \"assert calculate_statistics([1, 2, 2, 3, None]) == {'sum': 8, 'average': 2.0, 'median': 2, 'mode': [2]}\", \"assert calculate_statistics([10, None, 20, 30]) =...
{ "split": "train", "index": 64518, "acecode_id": "evol_15592", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a selection process from a vending machine. The vending machine has a set of items, each associated with a price. The function should take in an item name and an amount of money provided by the user. It should return a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_item('cola', 2.00, {'cola': 1.50, 'chips': 1.00, 'candy': 0.75}) == ('cola', 0.5)\", \"assert select_item('chips', 1.00, {'cola': 1.50, 'chips': 1.00, 'candy': 0.75}) == ('chips', 0.0)\", \"assert select_item('water', 1.00, {'cola': 1.50, 'chips': 1.0...
{ "split": "train", "index": 64519, "acecode_id": "oss_28272", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `calculate_net_income(gross_income: float, liabilities: float, tax_rate: float) -> float` that takes the gross income, accountable liabilities, and tax rate (as a percentage) as inputs and returns the net income. The net income is calculated by subtracting the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_net_income(100000, 20000, 30) == 50000.0\", \"assert calculate_net_income(50000, 15000, 20) == 25000.0\", \"assert calculate_net_income(0, 0, 0) == 0.0\", \"assert calculate_net_income(50000, 0, 10) == 45000.0\", \"assert calculate_net_income(10000...
{ "split": "train", "index": 64520, "acecode_id": "evol_485", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `create_human` that generates a dictionary representation of a human with default values for name ('John') and age (5). The function should also allow for custom values for name and age. The function should take two optional parameters, `name` (string) and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_human() == {'name': 'John', 'age': 5}\", \"assert create_human('Alice', 10) == {'name': 'Alice', 'age': 10}\", \"assert create_human('Dana', 25) == {'name': 'Dana', 'age': 25}\", \"assert create_human('Eve', 18) == {'name': 'Eve', 'age': 18}\", \"asse...
{ "split": "train", "index": 64521, "acecode_id": "evol_10925", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing words in a vocabulary. Your task is to create a function that initializes a vocabulary dictionary and a reversed vocabulary list. The function should take a list of words as input and return a dictionary where each unique word maps t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_vocabulary(['apple', 'banana', 'orange']) == ({'apple': 0, 'banana': 1, 'orange': 2}, ['apple', 'banana', 'orange'])\", \"assert initialize_vocabulary(['red', 'green', 'blue']) == ({'red': 0, 'green': 1, 'blue': 2}, ['red', 'green', 'blue'])\", \"...
{ "split": "train", "index": 64522, "acecode_id": "bigcode_python_fns_6167", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `validate_phone_number(phone_number: str) -> bool` that checks if the given string is a valid US phone number. The number may optionally include an international dialing code, area code, and/or separators such as spaces, parentheses, or hyphens. A valid US ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_phone_number('+1 123-456-7890') == True\", \"assert validate_phone_number('(123) 456-7890') == True\", \"assert validate_phone_number('123 456 7890') == True\", \"assert validate_phone_number('123-456-7890') == True\", \"assert validate_phone_number...
{ "split": "train", "index": 64523, "acecode_id": "evol_8686", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a log formatting function for a software application. The function should take a log message and a log type as input and return the formatted log message. The log types are defined as follows: Type 1 for 'Notify', Type 2 for 'Warning', and Type ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_log('System started', 1) == '[INFO]: System started'\", \"assert format_log('Disk space low', 2) == '[WARNING]: Disk space low'\", \"assert format_log('File not found', 3) == '[ERROR]: File not found'\", \"assert format_log('User logged in', 1) == '[I...
{ "split": "train", "index": 64524, "acecode_id": "oss_1706", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a dictionary containing variable templates and their corresponding values. Each key in the input dictionary represents a variable name and its associated value is a template string that may contain instances of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_variable_templates({'greeting': 'Hi, {{user}}!', 'user': 'Bob'}) == {'greeting': 'Hi, Bob!', 'user': 'Bob'}\", \"assert process_variable_templates({'title': 'Mr. {{name}}', 'name': 'John'}) == {'title': 'Mr. John', 'name': 'John'}\", \"assert process...
{ "split": "train", "index": 64525, "acecode_id": "oss_31476", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that checks if all the alphabetic characters in a given input string are unique and do not repeat. The function should return True if all alphabetic characters are unique and False otherwise.\nPlease reason step by step, then write a self-contained Python s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_string('Hello World!') == False\", \"assert validate_string('abcdefg') == True\", \"assert validate_string('Python3.8') == True\", \"assert validate_string('abcabc') == False\", \"assert validate_string('1234!@#$%^&*()') == True\", \"assert validate...
{ "split": "train", "index": 64526, "acecode_id": "evol_28227", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that simulates retrieving weather information for a given location. Your goal is to implement a function called `get_weather_data(location)` which takes a string `location` as an input parameter and returns a dictionary containing the foll...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_weather_data('New York') == {'temperature_celsius': 25.0, 'humidity': 60, 'wind_speed': 5.0, 'description': 'clear sky'}\", \"assert get_weather_data('Los Angeles') == {'temperature_celsius': 30.0, 'humidity': 50, 'wind_speed': 3.5, 'description': 'sunny...
{ "split": "train", "index": 64527, "acecode_id": "oss_18627", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that serializes a given Python object into a specific format based on the provided media type. Implement the function `serialize_data` that takes in a Python object `data` and a string `media_type`, and returns the serialized data ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert serialize_data({'name': 'Alice', 'age': 30}, 'application/json') == '{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}'\", \"assert serialize_data([1, 2, 3], 'application/json') == '[1, 2, 3]'\", \"assert serialize_data({'item': 'apple', 'quantity': 5}, 'applic...
{ "split": "train", "index": 64528, "acecode_id": "oss_20986", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries where each dictionary contains string keys and values of any type, write a function `transform_values(f: Callable[[Any], T], data: List[Dict[str, Any]]) -> List[Dict[str, T]]` that applies a function `f` to each value in each dictionary. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_values(lambda x: x + 1, [{'a': 1, 'b': 2}, {'c': 3}]) == [{'a': 2, 'b': 3}, {'c': 4}]\", \"assert transform_values(str, [{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}]) == [{'name': 'Alice', 'age': '30'}, {'name': 'Bob', 'age': '25'}]\",...
{ "split": "train", "index": 64529, "acecode_id": "bigcode_python_fns_41695", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that identifies the common elements in two given sets, counts the number of occurrences of these common elements in both sets, and determines the originating set for each common element. The function should return a dictionary where the keys are the common el...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert common_elements({1, 2, 3}, {3, 4, 5}) == {3: ([1, 1], 'both')}\", \"assert common_elements({1, 2}, {3, 4}) == {}\", \"assert common_elements({'a', 'b', 'c'}, {'c', 'd', 'e'}) == {'c': ([1, 1], 'both')}\", \"assert common_elements({10, 20, 30}, {20, 40, 50}) ...
{ "split": "train", "index": 64530, "acecode_id": "evol_24341", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Design a function in Python that takes two lists of integers as input and returns a list of unique elements that are present in both lists. The output list should be sorted in ascending order.\nPlease reason step by step, then write a self-contained Python solution. Give your f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert common_elements([1, 2, 3], [4, 5, 6]) == []\", \"assert common_elements([1, 1, 2, 3], [1, 2, 2]) == [1, 2]\", \"assert common_elements([], [1, 2, 3]) == []\", \"assert common_elements([1, 2, 3], []) == []\", \"assert common_elements([10, 20, 30], [30, 40, 50...
{ "split": "train", "index": 64531, "acecode_id": "evol_62", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, each representing a signal name. Your task is to implement a function that returns a list of unique signal names sorted in alphabetical order. Write a function `get_unique_signals(signals: List[str]) -> List[str]` that takes one parameter: a lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_signals(['review_request_published', 'review_published', 'reply_published']) == ['reply_published', 'review_published', 'review_request_published']\", \"assert get_unique_signals(['signal1', 'signal2', 'signal1', 'signal3']) == ['signal1', 'signal...
{ "split": "train", "index": 64532, "acecode_id": "bigcode_python_fns_6343", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to find a specific path in a directed acyclic graph (DAG). The graph is represented using an adjacency list, which is a dictionary where the keys are nodes (represented by integers) and the values are lists of adjacent nodes. Your goa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_path({1: [2], 2: []}, 1, 2) == [1, 2]\", \"assert find_path({1: [2, 3], 3: [4], 2: []}, 1, 4) == [1, 3, 4]\", \"assert find_path({1: [2], 2: [3], 3: [4], 4: []}, 1, 4) == [1, 2, 3, 4]\", \"assert find_path({1: [2, 3], 2: [], 3: [4], 4: []}, 1, 3) == [1,...
{ "split": "train", "index": 64533, "acecode_id": "oss_17076", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string representing a sequence of numbers separated by spaces. Your task is to implement a function `sum_of_squares(s: str) -> int` that calculates the sum of the squares of the integers in the string. If the string is empty or contains no valid integers, return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_squares('1 -2 3') == 14\", \"assert sum_of_squares('4 5 -6') == 77\", \"assert sum_of_squares('0 0 0') == 0\", \"assert sum_of_squares('') == 0\", \"assert sum_of_squares('10 -10') == 200\", \"assert sum_of_squares('1 2 3 4 5') == 55\", \"assert sum_o...
{ "split": "train", "index": 64534, "acecode_id": "oss_30379", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a debug level, a string representing the name of a component, an action string, and an affected component, write a function `log_action(dlevel: int, caller: str, action: str, affected: Any) -> str` that returns a log message indicating the action taken by the caller on th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_action(1, 'ComponentA', 'start', 'Packet1') == 'Caller ComponentA performed action start on Packet1'\", \"assert log_action(2, 'ComponentB', 'stop', 'Packet2') == 'Caller ComponentB performed action stop on Packet2'\", \"assert log_action(3, 'ComponentC'...
{ "split": "train", "index": 64535, "acecode_id": "bigcode_python_fns_33440", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that checks whether a given list of integers contains only even numbers. The function should return True if all numbers in the list are even, and False otherwise.\nPlease reason step by step, then write a self-contained Python solution. Give your fin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_all_even([2, 4, 6, 8]) == True\", \"assert is_all_even([2, 4, 5, 8]) == False\", \"assert is_all_even([0, 2, 4]) == True\", \"assert is_all_even([1, 3, 5]) == False\", \"assert is_all_even([]) == True\", \"assert is_all_even([2]) == True\", \"assert is_al...
{ "split": "train", "index": 64536, "acecode_id": "evol_980", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named 'largest_smallest_integers' that takes a list of integers as input and returns a tuple (a, b, c, d). In this tuple, 'a' should be the largest negative even integer, 'b' should be the smallest non-negative even integer, 'c' should be the largest negati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largest_smallest_integers([2, -4, 1, 3, 5, 7]) == (-4, 2, None, 1)\", \"assert largest_smallest_integers([]) == (None, None, None, None)\", \"assert largest_smallest_integers([0, -2, -1, 3]) == (-2, 0, -1, 3)\", \"assert largest_smallest_integers([-2, -4, -6...
{ "split": "train", "index": 64537, "acecode_id": "evol_3784", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of weights and a list of values corresponding to each item, along with the maximum capacity of a knapsack. Your task is to implement a function that calculates the maximum profit that can be achieved by filling the knapsack using the fractional knapsack app...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fractional_knapsack([10, 20, 30], [60, 100, 120], 50) == 240\", \"assert fractional_knapsack([1, 2, 3], [5, 10, 15], 4) == 20\", \"assert fractional_knapsack([10], [100], 10) == 100\", \"assert fractional_knapsack([10, 20], [60, 100], 0) == 0\", \"assert fra...
{ "split": "train", "index": 64538, "acecode_id": "bigcode_python_fns_30228", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function named `str_to_int_list` that takes a string of space-separated digits and returns a list of integers formed by taking two consecutive digits as each integer. If the input string contains any non-integer values, the function should raise TypeError. If the st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert str_to_int_list('123456') == [12, 34, 56]\", \"assert str_to_int_list('12345') == [12, 34, 5]\", \"assert str_to_int_list('9876543210') == [98, 76, 54, 32, 10]\", \"assert str_to_int_list('1') == [1]\", \"assert str_to_int_list('10') == [10]\", \"assert str_...
{ "split": "train", "index": 64539, "acecode_id": "evol_14383", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that swaps two elements in a list at given indices. The function should take a list of integers and two indices as input, then swap the elements at these indices. If either index is out of bounds or if the list is empty, the function should return None. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert swap_elements([1, 2, 3, 4], 0, 2) == [3, 2, 1, 4]\", \"assert swap_elements([5, 6, 7, 8], 1, 3) == [5, 8, 7, 6]\", \"assert swap_elements([10, 20, 30, 40], 0, 1) == [20, 10, 30, 40]\", \"assert swap_elements([5], 0, 0) == [5]\", \"assert swap_elements([], 0,...
{ "split": "train", "index": 64540, "acecode_id": "evol_36122", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a decorator function that wraps a given function and handles exceptions that may occur during its execution. If an exception is raised, the decorator should log the error message using the logging module at the INFO level and return None. If no exce...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_exceptions(lambda x: x / 0)(5) is None\", \"assert handle_exceptions(lambda x: x + 1)(5) == 6\", \"assert handle_exceptions(lambda x: 10 / x)(2) == 5\", \"assert handle_exceptions(lambda x: x ** 2)(3) == 9\", \"assert handle_exceptions(lambda x: x * 5...
{ "split": "train", "index": 64541, "acecode_id": "bigcode_python_fns_16013", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given an integer array `nums` and an integer `k`, return the `kth` largest element in the array. You need to implement your own sorting algorithm from scratch and cannot use any built-in sorting functions. Note that it is the `kth` largest element in the sorted order, not the `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findKthLargest([3, 2, 1, 5, 6, 4], 2) == 5\", \"assert findKthLargest([3, 2, 3, 1, 2, 4, 5, 5, 6], 4) == 4\", \"assert findKthLargest([1], 1) == 1\", \"assert findKthLargest([2, 1], 1) == 2\", \"assert findKthLargest([2, 1], 2) == 1\", \"assert findKthLarges...
{ "split": "train", "index": 64542, "acecode_id": "evol_26966", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of parsing command-line arguments for an exporter configuration. The function should accept two optional parameters: `port` and `address`. The `port` parameter should specify the port on which the exporter is l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_exporter_config() == {'port': 9221, 'address': ''}\", \"assert parse_exporter_config(port=8080) == {'port': 8080, 'address': ''}\", \"assert parse_exporter_config(address='127.0.0.1') == {'port': 9221, 'address': '127.0.0.1'}\", \"assert parse_exporter...
{ "split": "train", "index": 64543, "acecode_id": "oss_7849", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that applies a sequence of shift values to encrypt a given text using the Caesar Cipher method. The function should accept a string and a list of integers as inputs, where each integer represents a shift value. The function needs to apply each shift value c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert caeser_encrypt('abc', [1, 2, 3]) == 'bdf'\", \"assert caeser_encrypt('xyz', [1]) == 'yza'\", \"assert caeser_encrypt('A B C', [1, 1, 1]) == 'B C D'\", \"assert caeser_encrypt('a b c', [1, 1, 1]) == 'b c d'\", \"assert caeser_encrypt('Amazing!', [0, 0, 0]) ==...
{ "split": "train", "index": 64544, "acecode_id": "evol_4414", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that accepts a string and returns a new string with each character duplicated. Write a function `duplicate_characters` that takes a single parameter `input_string` (a string) and returns a new string where each character in `input_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert duplicate_characters('abc') == 'aabbcc'\", \"assert duplicate_characters('') == ''\", \"assert duplicate_characters('hello') == 'hheelllloo'\", \"assert duplicate_characters('123') == '112233'\", \"assert duplicate_characters('!@#') == '!!@@##'\", \"assert d...
{ "split": "train", "index": 64545, "acecode_id": "oss_23067", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 3x3 board representing a sliding puzzle. Each cell contains a number from 1 to 8 and one empty space represented by 0. Your task is to implement a function `nnovez_to_solve(board: List[List[int]]) -> int` that returns the minimum number of moves required to solv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nnovez_to_solve([[1,2,3],[4,5,6],[7,0,8]]) == 1\", \"assert nnovez_to_solve([[1,2,3],[4,5,6],[0,7,8]]) == 2\", \"assert nnovez_to_solve([[1,0,3],[4,2,5],[7,8,6]]) == 3\", \"assert nnovez_to_solve([[1,2,3],[4,6,5],[7,8,0]]) == -1\", \"assert nnovez_to_solve([...
{ "split": "train", "index": 64546, "acecode_id": "evol_30402", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a string that represents a data type, return an integer corresponding to that data type based on a predefined mapping. The data types and their corresponding integers are as follows: BOOL = 1, BYTE = 2, UBYTE = 3, SHORT = 4, USHORT = 5, INT = 6, UINT = 7, LONG = 8, ULONG ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_data_type_value('BOOL') == 1\", \"assert get_data_type_value('BYTE') == 2\", \"assert get_data_type_value('UBYTE') == 3\", \"assert get_data_type_value('SHORT') == 4\", \"assert get_data_type_value('USHORT') == 5\", \"assert get_data_type_value('INT') ==...
{ "split": "train", "index": 64547, "acecode_id": "bigcode_python_fns_39278", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a configuration dictionary to return a Config object. The Config object should contain specific attributes based on the keys and values in the input dictionary. The attributes are as follows: \n- `token` (mandatory):...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_config({'token': 'abc123'}) == Config(token='abc123', directory=Path('./'), host=None, owners=[], repos=[])\", \"assert parse_config({'token': 'abc123', 'directory': '/home/user'}) == Config(token='abc123', directory=Path('/home/user'), host=None, owne...
{ "split": "train", "index": 64548, "acecode_id": "oss_16448", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a dictionary of proxy settings where the keys are the names of the proxies and the values are the corresponding values. Your task is to implement a function `apply_proxies(proxies: Dict[str, str]) -> Dict[str, Dict[str, Dict[str, str]]]`, that will create a new st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_proxies({'http_proxy': 'http://proxy.com', 'https_proxy': 'https://proxy.com'}) == {'build': {'artifacts': [{'docker': {'buildArgs': {'http_proxy': 'http://proxy.com', 'https_proxy': 'https://proxy.com'}}}]}}\", \"assert apply_proxies({'no_proxy': 'loc...
{ "split": "train", "index": 64549, "acecode_id": "bigcode_python_fns_39295", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that calculates both the median and the standard deviation of the list without sorting it. The function should handle cases where the list is comprised of both even and odd counts of elements. Your function should return a tuple co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median_and_standard_deviation([3, 1, 2, 4, 5]) == (3, 1.4142135623730951)\", \"assert median_and_standard_deviation([1, 2, 3]) == (2, 0.816496580927726)\", \"assert median_and_standard_deviation([5, 5, 5, 5]) == (5, 0.0)\", \"assert median_and_standard_devia...
{ "split": "train", "index": 64550, "acecode_id": "evol_10372", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of resetting a device. The function, `reset_device`, takes no arguments and performs a reset operation, which is represented as printing 'Device has been reset.'. Implement the `reset_device` function to achiev...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reset_device() == None\", \"assert reset_device() == None\", \"assert reset_device() == None\", \"assert reset_device() == None\", \"assert reset_device() == None\", \"assert reset_device() == None\", \"assert reset_device() == None\", \"assert reset_device(...
{ "split": "train", "index": 64551, "acecode_id": "bigcode_python_fns_300", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the process of applying database migrations to a simplified database schema. Each migration operation is represented as a tuple with the following format: (operation_type, model_name, field_name, field_type). Your function should take a list of mi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_migrations([('CreateModel', 'User', 'username', 'CharField')]) == {'User': [('username', 'CharField')]}\", \"assert apply_migrations([('CreateModel', 'Comment', 'text', 'TextField'), ('AddField', 'Comment', 'post_id', 'IntegerField')]) == {'Comment': [...
{ "split": "train", "index": 64552, "acecode_id": "oss_19250", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a feature extraction function for text classification. Write a function `update_features(text: str, feature_dict: dict) -> None` that takes an input string `text` and a dictionary `feature_dict` where each key corresponds to a specific feature t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_features('The quick brown fox', {'suffix-brown': 0, 'prefix-The': 0, 'unigram-The': 0, 'bigram-The-quick': 0, 'trigram-The-quick-brown': 0, 'starting_capital': 0, 'capital_inside': 0, 'number_inside': 0, 'hyphen_inside': 0}) == None\", \"assert update...
{ "split": "train", "index": 64553, "acecode_id": "oss_27833", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the net amounts of transactions in a financial dataset. Your task is to write a function called `average_change` that calculates the average change in the net amounts over the given period. The average change is defined as the sum o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_change([0, 0, 0, 0]) == 0.0\", \"assert average_change([10, 20, 30, 40]) == 10.0\", \"assert average_change([-10, -20, -30, -40]) == -10.0\", \"assert average_change([100, 200, 100, 200, 300]) == 50.0\", \"assert average_change([1, 2, 3, 4, 5, 6]) ==...
{ "split": "train", "index": 64554, "acecode_id": "oss_24973", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that simulates the termination of an application based on its state. The function should take the application's name as input and return a string indicating the termination status. The function will simulate the following states for the ap...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert terminate_application('MyApp', 'running') == 'Application terminated successfully'\", \"assert terminate_application('MyApp', 'already stopped') == 'Application was already stopped'\", \"assert terminate_application('MyApp', 'not running') == 'Application wa...
{ "split": "train", "index": 64555, "acecode_id": "bigcode_python_fns_23150", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `check_puzzle_answer(user_input: str, answer: str) -> bool` that takes a user's answer to a puzzle and the correct answer as input, and returns `True` if the user's answer matches the correct answer (case-insensitive), and `False` otherwise.\nPlease reason ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_puzzle_answer('It\\u2019s daytime!', 'It\\u2019s daytime!') == True\", \"assert check_puzzle_answer('josh', 'Josh') == True\", \"assert check_puzzle_answer('Beauty', 'Beauty') == True\", \"assert check_puzzle_answer('BEAUTY', 'beauty') == True\", \"ass...
{ "split": "train", "index": 64556, "acecode_id": "evol_19937", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a specific array based on an integer input. Write a function `generate_array(n)` that takes an integer `n` as input and returns an array containing two elements: the first element should always be `1`, and the second elemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_array(1) == [1, 0]\", \"assert generate_array(2) == [1, 1]\", \"assert generate_array(3) == [1, 2]\", \"assert generate_array(4) == [1, 3]\", \"assert generate_array(5) == [1, 4]\", \"assert generate_array(6) == [1, 5]\", \"assert generate_array(7) ...
{ "split": "train", "index": 64557, "acecode_id": "oss_13536", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the capabilities of a single agent. Each integer represents a specific capability that the agent possesses. Your task is to implement a function `can_call_function(agent_capabilities: List[int], required_capabilities: List[int]) -> ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_call_function([1, 2, 3], [2, 3]) == True\", \"assert can_call_function([1, 2, 3], [3, 4]) == False\", \"assert can_call_function([5, 6, 7, 8], [5, 6]) == True\", \"assert can_call_function([10, 20, 30], [10, 40]) == False\", \"assert can_call_function([1...
{ "split": "train", "index": 64558, "acecode_id": "bigcode_python_fns_29546", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `fibonacciSeries(n: int) -> List[int]` that returns a list of the first `n` Fibonacci numbers. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the previous two numbers. If `n` is less tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacciSeries(0) == []\", \"assert fibonacciSeries(1) == [0]\", \"assert fibonacciSeries(2) == [0, 1]\", \"assert fibonacciSeries(3) == [0, 1, 1]\", \"assert fibonacciSeries(4) == [0, 1, 1, 2]\", \"assert fibonacciSeries(5) == [0, 1, 1, 2, 3]\", \"assert f...
{ "split": "train", "index": 64559, "acecode_id": "evol_29889", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_min_number(numbers: List[int]) -> int` that takes a list of integers and returns the smallest integer from the list. The input list will always contain at least one integer.\nPlease reason step by step, then write a self-contained Python solution. Giv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_min_number([12, 24, 72, 1, 4]) == 1\", \"assert find_min_number([5, 3, 8, 6, 2]) == 2\", \"assert find_min_number([-1, -5, -3, -4]) == -5\", \"assert find_min_number([100, 200, 300, 400]) == 100\", \"assert find_min_number([0, 0, 0, 0]) == 0\", \"assert...
{ "split": "train", "index": 64560, "acecode_id": "evol_11901", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the hours of availability for a project, implement a function `validate_availability_hours(hours: List[int]) -> Tuple[List[str], List[str]]` that validates the input data for missing values and monotonicity. The function should return a tup...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_availability_hours([1, 2, 3, 4]) == ([], [])\", \"assert validate_availability_hours([1, 2, 3, 2]) == ([], ['List is not monotonically non-decreasing'])\", \"assert validate_availability_hours([5, 5, 5, 5]) == ([], [])\", \"assert validate_availabil...
{ "split": "train", "index": 64561, "acecode_id": "bigcode_python_fns_6638", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `text`, determine if it contains any characters from a predefined set of 'filter detection characters'. You need to implement a function `check_filter(text: str) -> bool` that returns `True` if any of the characters in `text` are present in the set of filter dete...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_filter('Hello World!') == True\", \"assert check_filter('Test@123') == True\", \"assert check_filter('No special chars') == False\", \"assert check_filter('$$$ Money!') == True\", \"assert check_filter('Filter Example: %') == True\", \"assert check_fil...
{ "split": "train", "index": 64562, "acecode_id": "bigcode_python_fns_32288", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing sales data represented as a list of dictionaries in Python. Each dictionary contains the following keys: 'date' (a string), 'product' (a string), 'quantity' (an integer), and 'total_amount' (a float). Your task is to implement a function that proce...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_sales_data([{'date': '2023-01-01', 'product': 'A', 'quantity': 10, 'total_amount': 100.0}, {'date': '2023-01-02', 'product': 'B', 'quantity': 5, 'total_amount': 50.0}, {'date': '2023-01-01', 'product': 'A', 'quantity': 15, 'total_amount': 150.0}]) ==...
{ "split": "train", "index": 64563, "acecode_id": "oss_30409", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the setup of a page configuration for a web application. The function should take two parameters: `layout`, which is a string that can either be 'wide' or 'centered', and `menu_items`, which is a dictionary containing menu ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_page_config('wide', {'Home': 'http://home.com', 'Contact': 'http://contact.com'}) == 'Layout: wide, Menu: [Home: http://home.com, Contact: http://contact.com]'\", \"assert set_page_config('centered', {'About': 'http://about.com'}) == 'Layout: centered, M...
{ "split": "train", "index": 64564, "acecode_id": "oss_23121", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `simulate_starvation(priorities: List[int], threshold: int) -> List[int]` that simulates the aging of processes based on their priority levels. The function takes in a list of integers representing the priorities of processes and a threshold value. For each...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_starvation([5, 3, 1], 2) == [4, 2, 0]\", \"assert simulate_starvation([10, 8, 6], 3) == [9, 7, 5]\", \"assert simulate_starvation([0, 0, 0], 1) == [0, 0, 0]\", \"assert simulate_starvation([1, 1, 1], 3) == [0, 0, 0]\", \"assert simulate_starvation([...
{ "split": "train", "index": 64565, "acecode_id": "evol_32068", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a program to simulate a simple vending machine functionality. The vending machine has a set of available items, each with a unique code, name, and price. You need to create a function that accepts a list of items, a list of coins inserted, and a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert vending_machine([('A1', 'Soda', 1.50), ('B2', 'Chips', 1.00)], [1.00, 0.50], 'A1') == 'Soda'\", \"assert vending_machine([('A1', 'Soda', 1.50), ('B2', 'Chips', 1.00)], [1.00, 0.50], 'B2') == 'Chips'\", \"assert vending_machine([('A1', 'Soda', 1.50), ('B2', '...
{ "split": "train", "index": 64566, "acecode_id": "oss_28190", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of media items, where each media item is represented by a dictionary containing 'title', 'description', 'category', and 'release_date'. The function should return a list of titles of media items that were released in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_media_titles_released_in_2022([{'title': 'Movie A', 'description': 'Description A', 'category': 'Action', 'release_date': '2022-05-01'}, {'title': 'Movie B', 'description': 'Description B', 'category': 'Drama', 'release_date': '2021-03-15'}]) == ['Movie ...
{ "split": "train", "index": 64567, "acecode_id": "oss_22113", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that filters a list of private network descriptions based on a given keyword. The function should take two inputs: a list of strings representing network descriptions and a string keyword. The function should return a list of descriptions...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_network_descriptions(['My Network', 'Home Network', 'Office Network'], 'network') == ['My Network', 'Home Network', 'Office Network']\", \"assert filter_network_descriptions(['Private Network', 'Public Network', 'Test Network'], 'private') == ['Privat...
{ "split": "train", "index": 64568, "acecode_id": "bigcode_python_fns_30143", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a local ID generator function in Python that produces unique IDs within a specified range. Your function should take two parameters: 'start' and 'end', which define the inclusive range for generating IDs. The local ID generator should yield uniq...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert local_id_generator(1, 10) is not None\", \"assert isinstance(next(local_id_generator(1, 10)), int)\", \"assert 1 <= next(local_id_generator(1, 10)) <= 10\", \"assert 1 <= next(local_id_generator(1, 10)) <= 10\", \"assert 1 <= next(local_id_generator(1, 10)) ...
{ "split": "train", "index": 64569, "acecode_id": "oss_25884", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that identifies all prime numbers from a given list of integers. The function should also return the indices of these prime numbers in the original list. Additionally, for each index that is prime, if the number at that index is prime, it should be added...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert identify_primes([4, 6, 8, 9, 10]) == ([], [], [])\", \"assert identify_primes([10, 12, 14, 15]) == ([], [], [])\", \"assert identify_primes([1, 4, 6, 8]) == ([], [], [])\", \"assert identify_primes([29, 30, 31, 32, 33]) == ([29, 31], [0, 2], [31])\", \"asser...
{ "split": "train", "index": 64570, "acecode_id": "evol_25913", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given two parameters, `arg1` and `arg2`, implement a function that returns a string displaying the parameters in the format 'The first argument is {arg1} and the second argument is {arg2}'. Your function should handle both string and integer inputs for the parameters. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_parameters('hello', 'world') == 'The first argument is hello and the second argument is world'\", \"assert format_parameters(1, 2) == 'The first argument is 1 and the second argument is 2'\", \"assert format_parameters('test', 5) == 'The first argumen...
{ "split": "train", "index": 64571, "acecode_id": "bigcode_python_fns_40540", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D square grid of size N x N, where each cell contains a color represented as a tuple of three integers (R, G, B) ranging from 0 to 255, you need to rotate the grid by a given angle t in radians. Write a function that takes the source grid and the rotation angle as inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate([[255, 0, 0], [0, 255, 0], [0, 0, 255]], 0) == [[255, 0, 0], [0, 255, 0], [0, 0, 255]]\", \"assert rotate([[255, 255, 255], [255, 255, 255], [255, 255, 255]], 0) == [[255, 255, 255], [255, 255, 255], [255, 255, 255]]\", \"assert rotate([[255, 255, 0],...
{ "split": "train", "index": 64572, "acecode_id": "bigcode_python_fns_6012", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of integers and returns the sum of all even numbers in the list. If there are no even numbers, return 0. Your function should be named `sum_of_evens(numbers)` and take a single parameter `numbers`, which is a list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"...
{ "split": "train", "index": 64573, "acecode_id": "oss_34745", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string as input and returns the string in reverse order. You must not use any pre-defined string reversal functions or extra variables. Implement this functionality in a single function called `reverse_string`.\nPlease reason step by step, then wri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('Hello World!') == '!dlroW olleH'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('') == ''\", \"assert reverse_string('A') == 'A'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('OpenAI') ...
{ "split": "train", "index": 64574, "acecode_id": "evol_2078", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the disconnection of clients from a server using their session IDs (SIDs). Given a list of session IDs, your function should return a list of session IDs that remain connected after removing the specified disconnection sess...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert disconnect('abc123', ['abc123', 'xyz456', 'def789']) == ['xyz456', 'def789']\", \"assert disconnect('xyz456', ['abc123', 'xyz456', 'def789']) == ['abc123', 'def789']\", \"assert disconnect('def789', ['abc123', 'xyz456', 'def789']) == ['abc123', 'xyz456']\", ...
{ "split": "train", "index": 64575, "acecode_id": "bigcode_python_fns_10919", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named `binKey` that takes a string input representing a binary number (composed of '0's and '1's) and recursively counts the number of '0's in the string. The input string will always be valid, including the possibility of being an empty string. For example...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binKey('101') == 1\", \"assert binKey('1111') == 0\", \"assert binKey('10000101') == 5\", \"assert binKey('10101010') == 4\", \"assert binKey('0') == 1\", \"assert binKey('0000') == 4\", \"assert binKey('1') == 0\", \"assert binKey('1110') == 1\", \"assert b...
{ "split": "train", "index": 64576, "acecode_id": "evol_21476", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of password policies and corresponding passwords. Each policy specifies the lowest and highest number of times a specified letter must appear for the password to be considered valid. Your task is to determine the number of valid passwords according to two i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_valid_passwords([(1, 2)], ['b'], ['bb']) == (1, 0)\", \"assert count_valid_passwords([(2, 5)], ['d'], ['ddddd']) == (1, 0)\", \"assert count_valid_passwords([(1, 1)], ['e'], ['e']) == (1, 0)\", \"assert count_valid_passwords([(2, 4)], ['p'], ['pppp']) ...
{ "split": "train", "index": 64577, "acecode_id": "oss_34688", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of products, where each product is represented as a dictionary containing the following fields: 'product_id', 'product_name', 'category', 'price', and 'quantity'. Your task is to write a Python function that calculates the total quantity of products for a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_quantity([{'product_id': 1, 'product_name': 'ProductA', 'category': 'Electronics', 'price': 500, 'quantity': 10}, {'product_id': 2, 'product_name': 'ProductB', 'category': 'Clothing', 'price': 100, 'quantity': 20}, {'product_id': 3, 'product_...
{ "split": "train", "index": 64578, "acecode_id": "oss_13848", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of devices represented as dictionaries with 'bus' and 'address' keys, create a function `find_device_port(devices, target_device)` that returns the port number of the target device if it exists in the list. If the target device is not found in the list, return 'Dev...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_device_port([{'bus': 1, 'address': 10}, {'bus': 2, 'address': 20}], {'bus': 1, 'address': 10}) == 'Port 0'\", \"assert find_device_port([{'bus': 1, 'address': 10}, {'bus': 2, 'address': 20}], {'bus': 2, 'address': 20}) == 'Port 1'\", \"assert find_devic...
{ "split": "train", "index": 64579, "acecode_id": "bigcode_python_fns_8755", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `extract_min_max_indices(arr: List[int]) -> Tuple[int, int]` that returns the indices of the minimum and maximum values in the list. The function should return a tuple where the first element is the index of the minimum value and the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_min_max_indices([1, 2, 3, 4, 5]) == (0, 4)\", \"assert extract_min_max_indices([5, 4, 3, 2, 1]) == (4, 0)\", \"assert extract_min_max_indices([7, 3, 5, 3, 7]) == (1, 0)\", \"assert extract_min_max_indices([-1, -2, -3, -4]) == (3, 0)\", \"assert extra...
{ "split": "train", "index": 64580, "acecode_id": "bigcode_python_fns_942", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer `word_occurrence` representing how many texts a specific word appears in, and an integer `num_texts` representing the total number of texts, implement a function `inverse_document_frequency(word_occurrence: int, num_texts: int) -> float` that calculates the Inv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert inverse_document_frequency(1, 10) == 2.302585092994046\", \"assert inverse_document_frequency(2, 10) == 1.6094379124341003\", \"assert inverse_document_frequency(5, 10) == 0.6931471805599453\", \"assert inverse_document_frequency(10, 10) == 0.0\", \"assert i...
{ "split": "train", "index": 64581, "acecode_id": "bigcode_python_fns_27916", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function `normalize_string(s: str) -> str` that takes a string `s` as input and performs the following transformations: 1. Convert all characters in the string to lowercase. 2. Remove all punctuation characters from the string. 3. Remove the articles 'a', 'an', and 'the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_string('The quick brown fox jumps over a lazy dog.') == 'quick brown fox jumps over lazy dog'\", \"assert normalize_string('An apple a day keeps the doctor away.') == 'apple day keeps doctor away'\", \"assert normalize_string('Hello, World! This is...
{ "split": "train", "index": 64582, "acecode_id": "bigcode_python_fns_15704", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a given string of characters, including special characters, into its equivalent hexadecimal representation. If the input is not a string, the function should return an error message indicating that the input is invalid. The function should hav...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_hexadecimal('hello') == '68656c6c6f'\", \"assert to_hexadecimal('') == ''\", \"assert to_hexadecimal('!@#') == '214023'\", \"assert to_hexadecimal('123') == '313233'\", \"assert to_hexadecimal('abc') == '616263'\", \"assert to_hexadecimal(' ') == '20'\", ...
{ "split": "train", "index": 64583, "acecode_id": "evol_27522", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a dictionary and a string to generate a specific output. The function should take in a dictionary `l2c_` and a string `cpl`, and return a sorted list of keys from the dictionary where the corresponding value matches the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_sorted_keys({'a': 'x', 'b': 'y', 'c': 'x'}, 'x') == ['a', 'c']\", \"assert get_sorted_keys({'one': 'number', 'two': 'number', 'three': 'word'}, 'number') == ['one', 'two']\", \"assert get_sorted_keys({'cat': 'animal', 'dog': 'animal', 'fish': 'pet'}, 'pe...
{ "split": "train", "index": 64584, "acecode_id": "oss_5174", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You have been given a nested dictionary where each key can have either a primitive value or another dictionary as its value. Your task is to implement a function `attrdict(d: dict) -> AttrDict` that converts this nested dictionary into an object that supports attribute access t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert attrdict({'a': 1, 'b': {'c': 2}}).a == 1\", \"assert attrdict({'x': {'y': 3}}).x.y == 3\", \"assert isinstance(attrdict({'a': 1}), AttrDict)\", \"assert attrdict({'a': 10, 'b': 20}).b == 20\", \"assert attrdict({'name': 'Alice', 'age': {'years': 30}}).age.ye...
{ "split": "train", "index": 64585, "acecode_id": "bigcode_python_fns_34856", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings where each string contains a file class and a file name separated by a comma, create a function that returns a dictionary mapping each file class to its corresponding file name. However, only include entries where the file name starts with a specific pre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_file_class_dict(['ClassA,../../file1.txt', 'ClassB,../../file2.txt'], '../../', '//') == {'ClassA': '//file1.txt', 'ClassB': '//file2.txt'}\", \"assert create_file_class_dict(['ClassC,../../file3.txt'], '../../', '//') == {'ClassC': '//file3.txt'}\", ...
{ "split": "train", "index": 64586, "acecode_id": "bigcode_python_fns_23353", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of datasets and their content types. Each dataset can either be of type 'dataset' or 'dataset_collection'. Your function should take in a history ID and a list of datasets, and it should output two separate lists...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_datasets('history1', [{'id': '1', 'history_content_type': 'dataset'}, {'id': '2', 'history_content_type': 'dataset_collection'}]) == (['provenance1'], ['collection2'])\", \"assert process_datasets('history2', [{'id': '3', 'history_content_type': 'dat...
{ "split": "train", "index": 64587, "acecode_id": "bigcode_python_fns_32975", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages custom error handling for a hypothetical server. The function should accept either an integer representing a server error number and an associated exception class, or a dictionary where the keys are server error numbers and t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_custom_errors() == {}\", \"assert manage_custom_errors(1028, ValueError) == {1028: ValueError}\", \"assert manage_custom_errors(1029, KeyError) == {1029: KeyError}\", \"assert manage_custom_errors({1028: ValueError, 1029: KeyError}) == {1028: ValueErr...
{ "split": "train", "index": 64588, "acecode_id": "bigcode_python_fns_12907", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the upload and download process of files. The function `upload_download_test` takes a variable number of keyword arguments, where each key represents a file name and each value represents the size of the file in megabyt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upload_download_test(file1=10, file2=20) == (30, 30)\", \"assert upload_download_test(fileA=5, fileB=15, fileC=10) == (30, 30)\", \"assert upload_download_test(fileX=0) == (0, 0)\", \"assert upload_download_test() == (0, 0)\", \"assert upload_download_test(f...
{ "split": "train", "index": 64589, "acecode_id": "bigcode_python_fns_340", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a time in the format 'HH:MM:SS', write a function that converts this time into the total number of seconds since midnight. The input string will always be in the correct format with valid hours (00-23), minutes (00-59), and seconds (00-59). Your task...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert HHMMSS_to_seconds('00:00:00') == 0\", \"assert HHMMSS_to_seconds('01:00:00') == 3600\", \"assert HHMMSS_to_seconds('12:30:15') == 45015\", \"assert HHMMSS_to_seconds('23:59:59') == 86399\", \"assert HHMMSS_to_seconds('15:15:15') == 54915\", \"assert HHMMSS_t...
{ "split": "train", "index": 64590, "acecode_id": "bigcode_python_fns_28180", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a binary tree represented as a list of values, write a function that returns the number of nodes in the tree that have a specific target value. The binary tree is defined such that the first element in the list is the root node, and for any node at index i, its left child...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_nodes_with_value([], 0) == 0\", \"assert count_nodes_with_value([5, 3, 8, 2, 4, 7, 9], 10) == 0\", \"assert count_nodes_with_value([0], 0) == 1\", \"assert count_nodes_with_value([1, 2, 3, 4, 5, 6, 7], 8) == 0\", \"assert count_nodes_with_value([1, 2, ...
{ "split": "train", "index": 64591, "acecode_id": "bigcode_python_fns_34014", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a score function for a protein structure optimization problem. Implement a function `create_score_function(constraint_scale: float) -> dict` that creates a scoring dictionary for three types of constraints: atom pair constraints, dihedral constraint...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_score_function(1) == {'atom_pair': 5.0, 'dihedral': 1.0, 'angle': 1.0}\", \"assert create_score_function(0) == {'atom_pair': 0.0, 'dihedral': 0.0, 'angle': 0.0}\", \"assert create_score_function(2) == {'atom_pair': 10.0, 'dihedral': 2.0, 'angle': 2.0}...
{ "split": "train", "index": 64592, "acecode_id": "bigcode_python_fns_5773", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of floating-point numbers representing explained inertia values from a machine learning model. Your task is to implement a function that checks if the list is sorted in non-increasing order (i.e., the values should be in descending order). The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_explained_inertia_sorted([1.0, 0.9, 0.8, 0.7]) == True\", \"assert is_explained_inertia_sorted([0.5, 0.5, 0.5]) == True\", \"assert is_explained_inertia_sorted([1.0, 0.9, 0.9, 0.8]) == True\", \"assert is_explained_inertia_sorted([1.0, 0.9, 1.0]) == False...
{ "split": "train", "index": 64593, "acecode_id": "bigcode_python_fns_29243", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of objects, write a function `select_empty_objects(objects)` that takes a list of objects as input and returns a list containing only the objects of type 'EMPTY'. If there are no objects of type 'EMPTY', return an empty list. Each object is represented as a diction...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_empty_objects([{'type': 'EMPTY'}, {'type': 'CUBE'}, {'type': 'EMPTY'}, {'type': 'SPHERE'}]) == [{'type': 'EMPTY'}, {'type': 'EMPTY'}]\", \"assert select_empty_objects([{'type': 'CUBE'}, {'type': 'SPHERE'}, {'type': 'PYRAMID'}]) == []\", \"assert selec...
{ "split": "train", "index": 64594, "acecode_id": "bigcode_python_fns_22122", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of MAC addresses and updates a unique list of MAC addresses by adding any new MAC addresses that are not already in the existing list. The function should return a new list containing all unique MAC addresses. Write a fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_mac_addresses(['00:1A:2B:3C:4D:5E'], ['00:1A:2B:3C:4D:5F']) == ['00:1A:2B:3C:4D:5E', '00:1A:2B:3C:4D:5F']\", \"assert update_mac_addresses(['00:1A:2B:3C:4D:5E'], ['00:1A:2B:3C:4D:5E']) == ['00:1A:2B:3C:4D:5E']\", \"assert update_mac_addresses(['00:1A:...
{ "split": "train", "index": 64595, "acecode_id": "bigcode_python_fns_32069", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a `Client` object that has a method `run(command: str, structure: str) -> str`. Your task is to implement a function `locate_structure(client: Client, structure: str) -> str` that uses the `client` to locate a given `structure`. The `structure` is represented as a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert locate_structure(Client(), 'Building A') == Client().run('locate', 'Building A')\", \"assert locate_structure(Client(), 'Tree House') == Client().run('locate', 'Tree House')\", \"assert locate_structure(Client(), 'Bridge') == Client().run('locate', 'Bridge')...
{ "split": "train", "index": 64596, "acecode_id": "bigcode_python_fns_12282", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a QR code represented as a 2D list of binary values, where '1' represents a black module and '0' represents a white module. Your task is to generate a C-style representation of the QR code by converting each row of the binary matrix into hexadecimal format. Specif...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_qr_representation([[1, 1], [1, 1]]) == '0x03, 0x03'\", \"assert generate_qr_representation([[0, 0], [0, 0]]) == '0x00, 0x00'\", \"assert generate_qr_representation([[1, 0, 1], [0, 1, 0]]) == '0x05, 0x02'\", \"assert generate_qr_representation([[1, 1...
{ "split": "train", "index": 64597, "acecode_id": "bigcode_python_fns_34175", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that performs specific string manipulations. The function should take a string as input and return a modified version of the string based on the following rules: 1. If the input string contains the substring '条件为真' (Chinese cha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_string('\\u4f46\\u6761\\u4ef6\\u4e3a\\u771f\\u65f6\\uff0c\\u6267\\u884c\\u6d4b\\u8bd5') == '\\u4f46\\u6761\\u4ef6\\u4e3a\\u5047\\u65f6\\uff0c\\u8df3\\u8fc7\\u6d4b\\u8bd5'\", \"assert modify_string('\\u6267\\u884c\\u6d4b\\u8bd5\\u6761\\u4ef6\\u4e3a\\u7...
{ "split": "train", "index": 64598, "acecode_id": "oss_26883", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to index objects for a hypothetical database based on certain conditions. Implement a function `index_to_database` that takes the following parameters: \n- `app_label` (string): The label of the application. \n- `model_name` (string):...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert index_to_database('my_app', 'MyModel', 'MyDocument', [{'id': 1}, {'id': 2}, {'id': 3}]) == {'app_label': 'my_app', 'model_name': 'MyModel', 'document_class': 'MyDocument', 'objects_id': [1, 2, 3]}\", \"assert index_to_database('test_app', 'TestModel', 'TestD...
{ "split": "train", "index": 64599, "acecode_id": "oss_37345", "num_tests": 16 }