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 a binary tree, implement a function `postorder_traversal` that performs a postorder traversal (left, right, root) of the tree and returns the values of the nodes in the traversal order as a list of integers. You need to use an iterative approach with a stack to accomplish...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert postorder_traversal(None) == []\", \"assert postorder_traversal(TreeNode(1)) == [1]\", \"assert postorder_traversal(TreeNode(1, TreeNode(2), TreeNode(3))) == [2, 3, 1]\", \"assert postorder_traversal(TreeNode(1, TreeNode(2, TreeNode(4), TreeNode(5)), TreeNod...
{ "split": "train", "index": 66500, "acecode_id": "oss_34522", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `calculate_beta_scores(alpha: float, beta: float, n_iters: int, n_restarts: int, smooth_rate: float, time_limit: int, experiment: bool) -> float` that simulates the process of calculating beta scores based on given parameters. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_beta_scores(0.1, 0.2, 10, 3, 0.5, 100, False) == 0.2 ** 10 * 3 * 0.1\", \"assert calculate_beta_scores(0.0, 0.0, 10, 1, 0.1, 60, False) == 0.0\", \"assert calculate_beta_scores(0.2, 0.5, 3, 2, 0.1, 30, False) == 0.5 ** 3 * 2 * 0.2\", \"assert calcu...
{ "split": "train", "index": 66501, "acecode_id": "bigcode_python_fns_43391", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `create_client(name: str, address: str, contact_number: str, email: str, occupation: str, annual_income: float) -> dict` that takes the client's full legal name, permanent residential address, verified contact number, registered email address, occupation, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_client('John Doe', '123 Main St, Anytown, USA', '(123) 456-7890', 'john.doe@example.com', 'Software Engineer', 70000) == {'name': 'John Doe', 'address': '123 Main St, Anytown, USA', 'email': 'john.doe@example.com', 'occupation': 'Software Engineer', '...
{ "split": "train", "index": 66502, "acecode_id": "evol_27365", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of signal parameter dictionaries, each containing the best fit signal parameters, a background NLLH value, a list of signal NLLH values, and a list of test statistic values. Your task is to create a function that formats these inputs into a specific data st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_results([{'blipID': 1, 'timeID': 101, 'time': '2023-01-01T00:00:00', 'duration': 10}], [{'Signal_imx': 0.5, 'Signal_imy': 0.5, 'Signal_A': 1.0, 'Signal_gamma': 2.0, 'bkg_rate1': 0.1, 'bkg_rate2': 0.2}], 0.3, [0.4], [5.0]) == [(1, 101, '2023-01-01T00:0...
{ "split": "train", "index": 66503, "acecode_id": "bigcode_python_fns_29840", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D array representing pixel values of an image, convert it into a 1D byte string representation. The array can have either 3 channels (RGB) or 4 channels (RGBA). If the input array has 3 channels, the output should contain the pixel values in the order of RGB. If it has...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert array_to_byte_string([[(255, 0, 0), (0, 255, 0)], [(0, 0, 255), (255, 255, 0)]]) == b'\\\\xff\\\\x00\\\\x00\\\\x00\\\\xff\\\\x00\\\\x00\\\\x00\\\\xff\\\\xff\\\\xff\\\\x00'\", \"assert array_to_byte_string([[ (0, 0, 0), (255, 255, 255) ]]) == b'\\\\x00\\\\x00...
{ "split": "train", "index": 66504, "acecode_id": "bigcode_python_fns_13224", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of sections and a dictionary of default configuration options. Your task is to implement a function `merge_configuration(sections: List[str], defaults: Dict[str, Dict[str, str]]) -> Dict[str, Dict[str, str]]` that returns a merged configuration. The merged ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_configuration(['A', 'B', 'C'], {'A': {'key1': 'value1'}, 'B': {'key2': 'value2'}}) == {'A': {'key1': 'value1'}, 'B': {'key2': 'value2'}, 'C': {}}\", \"assert merge_configuration(['X', 'Y'], {'X': {'key1': 'value1'}}) == {'X': {'key1': 'value1'}, 'Y': {...
{ "split": "train", "index": 66505, "acecode_id": "bigcode_python_fns_14658", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a unique filename for a PNG file based on a given base name and an optional suffix. The function should take in two parameters: a string `base_name` representing the base name of the file, and an optional string `suffix` th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_png_filename('image') == 'image.png'\", \"assert generate_png_filename('image', 'v1') == 'image_v1.png'\", \"assert generate_png_filename('report') == 'report.png'\", \"assert generate_png_filename('report', 'final') == 'report_final.png'\", \"asser...
{ "split": "train", "index": 66506, "acecode_id": "bigcode_python_fns_11825", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representation of a datetime in the format 'HH:MM:SS+TZ', write a function `convert_to_server_time(datetime_str: str) -> str` that converts the input datetime string from the Berlin timezone (UTC+1) to server time (UTC). The server time is represented in the same...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_server_time('23:40:15+01:00') == '22:40:15+00:00'\", \"assert convert_to_server_time('16:00:00+01:00') == '15:00:00+00:00'\", \"assert convert_to_server_time('00:00:00+01:00') == '23:00:00+00:00'\", \"assert convert_to_server_time('12:30:45+01:00'...
{ "split": "train", "index": 66507, "acecode_id": "bigcode_python_fns_25859", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `content` that represents HTML content. Your task is to implement a function `extract_text` that extracts and returns all the text content from the provided HTML string, stripping out all HTML tags. The returned text should be a single string with all the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_text('<div>Hello <b>world</b>!</div>') == 'Hello world!'\", \"assert extract_text('<p>This is a <a href=\\\"#\\\">link</a>.</p>') == 'This is a link.'\", \"assert extract_text('<h1>Title</h1><p>Content</p>') == 'TitleContent'\", \"assert extract_text...
{ "split": "train", "index": 66508, "acecode_id": "bigcode_python_fns_49735", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer HTTP status code, return a string that includes the code followed by its corresponding reason phrase. The reason phrase should be constructed by taking the name of the HTTP status code, splitting it on underscores, capitalizing each word (except for the word 'O...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_status(200) == '200 OK'\", \"assert build_status(201) == '201 Created'\", \"assert build_status(204) == '204 No Content'\", \"assert build_status(301) == '301 Moved Permanently'\", \"assert build_status(400) == '400 Bad Request'\", \"assert build_statu...
{ "split": "train", "index": 66509, "acecode_id": "bigcode_python_fns_30304", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the progress tracking of a data processing pipeline. The function, `track_progress`, takes a generator and a logger, and logs the progress of the generator's execution at each step. The logger should log messages at the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert track_progress((i for i in range(5)), logger) == [0, 1, 2, 3, 4]\", \"assert track_progress((i for i in range(1)), logger) == [0]\", \"assert track_progress((i for i in range(10)), logger) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert track_progress((i for i...
{ "split": "train", "index": 66510, "acecode_id": "oss_33652", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a data point containing fitting parameters as keys. You are also given a set of parameter names that you can fit. Your task is to implement a function `trim_datasets(data, par_indexes)` that removes all the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert trim_datasets([{'a': 1, 'b': 2}, {'a': 1, 'c': 3}], {'a': 1, 'b': 2}) == [{'a': 1, 'b': 2}]\", \"assert trim_datasets([{'x': 5, 'y': 6}, {'x': 7}], {'x': 7}) == [{'x': 7}]\", \"assert trim_datasets([{'param1': 1}, {'param2': 2}], {'param1': 1}) == [{'param1'...
{ "split": "train", "index": 66511, "acecode_id": "bigcode_python_fns_16707", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Create a function called `generate_html` that takes a string `name` as an argument and returns a string representing a simple HTML page. The HTML page should include a header with the text 'Hello, {name}!' where {name} is replaced by the value of the `name` argument. The body o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_html('Alice') == '<html><head><title>Hello Page</title></head><body><h1>Hello, Alice!</h1><p>Welcome to our website.</p></body></html>'\", \"assert generate_html('Bob') == '<html><head><title>Hello Page</title></head><body><h1>Hello, Bob!</h1><p>Wel...
{ "split": "train", "index": 66512, "acecode_id": "evol_20290", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of strings, where each string represents a data entry. Your function should be able to analyze these strings and return a list of results based on specific processing rules. The processing rules are as follows...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data_entries(['error in line 1', 'success in operation', 'this is a test']) == ['Error Found', 'Operation Successful', 'No Action']\", \"assert process_data_entries(['all good', 'error detected', 'nothing to see here']) == ['No Action', 'Error Found'...
{ "split": "train", "index": 66513, "acecode_id": "oss_6135", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the indices of a lattice, write a function `get_section_name_mapping(lattice: List[int]) -> List[str]` that returns a list of section names based on specific rules. The lattice is divided into subsections, where each section is numbered and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_section_name_mapping([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == ['01U', '01U', '01U', '01U', '01U', '01U', '01U', '01U', '01U', '01U', '01U']\", \"assert get_section_name_mapping([0, 1, 5, 10, 15, 20, 25, 30, 35, 40, 45]) == ['01U', '01U', '01U', '01U', '01U...
{ "split": "train", "index": 66514, "acecode_id": "bigcode_python_fns_42271", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing product data in an inventory system. Implement a function `process_product_data(tables, title, price, price_old, brand, link)` that processes the given product data and handles potential exceptions according to the following rules: \n\n1. If the p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_product_data({}, 'Product A', 100, 90, 'Brand X', 'http://example.com') == None\", \"assert process_product_data({}, 'Product E', 100, 90, 'Brand E', 'http://example.com') == None\", \"assert process_product_data({}, 'Product F', 100, 90, 'Brand F', ...
{ "split": "train", "index": 66515, "acecode_id": "oss_23853", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a string representing a cryptocurrency name and a date in the format 'YYYYMMDD'. Your task is to generate a valid file name for saving the dataset of the cryptocurrency. The file name should be constructed by concatenating the cryptocurrency name, an underscore, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_file_name('Bitcoin', '20230101') == 'Bitcoin_20230101'\", \"assert generate_file_name('Ethereum', '20221231') == 'Ethereum_20221231'\", \"assert generate_file_name('Litecoin', '20220515') == 'Litecoin_20220515'\", \"assert generate_file_name('Ripple...
{ "split": "train", "index": 66516, "acecode_id": "bigcode_python_fns_44269", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of file names and returns a new list containing only those file names that do not end with the '.tmp' extension. The function should take a list of file names as input and filter out the specified files, witho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_temp_files(['file1.tmp', 'file2.txt', 'file3.tmp', 'file4.tmp']) == ['file2.txt']\", \"assert remove_temp_files(['file1.txt', 'file2.txt', 'file3.txt']) == ['file1.txt', 'file2.txt', 'file3.txt']\", \"assert remove_temp_files(['file1.tmp', 'file2.tmp'...
{ "split": "train", "index": 66517, "acecode_id": "oss_30613", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `is_numeric_string(s: str) -> bool` that checks if the given string `s` consists entirely of numeric characters (0-9). The function should return True if the string is numeric, and False otherwise.\nPlease reason step by step, then write a self-contained Python...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_numeric_string('123456') == True\", \"assert is_numeric_string('abc123') == False\", \"assert is_numeric_string('1234.56') == False\", \"assert is_numeric_string('9876543210') == True\", \"assert is_numeric_string('12a34') == False\", \"assert is_numeric_...
{ "split": "train", "index": 66518, "acecode_id": "evol_10189", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates an orthography profile for a given string. The orthography profile is a summary that outlines the character distribution in the string. Specifically, your function should take a string as input and return a dictionary where...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_orthography_profile('Hello World!') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, ' ': 1, 'w': 1, 'r': 1, 'd': 1, '!': 1}\", \"assert create_orthography_profile('OpenAI') == {'o': 1, 'p': 1, 'e': 1, 'n': 1, 'a': 1, 'i': 1}\", \"assert create_orthography_profile...
{ "split": "train", "index": 66519, "acecode_id": "bigcode_python_fns_38167", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `check_uptests(uptest_results: List[Tuple[str, Dict[str, List[Dict[str, Any]]]]]) -> Tuple[str, List[str]]` that processes a list of uptest results. Each item in `uptest_results` is a tuple consisting of a host (string) and a dictionary wh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_uptests([]) == ('No uptests!', [])\", \"assert check_uptests([('host1', {'proc1': [{'Passed': True, 'Name': 'test1', 'Output': ''}]})]) == ('All tests passed', [])\", \"assert check_uptests([('host1', {'proc1': [{'Passed': False, 'Name': 'test1', 'Outp...
{ "split": "train", "index": 66520, "acecode_id": "bigcode_python_fns_13534", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a stack that supports the following operations: `CustomStack(int maxSize)` initializes the object with `maxSize`, `void push(int x)` adds `x` to the top of the stack, `int pop()` removes and returns the top of stack or -1 if the stack is empty, `void inc(int k, int val)`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert CustomStack(3).pop() == -1\", \"assert (s := CustomStack(5)).push(1) is None\", \"assert (s := CustomStack(5)).push(2) is None\", \"assert (s := CustomStack(1)).push(100) is None\", \"assert (s := CustomStack(2)).push(10) is None\", \"assert (s := CustomStac...
{ "split": "train", "index": 66521, "acecode_id": "evol_11409", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple banking transaction system. The function should take an initial balance, a list of transactions, and return the final balance after processing all transactions. Each transaction is represented as a tuple containing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert final_balance(1000, [('deposit', 500), ('withdrawal', 200)]) == 1300\", \"assert final_balance(0, [('deposit', 1000), ('withdrawal', 500)]) == 500\", \"assert final_balance(100, [('withdrawal', 50), ('withdrawal', 60)]) == 50\", \"assert final_balance(500, [...
{ "split": "train", "index": 66522, "acecode_id": "oss_32564", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that creates a 2D wall object. The wall object should have a color and a position in 2D space. The function should accept a string representing the wall's color and an optional tuple representing the position. If the position is not p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_wall('red') == {'wall_color': 'red', 'position': (0, 0)}\", \"assert create_wall('blue', (1, 2)) == {'wall_color': 'blue', 'position': (1, 2)}\", \"assert create_wall('green') == {'wall_color': 'green', 'position': (0, 0)}\", \"assert create_wall('yel...
{ "split": "train", "index": 66523, "acecode_id": "oss_37034", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `is_valid_json(data: str) -> bool` that checks if the given string is a valid JSON format. The function should return True if the string represents valid JSON data, and False if it does not. The function must also correctly handle nested JSON structu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_json('{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30, \\\"address\\\": {\\\"city\\\": \\\"New York\\\", \\\"country\\\": \\\"USA\\\"}}') == True\", \"assert is_valid_json('{\\\"key\\\": [1, 2, 3], \\\"nested\\\": {\\\"inner_key\\\": \\\"value\\\"}}') ...
{ "split": "train", "index": 66524, "acecode_id": "evol_32945", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that constructs a ResNet-101 model. The function should take a single boolean argument `pretrained`. If `pretrained` is set to True, the function should return a string indicating that a pre-trained model is returned; otherwise, it sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_resnet101(True) == 'Returning a pre-trained model.'\", \"assert construct_resnet101(False) == 'Constructing a new model.'\", \"assert construct_resnet101(True) == 'Returning a pre-trained model.'\", \"assert construct_resnet101(False) == 'Construct...
{ "split": "train", "index": 66525, "acecode_id": "bigcode_python_fns_987", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string and a string type label. Write a function that checks if the string is non-empty and of type string. If the string is empty or not a string, the function should raise a ValueError with a message indicating that the name of the specified string type must n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_string_is_nonempty('Hello', 'greeting') == 'Hello'\", \"assert check_string_is_nonempty('123', 'number') == '123'\", \"assert check_string_is_nonempty(' ', 'whitespace') == ' '\", \"assert check_string_is_nonempty('Non-empty string', 'text') == 'Non-em...
{ "split": "train", "index": 66526, "acecode_id": "bigcode_python_fns_46500", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string containing Python code snippets, write a function `extract_imported_modules(code: str) -> dict` that extracts information about the imported modules. The function should return a dictionary where the keys are the names of the imported modules and the values are l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_imported_modules('from math import sqrt, sin\\\\nimport os\\\\nfrom collections import defaultdict') == {'math': ['sqrt', 'sin'], 'os': [], 'collections': ['defaultdict']}\", \"assert extract_imported_modules('import random\\\\nfrom datetime import d...
{ "split": "train", "index": 66527, "acecode_id": "oss_11495", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a 5x5 grid filled with digits from 0 to 9, write a function that determines whether the grid satisfies the following conditions: the sum of each row, each column, and both diagonals must be equal. You should implement a function `is_magic_square(grid: List[List[int]]) -> ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_magic_square([[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1]]) == True\", \"assert is_magic_square([[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]) == True\", \"assert is_magic_squ...
{ "split": "train", "index": 66528, "acecode_id": "evol_9430", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that filters and collects completed scans from a given list of scans. Each scan is represented as a dictionary with two keys: 'id' and 'status'. Your function should take a list of these scan dictionaries and return a list of the 'id's of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_completed_scans([{'id': 1, 'status': 'completed'}, {'id': 2, 'status': 'in_progress'}, {'id': 3, 'status': 'completed'}]) == [1, 3]\", \"assert get_completed_scans([{'id': 1, 'status': 'in_progress'}, {'id': 2, 'status': 'in_progress'}, {'id': 3, 'status...
{ "split": "train", "index": 66529, "acecode_id": "bigcode_python_fns_26486", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a final wavefunction represented as a complex number, and an objective function that computes a value based on this wavefunction. Implement a function `calculate_objective_value(result, objective)` that takes the final wavefunction `result` and an `objective` obje...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_objective_value(complex(1, 2), ObjectiveFunction()) == complex(1, 2)\", \"assert calculate_objective_value(complex(0, 0), ObjectiveFunction()) == complex(0, 0)\", \"assert calculate_objective_value(complex(-1, -2), ObjectiveFunction()) == complex(-...
{ "split": "train", "index": 66530, "acecode_id": "oss_23696", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an input value `x` and a list of allowable values called `allowable_set`, implement a function that returns a one-hot encoding representation of `x` based on `allowable_set`. If `x` is not present in `allowable_set`, it should be replaced by the last element of `allowable...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert one_hot_encoding(2, [1, 2, 3]) == [False, True, False]\", \"assert one_hot_encoding(4, [1, 2, 3]) == [False, False, True]\", \"assert one_hot_encoding('a', ['a', 'b', 'c']) == [True, False, False]\", \"assert one_hot_encoding('d', ['a', 'b', 'c']) == [False,...
{ "split": "train", "index": 66531, "acecode_id": "bigcode_python_fns_45888", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a string representation of C++ forward declarations for a list of classes. You will receive two lists as input: one containing the names of concrete classes and the other containing the names of abstract classes. Your function should yield a strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_forward_declarations(['Dog', 'Cat'], ['Animal']) == '#ifndef STORAGE_ZETASQL_PARSER_PARSE_TREE_DECLS_H\\\\n#define STORAGE_ZETASQL_PARSER_PARSE_TREE_DECLS_H\\\\nnamespace zetasql {\\\\nclass Animal;\\\\nclass Dog;\\\\nclass Cat;\\\\n} // namespace ...
{ "split": "train", "index": 66532, "acecode_id": "bigcode_python_fns_1136", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a set of properties based on a given set of rules. The rules are defined in a dictionary where the keys represent the property names, and the values are tuples containing the expected type and a boolean indicating wheth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_properties({'Artifacts': (list, True), 'Description': (str, False), 'Environment': (str, True)}, {'Artifacts': ['artifact1'], 'Environment': 'Production'}) == True\", \"assert validate_properties({'Artifacts': (list, True), 'Description': (str, Fals...
{ "split": "train", "index": 66533, "acecode_id": "oss_11502", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a CMYK color representation into its HEX equivalent. The function should accept four parameters, representing the values of Cyan, Magenta, Yellow, and Black (K) respectively, and return the corresponding HEX color code as a string. Each parame...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cmyk_to_hex(0.0, 0.0, 0.0, 0.0) == '#ffffff'\", \"assert cmyk_to_hex(0.0, 0.0, 0.0, 1.0) == '#000000'\", \"assert cmyk_to_hex(0.0, 1.0, 0.0, 0.0) == '#ff00ff'\", \"assert cmyk_to_hex(0.0, 0.0, 1.0, 0.0) == '#ffff00'\", \"assert cmyk_to_hex(0.5, 0.5, 0.0, 0.0...
{ "split": "train", "index": 66534, "acecode_id": "evol_9050", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns a new list containing only the unique elements from the original list, preserving the order of their first occurrence. The output list should not contain any duplicates, and it should maintain the same order as the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_elements([5, 5, 5, 5, 5]) == [5]\", \"assert unique_elements([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert unique_elements([7, 8, 9, 7, 10, 8]) == [7, 8, 9, 10]\", \"assert unique_elements([]...
{ "split": "train", "index": 66535, "acecode_id": "evol_28545", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a weather forecast summary based on provided weather data. The input will be a JSON string representing the weather data which contains current conditions and forecasts for the next few periods. Your function should extract the current temperature...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_weather_summary('{\\\"properties\\\": {\\\"periods\\\": [{\\\"temperature\\\": 50, \\\"windSpeed\\\": \\\"10 mph\\\"}, {\\\"temperature\\\": 65, \\\"windSpeed\\\": \\\"5 mph\\\"}, {\\\"temperature\\\": 55, \\\"windSpeed\\\": \\\"15 mph\\\"}]}}') == ...
{ "split": "train", "index": 66536, "acecode_id": "bigcode_python_fns_7894", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a variable that represents a distance, implement a function that returns the data type of that variable as a string. The variable will be a float representing the distance. Your function should take one parameter, which is the distance variable, and return its data type. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_data_type(15.5) == 'float'\", \"assert get_data_type(0.0) == 'float'\", \"assert get_data_type(-12.3) == 'float'\", \"assert get_data_type(100.1) == 'float'\", \"assert get_data_type(3.14) == 'float'\", \"assert get_data_type(2.718) == 'float'\", \"asser...
{ "split": "train", "index": 66537, "acecode_id": "evol_15568", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `bases` and `exponents`, write a function `power(bases: List[int], exponents: List[int]) -> List[int]` that returns a new list where each element is the result of raising the corresponding element in `bases` to the power of the corresponding element...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert power([2], [3]) == [8]\", \"assert power([1, 2, 3], [0, 1, 2]) == [1, 2, 9]\", \"assert power([0, 1, 2], [1, 2, 3]) == [0, 1, 8]\", \"assert power([2, 3, 4], [2, 3, 4]) == [4, 27, 256]\", \"assert power([-1, -2, -3], [1, 2, 3]) == [-1, 4, -27]\", \"assert po...
{ "split": "train", "index": 66538, "acecode_id": "bigcode_python_fns_11509", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with designing a function that simulates the operation of a pump that can either pull in or pump out a certain volume of liquid. The pump has a maximum capacity and currently holds a certain volume of liquid. You need to implement a function, `pump_volume(volume:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pump_volume(30, 0) == 'Pulled in 30 units.'\", \"assert pump_volume(60, 0) == 'Pulled in 50 units.'\", \"assert pump_volume(50, 1) == 'Pumped out 50 units.'\", \"assert pump_volume(20, 1) == 'Pumped out 20 units.'\", \"assert pump_volume(30, 1) == 'Pumped ou...
{ "split": "train", "index": 66539, "acecode_id": "bigcode_python_fns_31023", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string input representing a name. Your task is to create a function that appends the word 'apple' to the end of the name and returns the resulting string. If the input is not a string, the function should return 'Must pass in Name'. Define a function `append_app...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert append_apple('John') == 'Johnapple'\", \"assert append_apple('Alice') == 'Aliceapple'\", \"assert append_apple('') == 'apple'\", \"assert append_apple('Bob') == 'Bobapple'\", \"assert append_apple('Charlie') == 'Charlieapple'\", \"assert append_apple('Diana'...
{ "split": "train", "index": 66540, "acecode_id": "bigcode_python_fns_18996", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the implied volatility of a financial option using the Newton-Raphson method. Implied volatility represents the market's expectation of future volatility. The function `implied_vol` takes three parameters: a callable func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(implied_vol(lambda vol: vol * 100, 50, {}) - 0.5) < 1e-6\", \"assert abs(implied_vol(lambda vol: vol * 200, 100, {}) - 0.5) < 1e-6\", \"assert abs(implied_vol(lambda vol: vol * 150, 75, {}) - 0.5) < 1e-6\", \"assert abs(implied_vol(lambda vol: vol * 300,...
{ "split": "train", "index": 66541, "acecode_id": "oss_32275", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `convert_to_dict(lst)` that takes a list of integers as input and returns a dictionary where the keys are the indexes and the values are the elements of the list. You must use the `enumerate` function to achieve this.\nPlease reason step by step, then write...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_dict([1, 2, 3]) == {0: 1, 1: 2, 2: 3}\", \"assert convert_to_dict([10, 20, 30, 40, 50]) == {0: 10, 1: 20, 2: 30, 3: 40, 4: 50}\", \"assert convert_to_dict([]) == {}\", \"assert convert_to_dict([5]) == {0: 5}\", \"assert convert_to_dict([-1, -2, -3...
{ "split": "train", "index": 66542, "acecode_id": "evol_13048", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a dictionary containing various settings for an advertising platform. The function should modify the dictionary by adding a new key-value pair for each setting, where the key is the original setting name prefixed wit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_ad_settings({'A': 'test'}) == {'AD_SETTING_A': 'TEST'}\", \"assert process_ad_settings({'B': 2}) == {'AD_SETTING_B': 2}\", \"assert process_ad_settings({'C': 'hello', 'D': 'world'}) == {'AD_SETTING_C': 'HELLO', 'AD_SETTING_D': 'WORLD'}\", \"assert pr...
{ "split": "train", "index": 66543, "acecode_id": "oss_30968", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that constructs a nested field specification based on given sub field specifications. The function should accept a dictionary of fields, where each field can be defined as a nested dictionary. Additionally, the function can accept optiona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nested({'field1': {}, 'field2': {}}, param1='value1', param2='value2') == {'type': 'nested', 'fields': {'field1': {}, 'field2': {}}, 'config': {'param1': 'value1', 'param2': 'value2'}}\", \"assert nested({'fieldA': {'subfield1': {}}, 'fieldB': {}}, option1='...
{ "split": "train", "index": 66544, "acecode_id": "bigcode_python_fns_26069", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the names and IDs of folders contained within a specified folder. The function should take a folder ID as input and return a list of dictionaries, where each dictionary contains the 'name' and 'id' of each sub-folder. Imple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_folder_contents(1) == [{'name': 'Subfolder A', 'id': '1a'}, {'name': 'Subfolder B', 'id': '1b'}]\", \"assert get_folder_contents(2) == [{'name': 'Subfolder C', 'id': '2a'}, {'name': 'Subfolder D', 'id': '2b'}, {'name': 'Subfolder E', 'id': '2c'}]\", \"as...
{ "split": "train", "index": 66545, "acecode_id": "bigcode_python_fns_20244", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `hello_world(input: str) -> str` that takes a string as input. If the input is 'World', it should return 'Hello, World!'. For any other input, it should return 'Hello, ' concatenated with the input string. Ensure that the function handles strings correctly ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hello_world('World') == 'Hello, World!'\", \"assert hello_world('Alice') == 'Hello, Alice'\", \"assert hello_world('Bob') == 'Hello, Bob'\", \"assert hello_world('') == 'Hello, '\", \"assert hello_world('Python') == 'Hello, Python'\", \"assert hello_world(''...
{ "split": "train", "index": 66546, "acecode_id": "evol_9212", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string formula representing a statistical model, write a function `model_description(formula: str) -> str` that interprets the formula and returns a human-readable description of the model. The formula will consist of variables and their interactions, represented using ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert model_description('y ~ x1 + x2') == 'y is modeled by x1 and x2'\", \"assert model_description('profit ~ sales + cost') == 'profit is modeled by sales and cost'\", \"assert model_description('price ~ demand + supply') == 'price is modeled by demand and supply...
{ "split": "train", "index": 66547, "acecode_id": "bigcode_python_fns_39538", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the cumulative length of a given list of names after eliminating names that start with a lowercase letter and discarding any names that contain non-alphabetic characters. Your function should take a list of strings as input and return an int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_name_length(['Zoe', 'adam', 'Oscar', 'N@than']) == 8\", \"assert sum_name_length(['delta', 'Epsilon', 'zeta']) == 7\", \"assert sum_name_length(['Oliver', 'peter', 'Quinn']) == 11\", \"assert sum_name_length(['Ulysses', 'viktor', 'Wanda']) == 12\", \"ass...
{ "split": "train", "index": 66548, "acecode_id": "evol_1186", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Create a function in Python 3 that checks if the provided value is a positive integer. The function should return 'Valid input' if the value is a positive integer, 'Error: The input is not an integer.' if the input is not an integer, and 'Error: The input is an integer but nega...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_positive_integer(5) == 'Valid input'\", \"assert validate_positive_integer(0) == 'Error: The input is an integer but negative.'\", \"assert validate_positive_integer(-3) == 'Error: The input is an integer but negative.'\", \"assert validate_positive...
{ "split": "train", "index": 66549, "acecode_id": "evol_8693", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to normalize audio levels. Write a function called `normalize_audio_levels` that takes a list of audio levels in decibels (dB) and a target audio level in decibels. The function should return a new list where each audio level has been adj...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_audio_levels([-10, 0, 10], -5) == [-5, 5, 15]\", \"assert normalize_audio_levels([0, -5, -10], -10) == [10, 5, 0]\", \"assert normalize_audio_levels([-20, -15, -10, -5], -10) == [-10, -5, 0, 5]\", \"assert normalize_audio_levels([10, 20, 30], 25) =...
{ "split": "train", "index": 66550, "acecode_id": "oss_11250", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `affirm` and `denied`. Your task is to implement a function `check_contexts(affirm: List[int], denied: List[int]) -> bool` that checks if there are any overlapping elements between the two lists. If there are overlapping elements, the functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_contexts([1, 2, 3], [4, 5, 6]) == True\", \"assert check_contexts([], []) == True\", \"assert check_contexts([7, 8, 9], [1, 2, 3]) == True\", \"assert check_contexts([0], [1]) == True\", \"assert check_contexts([100, 200], [300, 400]) == True\", \"asse...
{ "split": "train", "index": 66551, "acecode_id": "bigcode_python_fns_49689", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates the extension of a given filename. The function should check if the filename ends with either '.dcm' or '.gz'. If the extension is valid, the function should return True; otherwise, it should return False. Implement the fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_dicom_extension('image.dcm') == True\", \"assert is_valid_dicom_extension('document.gz') == True\", \"assert is_valid_dicom_extension('photo.jpeg') == False\", \"assert is_valid_dicom_extension('archive.gz') == True\", \"assert is_valid_dicom_extens...
{ "split": "train", "index": 66552, "acecode_id": "bigcode_python_fns_4376", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `get_key_value_at_index`. This function should take two parameters: a list of tuples `key_value_pairs` where each tuple contains a key and its corresponding value, and an integer `index`. The function should return the key-valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_key_value_at_index([('a', 1), ('b', 2), ('c', 3)], 1) == ('b', 2)\", \"assert get_key_value_at_index([('x', 10), ('y', 20)], 0) == ('x', 10)\", \"assert get_key_value_at_index([('name', 'Alice'), ('age', 30)], 1) == ('age', 30)\", \"assert get_key_value_...
{ "split": "train", "index": 66553, "acecode_id": "oss_15499", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of player objects, where each player is represented as a dictionary containing the player's name and score. Write a function `insert_players(players: List[Dict[str, Union[str, int]]]) -> List[str]` that takes a list of player dictionaries and returns a list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_players([{'name': 'Alice', 'score': 10}, {'name': 'Bob', 'score': 15}]) == ['Inserted: Alice', 'Inserted: Bob']\", \"assert insert_players([{'name': 'Alice', 'score': 10}, {'name': 'Alice', 'score': 20}]) == ['Inserted: Alice', 'Player Alice already e...
{ "split": "train", "index": 66554, "acecode_id": "bigcode_python_fns_25673", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that takes a list of integers and returns a new list containing only the unique integers from the original list, preserving their original order. The input list may contain duplicate integers and may be empty. Your function should handle the case of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([1, 1, 2, 2, 3, 3, 4]) == [1, 2, ...
{ "split": "train", "index": 66555, "acecode_id": "evol_10052", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are asked to implement a Python function that counts the number of integers from 1 to a given integer x (exclusive). The function should return the count of these integers. Implement the function `count_integers(x)` that takes an integer x as input and returns the count of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_integers(5) == 4\", \"assert count_integers(1) == 0\", \"assert count_integers(10) == 9\", \"assert count_integers(100) == 99\", \"assert count_integers(50) == 49\", \"assert count_integers(20) == 19\", \"assert count_integers(15) == 14\", \"assert cou...
{ "split": "train", "index": 66556, "acecode_id": "evol_16629", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, implement a function `double_up(my_str)` that returns a new string that consists of the original string repeated twice, separated by a space. For example, if the input string is 'hello', the output should be 'hello hello'.\nPlease reason step by step, then write...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert double_up('hello') == 'hello hello'\", \"assert double_up('world') == 'world world'\", \"assert double_up('') == ' '\", \"assert double_up('a') == 'a a'\", \"assert double_up('abc') == 'abc abc'\", \"assert double_up('test case') == 'test case test case'\", ...
{ "split": "train", "index": 66557, "acecode_id": "evol_26126", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that verifies basic authentication credentials. The function should take two parameters: a string representing the username and a string representing the password. The function should return 'True' if the provided credentials match th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_credentials('example_user', 'example_password') == True\", \"assert check_credentials('example_user', 'wrong_password') == False\", \"assert check_credentials('wrong_user', 'example_password') == False\", \"assert check_credentials('wrong_user', 'wrong...
{ "split": "train", "index": 66558, "acecode_id": "oss_721", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of unique integers, write a function that returns a list of all possible non-empty subsets (also called the powerset) of the input list. Each subset should be represented as a list. The order of the subsets in the output list does not matter, but each subset should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert non_empty_powerset([1, 2]) == [[1], [2], [1, 2]]\", \"assert non_empty_powerset([4, 5]) == [[4], [5], [4, 5]]\", \"assert non_empty_powerset([]) == []\", \"assert non_empty_powerset([10]) == [[10]]\", \"assert non_empty_powerset([10, 20]) == [[10], [20], [10...
{ "split": "train", "index": 66559, "acecode_id": "bigcode_python_fns_16325", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of words, implement a function that groups the anagrams together and returns a list of lists, where each inner list contains words that are anagrams of each other. Anagrams are words that have the same letters in a different order. The input list may contain duplic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert groupAnagrams(['']) == [['']]\", \"assert groupAnagrams(['a']) == [['a']]\", \"assert groupAnagrams(['aaa', 'aa', 'a']) == [['aaa'], ['aa'], ['a']]\", \"assert groupAnagrams(['dormitory', 'dirty room', 'room dirty']) == [['dormitory'], ['dirty room', 'room d...
{ "split": "train", "index": 66560, "acecode_id": "evol_28150", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a list of integers, return a new list that contains only the last occurrence of each integer from the original list. The order of the integers in the new list should be the same as the order of their last appearances in the original list. You may assume that the input lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_last_redundancies([5, 5, 5, 5]) == [5]\", \"assert remove_last_redundancies([1, 2, 3]) == [1, 2, 3]\", \"assert remove_last_redundancies([]) == []\", \"assert remove_last_redundancies([1]) == [1]\", \"assert remove_last_redundancies([1, 1, 1, 1]) == [...
{ "split": "train", "index": 66561, "acecode_id": "bigcode_python_fns_21133", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_api_details(api_name: str, api_version: str, scopes: List[str], key_file: str, service_email: str) -> Dict[str, Any]` that simulates the retrieval of details about a specific API service. The function takes the name of the API, the v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_api_details('drive', 'v3', ['https://www.googleapis.com/auth/drive'], '/path/to/keyfile.p12', 'service@example.com') == {'api_name': 'drive', 'api_version': 'v3', 'scopes': ['https://www.googleapis.com/auth/drive'], 'service_email': 'service@example.com'...
{ "split": "train", "index": 66562, "acecode_id": "bigcode_python_fns_19698", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and writes the binary representation of this list to a binary file using the pickle format. Your function should accept two parameters: the list of integers and the file path where the data should be saved. W...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert write_binary_data([1, 2, 3, 4], 'output.pkl') is None\", \"assert write_binary_data([], 'empty.pkl') is None\", \"assert write_binary_data([-1, -2, -3], 'negatives.pkl') is None\", \"assert write_binary_data([0], 'zero.pkl') is None\", \"assert write_binary_...
{ "split": "train", "index": 66563, "acecode_id": "bigcode_python_fns_38153", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `replace_substring` that takes three parameters: a string `text`, a string `old`, and a string `new`. The function should return a new string where all occurrences of the substring `old` in `text` are replaced with the substring `new`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_substring('Hello World', 'World', 'Universe') == 'Hello Universe'\", \"assert replace_substring('Hello World', 'world', 'Universe') == 'Hello World'\", \"assert replace_substring('abcabcabc', 'abc', '123') == '123123123'\", \"assert replace_substring...
{ "split": "train", "index": 66564, "acecode_id": "bigcode_python_fns_43721", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of components in a 3D animation software environment, and your task is to identify all the node editors present in that list. Implement a function `get_node_editors(components: List[str]) -> List[str]` that takes a list of component names as input and retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_node_editors(['NodeEditor1', 'Renderer', 'NodeEditor2', 'NodeEditor1']) == ['NodeEditor1', 'NodeEditor2']\", \"assert get_node_editors(['Camera', 'Light', 'Mesh', 'NodeEditor']) == ['NodeEditor']\", \"assert get_node_editors(['NodeEditorA', 'NodeEditorB'...
{ "split": "train", "index": 66565, "acecode_id": "oss_9778", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that sorts a given dictionary by the number of vowels in each key. The function should take a dictionary as input and return a new dictionary sorted in ascending order based on the count of vowels in the keys. Note that the keys are strings.\nPlease reason st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_dict_by_vowels({'parrot': 'bird', 'elephant': 'mammal', 'trout': 'fish', 'python': 'reptile'}) == {'trout': 'fish', 'parrot': 'bird', 'python': 'reptile', 'elephant': 'mammal'}\", \"assert sort_dict_by_vowels({'apple': 'fruit', 'banana': 'fruit', 'kiwi'...
{ "split": "train", "index": 66566, "acecode_id": "evol_19211", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to parse a set of rules defined in a given code snippet. Each rule is represented by a line of text, and the rules are categorized by prefixes denoting their type. The prefixes are as follows: '*' for general rules and '#' for utility...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_rules('''\\n*rule1,\\n*rule2,\\n#util_rule1,\\n*rule3,\\n#util_rule2\\n''') == {'general_rules': ['rule1', 'rule2', 'rule3'], 'utility_rules': ['util_rule1', 'util_rule2']}\", \"assert parse_rules('''\\n#util1,\\n*ruleA,\\n*ruleB,\\n*ruleC\\n''') == {'...
{ "split": "train", "index": 66567, "acecode_id": "oss_20403", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns a new string that contains only the alphanumeric characters from the input string. Alphanumeric characters include lowercase letters (a-z), uppercase letters (A-Z), and digits (0-9). All other characters should be re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_alphanumeric('Hello, World!') == 'HelloWorld'\", \"assert filter_alphanumeric('123 ABC!') == '123ABC'\", \"assert filter_alphanumeric('Python3.9') == 'Python39'\", \"assert filter_alphanumeric('!@#$%^&*()') == ''\", \"assert filter_alphanumeric('2023-...
{ "split": "train", "index": 66568, "acecode_id": "evol_9395", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of team scores represented as strings, where each string contains the team's name followed by its score, separated by a space (e.g. 'TeamA 45'). Your task is to implement a function that extracts the total score for each team and returns a list of tuples. E...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_team_totals(['TeamA 45', 'TeamB 30', 'TeamC 55']) == [('TeamC', 55), ('TeamA', 45), ('TeamB', 30)]\", \"assert parse_team_totals(['TeamX 20', 'TeamY 20', 'TeamZ 10']) == [('TeamX', 20), ('TeamY', 20), ('TeamZ', 10)]\", \"assert parse_team_totals(['Team...
{ "split": "train", "index": 66569, "acecode_id": "bigcode_python_fns_48688", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the visibility state of a turtle in a simple graphics program. The turtle can be either visible or hidden. Implement a function `toggle_visibility()` that toggles the current visibility state of the turtle. The function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert toggle_visibility() == True\", \"assert toggle_visibility() == True\", \"assert toggle_visibility() == True\", \"assert toggle_visibility() == True\", \"assert toggle_visibility() == True\", \"assert toggle_visibility() == True\", \"assert toggle_visibility(...
{ "split": "train", "index": 66570, "acecode_id": "bigcode_python_fns_49502", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `intersperse` that takes a list of integers `numbers`, an integer `delimeter`, and two optional boolean parameters `even_positions_only` and `prime_positions` (both defaulting to False). The function should return a new list where the `delimeter` is inserte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intersperse([1, 2, 3], 0) == [1, 2, 3]\", \"assert intersperse([1, 2, 3], 0, False, True) == [1, 2, 0, 3]\", \"assert intersperse([1, 2, 3, 4, 5], 9) == [1, 2, 3, 4, 5]\", \"assert intersperse([], 5) == []\", \"assert intersperse([10], 5) == [10]\", \"assert...
{ "split": "train", "index": 66571, "acecode_id": "evol_31086", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks whether a given configuration object is valid. The configuration is considered valid if it is not None. Write a function `is_valid_config()` that takes a single parameter `config` and returns a boolean indicating whether the `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_config(None) == False\", \"assert is_valid_config(5) == True\", \"assert is_valid_config('config') == True\", \"assert is_valid_config([]) == True\", \"assert is_valid_config({}) == True\", \"assert is_valid_config(set()) == True\", \"assert is_vali...
{ "split": "train", "index": 66572, "acecode_id": "bigcode_python_fns_34041", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with determining if a successful connection has occurred within a specified time frame. Implement a function `check_successful_connection(success_count: int, last_check_time: int, current_time: int, successful_connections_period: int, no_successful_connections_pe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_successful_connection(5, 100, 110, 15, 10) == True\", \"assert check_successful_connection(0, 100, 115, 15, 10) == False\", \"assert check_successful_connection(0, 100, 125, 15, 10) == False\", \"assert check_successful_connection(0, 100, 135, 20, 15) ...
{ "split": "train", "index": 66573, "acecode_id": "bigcode_python_fns_17361", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of integers `numbers`, return a new list containing all the missing integers that are not present in the list, sorted in increasing order. A missing integer is defined as any integer that is not in the provided list, starting from 1 up to the maximum integer in the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert missing_integers([]) == []\", \"assert missing_integers([-1, -2, -3]) == []\", \"assert missing_integers([1, 2, 3]) == []\", \"assert missing_integers([1, 2, 4]) == [3]\", \"assert missing_integers([3, 5, 2]) == [1, 4]\", \"assert missing_integers([1, 3, 3, ...
{ "split": "train", "index": 66574, "acecode_id": "bigcode_python_fns_37764", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines if a given list of integers contains any duplicates. The function should take a list of integers as input and return True if any integer appears at least twice in the list, and False if every integer is distinct. Your ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contains_duplicates([1, 2, 3, 4, 5]) == False\", \"assert contains_duplicates([1, 2, 3, 1]) == True\", \"assert contains_duplicates([]) == False\", \"assert contains_duplicates([7, 8, 9, 10, 11, 12]) == False\", \"assert contains_duplicates([2, 3, 4, 5, 3]) ...
{ "split": "train", "index": 66575, "acecode_id": "oss_1760", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `edit_distance(str1: str, str2: str) -> int` that computes the edit distance between two strings. The edit distance is the minimum number of operations (insertions, deletions, and substitutions) required to change one string into the other.\nPlease reason step ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert edit_distance('kitten', 'sitting') == 3\", \"assert edit_distance('', '') == 0\", \"assert edit_distance('a', 'a') == 0\", \"assert edit_distance('a', '') == 1\", \"assert edit_distance('', 'a') == 1\", \"assert edit_distance('abc', 'abc') == 0\", \"assert e...
{ "split": "train", "index": 66576, "acecode_id": "evol_29573", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `encoder_dropout` and `decoder_dropout`, both containing four elements each. The elements represent the dropout rates for different components of an encoder-decoder architecture in a machine learning model. Your task is to write a function `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_dropout_conflicts([0, 0, 0, 0], [0, 0, 0, 0]) == []\", \"assert check_dropout_conflicts([0, 1, 0, 0], [0, 0, 0, 0]) == []\", \"assert check_dropout_conflicts([1, 1, 0, 0], [0, 0, 0, 0]) == ['Setting encoder dropout AND source embedding dropout > 0 lead...
{ "split": "train", "index": 66577, "acecode_id": "bigcode_python_fns_19216", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that checks for the presence of inline HTML elements in a given list of Markdown strings. The function should take a list of strings as input, where each string represents a separate line in a Markdown document. The function should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_inline_html(['This is a test', '<a href=\\\"link\\\">link</a>', 'Another line']) == ['2:1: MD033: Inline HTML [Element: a] (no-inline-html)']\", \"assert check_inline_html(['No inline HTML here', 'Just text']) == []\", \"assert check_inline_html(['<scr...
{ "split": "train", "index": 66578, "acecode_id": "bigcode_python_fns_18946", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the launch of a plugin flow for a client. The function should take in the following parameters: a unique flow identifier (flow_id), a client identifier (client_id), a plugin name (plugin), and a dictionary of plugin argumen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert launch_plugin_flow('flow123', 'client456', 'pluginA', {'arg1': 'value1'}) == {'status': 'success'}\", \"assert launch_plugin_flow('flow789', 'client321', 'pluginB', {'arg2': 'value2'}) == {'status': 'success'}\", \"assert launch_plugin_flow('flow456', 'clien...
{ "split": "train", "index": 66579, "acecode_id": "bigcode_python_fns_33789", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `day_after_days(start_day: str, add_days: int) -> str` that takes a string representing a day of the week (e.g., 'Monday', 'Tuesday', etc.) and an integer representing the number of days to add. The function should return the day of the week that results fr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert day_after_days('Monday', 0) == 'Monday'\", \"assert day_after_days('Monday', 1) == 'Tuesday'\", \"assert day_after_days('Monday', 6) == 'Sunday'\", \"assert day_after_days('Monday', 7) == 'Monday'\", \"assert day_after_days('Tuesday', 1) == 'Wednesday'\", \"...
{ "split": "train", "index": 66580, "acecode_id": "evol_19853", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that identifies the index of a 'boundary' element in a list of integers. A boundary element is defined as an element where the product of all elements to the left is equal to the geometric mean of the elements to the right. If no boundary element exi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_boundary_index([5, 10, 15, 20]) == -1\", \"assert find_boundary_index([2, 2, 2, 8]) == 2\", \"assert find_boundary_index([]) == -1\", \"assert find_boundary_index([9]) == -1\", \"assert find_boundary_index([1, 2, 3, 4, 5, 6, 7]) == -1\"]}" }
{ "split": "train", "index": 66581, "acecode_id": "evol_19968", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given an iterable containing integers from 0 to n-1, implement a function that returns a list of these integers in the same order. The input will be a single integer n, which represents the number of elements in the iterable. Your function should return a list containing all in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert for_in_pyiter(5) == [0, 1, 2, 3, 4]\", \"assert for_in_pyiter(0) == []\", \"assert for_in_pyiter(1) == [0]\", \"assert for_in_pyiter(2) == [0, 1]\", \"assert for_in_pyiter(3) == [0, 1, 2]\", \"assert for_in_pyiter(4) == [0, 1, 2, 3]\", \"assert for_in_pyiter...
{ "split": "train", "index": 66582, "acecode_id": "bigcode_python_fns_32907", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of format names, implement a function that takes a format name as input and checks if it exists in the list. If it exists, return 'Format found', otherwise return 'Format not found'. The function should be case-sensitive. You can assume the list of formats is prede...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_format('PDF') == 'Format found'\", \"assert check_format('DOCX') == 'Format found'\", \"assert check_format('TXT') == 'Format found'\", \"assert check_format('pdf') == 'Format not found'\", \"assert check_format('docx') == 'Format not found'\", \"asser...
{ "split": "train", "index": 66583, "acecode_id": "bigcode_python_fns_15002", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings (tokens), write a function to generate all possible n-grams of a specified length from the tokens. An n-gram is defined as a contiguous sequence of n items from the input list. The function should return a list of tuples, where each tuple represents an n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_ngrams(['hello', 'world'], 3) == [('hello',), ('world',), ('hello', 'world')]\", \"assert generate_ngrams(['one', 'two', 'three'], 1) == [('one',), ('two',), ('three',)]\", \"assert generate_ngrams([], 4) == []\", \"assert generate_ngrams(['test'], ...
{ "split": "train", "index": 66584, "acecode_id": "bigcode_python_fns_25320", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with verifying the OSPF3 metric of a network interface. Write a function `verify_ospf3_metric(interfaces: List[Dict[str, str]], interface: str, metric: str) -> bool` that checks if a given interface has a specified OSPF3 metric. The function should take a list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_ospf3_metric([{'interface-name': 'ge-0/0/0.0', 'interface-cost': '5'}, {'interface-name': 'ge-0/0/1.0', 'interface-cost': '10'}], 'ge-0/0/0.0', '5') == True\", \"assert verify_ospf3_metric([{'interface-name': 'ge-0/0/0.0', 'interface-cost': '5'}, {'in...
{ "split": "train", "index": 66585, "acecode_id": "bigcode_python_fns_49916", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `build_callgraph(levels: int, lines: List[str]) -> Dict[int, List[Tuple[str, float]]]` that constructs a call graph based on a list of strings representing call graph entries. Each entry contains a level, sampling percentage, and function name s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_callgraph(2, ['0,10.5,funcA', '1,20.0,funcB', '2,30.0,funcC']) == {0: [('funcA', 10.5)], 1: [('funcB', 20.0)]}\", \"assert build_callgraph(1, ['0,5.5,funcX', '0,15.0,funcY']) == {0: [('funcX', 5.5), ('funcY', 15.0)]}\", \"assert build_callgraph(3, ['1,...
{ "split": "train", "index": 66586, "acecode_id": "bigcode_python_fns_26306", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a Docker image tag in the format 'registry/repository:tag' (e.g., 'docker.io/library/alpine:latest'). Write a function `extract_image_details(tag: str) -> Tuple[str, str, str]` that extracts and returns the registry, repository, and tag from the provided image tag...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_image_details('docker.io/library/alpine:latest') == ('docker.io', 'library/alpine', 'latest')\", \"assert extract_image_details('myregistry.com/myrepo/myimage:1.0') == ('myregistry.com', 'myrepo/myimage', '1.0')\", \"assert extract_image_details('gcr...
{ "split": "train", "index": 66587, "acecode_id": "bigcode_python_fns_44915", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing the content of multiple files. Your task is to implement a function that concatenates the contents of all the files into a single string. Each file's content is represented as a string in the list. The concatenated string should have...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concatenate_file_contents([]) == ''\", \"assert concatenate_file_contents(['Hello', 'World']) == 'Hello World'\", \"assert concatenate_file_contents(['This', 'is', 'a', 'test.']) == 'This is a test.'\", \"assert concatenate_file_contents(['Leet', 'Code']) ==...
{ "split": "train", "index": 66588, "acecode_id": "bigcode_python_fns_29447", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of 2D coordinates represented as tuples (x, y). Your task is to implement a function that takes this list and returns a new list containing the x-coordinates of all points that lie above the line y = x. The function should have the following signature: def ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert points_above_line([(1, 2), (3, 1), (0, 0), (4, 5)]) == [1, 4]\", \"assert points_above_line([(0, 0), (1, 1), (2, 2)]) == []\", \"assert points_above_line([(5, 6), (7, 5), (6, 7)]) == [5, 6]\", \"assert points_above_line([(3, 4), (5, 5), (6, 7)]) == [3, 6]\",...
{ "split": "train", "index": 66589, "acecode_id": "bigcode_python_fns_40780", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates unique order keys for a point of sale (POS) system based on a given input dictionary. The input dictionary contains two key-value pairs: 'source' and 'order_id'. If the 'source' is 'Alipay', the order key should be generate...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_order_key({'source': 'Alipay', 'order_id': '12345'}) == 'AlipayOrder12345'\", \"assert create_order_key({'source': 'Alipay', 'order_id': '67890'}) == 'AlipayOrder67890'\", \"assert create_order_key({'source': 'CreditCard', 'order_id': '54321'}) == 'De...
{ "split": "train", "index": 66590, "acecode_id": "oss_27606", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a directed graph represented as a list of weighted edges. Each edge is defined by a tuple (u, v, w) where u is the starting node, v is the ending node, and w is the weight of the edge. Your task is to filter out the edges from the graph that have a weight less tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_edges([(0, 3, 1), (1, 0, 2), (1, 4, 3), (2, 4, 4), (2, 5, 5), (2, 7, 6), (3, 1, 7), (3, 4, 8), (4, 5, 9)], 5) == [(2, 7, 6), (3, 1, 7), (3, 4, 8), (4, 5, 9)]\", \"assert filter_edges([(0, 1, 4), (1, 2, 3), (2, 3, 2), (3, 4, 10)], 3) == [(0, 1, 4), (3,...
{ "split": "train", "index": 66591, "acecode_id": "bigcode_python_fns_40395", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an initial list of strings that contains information about different subjects. You will also receive a new list of strings representing additional subjects. Your task is to write a function that appends the new list to the existing list and returns the updated lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert append_subjects(['Math', 'Science'], ['History', 'Art']) == ['Math', 'Science', 'History', 'Art']\", \"assert append_subjects([], ['Python', 'Java']) == ['Python', 'Java']\", \"assert append_subjects(['Physics'], ['Chemistry']) == ['Physics', 'Chemistry']\",...
{ "split": "train", "index": 66592, "acecode_id": "oss_2463", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a style name, implement a function `is_description_style(style: str) -> bool` that returns `True` if the style is either 'Normal' or 'Note'. Otherwise, it should return `False`. You can assume that the input style will always be a non-empty string.\n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_description_style('Normal') == True\", \"assert is_description_style('Note') == True\", \"assert is_description_style('Bold') == False\", \"assert is_description_style('Italic') == False\", \"assert is_description_style('Underline') == False\", \"assert i...
{ "split": "train", "index": 66593, "acecode_id": "bigcode_python_fns_15824", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a URL routing system for a web application. Your goal is to implement a function that determines whether a given URL path matches a specific pattern. The pattern should allow for both '/simple/' and '/simple' to be considered valid matches, while an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matches_url_pattern('/simple/') == True\", \"assert matches_url_pattern('/simple') == True\", \"assert matches_url_pattern('/simple/other') == False\", \"assert matches_url_pattern('/simple/other/thing') == False\", \"assert matches_url_pattern('/not-simple/...
{ "split": "train", "index": 66594, "acecode_id": "oss_21198", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings `p` and `q`, return `true` if they become identical after being processed in empty text editors. The symbol `'*'` represents a duplicate character operation and the symbol `'/'` represents a delete character operation. Note that after duplicating or deleting a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert areProcessedStringsEqual('a/c', 'b') == False\", \"assert areProcessedStringsEqual('a/', 'a') == False\", \"assert areProcessedStringsEqual('/*', 'a') == False\", \"assert areProcessedStringsEqual('/*b', 'b') == True\", \"assert areProcessedStringsEqual('abc...
{ "split": "train", "index": 66595, "acecode_id": "evol_32428", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a grid represented as a 2D list of strings, where each inner list represents a row of the grid. The first row of the grid contains the headers, and the subsequent rows contain the corresponding data. Write a function `extract_grid_cells(grid: List[List[str]]) -> T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_grid_cells([['Name', 'Age'], ['Alice', '30'], ['Bob', '25']]) == (['Name', 'Age'], [{'Name': 'Alice', 'Age': '30'}, {'Name': 'Bob', 'Age': '25'}])\", \"assert extract_grid_cells([['Product', 'Price'], ['Apple', '1.00'], ['Banana', '0.50']]) == (['Pro...
{ "split": "train", "index": 66596, "acecode_id": "bigcode_python_fns_16397", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers A, determine if the array is bitonic. An array is considered bitonic if it first strictly increases to a peak and then strictly decreases from that peak, or vice versa. Return true if the array is bitonic, otherwise return false.\nPlease reason step b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isBitonic([1,3,5,7,6,4,2]) == True\", \"assert isBitonic([1,2,3,4,5]) == False\", \"assert isBitonic([5,4,3,2,1]) == False\", \"assert isBitonic([1,3,5,7,9,8,6,4,2,1]) == True\", \"assert isBitonic([1,2,3,4]) == False\", \"assert isBitonic([4,3,2,1]) == Fals...
{ "split": "train", "index": 66597, "acecode_id": "evol_9397", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `push_node` that adds a new node with a specified value at a given position in a doubly linked list. If the position is less than 1, the function should do nothing. Additionally, implement a function `delete_node` that removes a node from the doubly linked ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert push_node(1, 1) == None\", \"assert push_node(2, 1) == None\", \"assert push_node(3, 2) == None\", \"assert push_node(4, 3) == None\", \"assert delete_node(1) == None\", \"assert delete_node(2) == None\", \"assert delete_node(3) == None\", \"assert delete_no...
{ "split": "train", "index": 66598, "acecode_id": "evol_12676", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of news articles, each represented by a dictionary with 'id', 'title', 'type', and 'publish_time', write a function that retrieves the latest 30 news articles filtered by a list of user-followed types. The function should take two arguments: a list of news articles...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_latest_news([{'id': 1, 'title': 'News A', 'type': {'name': 'Sports'}, 'publish_time': '2023-10-01'}, {'id': 2, 'title': 'News B', 'type': {'name': 'Politics'}, 'publish_time': '2023-10-02'}, {'id': 3, 'title': 'News C', 'type': {'name': 'Sports'}, 'publi...
{ "split": "train", "index": 66599, "acecode_id": "bigcode_python_fns_15412", "num_tests": 11 }