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": "Given two dictionaries, `given_dictionary` and `predefined_dictionary`, implement a function `merge_dictionaries(given_dictionary, predefined_dictionary)` that returns a new dictionary containing only the keys that are present in both dictionaries. For each common key, the valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_dictionaries({'a': 1, 'b': 2, 'c': 3, 'd': 4}, {'b': 4, 'd': 6, 'f': 8, 'g': 10}) == {'b': (2, 4), 'd': (4, 6)}\", \"assert merge_dictionaries({'x': 10, 'y': 20}, {'y': 30, 'z': 40}) == {'y': (20, 30)}\", \"assert merge_dictionaries({'key1': 100, 'key2...
{ "split": "train", "index": 81600, "acecode_id": "evol_26243", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string input that represents the status of a system, implement a function `get_status_code` that returns a corresponding status code based on the following criteria: If the input is '正常', return '1'; if the input is '停用', return '0'; if the input is an empty string, ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_status_code('\\u6b63\\u5e38') == '1'\", \"assert get_status_code('\\u505c\\u7528') == '0'\", \"assert get_status_code('\\u5176\\u4ed6\\u72b6\\u6001') == '\\u5176\\u4ed6\\u72b6\\u6001'\", \"assert get_status_code('') == ''\", \"assert get_status_code('act...
{ "split": "train", "index": 81601, "acecode_id": "bigcode_python_fns_10318", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes alerts for a group. Each alert has a start and end revision, and a bug ID associated with it. Your function should take an alert represented by a dictionary with keys 'start_revision', 'end_revision', and 'bug_id', and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_group({'start_revision': 10, 'end_revision': 15, 'bug_id': 4}, {'start_revision': 10, 'end_revision': 15, 'bug_id': None}) == {'start_revision': 10, 'end_revision': 15, 'bug_id': None}\", \"assert update_group({'start_revision': 2, 'end_revision': 6, ...
{ "split": "train", "index": 81602, "acecode_id": "bigcode_python_fns_39199", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a list of stock symbols, write a function `filter_stocks` that returns a list of stock symbols that start with a specified letter. The function should take two parameters: a list of strings `stocks` representing the stock symbols and a string `letter` representing the sta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_stocks(['AAPL', 'GOOGL', 'MSFT', 'AMZN', 'aapl'], 'A') == ['AAPL', 'AMZN', 'aapl']\", \"assert filter_stocks(['AAPL', 'GOOGL', 'MSFT', 'AMZN', 'aapl'], 'B') == []\", \"assert filter_stocks(['TSLA', 'FB', 'NFLX', 'TWTR'], 'T') == ['TSLA', 'TWTR']\", \"...
{ "split": "train", "index": 81603, "acecode_id": "bigcode_python_fns_3790", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that handles location response data in a mobile application. The function should update the location field and feedback message based on the response received. Specifically, you need to create a function `handle_location_response(resp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_location_response({'LOCATION_FRIENDLY': 'Central Park'}, {'text': ''}, {'text': ''}) == ('Central Park', 'Successfully got location!')\", \"assert handle_location_response({'LOCATION_FRIENDLY': 'Eiffel Tower'}, {'text': ''}, {'text': ''}) == ('Eiffel ...
{ "split": "train", "index": 81604, "acecode_id": "oss_20272", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total cost of a customer's order at a coffee shop based on the quantities of items they want to purchase. The prices for the items are as follows: Coffee: $2.50 per cup, Muffin: $3.00 each, and Croissant: $2.75 each. Your function should take...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_cost(0, 0, 0) == 0.0\", \"assert calculate_total_cost(1, 0, 0) == 2.7\", \"assert calculate_total_cost(0, 1, 0) == 3.24\", \"assert calculate_total_cost(4, 0, 0) == 10.80\", \"assert calculate_total_cost(2, 1, 0) == 8.64\"]}" }
{ "split": "train", "index": 81605, "acecode_id": "oss_27852", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates loading article information for a given thread ID. The function `load_article_info(thread_id: int, threads: List[Dict[str, Any]]) -> str` should take a thread ID and a list of threads, where each thread is represented a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_article_info(0, [{'id': 0, 'article_info': 'Article 1'}, {'id': 1, 'article_info': 'Article 2'}]) == 'Article 1'\", \"assert load_article_info(1, [{'id': 0, 'article_info': 'Article 1'}, {'id': 1, 'article_info': 'Article 2'}]) == 'Article 2'\", \"asser...
{ "split": "train", "index": 81606, "acecode_id": "bigcode_python_fns_39884", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `create_parser_udf` that initializes a parser configuration based on specified parameters. The function should accept the following parameters: `structural` (boolean, default: True), `blacklist` (list of strings, default: ['style', 'scrip...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_parser_udf() == {'structural': True, 'blacklist': ['style', 'script'], 'flatten': ['span', 'br'], 'language': 'en', 'lingual': True, 'strip': True, 'replacements': [('[\\\\u2010\\\\u2011\\\\u2012\\\\u2013\\\\u2014\\\\u2212]', '-')], 'tabular': True, '...
{ "split": "train", "index": 81607, "acecode_id": "bigcode_python_fns_18855", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given the coordinates of a bounding box in an image along with the dimensions of the image. Your task is to write a function `transform_bbox` that calculates and returns the center coordinates (x, y), width (w), and height (h) of the bounding box in relative terms based...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_bbox(0, 10, 0, 20, 100, 100) == (0.05, 0.1, 10, 20)\", \"assert transform_bbox(0, 0, 0, 0, 1, 1) == (0.0, 0.0, 0, 0)\", \"assert transform_bbox(1, 2, 1, 2, 10, 10) == (0.15, 0.15, 1, 1)\", \"assert transform_bbox(3, 7, 3, 7, 50, 50) == (0.1, 0.1, 4...
{ "split": "train", "index": 81608, "acecode_id": "oss_12317", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of markers used in various intervals. Your task is to implement a function that identifies the maximum number of markers used within any single interval where the interval is defined by the two indices of the list. The fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_markers([3, 5, 2, 8, 6]) == 8\", \"assert max_markers([1, 2, 3, 4, 5]) == 5\", \"assert max_markers([10, 20, 30, 40]) == 40\", \"assert max_markers([-1, -2, -3, -4]) == -1\", \"assert max_markers([0]) == 0\", \"assert max_markers([7, 5, 3, 1]) == 7\", \"...
{ "split": "train", "index": 81609, "acecode_id": "bigcode_python_fns_41215", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `f(x)` that calculates the x-th number in the Fibonacci sequence using memoization. The Fibonacci sequence is defined as follows: F(0) = 1, F(1) = 1, and for n > 1, F(n) = F(n-1) + F(n-2). Your function should take a non-negative integer x and return the x-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert f(0) == 1\", \"assert f(1) == 1\", \"assert f(2) == 2\", \"assert f(3) == 3\", \"assert f(4) == 5\", \"assert f(5) == 8\", \"assert f(6) == 13\", \"assert f(7) == 21\", \"assert f(8) == 34\", \"assert f(9) == 55\", \"assert f(10) == 89\", \"assert f(11) == 1...
{ "split": "train", "index": 81610, "acecode_id": "evol_1110", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `replace_and_count(s: str, t: str, r: str) -> Tuple[int, Dict[str, int]]` that replaces all occurrences of the substring `t` in the string `s` with the substring `r`. The function should return a tuple containing the total number of distinct words in the up...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_and_count('The quick brown fox jumps over the lazy dog.', 'fox', 'cat') == (8, {'the': 2, 'quick': 1, 'brown': 1, 'cat': 1, 'jumps': 1, 'over': 1, 'lazy': 1, 'dog': 1})\", \"assert replace_and_count('Hello world! Hello!', 'Hello', 'Hi') == (2, {'hi':...
{ "split": "train", "index": 81611, "acecode_id": "evol_2082", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a string 'path' representing a file or directory path, and a list of strings 'pattern_list' representing wildcard patterns, write a function that determines if the 'path' matches any of the patterns in 'pattern_list'. The wildcard patterns may include '*' which matches an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert glob_path_match('file.txt', ['*.txt', '*.pdf']) == True\", \"assert glob_path_match('file.txt', ['*.pdf', '*.doc']) == False\", \"assert glob_path_match('image.png', ['*.jpg', 'image.*']) == True\", \"assert glob_path_match('data/data1.csv', ['data/*.csv', '...
{ "split": "train", "index": 81612, "acecode_id": "bigcode_python_fns_17605", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing atomic numbers of a molecule's atoms, write a function that constructs a dictionary containing two keys: 'node_type' and 'n_feat'. The 'node_type' key should map to a list of atomic numbers, while 'n_feat' should map to a list of feature ve...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_atom_features([1, 6, 7, 8]) == {'node_type': [1, 6, 7, 8], 'n_feat': [[1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0]]}\", \"assert construct_atom_features([6, 6, 8, 1]) == {'node_type': [6, 6, 8, 1], 'n_feat': [[0, 1, 0, 0, 0], ...
{ "split": "train", "index": 81613, "acecode_id": "bigcode_python_fns_32361", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks the properties of a recurring schedule. Given a schedule represented as a dictionary with the keys 'schedule_id', 'enabled', 'recurring', 'days', 'start_time', 'end_time', 'duration', and 'schedule_data', your function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_schedule({'schedule_id': '123', 'enabled': True, 'recurring': True, 'days': ['Monday'], 'start_time': '09:00', 'end_time': '17:00', 'duration': 8, 'schedule_data': b'data'}) == True\", \"assert validate_schedule({'schedule_id': '124', 'enabled': Fal...
{ "split": "train", "index": 81614, "acecode_id": "bigcode_python_fns_36357", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings representing gene names, implement a function that returns a new list containing only the gene names that are classified as 'channels'. The list of channel names is provided as a second argument. The function should ignore duplicate channel names in the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_channels(['GeneA', 'GeneB', 'GeneC', 'GeneA'], ['GeneA', 'GeneC', 'GeneD']) == ['GeneA', 'GeneC']\", \"assert filter_channels(['GeneX', 'GeneY', 'GeneZ'], ['GeneA', 'GeneB']) == []\", \"assert filter_channels(['Channel1', 'Channel2', 'Channel1', 'Chan...
{ "split": "train", "index": 81615, "acecode_id": "bigcode_python_fns_33865", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function called `check_integers_type` that checks if all integers in the list are of the specified type. The function should take two parameters: a list of integers `nums` and a string `dtype` which could be either 'int' or 'float'. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_integers_type([1, 2, 3], 'int') == True\", \"assert check_integers_type([1, 2.0, 3], 'int') == False\", \"assert check_integers_type([1.0, 2.0, 3.0], 'float') == True\", \"assert check_integers_type([1, 2, 3.5], 'int') == False\", \"assert check_intege...
{ "split": "train", "index": 81616, "acecode_id": "bigcode_python_fns_34848", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D array of integers representing a grid of values. Your task is to implement a function `get_region_sum(grid: List[List[int]], row_start: int, row_end: int, col_start: int, col_end: int) -> int` that calculates the sum of all values in the specified rectangular...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_region_sum([[1, 2], [3, 4]], 0, 1, 0, 1) == 10\", \"assert get_region_sum([[1]], 0, 0, 0, 0) == 1\", \"assert get_region_sum([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 0, 1, 0, 1) == 12\", \"assert get_region_sum([[0, 0], [0, 0]], 0, 1, 0, 1) == 0\", \"assert ge...
{ "split": "train", "index": 81617, "acecode_id": "bigcode_python_fns_4188", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the sum of all even numbers in the list. If there are no even numbers, return 0. The function signature should be: `def sum_of_even_numbers(numbers: List[int]) -> int:`. The input list can contain both positive and negativ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_even_numbers([0, 2, 4, 6]) == 12\", \"assert sum_of_even_numbers([-2, -4, -6]) == -12\", \"assert sum_of_even_numbers([1, 3, 5]) == 0\", \"assert sum_of_even_numbers([10, 20, 30, 40]) == 100\", \"a...
{ "split": "train", "index": 81618, "acecode_id": "bigcode_python_fns_18048", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that represents a device backend name. Your task is to implement a function called 'validate_backend_name' that checks if the given backend name corresponds to a valid backend. A valid backend name is defined as any of the following: 'FakeVigo', 'FakePari...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_backend_name('FakeVigo') == True\", \"assert validate_backend_name('FakeParis') == True\", \"assert validate_backend_name('FakeMelbourne') == True\", \"assert validate_backend_name('FakeJohannesburg') == True\", \"assert validate_backend_name('FakeR...
{ "split": "train", "index": 81619, "acecode_id": "bigcode_python_fns_20290", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a clean disconnection of an LTE network. Write a function `clean_disconnect(verbose: bool) -> str` that takes a boolean parameter `verbose`. If `verbose` is `True`, the function should print debugging statements indicating the progress of the disc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_disconnect(True) == 'Disconnected Successfully'\", \"assert clean_disconnect(False) == 'Disconnected Successfully'\", \"assert clean_disconnect(True) == 'Disconnected Successfully'\", \"assert clean_disconnect(False) == 'Disconnected Successfully'\", \...
{ "split": "train", "index": 81620, "acecode_id": "bigcode_python_fns_32973", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the prices of a stock on different days. Your task is to determine the maximum profit that can be obtained by buying and selling the stock at most twice. Note that you cannot engage in multiple transactions simultaneously; you must ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_profit([3, 3, 5, 0, 0, 3, 1, 4]) == 6\", \"assert max_profit([1, 2, 3, 4, 5]) == 4\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([3, 2, 6, 5, 0, 3]) == 7\", \"assert max_profit([1, 2]) == 1\", \"assert max_profit([5, 5, 5, 5]) == 0\...
{ "split": "train", "index": 81621, "acecode_id": "oss_4449", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified data transformation pipeline. Your goal is to create a function `transform_pipeline(stages: List[Callable[[int], int]], input_data: int) -> int` that takes a list of transformation functions (stages) and an integer input_data. Each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_pipeline([lambda x: x + 1], 0) == 1\", \"assert transform_pipeline([lambda x: x * 2], 1) == 2\", \"assert transform_pipeline([lambda x: x - 3], 5) == 2\", \"assert transform_pipeline([lambda x: x + 10, lambda x: x * 3], 2) == 36\", \"assert transfo...
{ "split": "train", "index": 81622, "acecode_id": "oss_24987", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `evaluate_polynomial(terms: List[Tuple[int, int]], x: int) -> int` that takes a list of polynomial terms represented as tuples where each tuple contains a coefficient and an exponent, and an integer x. The function should return the value of the polynomial ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_polynomial([(5, 3), (-10, 2), (1, 1), (1, 0)], 1) == -3\", \"assert evaluate_polynomial([(1, 0)], 5) == 1\", \"assert evaluate_polynomial([(0, 1)], 3) == 0\", \"assert evaluate_polynomial([(1, 2), (2, 2)], 1) == 3\", \"assert evaluate_polynomial([(1...
{ "split": "train", "index": 81623, "acecode_id": "evol_749", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that extracts the short representation of a fully qualified XML tag. The function should take a single string input representing an XML tag, which may either be fully qualified or not. A fully qualified XML tag is defined as one that star...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert strip_tag('{namespace}tag') == 'tag'\", \"assert strip_tag('tag') == 'tag'\", \"assert strip_tag('{ns}element') == 'element'\", \"assert strip_tag('{example}item') == 'item'\", \"assert strip_tag('{a}b') == 'b'\", \"assert strip_tag('simpleTag') == 'simpleTa...
{ "split": "train", "index": 81624, "acecode_id": "bigcode_python_fns_29803", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a specified number of events. The function should take a single integer parameter, `num_events`, which represents the number of events to process. The function must return a string indicating how many events were processed....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_events(0) == 'Processing 0 events'\", \"assert process_events(1) == 'Processing 1 events'\", \"assert process_events(5) == 'Processing 5 events'\", \"assert process_events(10) == 'Processing 10 events'\", \"assert process_events(15) == 'Processing 15...
{ "split": "train", "index": 81625, "acecode_id": "oss_24729", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a data logging system for environmental monitoring. Your goal is to create a Python function `detect_anomalies(logs)` that processes a list of log dictionaries, each containing a 'temperature' (integer) and 'pressure' (float). An anomaly is defi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_anomalies([{'temperature': 36, 'pressure': 2.8}, {'temperature': 34, 'pressure': 3.2}, {'temperature': 40, 'pressure': 3.6}, {'temperature': 37, 'pressure': 2.3}]) == [1, 2, 3]\", \"assert detect_anomalies([{'temperature': 35, 'pressure': 2.5}, {'temp...
{ "split": "train", "index": 81626, "acecode_id": "oss_7067", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Implement a function that takes this list as input and returns the same list. Your function should simply return the input list without any modifications. The input list can contain any integers, including negative numbers and zero. Please impl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert return_same_list([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert return_same_list([-1, -2, -3]) == [-1, -2, -3]\", \"assert return_same_list([0]) == [0]\", \"assert return_same_list([]) == []\", \"assert return_same_list([10, 20, 30, -40]) == [10, 20, 30, -4...
{ "split": "train", "index": 81627, "acecode_id": "bigcode_python_fns_44865", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that generates a SQL query string to create a table based on the provided table name and a list of columns with their respective data types. The function should ensure that the specified data types are valid SQLite types: 'text', 'integer', 'real', or 'boolean...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_table_creation_query('users', [('id', 'integer'), ('username', 'text'), ('email', 'text')]) == \\\"CREATE TABLE IF NOT EXISTS users (id integer, username text, email text);\\\"\", \"assert get_table_creation_query('products', [('product_id', 'integer'), ...
{ "split": "train", "index": 81628, "acecode_id": "evol_13823", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of feature descriptions, where each feature description is represented as a string. You also have a feature name for which you want to determine if there is a corresponding category defined in the list of feature descriptions. Implement a function that take...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_feature_category(['color red', 'size medium', 'shape round'], 'size') == 'size'\", \"assert find_feature_category(['color red', 'size medium', 'shape round'], 'color') == 'color'\", \"assert find_feature_category(['color red', 'size medium', 'shape roun...
{ "split": "train", "index": 81629, "acecode_id": "bigcode_python_fns_39193", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the total cost of items in a shopping cart. The shopping cart is represented as a dictionary where the keys are items (strings) and the values are tuples containing the quantity (integer) and the price (float) of each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_cost({'orange': (1, 2.0), 'grapes': (2, 3.0)}) == 8.0\", \"assert calculate_total_cost({'milk': (1, 1.2), 'bread': (2, 2.5), 'eggs': (1, 3.0)}) == 9.2\", \"assert calculate_total_cost({'water': (5, 0.99)}) == 4.95\", \"assert calculate_total_...
{ "split": "train", "index": 81630, "acecode_id": "oss_4360", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a test recorder for an automated testing framework. The test recorder should track the number of test cases recorded and the number of failed test cases. Your goal is to implement a function `record_test_case(is_failed: bool) -> None` that recor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert record_test_case(True) == None\", \"assert record_test_case(False) == None\", \"assert record_test_case(False) == None\", \"assert record_test_case(True) == None\", \"assert record_test_case(False) == None\", \"assert record_test_case(False) == None\", \"ass...
{ "split": "train", "index": 81631, "acecode_id": "oss_27415", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the even integers from the input list. The order of the even integers in the output list should be the same as their order in the input list. Write a function named `fil...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([10, 15, 20, 25, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([0, 1, 2,...
{ "split": "train", "index": 81632, "acecode_id": "oss_2021", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `compute_gpa(courses: List[Tuple[str, str]]) -> float` that calculates the GPA of a student based on a list of courses. Each course is represented as a tuple containing the course name and the grade (A, B, C, D, E). The GPA is computed as the average of the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_gpa([]) == 0.0\", \"assert compute_gpa([('Math', 'A'), ('Physics', 'B')]) == 3.5\", \"assert compute_gpa([('Math', 'C'), ('Physics', 'A'), ('Chemistry', 'B')]) == 3.0\", \"assert compute_gpa([('Biology', 'D'), ('History', 'E')]) == 0.5\", \"assert co...
{ "split": "train", "index": 81633, "acecode_id": "evol_5838", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing an arithmetic expression in infix notation, implement a function that converts it to postfix notation (Reverse Polish Notation). The expression will only contain single-letter operands (a-z), operators (+, -, *, /, ^), and parentheses. Your function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert infixToPostfix('a+b') == 'ab+'\", \"assert infixToPostfix('a+b*c') == 'abc*+'\", \"assert infixToPostfix('(a+b)*c') == 'ab+c*'\", \"assert infixToPostfix('a+b-c') == 'ab+c-'\", \"assert infixToPostfix('a/(b+c)') == 'abc+/'\", \"assert infixToPostfix('((a+b)*...
{ "split": "train", "index": 81634, "acecode_id": "evol_15500", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that creates a simple representation of a Swagger API specification in JSON format. The function should take a title, version, and description as parameters and return a dictionary representing the Swagger specification. The Swagger s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_swagger_spec('Sample API', '1.0.0', 'A sample API for demonstration purposes') == {'swagger': '2.0', 'info': {'title': 'Sample API', 'version': '1.0.0', 'description': 'A sample API for demonstration purposes'}, 'paths': {}}\", \"assert create_swagger...
{ "split": "train", "index": 81635, "acecode_id": "oss_14972", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a given decimal integer into its binary representation as a string. The function should take a single integer argument and return the corresponding binary string without the '0b' prefix.\nPlease reason step by step, then write a self-contained...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_decimal_to_binary(0) == '0'\", \"assert convert_decimal_to_binary(1) == '1'\", \"assert convert_decimal_to_binary(2) == '10'\", \"assert convert_decimal_to_binary(3) == '11'\", \"assert convert_decimal_to_binary(4) == '100'\", \"assert convert_decima...
{ "split": "train", "index": 81636, "acecode_id": "evol_25132", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of URLs that may refer to local files, HTTP links, FTP links, and special DAP URLs. Your task is to implement a function `sort_url_list(url_list)` that sorts this list of URLs based on the following criteria: 1) Local file URLs should come first, sorted in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_url_list(['file://path/to/local/file', 'http://example.com', 'ftp://example.com', 'http://ecs.nasa.gov/data', 'http://dods.example.com']) == ['file://path/to/local/file', 'http://ecs.nasa.gov/data', 'http://example.com', 'http://dods.example.com', 'ftp:...
{ "split": "train", "index": 81637, "acecode_id": "bigcode_python_fns_15827", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of 3D points represented by their Cartesian coordinates (x, y, z), write a function that returns the vector representing the gravitational force acting on these points. The gravitational force can be represented as a vector (0, 0, -g), where g is the acceleration d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_gravity_force([(1, 2, 3), (4, 5, 6)]) == (0.0, 0.0, -19.62)\", \"assert calculate_gravity_force([(0, 0, 0), (1, 1, 1), (2, 2, 2)]) == (0.0, 0.0, -29.43)\", \"assert calculate_gravity_force([(1, 1, 1)]) == (0.0, 0.0, -9.81)\", \"assert calculate_gra...
{ "split": "train", "index": 81638, "acecode_id": "bigcode_python_fns_45035", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a target integer. Write a function that returns a list of all unique pairs (a, b) where a and b are integers from the input list such that a + b equals the target integer. Each pair (a, b) must be unique, meaning that (a, b) is considered th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pairs([1, 1, 2, 2, 3], 4) == [(1, 3), (2, 2)]\", \"assert find_pairs([1, 2, 3, 4, 5], 10) == []\", \"assert find_pairs([], 5) == []\", \"assert find_pairs([1, 1, 1, 1], 2) == [(1, 1)]\", \"assert find_pairs([2, 4, 3, 1, 5], 6) == [(2, 4), (1, 5)]\", \"a...
{ "split": "train", "index": 81639, "acecode_id": "bigcode_python_fns_23203", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a dictionary of string-integer pairs, implement a function `extract_entries(dictionary, string)` that extracts the entries whose keys commence with the given string. The function should return a new dictionary containing only those entries. If the string is empty or does ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_entries({'cat': 1, 'dog': 2, 'mouse': 3}, 'c') == {'cat': 1}\", \"assert extract_entries({'cat': 1, 'dog': 2, 'mouse': 3}, 'm') == {'mouse': 3}\", \"assert extract_entries({'cat': 1, 'dog': 2, 'mouse': 3}, 'd') == {'dog': 2}\", \"assert extract_entri...
{ "split": "train", "index": 81640, "acecode_id": "evol_34001", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `get_model_parameters(version: Tuple[str, str], use_dw: bool = False, use_dr: bool = False, bn_epsilon: float = 1e-3) -> Tuple[List[int], List[int], List[float]]` that generates the model parameters for the Jasper or QuartzNet architecture based...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_model_parameters(('jasper', '10x5'), False, False, 1e-3) == ([256, 256, 384, 512, 640, 768, 896, 1024], [11, 11, 13, 17, 21, 25, 29, 1], [0.2, 0.2, 0.2, 0.2, 0.3, 0.3, 0.4, 0.4])\", \"assert get_model_parameters(('quartznet', '10x5'), False, False, 1e-3)...
{ "split": "train", "index": 81641, "acecode_id": "bigcode_python_fns_46279", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the configuration of a machine learning model training process. The function should accept parameters equivalent to command-line arguments for configuring the training process. Your task is to implement a function `configur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_training() == {'learning_rate': 0.001, 'batch_size': 32, 'epochs': 10, 'l2_regularization': 1e-05, 'verbose': False, 'debug': 0, 'trn_images': 'all'}\", \"assert configure_training(0.01) == {'learning_rate': 0.01, 'batch_size': 32, 'epochs': 10, 'l...
{ "split": "train", "index": 81642, "acecode_id": "oss_28187", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the initial data and a list of integers representing the restrictions. Your task is to implement a function `update_data(data, restrictions)` that modifies the `data` list based on the following rules: For each pair of adjacent indi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_data([1, 0, 2, 0], [0, 1]) == [1, 0, 2, 0]\", \"assert update_data([0, 0, 0], []) == [0, 0, 0]\", \"assert update_data([7, 7], [1]) == [7, 7]\", \"assert update_data([1, 1, 1], [1]) == [1, 1, 1]\", \"assert update_data([2, 2, 0], [2]) == [1, 3, 0]\", ...
{ "split": "train", "index": 81643, "acecode_id": "oss_26130", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages the creation and deletion of test containers for a cloud storage service simulation. Implement a function named `manage_test_container` that takes two parameters: `action` (a string that can be either 'create' or 'delete') an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_test_container('create', 'test_container_1') == 'Container created'\", \"assert manage_test_container('delete', 'test_container_1') == 'Container deleted'\", \"assert manage_test_container('create', 'test_container_2') == 'Container created'\", \"asse...
{ "split": "train", "index": 81644, "acecode_id": "oss_11497", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named 'add_numbers' that takes two integer parameters, a and b, and returns their sum.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_numbers(1, 2) == 3\", \"assert add_numbers(0, 0) == 0\", \"assert add_numbers(-1, 1) == 0\", \"assert add_numbers(-5, -5) == -10\", \"assert add_numbers(10, 15) == 25\", \"assert add_numbers(100, 200) == 300\", \"assert add_numbers(-50, 50) == 0\", \"ass...
{ "split": "train", "index": 81645, "acecode_id": "evol_14069", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a Python function that processes a list of people's information, where each entry is formatted as 'name,age,city,salary'. Your function should extract the name and city of the person with the highest salary from the provided list of entries. Return t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_highest_salary_info({'group1': ['John,25,New York,60000', 'Alice,30,San Francisco,75000', 'Bob,28,Los Angeles,70000'], 'group2': ['Emily,27,Chicago,68000', 'David,32,Boston,72000']}) == {'group1': ('Alice', 'San Francisco'), 'group2': ('David', 'Bost...
{ "split": "train", "index": 81646, "acecode_id": "oss_36984", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a date in string format, implement a function `validate_date(period: str, start: bool = False) -> str` that validates the format of the date and returns it in the format 'YYYY-MM-DD'. If the input date is in the format 'YY-MM-DD', it should also be accepted. If the input ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_date('23-01-01') == '2023-01-01'\", \"assert validate_date('99-12-31') == '1999-12-31'\", \"assert validate_date('2000-01-01') == '2000-01-01'\", \"assert validate_date('2021-05-15') == '2021-05-15'\", \"assert validate_date('20-03-01') == '2020-03-...
{ "split": "train", "index": 81647, "acecode_id": "bigcode_python_fns_20712", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with converting a given string containing REST-style text with potential errors into an HTML representation. Implement a function called `rest_to_html` that takes a single input parameter, a string `rest_text`. The function should return a string representing the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rest_to_html('Some text with an `error') == '<!DOCTYPE html><html><head><title>SystemMessage</title></head><body><h1>SystemMessage</h1><pre class=\\\"error\\\">&lt;string&gt;:1: (WARNING/2) Inline interpreted text or phrase reference start-string without end...
{ "split": "train", "index": 81648, "acecode_id": "bigcode_python_fns_40430", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a resource class string based on specific criteria. The function should take a single parameter, `resource_class`, which is a string. Your goal is to check whether the `resource_class` meets the following requirements: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_resource_class('valid123') == True\", \"assert validate_resource_class('abc123') == True\", \"assert validate_resource_class('a') == True\", \"assert validate_resource_class('1234567890') == True\", \"assert validate_resource_class('resource') == Tr...
{ "split": "train", "index": 81649, "acecode_id": "oss_16420", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function `say_hello(name_list)` that takes a list of names as input and prints a greeting for each name in the format 'Greetings {name}!'. If the input is not a list or if the list is empty, the function should do nothing. If any element in the list is not a string, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert say_hello(['Alice', 'Bob', 'Charlie']) == None\", \"assert say_hello([]) == None\", \"assert say_hello('Not a list') == None\", \"assert say_hello(['Jane', 123, None, 'Max']) == None\", \"assert say_hello(['']) == None\", \"assert say_hello([' ']) == None\...
{ "split": "train", "index": 81650, "acecode_id": "evol_24417", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of band names and returns a formatted string that lists all the bands in a specific format. The format should be 'Band 1, Band 2, Band 3, and Band N' where Band N is the last band in the list. If there is only one band, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_band_list(['The Beatles']) == 'The Beatles'\", \"assert format_band_list(['The Beatles', 'The Rolling Stones']) == 'The Beatles and The Rolling Stones'\", \"assert format_band_list(['Nirvana', 'Pearl Jam', 'Soundgarden']) == 'Nirvana, Pearl Jam, and S...
{ "split": "train", "index": 81651, "acecode_id": "bigcode_python_fns_4211", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers representing the temperatures of a gas at different states. Your task is to implement a function `calculate_sound_speeds(temperatures: List[int]) -> Tuple[float, float, float]` that computes three sound speeds based on the given temperatures. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sound_speeds([300, 350, 400]) == (350.0, 400.0, 300.0)\", \"assert calculate_sound_speeds([100, 200, 300]) == (200.0, 300.0, 100.0)\", \"assert calculate_sound_speeds([500]) == (500.0, 500.0, 500.0)\", \"assert calculate_sound_speeds([]) == (0.0, 0...
{ "split": "train", "index": 81652, "acecode_id": "bigcode_python_fns_26091", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a Python function that identifies the optimal rightmost point of removal for a specific value from a sorted list or tuple, while maintaining the overall sorted sequence. This function should handle various data types including integers, floats, strings, tuples, and lists...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_removal_point([1, 2, 3, 4, 5], 6) == 5\", \"assert find_removal_point(['apple', 'banana', 'cherry'], 'date') == 3\", \"assert find_removal_point([1, 3, 5, 7], 4) == 2\", \"assert find_removal_point([], 1) == 0\", \"assert find_removal_point([1, 2, 3, 4,...
{ "split": "train", "index": 81653, "acecode_id": "evol_33536", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a name as an argument and returns a personalized greeting message. The function should be named `greet` and should follow the format 'Hello, {name}!'. Your function must be able to handle any string input for the name, i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert greet('Alice') == 'Hello, Alice!'\", \"assert greet('Bob') == 'Hello, Bob!'\", \"assert greet('Charlie') == 'Hello, Charlie!'\", \"assert greet('') == 'Hello, !'\", \"assert greet('John Doe') == 'Hello, John Doe!'\", \"assert greet('12345') == 'Hello, 12345!...
{ "split": "train", "index": 81654, "acecode_id": "oss_32165", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two datasets represented as lists of integers. Your task is to implement a function `find_common_elements(dataset1: List[int], dataset2: List[int]) -> List[int]` that returns a list of integers containing all the unique elements that are common to both datasets. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_common_elements([1, 2, 3, 4], [3, 4, 5, 6]) == [3, 4]\", \"assert find_common_elements([1, 2, 2, 3], [3, 3, 4, 5]) == [3]\", \"assert find_common_elements([7, 8, 9], [1, 2, 3]) == []\", \"assert find_common_elements([], [1, 2, 3]) == []\", \"assert find...
{ "split": "train", "index": 81655, "acecode_id": "bigcode_python_fns_42754", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 3D array of integers, implement a function `find_max_sum(arr: List[List[List[int]]]) -> int` that finds the maximum sum of any subarray within the 3D array. The dimensions of the array will be at least 1x1x1. The function should return the maximum sum found.\nPlease rea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_sum([[[1]]]) == 1\", \"assert find_max_sum([[[0]]]) == 0\", \"assert find_max_sum([[[1, -1], [2, -2]], [[3, -3], [4, -4]]]) == 4\", \"assert find_max_sum([[[1, 2], [3, 4]], [[-1, -2], [-3, -4]]]) == 10\", \"assert find_max_sum([[[0, 0, 0], [0, 0, 0]...
{ "split": "train", "index": 81656, "acecode_id": "evol_22119", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers representing version components of a software package and returns the version as a string formatted according to semantic versioning rules. The input list will contain six elements: [major, minor, patch, pre-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_version([3, 2, 0, 0, 0, 'final']) == '3.2'\", \"assert format_version([7, 2, 3, 0, 0, 'final']) == '7.2.3'\", \"assert format_version([9, 3, 1, 0, 0, 'final']) == '9.3.1'\", \"assert format_version([10, 5, 0, 0, 0, 'final']) == '10.5'\", \"assert form...
{ "split": "train", "index": 81657, "acecode_id": "bigcode_python_fns_40174", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given string contains balanced parentheses. A string is considered balanced if every opening parenthesis '(' has a corresponding closing parenthesis ')' and they are correctly nested. Implement the function `is_balanced(s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_balanced('()') == True\", \"assert is_balanced('(()())') == True\", \"assert is_balanced(')(') == False\", \"assert is_balanced('((())') == False\", \"assert is_balanced('abc(def)ghi') == True\", \"assert is_balanced('a(b)c(d(e)f)g') == True\", \"assert i...
{ "split": "train", "index": 81658, "acecode_id": "bigcode_python_fns_917", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two 3D points represented by their coordinates as tuples (x, y, z), write a function `compute_distance(location_1: Tuple[float, float, float], location_2: Tuple[float, float, float]) -> float` that calculates the Euclidean distance between these two points. The distance s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_distance((0.0, 0.0, 0.0), (1.0, 1.0, 1.0)) == 1.7320508075688772\", \"assert compute_distance((1.0, 2.0, 3.0), (4.0, 5.0, 6.0)) == 5.196152422706632\", \"assert compute_distance((0.0, 0.0, 0.0), (0.0, 0.0, 0.0)) == 0.0\", \"assert compute_distance((1...
{ "split": "train", "index": 81659, "acecode_id": "bigcode_python_fns_49749", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two sets of integers, `set1` and `set2`, implement a function `iou_set(set1, set2)` that calculates the Intersection over Union (IoU) of the two sets. The IoU is defined as the size of the intersection of the two sets divided by the size of their union. If both sets are e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert iou_set(set([1, 2, 3]), set([3, 4, 5])) == 0.2\", \"assert iou_set(set([1, 2]), set([2, 3])) == 0.3333333333333333\", \"assert iou_set(set([1]), set([1])) == 1.0\", \"assert iou_set(set([]), set([])) == 0\", \"assert iou_set(set([1, 2, 3]), set([])) == 0.0\"...
{ "split": "train", "index": 81660, "acecode_id": "bigcode_python_fns_30015", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing a list of dependencies and generating a report containing the dependency names and their respective versions. You will be provided with a list of strings, where each string is formatted as '<dependency_name>==<version>'. Your job is to write a Pyth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_dependency_report(['numpy==1.21.0', 'pandas==1.3.0', 'scipy==1.7.0', 'numpy==1.20.0']) == {'numpy': '1.21.0', 'pandas': '1.3.0', 'scipy': '1.7.0'}\", \"assert generate_dependency_report(['requests==2.25.1', 'requests==2.25.0', 'requests==2.24.0']) =...
{ "split": "train", "index": 81661, "acecode_id": "oss_18670", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a string as input and replaces all occurrences of multiple consecutive spaces (including leading and trailing spaces) with a single space. Additionally, the function should also handle tabs as spaces. Implement the function `nor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_spaces('hello world how are you') == 'hello world how are you'\", \"assert normalize_spaces(' leading and trailing spaces ') == 'leading and trailing spaces'\", \"assert normalize_spaces('this is a test') == 'this is a test'\", \"as...
{ "split": "train", "index": 81662, "acecode_id": "evol_10265", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named `word_count` that takes a string as input and computes the total quantity of words that the string contains. A word is defined as a sequence of characters separated by whitespace. The function should handle cases where the input is not a string, retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_count('Hello World') == 2\", \"assert word_count('This is a sentence.') == 4\", \"assert word_count(' leading and trailing spaces ') == 4\", \"assert word_count(' ') == 0\", \"assert word_count('word_with_special_chars_!@#') == 1\", \"assert word_cou...
{ "split": "train", "index": 81663, "acecode_id": "evol_9919", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that finds all unique triplets (a, b, c) within the array such that the product of the triplet equals a specified target product. Each triplet should be returned as a list, and if no such triplet exists, return an empty list.\nPl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_triplets([0, 0, 0, 0], 0) == [[0, 0, 0]]\", \"assert find_triplets([1, 1, 2, 3, 4, 5], 6) == [[1, 2, 3]]\", \"assert find_triplets([10, 20, 30, 40, 50], 6000) == [[10, 20, 30]]\", \"assert find_triplets([5, 5, 5, 5], 125) == [[5, 5, 5]]\", \"assert find...
{ "split": "train", "index": 81664, "acecode_id": "evol_12039", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of integers called 'membership_logits'. Your task is to implement a function that returns two lists representing the inclusive start index and exclusive end index of all positive integers in the input list. If there are no positive integers in the list, bot...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_positive_indices([0, -1, -2, -3]) == ([0], [0])\", \"assert get_positive_indices([1, 2, 3, 4]) == ([0], [3])\", \"assert get_positive_indices([0, 1, 2, 3]) == ([1], [3])\", \"assert get_positive_indices([-5, -1, 0]) == ([0], [0])\", \"assert get_positive...
{ "split": "train", "index": 81665, "acecode_id": "bigcode_python_fns_31205", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates sending a message to a specified channel and handles potential errors that may occur during the process. Your task is to implement a function `send_message_to_channel` that takes the following parameters: \n- `channel_id` (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_message_to_channel(-1, 'Hello, World!') == 'Invalid channel ID'\", \"assert send_message_to_channel(0, 'Hello, World!') == 'Invalid channel ID'\", \"assert send_message_to_channel(1, '') == 'Message content cannot be empty'\", \"assert send_message_to_c...
{ "split": "train", "index": 81666, "acecode_id": "oss_20509", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of Unicode code points and returns a dictionary mapping each code point to its corresponding Unicode character name. The function should perform the following steps: 1. Import the necessary module for Unicode data...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unicode_names([65, 66, 67]) == {65: 'LATIN CAPITAL LETTER A', 66: 'LATIN CAPITAL LETTER B', 67: 'LATIN CAPITAL LETTER C'}\", \"assert get_unicode_names([97, 98, 99]) == {97: 'LATIN SMALL LETTER A', 98: 'LATIN SMALL LETTER B', 99: 'LATIN SMALL LETTER C'}\...
{ "split": "train", "index": 81667, "acecode_id": "oss_20794", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `is_perfect_square(n: int) -> bool` that checks if a given integer `n` is a perfect square. A perfect square is an integer that is the square of an integer. Return `True` if `n` is a perfect square, otherwise return `False`. Note that negative numbers canno...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_perfect_square(0) == True\", \"assert is_perfect_square(1) == True\", \"assert is_perfect_square(4) == True\", \"assert is_perfect_square(9) == True\", \"assert is_perfect_square(16) == True\", \"assert is_perfect_square(25) == True\", \"assert is_perfect...
{ "split": "train", "index": 81668, "acecode_id": "evol_18567", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a stack data structure that allows you to push and pop elements. Implement a function `stack_length(stack: List[int]) -> int` that takes a stack (represented as a list of integers) and returns the number of elements in the stack. A stack can be empty or contain an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stack_length([]) == 0\", \"assert stack_length([1]) == 1\", \"assert stack_length([1, 2, 3]) == 3\", \"assert stack_length([5, 6, 7, 8]) == 4\", \"assert stack_length([0, -1, -2]) == 3\", \"assert stack_length([10, 20, 30, 40, 50]) == 5\", \"assert stack_len...
{ "split": "train", "index": 81669, "acecode_id": "bigcode_python_fns_44404", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the addition of a student to a system. The function should take three parameters: the student's first name, last name, and card information. If the first name is an empty string, the function should return 'Invalid first na...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_student('John', 'Doe', '1234-5678-9876-5432') == 'Student added successfully'\", \"assert add_student('', 'Doe', '1234-5678-9876-5432') == 'Invalid first name'\", \"assert add_student('John', '', '1234-5678-9876-5432') == 'Invalid last name'\", \"assert ...
{ "split": "train", "index": 81670, "acecode_id": "bigcode_python_fns_3579", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary containing information about flights, where each flight has an origin and a destination. Your task is to implement a function `find_airports_without_departures(vuelos: Dict[str, Dict[str, Union[str, float]]]) -> List[str]` that returns a list of airpo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_airports_without_departures({'flight1': {'origen': 'A', 'destino': 'B'}, 'flight2': {'origen': 'C', 'destino': 'A'}}) == ['B']\", \"assert find_airports_without_departures({'flight1': {'origen': 'A', 'destino': 'B'}, 'flight2': {'origen': 'B', 'destino'...
{ "split": "train", "index": 81671, "acecode_id": "bigcode_python_fns_16329", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of directory contents represented as a dictionary where the keys are directory names and the values are lists of filenames in those directories. You also have a string representing a filename (without the extension). Your task is to implement a function tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert which_subdir('example', {'dir1': ['example.json', 'test.json'], 'dir2': ['sample.json']}) == 'dir1'\", \"assert which_subdir('test', {'dir1': ['example.json'], 'dir2': ['test.json', 'sample.json']}) == 'dir2'\", \"assert which_subdir('missing', {'dir1': ['ex...
{ "split": "train", "index": 81672, "acecode_id": "bigcode_python_fns_36918", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_value(dictionary, key)` that retrieves the value associated with a specified key from a given dictionary. If the key does not exist, the function should return the string 'Error: The key does not exist.'\nPlease reason step by step, then write a self-c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_value({'name': 'John', 'age': 30, 'occupation': 'teacher', 'height': None}, 'name') == 'John'\", \"assert get_value({'name': 'John', 'age': 30, 'occupation': 'teacher', 'height': None}, 'age') == 30\", \"assert get_value({'name': 'John', 'age': 30, 'occu...
{ "split": "train", "index": 81673, "acecode_id": "evol_30685", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with retrieving the top symbols from a specified market based on predefined criteria. Your function should take a market type as input and return a list of the top 100 symbols for that market. The function should support three market types: 'crypto', 'shanghai', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_top_symbols('crypto') == ['BTC', 'ETH', 'XRP', 'LTC', 'BCH', 'DOT', 'LINK', 'BNB', 'USDT', 'ADA', 'SOL', 'DOGE', 'MATIC', 'AVAX', 'SHIB', 'UNI', 'TRX', 'XLM', 'XMR', 'ALGO', 'ATOM', 'EOS', 'AAVE', 'FTM', 'SNX', 'MANA', 'NEO', 'HT', 'FIL', 'LDO', 'CHZ', '...
{ "split": "train", "index": 81674, "acecode_id": "bigcode_python_fns_49466", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the greatest common divisor (GCD) of two non-negative integers, 'a' and 'b'. The function should raise a ValueError if either input is not an integer, if either input is negative, or if both inputs are zero. The GCD of two numbers is the lar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert highest_common_factor(3, 5) == 1\", \"assert highest_common_factor(25, 15) == 5\", \"assert highest_common_factor(0, 5) == 5\", \"assert highest_common_factor(5, 0) == 5\", \"assert highest_common_factor(7, 14) == 7\", \"assert highest_common_factor(14, 7) =...
{ "split": "train", "index": 81675, "acecode_id": "evol_15077", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_primes(start: int, end: int) -> List[int]` that takes two integers, `start` and `end`, and returns a list of all prime numbers in the inclusive range from `start` to `end`. A prime number is defined as a natural number greater than 1 that cannot b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_primes(10, 20) == [11, 13, 17, 19]\", \"assert generate_primes(1, 1) == []\", \"assert generate_primes(2, 2) == [2]\", \"assert generate_primes(0, 10) == [2, 3, 5, 7]\", \"assert generate_primes(15, 30) == [17, 19, 23, 29]\", \"assert generate_prime...
{ "split": "train", "index": 81676, "acecode_id": "evol_4652", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the type of geometric shape based on the given attributes. The function should take a variable number of keyword arguments that represent the attributes of the shape. The function should return one of the following strings...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_shape_type(radius=5) == 'Circle'\", \"assert determine_shape_type(length=4, width=3) == 'Rectangle'\", \"assert determine_shape_type(side1=3, side2=4, side3=5) == 'Triangle'\", \"assert determine_shape_type(length=4) == 'Unknown'\", \"assert determ...
{ "split": "train", "index": 81677, "acecode_id": "oss_36616", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a directed graph represented as an adjacency list where each node is an object with properties indicating whether it is omittable or contains a task. Implement a function `check_violation(graph: Dict[int, List[int]], node_properties: Dict[int, Tuple[bool, bool]], ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_violation({1: [2], 2: [3], 3: [], 4: [1]}, {1: (False, True), 2: (False, False), 3: (True, False), 4: (False, False)}, 3, 4) == True\", \"assert check_violation({1: [2], 2: [3], 3: [], 4: []}, {1: (False, False), 2: (True, True), 3: (False, False), 4: ...
{ "split": "train", "index": 81678, "acecode_id": "bigcode_python_fns_30109", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `linear_search(lst, target)` that takes a list of integers `lst` and an integer `target`. The function should return the index of the first occurrence of `target` in the list. If `target` is not found in the list, return None.\nPlease reason step by step, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_search([1, 2, 3, 4, 5, 6, 7, 8, 9], 7) == 6\", \"assert linear_search([1, 2, 3, 4, 5, 6, 7, 8, 9], 1) == 0\", \"assert linear_search([1, 2, 3, 4, 5, 6, 7, 8, 9], 9) == 8\", \"assert linear_search([1, 2, 3, 4, 5, 6, 7, 8, 9], 5) == 4\", \"assert linear...
{ "split": "train", "index": 81679, "acecode_id": "evol_172", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a nested dictionary where the keys may contain slashes (/) to represent hierarchy, and the values can be integers, None, or other dictionaries. Your task is to implement a function that flattens this nested dictionary into a single-level dictionary. In the flatten...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_dict({'a': 1, 'b/c': 2, 'b/d': 3}) == {'a': 1, 'b/c': 2, 'b/d': 3}\", \"assert flatten_dict({'x': {'y': {'z': 5}}}) == {'x/y/z': 5}\", \"assert flatten_dict({'key1': {'key2': 10, 'key3': 20}}) == {'key1/key2': 10, 'key1/key3': 20}\", \"assert flatten...
{ "split": "train", "index": 81680, "acecode_id": "bigcode_python_fns_25140", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a basic cloud polling scheduler that manages a list of polling schedules. Each polling schedule is represented by a dictionary with the keys 'id', 'name', and 'interval'. Your goal is to create a function that takes a list of polling schedules a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_schedules([{'id': 1, 'name': 'Schedule A', 'interval': 10}, {'id': 2, 'name': 'Schedule B', 'interval': 5}], 6) == ['Schedule A']\", \"assert filter_schedules([{'id': 1, 'name': 'Schedule A', 'interval': 10}, {'id': 2, 'name': 'Schedule B', 'interval'...
{ "split": "train", "index": 81681, "acecode_id": "oss_7328", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes in three integers representing different temperature readings and returns the median value after sorting them in ascending order. The median is defined as the value that occupies the middle position after sorting.\nPlease reason step by step, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median_temperature(30, 20, 10) == 20\", \"assert median_temperature(5, 15, 10) == 10\", \"assert median_temperature(100, 25, 75) == 75\", \"assert median_temperature(-10, 0, 10) == 0\", \"assert median_temperature(1, 1, 1) == 1\", \"assert median_temperature...
{ "split": "train", "index": 81682, "acecode_id": "evol_6842", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the average age of a list of repositories in days. Each repository's age is represented as an integer, which indicates the number of days since its creation until the current date. Your function should take a list o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_repo_age([365, 730, 1095]) == 730.0\", \"assert calculate_average_repo_age([0, 0, 0]) == 0.0\", \"assert calculate_average_repo_age([10, 20, 30, 40]) == 25.0\", \"assert calculate_average_repo_age([1, 2, 3, 4, 5]) == 3.0\", \"assert calcula...
{ "split": "train", "index": 81683, "acecode_id": "oss_19463", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns a random color from a predefined list of Bootstrap color identifiers. The list of colors includes 'primary', 'secondary', 'success', 'danger', 'warning', 'info', and 'dark'. Your function should return one of these colors eac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_random_color() in ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark']\", \"assert get_random_color() in ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark']\", \"assert get_random_color() in ['primary', 'secondary...
{ "split": "train", "index": 81684, "acecode_id": "bigcode_python_fns_2752", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the character-level text similarity metric between two given English phrases using the Levenshtein distance approach. The function should return a float value between 0 and 1, where 1 means the phrases are identical and 0 means they have no ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert character_level_text_similarity('Hello, World!', 'Hello, World!') == 1.0\", \"assert character_level_text_similarity('Test phrase', 'Test phrase') == 1.0\", \"assert character_level_text_similarity('abcdef', 'abcdefg') == 0.8571428571428571\", \"assert chara...
{ "split": "train", "index": 81685, "acecode_id": "evol_35943", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a function that takes a variable number of keyword arguments. Your task is to implement a function `render_image` that simulates the rendering of an image based on those keyword arguments. The function should return a string representation of the image based on th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert render_image() == 'Default image'\", \"assert render_image(width=100) == 'Image of width 100 and height None'\", \"assert render_image(height=200) == 'Image of width None and height 200'\", \"assert render_image(width=100, height=200) == 'Image of width 100 ...
{ "split": "train", "index": 81686, "acecode_id": "bigcode_python_fns_30527", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D array of integers, implement a function that returns the coordinates (i.e., the row and column index) of the largest number in the array. The array can have an irregular shape (not all rows have to be the same length). In the case of a tie for the largest number, ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_largest([[3, 9, 10], [21, 1, 17], [8, 9]]) == (1, 0)\", \"assert find_largest([[1, 2], [3, 4], [5]]) == (2, 0)\", \"assert find_largest([[7, 8, 9], [1, 2], [3, 4, 5]]) == (0, 2)\", \"assert find_largest([[1]]) == (0, 0)\", \"assert find_largest([[0, -1]...
{ "split": "train", "index": 81687, "acecode_id": "evol_25717", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `read_pet_types(skip: int, limit: int) -> List[str]` that simulates reading a list of pet types from a database. The function takes two parameters: `skip`, which indicates how many pet types to skip, and `limit`, which indicates the m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert read_pet_types(0, 5) == ['Dog', 'Cat', 'Fish', 'Bird', 'Hamster']\", \"assert read_pet_types(2, 3) == ['Fish', 'Bird', 'Hamster']\", \"assert read_pet_types(5, 2) == ['Lizard', 'Turtle']\", \"assert read_pet_types(10, 5) == []\", \"assert read_pet_types(0, 1...
{ "split": "train", "index": 81688, "acecode_id": "bigcode_python_fns_30547", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of labeled data points and their corresponding labels, your task is to implement a function that simulates a diffusion process to predict the labels of unlabelled data points. The function should take a 2D list of labeled data points and a 2D list of unlabelled dat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_labels([[1, 2], [2, 3], [3, 3]], [0, 0, 1], [[1, 1], [2, 2]]) == [0, 0]\", \"assert predict_labels([[0, 0], [1, 1], [2, 2]], [0, 1, 1], [[0, 1], [1, 0]]) == [0, 0]\", \"assert predict_labels([[1, 1], [1, 2], [2, 1], [2, 2]], [0, 0, 1, 1], [[1, 1.5], ...
{ "split": "train", "index": 81689, "acecode_id": "bigcode_python_fns_9362", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates sending a notification message to a user in a messaging application. The function `send_notification(queue_name: str, user_id: str) -> str` takes in two parameters: a string `queue_name` which represents the name of the mes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_notification('main_queue', 'user123') == 'Notification sent to main_queue for user user123'\", \"assert send_notification('support_queue', 'user456') == 'Notification sent to support_queue for user user456'\", \"assert send_notification('notification_qu...
{ "split": "train", "index": 81690, "acecode_id": "bigcode_python_fns_11402", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of usernames, implement a function that returns a list of strings indicating the deletion status for each user. Each deletion status string should follow the format \"Deleted user: <username>\". If a username does not exist in the list, it should be ignored. You ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_user_status(['alice', 'bob', 'charlie']) == ['Deleted user: alice', 'Deleted user: bob', 'Deleted user: charlie']\", \"assert delete_user_status(['john']) == ['Deleted user: john']\", \"assert delete_user_status([]) == []\", \"assert delete_user_statu...
{ "split": "train", "index": 81691, "acecode_id": "bigcode_python_fns_8053", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates and sets the name of the primary key for a given table in a custom database system. The function should take two parameters: the name of the table and the name of the primary key. The function should perform the following v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_primary_key('user_table', 'USER_PK') == True\", \"assert set_primary_key('sales_table', 'SALES_ID') == True\", \"assert set_primary_key('inventory', 'ITEM_COUNT') == True\", \"assert set_primary_key('products', 'PRODUCT_ID_1') == True\", \"assert set_pri...
{ "split": "train", "index": 81692, "acecode_id": "oss_28879", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a vocabulary management system for a natural language processing application. Your goal is to create a function `get_index` that takes a word and a vocabulary dictionary as input, and returns the index of the word if it exists in the dictionary,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_index('apple', {'apple': 0, 'banana': 1, 'cherry': 2}) == 0\", \"assert get_index('banana', {'apple': 0, 'banana': 1, 'cherry': 2}) == 1\", \"assert get_index('cherry', {'apple': 0, 'banana': 1, 'cherry': 2}) == 2\", \"assert get_index('date', {'apple': ...
{ "split": "train", "index": 81693, "acecode_id": "oss_9654", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `filter_strings(strings: List[str], pattern: str) -> List[str]`. This function takes a list of strings and a pattern string as inputs. The function should return a list of strings that match the given pattern. The pattern can contain ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_strings(['HelloWorld', 'Hello', 'Hello123', 'HiThere'], 'Hello%') == ['HelloWorld', 'Hello', 'Hello123']\", \"assert filter_strings(['abc', '123abc456', 'xyzabc'], '%abc%') == ['abc', '123abc456', 'xyzabc']\", \"assert filter_strings(['apple', 'banana...
{ "split": "train", "index": 81694, "acecode_id": "bigcode_python_fns_19996", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages an inventory of items in a shop. The function should allow the addition of a new item to the inventory. Each item is represented by a dictionary with the following keys: 'name' (a string), 'price' (a float), and 'quantity...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_item_to_inventory([], {'name': 'apple', 'price': 1.0, 'quantity': 10}) == [{'name': 'apple', 'price': 1.0, 'quantity': 10}]\", \"assert add_item_to_inventory([{'name': 'banana', 'price': 0.5, 'quantity': 5}], {'name': 'apple', 'price': 1.0, 'quantity': 1...
{ "split": "train", "index": 81695, "acecode_id": "oss_10917", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer `n` and a digit `d` (0 <= d <= 9), implement a function that counts the total number of times the digit `d` appears in all non-negative integers less than or equal to `n`. For example, if `n = 13` and `d = 1`, the output should be `6` because the digit `1` appe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert digitsCount(13, 1) == 6\", \"assert digitsCount(20, 2) == 3\", \"assert digitsCount(0, 0) == 0\", \"assert digitsCount(100, 1) == 21\", \"assert digitsCount(99, 9) == 20\", \"assert digitsCount(1000, 1) == 301\", \"assert digitsCount(999, 8) == 300\", \"asse...
{ "split": "train", "index": 81696, "acecode_id": "evol_35728", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the status of a job in a system. The function should take in a job status as input and return a message indicating the current status of the job. The job status can be one of three values: 'NOT_RUNNING', 'DONE', or 'IN_PROG...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_job_status('NOT_RUNNING') == {'status': 'NOT_RUNNING'}\", \"assert get_job_status('DONE') == {'status': 'DONE'}\", \"assert get_job_status('IN_PROGRESS') == {'status': 'IN_PROGRESS'}\", \"assert get_job_status('COMPLETED') == {'error': 'Invalid status'}\...
{ "split": "train", "index": 81697, "acecode_id": "bigcode_python_fns_16502", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `pythagorean_distance` that calculates the distance from the origin to a point in N-dimensional space, given N-1 dimensions. Each dimension is represented by a positive whole number. The distance is calculated using the generalized Pythagorean theorem.\nPle...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pythagorean_distance(3, 4) == 5.0\", \"assert pythagorean_distance(1, 1, 1) == 1.7320508075688772\", \"assert pythagorean_distance(5, 12) == 13.0\", \"assert pythagorean_distance(2, 2, 2) == 3.4641016151377544\", \"assert pythagorean_distance(0) == 0.0\", \"...
{ "split": "train", "index": 81698, "acecode_id": "evol_3365", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with extracting specific keywords from a given dictionary. Your function should take a dictionary as the first parameter and a variable number of keyword strings as the subsequent parameters. The function should return a new dictionary containing the requested ke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_keywords({'name': 'Alice', 'age': 30, 'city': 'Wonderland'}, 'name', 'age') == {'name': 'Alice', 'age': 30}\", \"assert extract_keywords({'name': 'Bob', 'age': 25, 'city': 'Builderland'}, 'city', 'occupation') == {'city': 'Builderland', 'occupation':...
{ "split": "train", "index": 81699, "acecode_id": "bigcode_python_fns_28270", "num_tests": 16 }