data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are given a nested list that can contain integers and other nested lists. Write a function `nested_list_summary(nested_list: List[Union[int, List]]) -> List[List[int]]` that returns a list of lists where each inner list contains the first and last integer found in each non-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nested_list_summary([[1,2,[3,4,[5,6,7],8],9], [10,11,12]]) == [[1, 9], [10, 12]]\", \"assert nested_list_summary([[], [1, 2], [[3, 4], []], [5]]) == [[1, 2], [3, 4], [5, 5]]\", \"assert nested_list_summary([[], [], []]) == []\", \"assert nested_list_summary(... | {
"split": "train",
"index": 82500,
"acecode_id": "evol_25039",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string representing a file path. The function should check if the file path is valid (i.e., it should not contain any illegal characters such as ':', '?', '*', '<', '>', '|', and should not be empty). If the file path is vali... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_file_path('/home/user/file.txt') == 'Valid Path'\", \"assert validate_file_path('') == 'Invalid Path'\", \"assert validate_file_path('C:/Invalid|Path/file.txt') == 'Invalid Path'\", \"assert validate_file_path('C:/Invalid*Path/file.txt') == 'Invalid... | {
"split": "train",
"index": 82501,
"acecode_id": "bigcode_python_fns_22220",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_number(num, start=1, end=10)` that verifies whether a numerical value falls within the inclusive range defined by `start` and `end`. The function should handle non-numeric inputs gracefully by returning `False`. The default range to check should be f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_number(5) == True\", \"assert check_number(1) == True\", \"assert check_number(10) == True\", \"assert check_number(0) == False\", \"assert check_number(11) == False\", \"assert check_number(7.5) == True\", \"assert check_number(-3) == False\", \"asser... | {
"split": "train",
"index": 82502,
"acecode_id": "evol_18420",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid represented as a list of lists, where each cell can contain one of the following characters: '*', 'X', 'O', '#', or 'T'. The character '*' represents the starting position, 'X' represents an obstacle, 'O' represents an open space, '#' represents food, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getFood([['*', 'O', 'O'], ['O', 'X', '#'], ['O', 'T', 'O']]) == 3\", \"assert getFood([['*', 'O', 'O'], ['O', 'X', 'O'], ['O', 'T', 'O']]) == -1\", \"assert getFood([['*', 'O', 'T'], ['O', 'X', '#'], ['O', 'O', 'O']]) == 4\", \"assert getFood([['*', 'O', 'O'... | {
"split": "train",
"index": 82503,
"acecode_id": "evol_19013",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function named `create_app` that simulates the initialization of a web application configuration. The function should accept an optional dictionary parameter `config` which can contain various key-value pairs. The function should return an object ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_app() == {'testing': False}\", \"assert create_app({'TESTING': True}) == {'testing': True}\", \"assert create_app({'TESTING': False}) == {'testing': False}\", \"assert create_app({'TESTING': 0}) == {'testing': False}\", \"assert create_app({'OTHER_KEY... | {
"split": "train",
"index": 82504,
"acecode_id": "bigcode_python_fns_39962",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks the connection status of a Basestation device based on the last status time and a predefined timeout limit. The function will take two parameters: `last_status_time` (a float representing the last time the Basestation sent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_connected(0, 30) == True\", \"assert is_connected(0, 60) == False\", \"assert is_connected(0, 59.999) == True\", \"assert is_connected(30, 89.999) == True\", \"assert is_connected(30, 90) == False\", \"assert is_connected(10, 70) == False\", \"assert is_c... | {
"split": "train",
"index": 82505,
"acecode_id": "oss_5117",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that saves a string representation of a decoder to a specified file path. The function should take in two parameters: a string `decoder` which represents the data to be saved, and a string `path` which represents the file location whe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_decoder('example_decoder', 'path/to/save') == True\", \"assert save_decoder('decoder_data', '/valid/path') == True\", \"assert save_decoder('', '/valid/path') == False\", \"assert save_decoder('decoder_data', '') == False\", \"assert save_decoder('decod... | {
"split": "train",
"index": 82506,
"acecode_id": "bigcode_python_fns_40981",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that updates the properties of a cluster based on provided arguments. The function, `update_cluster`, should accept a cluster identifier, a dictionary of properties to update, and a verbosity flag. The function will log a message indicati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_cluster('cluster_1', {'property_a': 'value_a'}, verbosity=True) == {'id': 'cluster_1', 'property_a': 'value_a', 'status': 'updated', 'message': 'Update successful'}\", \"assert update_cluster('cluster_2', {'property_b': 'value_b'}, verbosity=False) ==... | {
"split": "train",
"index": 82507,
"acecode_id": "bigcode_python_fns_13610",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of meta tags represented as dictionaries. Each dictionary may contain attributes such as 'property' and 'content'. Your task is to implement a function that checks whether the list contains a specific Open Graph image tag and an Open Graph image alt tag. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_open_graph_tags([{'property': 'og:image', 'content': 'https://i.imgur.com/611EovQh.jpg'}, {'property': 'og:image:alt', 'content': '<no title>'}]) == ('https://i.imgur.com/611EovQh.jpg', '<no title>')\", \"assert get_open_graph_tags([{'property': 'og:imag... | {
"split": "train",
"index": 82508,
"acecode_id": "bigcode_python_fns_48953",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that calculates the sum of all even Fibonacci numbers up to the nth Fibonacci number, where n is a non-negative integer. The function should take a single parameter, n, and return the sum of the even Fibonacci numbers found in that range. If n is less than 0, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_even_fibonacci(0) == 0\", \"assert sum_even_fibonacci(1) == 0\", \"assert sum_even_fibonacci(3) == 2\", \"assert sum_even_fibonacci(4) == 2\", \"assert sum_even_fibonacci(5) == 2\", \"assert sum_even_fibonacci(8) == 10\", \"assert sum_even_fibonacci(10) ... | {
"split": "train",
"index": 82509,
"acecode_id": "evol_8546",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a function `f` that takes a single integer as input and returns an integer. You are also provided with a list of integers `x_vals`. Your task is to create a function `apply_function(f, x_vals)` that returns a list of integers where each integer is the result of ap... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_function(lambda x: x * 2, [1, 2, 3]) == [2, 4, 6]\", \"assert apply_function(lambda x: x + 5, [0, -1, -5]) == [5, 4, 0]\", \"assert apply_function(lambda x: x ** 2, [1, 2, 3, 4]) == [1, 4, 9, 16]\", \"assert apply_function(lambda x: x // 2, [1, 2, 3, 4... | {
"split": "train",
"index": 82510,
"acecode_id": "bigcode_python_fns_28874",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of numerical data points and their corresponding labels. Implement a function `most_frequent_label(data_points: List[List[float]], labels: List[int], k: int, query_point: List[float]) -> Tuple[int, int]` that uses the k-nearest neighbors algorithm to predic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert most_frequent_label([[1.0, 2.0], [2.0, 3.0], [3.0, 4.0]], [0, 1, 1], 2, [2.5, 3.5]) == (1, 2)\", \"assert most_frequent_label([[1.0, 2.0], [2.0, 3.0], [3.0, 4.0]], [0, 1, 1], 3, [2.5, 3.5]) == (1, 2)\", \"assert most_frequent_label([[1.0, 1.0], [2.0, 2.0], [... | {
"split": "train",
"index": 82511,
"acecode_id": "bigcode_python_fns_8553",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the number of days remaining until a specified future date. The function should take two parameters: the future date as a string in the format 'YYYY-MM-DD' and the current date as a string in the same format. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert days_until('2023-12-31', '2023-12-30') == 1\", \"assert days_until('2023-12-31', '2023-12-31') == 0\", \"assert days_until('2023-12-31', '2024-01-01') == 0\", \"assert days_until('2024-01-01', '2023-12-31') == 1\", \"assert days_until('2023-01-01', '2023-01-... | {
"split": "train",
"index": 82512,
"acecode_id": "bigcode_python_fns_27352",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a card game where players can use various cards to enhance their abilities. Each card has a name and a type. Your task is to create a function `is_card_type(card_name: str, card_type: str, cards: List[Tuple[str, str]]) -> bool` that checks if a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_card_type('Fireball', 'Spell', [('Fireball', 'Spell'), ('Shield', 'Defense')]) == True\", \"assert is_card_type('Shield', 'Spell', [('Fireball', 'Spell'), ('Shield', 'Defense')]) == False\", \"assert is_card_type('Fireball', 'Defense', [('Fireball', 'Spel... | {
"split": "train",
"index": 82513,
"acecode_id": "oss_22507",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple Task Manager system. The task manager will manage a list of tasks and allow you to add tasks and retrieve the name of the next task in the list. Implement a function `task_manager_operations(operations: List[Tuple[str, str]]) -> List[st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert task_manager_operations([('add', 'Task 1'), ('add', 'Task 2'), ('next', 'Task 1')]) == ['Task 2']\", \"assert task_manager_operations([('add', 'Task A'), ('add', 'Task B'), ('next', 'Task A'), ('next', 'Task B'), ('next', 'Task A')]) == ['Task B', 'Task A', ... | {
"split": "train",
"index": 82514,
"acecode_id": "oss_15426",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `select_range(arr: List[int], start: int, end: int) -> List[int]` that returns the sublist of integers from the input list `arr`, starting from the index `start` to the index `end` (inclusive). If the start index is out of bounds or th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_range([1, 2, 3, 4, 5], 1, 3) == [2, 3, 4]\", \"assert select_range([1, 2, 3, 4, 5], 0, 2) == [1, 2, 3]\", \"assert select_range([1, 2, 3, 4, 5], 2, 4) == [3, 4, 5]\", \"assert select_range([1, 2, 3, 4, 5], 3, 3) == [4]\", \"assert select_range([1, 2, ... | {
"split": "train",
"index": 82515,
"acecode_id": "bigcode_python_fns_45821",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `cube_odd_numbers(N)` that takes a single integer input N, and returns a list of the cubed values of the first N odd integers in ascending order. If N is not a positive integer (i.e., less than 1 or not an integer), the function should raise a ValueError wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cube_odd_numbers(1) == [1]\", \"assert cube_odd_numbers(2) == [1, 27]\", \"assert cube_odd_numbers(3) == [1, 27, 125]\", \"assert cube_odd_numbers(4) == [1, 27, 125, 343]\", \"assert cube_odd_numbers(5) == [1, 27, 125, 343, 729]\", \"assert cube_odd_numbers(... | {
"split": "train",
"index": 82516,
"acecode_id": "evol_17744",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a function `parse_xml_content(xml_string: str, desired_tags: List[str], ignore_tags: List[str]) -> Dict[str, List[str]]` that parses the given XML string and extracts the text content within specified tags while ignoring certain types of tags. The function should return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_xml_content('<root><a>Hello</a><b>World</b></root>', ['a'], ['b']) == {'a': ['Hello']}\", \"assert parse_xml_content('<root><a>Hello</a><b>World</b></root>', ['b'], ['a']) == {'b': ['World']}\", \"assert parse_xml_content('<root><a>Hello</a><a>Everyone... | {
"split": "train",
"index": 82517,
"acecode_id": "evol_11835",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a sentence, implement a function `filter_words(sentence: str) -> List[str]` that filters and returns a list of words based on the following conditions: 1) The words must start with 't' or 'T'. 2) The words must end with a vowel (a, e, i, o, u). 3) The words must not conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_words('Tacos are a great choice for dinner.') == []\", \"assert filter_words('Tea is better than coffee') == ['Tea']\", \"assert filter_words('Tennis requires skill and patience') == []\", \"assert filter_words('Tell me about the things you love') == ... | {
"split": "train",
"index": 82518,
"acecode_id": "evol_31173",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of film details and an attribute name as input, and returns a sorted list of films based on the specified attribute. Each film detail is represented as a dictionary containing the keys: 'title', 'filmmaker', 'release_yea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_films([{'title': 'Film1', 'filmmaker': 'Filmmaker1', 'release_year': 2000, 'genre': 'Action', 'runtime': 120}, {'title': 'Film2', 'filmmaker': 'Filmmaker2', 'release_year': 1990, 'genre': 'Thriller', 'runtime': 130}, {'title': 'Film3', 'filmmaker': 'Fil... | {
"split": "train",
"index": 82519,
"acecode_id": "evol_27729",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of complex numbers representing the amplitudes of a quantum wavefunction and a qubit operator represented as a list of complex numbers. Your task is to compute the expectation value of the qubit operator with respect to the quantum wavefunction. The expecta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_expectation_value([1+0j, 0+0j], [1+0j, 0+0j]) == (1+0j)\", \"assert get_expectation_value([0+0j, 1+0j], [0+0j, 1+0j]) == (1+0j)\", \"assert get_expectation_value([1+0j, 0+0j], [0+0j, 1+0j]) == (0+0j)\", \"assert get_expectation_value([1+0j, 1+0j, 1+0j], ... | {
"split": "train",
"index": 82520,
"acecode_id": "bigcode_python_fns_37970",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Susan is reading a book that consists of a certain number of pages. Given the total number of pages and the time it takes to read one page, write a function that calculates the total time in minutes required for her to finish the book. The function should take two parameters: t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reading_time(18, 3) == 54\", \"assert reading_time(0, 5) == 0\", \"assert reading_time(100, 2) == 200\", \"assert reading_time(50, 4) == 200\", \"assert reading_time(25, 1) == 25\", \"assert reading_time(10, 6) == 60\", \"assert reading_time(5, 3) == 15\", \... | {
"split": "train",
"index": 82521,
"acecode_id": "evol_16027",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of `Resource` objects, where each `Resource` has an `author` attribute. Your task is to implement a function `filter_resources_by_author(resources: List[Resource], author: str) -> List[Resource]` that returns a list of all `Resource` objects written by the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_resources_by_author([Resource('Title1', 'AuthorC')], 'AuthorA') == []\", \"assert filter_resources_by_author([], 'AuthorA') == []\", \"assert filter_resources_by_author([Resource('Title1', 'AuthorB'), Resource('Title2', 'AuthorB'), Resource('Title3', ... | {
"split": "train",
"index": 82522,
"acecode_id": "bigcode_python_fns_14458",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a new appointment can be added to a calendar without causing any scheduling conflicts. The appointments are represented as a list of tuples, where each tuple contains the start time, end time, and description of the app... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_add_appointment([('09:00', '10:00', 'Meeting 1'), ('10:30', '11:30', 'Meeting 2')], ('10:00', '10:30', 'Meeting 3')) == True\", \"assert can_add_appointment([('09:00', '10:00', 'Meeting 1'), ('10:30', '11:30', 'Meeting 2')], ('09:30', '10:30', 'Meeting 4... | {
"split": "train",
"index": 82523,
"acecode_id": "oss_28459",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of sentences, count the number of sentences that contain the phrase 'no es' (which translates to 'is not' in English). Implement a function `count_negative_phrases(sentences: List[str]) -> int` that takes a list of strings `sentences` as input and returns the count... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_negative_phrases(['En realidad la pandemia no es mala.', 'El clima es agradable.']) == 1\", \"assert count_negative_phrases(['Simplemente no es justo.', 'La vida es hermosa.']) == 1\", \"assert count_negative_phrases(['Trabajo duro, no es suficiente.',... | {
"split": "train",
"index": 82524,
"acecode_id": "bigcode_python_fns_13602",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `hash_credentials(password: str, api_key: str, created: bool) -> Tuple[str, str]`. This function takes in three parameters: a string `password`, a string `api_key`, and a boolean `created`. The function returns a tuple containing the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hash_credentials('mypassword', 'myapikey', True) == ('hashed_mypassword', 'hashed_myapikey')\", \"assert hash_credentials('mypassword', 'pbkdf2:sha256$hashed_api_key', False) == ('hashed_mypassword', 'pbkdf2:sha256$hashed_api_key')\", \"assert hash_credentia... | {
"split": "train",
"index": 82525,
"acecode_id": "bigcode_python_fns_1755",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string that contains a valid representation of an object in the format of curly braces. Your task is to implement a function `string_tokenize(s: str) -> List[Tuple[str, int]]` which takes a single string `s` as input and returns a list of tuples. Each tuple shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_tokenize('{}') == [('{', 0), ('}', 1)]\", \"assert string_tokenize('{Hello}') == [('{', 0), ('}', 6)]\", \"assert string_tokenize('No braces here') == []\", \"assert string_tokenize('{a}{b}{c}') == [('{', 0), ('}', 2), ('{', 3), ('}', 5), ('{', 6), ('... | {
"split": "train",
"index": 82526,
"acecode_id": "bigcode_python_fns_44829",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `create_architecture` that returns a new list where each integer is multiplied by a specified factor. The function should take three parameters: an integer list `nums`, an integer `factor`, and an optional integer `threshold`. If the o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_architecture([1, 2, 3], 2) == [2, 4, 6]\", \"assert create_architecture([4, 5, 6], 3) == [12, 15, 18]\", \"assert create_architecture([1, 2, 3], 10) == [10, 20, 30]\", \"assert create_architecture([10, 20, 30], 1) == [10, 20, 30]\", \"assert create_ar... | {
"split": "train",
"index": 82527,
"acecode_id": "bigcode_python_fns_5878",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of partitions represented as dictionaries, each containing the keys 'KNAME', 'UUID', 'PARTUUID', and 'TYPE', implement a function `find_partition(partitions: List[Dict[str, str]], uuid: str) -> str` that returns the device name of the partition that matches the giv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_partition([{'KNAME': 'sda1', 'UUID': '1234', 'PARTUUID': 'abcd', 'TYPE': 'part'}, {'KNAME': 'sda2', 'UUID': '5678', 'PARTUUID': 'efgh', 'TYPE': 'part'}], '1234') == 'sda1'\", \"assert find_partition([{'KNAME': 'sda1', 'UUID': '1234', 'PARTUUID': 'abcd',... | {
"split": "train",
"index": 82528,
"acecode_id": "bigcode_python_fns_28628",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of four points representing the vertices of a quadrilateral in ECEF coordinates, implement a function that computes the unit vector pointing in the direction of the strike for the quadrilateral. The top edge is assumed to be horizontal. Each point is represented as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_quad_strike_vector([(1, 0, 0), (2, 0, 0), (2, 1, 0), (1, 1, 0)]) == (1.0, 0.0, 0.0)\", \"assert get_quad_strike_vector([(3, 4, 5), (6, 4, 5), (6, 8, 5), (3, 8, 5)]) == (1.0, 0.0, 0.0)\", \"assert get_quad_strike_vector([(1, 1, 1), (2, 1, 1), (2, 2, 1), (... | {
"split": "train",
"index": 82529,
"acecode_id": "bigcode_python_fns_7831",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `asterisk_string(n)` that generates a string of asterisk characters of length `n`, where every nth character is replaced with a hash (#). The function should validate the input to ensure that `n` is an integer greater than zero. If `n` is invalid, the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert asterisk_string(1) == '#'\", \"assert asterisk_string(2) == '*#'\", \"assert asterisk_string(3) == '**#'\", \"assert asterisk_string(4) == '***#'\", \"assert asterisk_string(5) == '****#'\", \"assert asterisk_string(6) == '*****#'\", \"assert asterisk_string... | {
"split": "train",
"index": 82530,
"acecode_id": "evol_22251",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `factorial(n: int) -> int` that calculates the factorial of a non-negative integer n. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. The factorial of 0 is defined to be 1. Ensure that your function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 82531,
"acecode_id": "evol_34259",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a list of unique words. The function should allow you to add words to the list, display the list of words, and return the list of words as a sorted list. Your task is to implement the function `manage_words(words: List[st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_words([], ['apple', 'banana', 'cherry']) == ['apple', 'banana', 'cherry']\", \"assert manage_words(['apple', 'banana'], ['banana', 'cherry']) == ['apple', 'banana', 'cherry']\", \"assert manage_words(['apple'], ['apple', 'banana', 'apple']) == ['apple... | {
"split": "train",
"index": 82532,
"acecode_id": "oss_19930",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the execution of a series of commands for a hardware description language (HDL) synthesis and simulation tool. The function will take in a list of files, a top-level module name, and a boolean flag indicating whether... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_hdl_simulation(['file1.sv', 'file2.sv'], 'top_module', True) == None\", \"assert run_hdl_simulation(['file3.sv'], 'test_module', False) == None\", \"assert run_hdl_simulation([], 'empty_module', True) == None\", \"assert run_hdl_simulation(['file4.sv', '... | {
"split": "train",
"index": 82533,
"acecode_id": "oss_28155",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer, implement a function that converts each digit of the integer into its corresponding Roman numeral representation. The function should return a list of dictionaries, where each dictionary maps the original digit to its Roman numeral symbol. Handle s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_integer_to_roman(1234567890) == [{1: 'I'}, {2: 'II'}, {3: 'III'}, {4: 'IV'}, {5: 'V'}, {6: 'VI'}, {7: 'VII'}, {8: 'VIII'}, {9: 'IX'}, {0: '0'}]\", \"assert convert_integer_to_roman(0) == [{0: '0'}]\", \"assert convert_integer_to_roman(1) == [{1: 'I'}... | {
"split": "train",
"index": 82534,
"acecode_id": "evol_9744",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of thermodynamic data represented as a list of dictionaries. Each dictionary contains the following keys: 'substance', 'temperature', and 'entropy'. Your task is to implement a function called `process_thermo_data` that takes in this list of thermodynamic d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_thermo_data([{'substance': 'H2O', 'temperature': 100.0, 'entropy': 70.0}, {'substance': 'CO2', 'temperature': 25.0, 'entropy': 213.0}]) == (62.5, 'CO2')\", \"assert process_thermo_data([{'substance': 'O2', 'temperature': 0.0, 'entropy': 205.0}, {'sub... | {
"split": "train",
"index": 82535,
"acecode_id": "oss_20469",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given three string parameters, s1, s2, and s3, implement a function that returns the longest common subsequence present among the three strings. The subsequence must exist in the same order in all three strings but does not have to be contiguous. The function should be able to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcs('abc', 'abc', 'abc') == ['a', 'b', 'c']\", \"assert lcs('abc', 'def', 'ghi') == []\", \"assert lcs('', '', '') == []\", \"assert lcs('single', 'single', 'single') == ['s', 'i', 'n', 'g', 'l', 'e']\", \"assert lcs('abc', '', 'abc') == []\", \"assert lcs('... | {
"split": "train",
"index": 82536,
"acecode_id": "evol_16499",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines if a mapped attribute should be ignored based on its options. The mapped attribute is defined by an attribute and a dictionary of options. Your goal is to implement the function `should_ignore(attribute_kind: str, key:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert should_ignore('VALID', 'key1', {'key1': None}) is True\", \"assert should_ignore('VALID', 'key1', {'key1': 'value'}) is False\", \"assert should_ignore('VALID', 'key2', {'key2': None}) is True\", \"assert should_ignore('VALID', 'key1', {'key1': None, 'key2':... | {
"split": "train",
"index": 82537,
"acecode_id": "oss_4739",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of positive and negative weights, implement a function that groups these weights into a specified number of clusters. The function should return two dictionaries: one for positive weights and another for negative weights, where each dictionary's keys are the cluste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_weight_clusters([1, 1, 1, 1], 2) == ({0: [1, 1], 1: [1, 1]}, {})\", \"assert create_weight_clusters([5, 15, 25, 35], 4) == ({0: [5], 1: [15], 2: [25], 3: [35]}, {})\", \"assert create_weight_clusters([3], 1) == ({0: [3]}, {})\", \"assert create_weight... | {
"split": "train",
"index": 82538,
"acecode_id": "bigcode_python_fns_26837",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a window with specified attributes. The function `create_window` should take in three parameters: `title` (a string representing the window title), `width` (an integer representing the window width), and `he... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_window('Test Window', 800, 600) == {'title': 'Test Window', 'width': 800, 'height': 600}\", \"assert create_window('My App', 1024, 768) == {'title': 'My App', 'width': 1024, 'height': 768}\", \"assert create_window('Hello World', 300, 200) == {'title'... | {
"split": "train",
"index": 82539,
"acecode_id": "oss_19126",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci_selector(index: int) -> Union[int, str]` that returns the Fibonacci number at the specified index, where the indexing starts from 0. The function should handle invalid inputs and out-of-range indices gracefully by returning appropriate error mess... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_selector(0) == 0\", \"assert fibonacci_selector(1) == 1\", \"assert fibonacci_selector(2) == 1\", \"assert fibonacci_selector(3) == 2\", \"assert fibonacci_selector(4) == 3\", \"assert fibonacci_selector(5) == 5\", \"assert fibonacci_selector(6) ==... | {
"split": "train",
"index": 82540,
"acecode_id": "evol_32215",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `clone_container` that takes in two parameters: a `name` (string) and an optional `description` (string). The function should validate the `name` parameter — if it is not provided, it should return an error message. If the `name` is valid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clone_container('Container1', 'A description') == {'name': 'Container1', 'description': 'A description'}\", \"assert clone_container('Container2') == {'name': 'Container2', 'description': 'No description provided'}\", \"assert clone_container('TestContainer'... | {
"split": "train",
"index": 82541,
"acecode_id": "bigcode_python_fns_28766",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of event dictionaries, implement a function `list_events(events: List[Dict[str, Any]], sort: str) -> Dict[str, Any]` that returns a dictionary containing the sorted events based on the provided sorting criteria. The input `events` is a list of dictionaries where ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_events([{'id': 1, 'name': 'Event A', 'date': '2023-10-01'}, {'id': 2, 'name': 'Event B', 'date': '2023-09-30'}], 'most_recent') == {'outputs_prefix': 'EventList', 'raw_response': [{'id': 1, 'name': 'Event A', 'date': '2023-10-01'}, {'id': 2, 'name': 'Ev... | {
"split": "train",
"index": 82542,
"acecode_id": "bigcode_python_fns_47642",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a distance measurement from kilometers to nautical miles. The conversion factor is that 1 kilometer is approximately equivalent to 0.539957 nautical miles. Your function should take a single parameter, km, which represents the distance in kilomete... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert km_to_nautical_miles(0) == 0.0\", \"assert km_to_nautical_miles(1) == 0.539957\", \"assert km_to_nautical_miles(100) == 53.9957\", \"assert km_to_nautical_miles(1000) == 539.957\", \"assert km_to_nautical_miles(2000) == 1079.914\"]}"
} | {
"split": "train",
"index": 82543,
"acecode_id": "evol_12778",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages email settings for a web clipping application. The function should take an email address, reply-to address, and a boolean indicating if the settings should be default. The function should return a dictionary containing the em... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_email_settings('test@example.com', 'reply@example.com', True) == {'address': 'test@example.com', 'reply_to': 'reply@example.com', 'make_default': True}\", \"assert manage_email_settings('user@domain.com', None, False) == {'address': 'user@domain.com',... | {
"split": "train",
"index": 82544,
"acecode_id": "oss_32366",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a specific blob exists in a repository based on its checksum and whether it is currently being uploaded. Your goal is to implement a Python function that takes two parameters: a string `repository` representing the name of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lookup_blob_in_repository('repo1', 'checksum1') == 'uuid1'\", \"assert lookup_blob_in_repository('repo1', 'checksum2') == None\", \"assert lookup_blob_in_repository('repo3', 'checksum5') == None\", \"assert lookup_blob_in_repository('repo4', 'checksum8') == ... | {
"split": "train",
"index": 82545,
"acecode_id": "oss_4935",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `add_book(title: str, author: str, genre: str) -> str` that adds a new book to a digital library. The function should return a confirmation message stating that the book has been added along with its title, author, and genre. Assume that there is a database... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_book('1984', 'George Orwell', 'Dystopian') == 'Book added: 1984 by George Orwell, Genre: Dystopian'\", \"assert add_book('To Kill a Mockingbird', 'Harper Lee', 'Fiction') == 'Book added: To Kill a Mockingbird by Harper Lee, Genre: Fiction'\", \"assert ad... | {
"split": "train",
"index": 82546,
"acecode_id": "evol_20287",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that retrieves data from a list of dictionaries, where each dictionary represents a row of data in a hypothetical database table. The function should take the name of the table (as a string) and return all the rows of data in the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_data_from_table('users', {'users': [{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}]}) == [(1, 'Alice'), (2, 'Bob')]\", \"assert retrieve_data_from_table('orders', {'users': [{'id': 1, 'name': 'Alice'}]}) == []\", \"assert retrieve_data_from_ta... | {
"split": "train",
"index": 82547,
"acecode_id": "oss_1012",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining if a general can deploy for a military mission based on their requisition of resources. Implement a function `can_deploy(deployed: bool, requisition: dict, cost: int, specific_requisition: dict) -> bool` that takes the following parameters: \n- `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_deploy(False, {'food': 10, 'ammo': 5}, 15, {'food': 5, 'ammo': 5}) == True\", \"assert can_deploy(True, {'food': 10, 'ammo': 5}, 15, {'food': 5, 'ammo': 5}) == False\", \"assert can_deploy(False, {'food': 10, 'ammo': 5}, 10, {'food': 0, 'ammo': 5}) == Tr... | {
"split": "train",
"index": 82548,
"acecode_id": "oss_2174",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with sorting a collection of content items based on their 'published' status and 'urgency' level. Each content item is represented as a dictionary containing the attributes 'published' (a boolean) and 'urgency' (an integer). Your goal is to implement a function `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_content_items({'item1': {'published': True, 'urgency': 3}, 'item2': {'published': False, 'urgency': 2}, 'item3': {'published': True, 'urgency': 1}, 'item4': {'published': False, 'urgency': 4}}) == ['item1', 'item3', 'item2', 'item4']\", \"assert sort_co... | {
"split": "train",
"index": 82549,
"acecode_id": "oss_3111",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the metrics for various nodes in a graph. Your task is to write a function `compute_node_metrics` that takes this list of metrics and computes a new feature for each node based on the existing metrics. The new feature is defined as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_node_metrics([10, 20, 30, 40, 50]) == [25, 45, 65, 85, 105]\", \"assert compute_node_metrics([1, 2, 3]) == [7, 9, 11]\", \"assert compute_node_metrics([0]) == [5]\", \"assert compute_node_metrics([100, 200]) == [205, 405]\", \"assert compute_node_met... | {
"split": "train",
"index": 82550,
"acecode_id": "oss_4477",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a color map based on a list of numerical values. The color map should transition from blue for the minimum value, to white for a midpoint value, and then to red for the maximum value. Your function should take the following... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_color_map([-2, -1, 0, 1, 2]) == [(-2, 'blue'), (-1, 'blue'), (0, 'white'), (1, 'red'), (2, 'red')]\", \"assert generate_color_map([-10, 0, 10], -10, 10) == [(-10, 'blue'), (0, 'white'), (10, 'red')]\", \"assert generate_color_map([5, 15, 25], 0, 30)... | {
"split": "train",
"index": 82551,
"acecode_id": "bigcode_python_fns_24341",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that combines two dictionaries into one. The function should take two dictionaries as inputs and return a single dictionary that contains all the keys and values from both input dictionaries. If there are any duplicate keys, the value fro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_dictionaries({'a': 1, 'b': 2}, {'b': 3, 'c': 4}) == {'a': 1, 'b': 3, 'c': 4}\", \"assert combine_dictionaries({}, {'a': 1}) == {'a': 1}\", \"assert combine_dictionaries({'x': 10}, {}) == {'x': 10}\", \"assert combine_dictionaries({'a': 1, 'b': 2}, {'... | {
"split": "train",
"index": 82552,
"acecode_id": "bigcode_python_fns_43630",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function `analyze_number(n)` that determines if the number exhibits palindrome characteristics. The function should return a tuple containing: a boolean indicating if the number is a palindrome, the count of digits in the number, a list of differing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_number(7337) == (True, 4, [], [])\", \"assert analyze_number(-7337) == (True, 4, [], [])\", \"assert analyze_number(-12321) == (True, 5, [], [])\", \"assert analyze_number(0) == (True, 1, [], [])\", \"assert analyze_number(1) == (True, 1, [], [])\", ... | {
"split": "train",
"index": 82553,
"acecode_id": "evol_14552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with finding the maximum batch ID from a list of batch file names. Each batch file name is a string representing the ID of the batch, and the IDs are zero-padded numbers (e.g., '000001', '000002', etc.). If the list is empty, return -1. Your function should take ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_maximum_batch_id(['000001', '000002', '000003']) == 3\", \"assert get_maximum_batch_id(['000010', '000002', '000007']) == 10\", \"assert get_maximum_batch_id(['000005']) == 5\", \"assert get_maximum_batch_id(['000100', '000099', '000098']) == 100\", \"as... | {
"split": "train",
"index": 82554,
"acecode_id": "bigcode_python_fns_39844",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries: `param2requests` and `param2default`. The `param2requests` dictionary maps parameter names (as strings) to lists of their possible values, while the `param2default` dictionary maps parameter names to their default values. Your task is to generate... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gen_all_param2vals({'a': [1, 2]}, {'a': 0}) == [{'a': 1}, {'a': 2}]\", \"assert gen_all_param2vals({'a': [1]}, {'a': 0}) == [{'a': 1}]\", \"assert gen_all_param2vals({'a': [1, 2], 'b': ['x', 'y']}, {'a': 0, 'b': 'z'}) == [{'a': 1, 'b': 'x'}, {'a': 1, 'b': 'y... | {
"split": "train",
"index": 82555,
"acecode_id": "bigcode_python_fns_23501",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function named 'merge_and_sort_lists' that takes two lists of integers and a string 'order'. The function should merge the two lists into one and sort the combined list in either ascending ('asc') or descending ('desc') order, based on the value of 'order'. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_and_sort_lists([1, 2, 3], [4, 5, 6], 'asc') == [1, 2, 3, 4, 5, 6]\", \"assert merge_and_sort_lists([3, 1], [2, 4], 'desc') == [4, 3, 2, 1]\", \"assert merge_and_sort_lists([], [], 'asc') == []\", \"assert merge_and_sort_lists([1, 3], [2], 'asc') == [1,... | {
"split": "train",
"index": 82556,
"acecode_id": "evol_27052",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two integers, `a` and `b`. Your task is to implement a function `calculate_modulo(a, b)` that returns the result of the modulo operation of `a` with respect to `b`. The modulo operation is defined as the remainder when `a` is divided by `b`. Note that `b` will alw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_modulo(10, 3) == 1\", \"assert calculate_modulo(10, 5) == 0\", \"assert calculate_modulo(0, 3) == 0\", \"assert calculate_modulo(-10, 3) == 2\", \"assert calculate_modulo(-10, 5) == 0\", \"assert calculate_modulo(-10, 7) == 4\", \"assert calculate_... | {
"split": "train",
"index": 82557,
"acecode_id": "oss_27500",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the area and circumference of a circle given its radius. The area of a circle can be calculated using the formula: π * radius^2, where π is approximately equal to 3.14159. The circumference of a circle can be calculate... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert circle_area_circumference(0) == (0.0, 0.0)\", \"assert circle_area_circumference(1) == (3.14159, 6.28318)\", \"assert circle_area_circumference(4) == (50.26544, 25.13272)\", \"assert circle_area_circumference(5) == (78.53975, 31.4159)\", \"assert circle_area... | {
"split": "train",
"index": 82558,
"acecode_id": "oss_14730",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a custom data loader for a machine learning project. The function should take a list of data items and a batch size as inputs and return a list of batches. Each batch should be a list containing the specifie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_data_loader([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\", \"assert custom_data_loader(['a', 'b', 'c'], 1) == [['a'], ['b'], ['c']]\", \"assert custom_data_loader([], 5) == []\", \"assert custom_data_loader([1, 2, 3], 3) == [[1, 2, 3]]\", \"assert cu... | {
"split": "train",
"index": 82559,
"acecode_id": "oss_31846",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that computes the volume of a pyramid given its base area and height. The function should take two parameters: base_area (a float) and height (a float), and return the volume of the pyramid as a float. The formula for the volume of a pyramid is given by the equ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pyramid_volume(15, 10) == 50.0\", \"assert pyramid_volume(0, 10) == 0.0\", \"assert pyramid_volume(15, 0) == 0.0\", \"assert pyramid_volume(30, 5) == 50.0\", \"assert pyramid_volume(10, 15) == 50.0\", \"assert pyramid_volume(25, 9) == 75.0\", \"assert pyrami... | {
"split": "train",
"index": 82560,
"acecode_id": "evol_27146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of commands. Your task is to implement a function `process_commands(commands)` that takes a list of commands as input and behaves according to the following rules: If the input list of commands is the same as the previous input list of commands, simply retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_commands(['command3']) == 'Error: command3'\", \"assert process_commands([]) == False\", \"assert process_commands(['command1']) == 'Error: command1'\", \"assert process_commands(['command4', 'command1']) == 'Error: command4 && command1'\", \"assert ... | {
"split": "train",
"index": 82561,
"acecode_id": "oss_5075",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a given tuple of integers in ascending order using the bubble sort algorithm. The function should take a tuple as input and return a new tuple with the elements sorted. For example, given the input (63, 51, 2, 9, 31, 76, 4), the output should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort((63, 51, 2, 9, 31, 76, 4)) == (2, 4, 9, 31, 51, 63, 76)\", \"assert bubble_sort((1, 2, 3)) == (1, 2, 3)\", \"assert bubble_sort((5, 4, 3, 2, 1)) == (1, 2, 3, 4, 5)\", \"assert bubble_sort((10, 20, 30, 40)) == (10, 20, 30, 40)\", \"assert bubble_s... | {
"split": "train",
"index": 82562,
"acecode_id": "evol_13996",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that checks if it is possible to interchange elements between two supplied integer arrays such that all elements in one array become odd numbers while maintaining the same total sum of all elements. If this transformation is possible, the function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_for_odds([1, 2, 3, 4], [1, 2, 3, 4]) == 'YES'\", \"assert swap_for_odds([1, 2, 3, 4], [2, 4, 6, 8]) == 'NO'\", \"assert swap_for_odds([2, 6], [1, 5]) == 'NO'\", \"assert swap_for_odds([0, 2, 4], [3, 5]) == 'NO'\", \"assert swap_for_odds([4, 4, 4], [2, 2... | {
"split": "train",
"index": 82563,
"acecode_id": "evol_9180",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional array of integers, implement a function that identifies the highest numerical value present in each sub-array and returns a list of tuples. Each tuple should contain the maximum value and its index position within its respective sub-array. If multiple hi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max([[8, 1, 10, -1, 4, 9],[3,7,15,5],[21,9,6,-8,14]]) == [(10, 2), (15, 2), (21, 0)]\", \"assert find_max([[1, 2, 3], [4, 5, 6]]) == [(3, 2), (6, 2)]\", \"assert find_max([[0], [-1]]) == [(0, 0), (-1, 0)]\", \"assert find_max([[5, 5, 5], [5, 5]]) == [(5... | {
"split": "train",
"index": 82564,
"acecode_id": "evol_4690",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing file names. Implement a function that takes a list of these file names and returns a new list where each file name has been modified to include a prefix 'uploaded_' before the original file name. For example, if the input list is ['f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_upload_prefix(['file1.txt', 'image.png', 'document.pdf']) == ['uploaded_file1.txt', 'uploaded_image.png', 'uploaded_document.pdf']\", \"assert add_upload_prefix(['data.csv', 'report.docx']) == ['uploaded_data.csv', 'uploaded_report.docx']\", \"assert add... | {
"split": "train",
"index": 82565,
"acecode_id": "bigcode_python_fns_40693",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string identifier that follows the format 'did:op:<hex_value>', where <hex_value> is a 64-character hexadecimal string. Your task is to implement a function that converts this identifier to its corresponding byte representation. The function should be able to co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert did_to_id_bytes('did:op:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef') == bytes.fromhex('1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef')\", \"assert did_to_id_bytes('did:op:0000000000000000000000000000000000000000000000... | {
"split": "train",
"index": 82566,
"acecode_id": "bigcode_python_fns_4982",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that updates a specific entry in a configuration dictionary. The function should take a configuration dictionary, a table name, a key, and a dictionary of data representing attributes to update. If an attribute's value in the data diction... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_entry({'users': {'user1': {'name': 'Alice', 'age': 30}}}, 'users', 'user1', {'name': 'Bob'}) == {'users': {'user1': {'name': 'Bob', 'age': 30}}}\", \"assert update_entry({'users': {'user1': {'name': 'Alice', 'age': 30}}}, 'users', 'user1', {'age': Non... | {
"split": "train",
"index": 82567,
"acecode_id": "bigcode_python_fns_42753",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_balance_history(token: str, balance_data: List[Tuple[str, float, float]]) -> List[Tuple[str, float, float]]` that filters a given list of balance entries based on a specified token. Each balance entry is represented as a tuple contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_balance_history('ETH', [('2023-01-01', 0.5, 10000), ('2023-01-02', 0.7, 11000), ('2023-01-01', 0.2, 5000)]) == []\", \"assert get_balance_history('BTC', []) == []\", \"assert get_balance_history('LTC', [('2023-01-01', 1.0, 20000), ('2023-01-02', 1.5, 250... | {
"split": "train",
"index": 82568,
"acecode_id": "bigcode_python_fns_26902",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement the function `multiplicative_replacement` that takes a 2D list of floats called `input_array` as input. For each element in the input array, replace the element with the product of its value and the sum of its row. The function should return a 2D list that contains th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiplicative_replacement([[1.0, 2.0], [3.0, 4.0]]) == [[1.0 * 3.0, 2.0 * 3.0], [3.0 * 7.0, 4.0 * 7.0]]\", \"assert multiplicative_replacement([[0.5, 0.5], [1.0, 1.0]]) == [[0.5 * 1.0, 0.5 * 1.0], [1.0 * 2.0, 1.0 * 2.0]]\", \"assert multiplicative_replaceme... | {
"split": "train",
"index": 82569,
"acecode_id": "oss_22708",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing virtual instances in a cloud environment. Implement a function `manage_instance(action: str, instance_id: str) -> str` that simulates managing instances based on user input. The function should take two parameters: `action`, which can be either 'ter... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_instance('terminate', 'i-12345') == 'Instance i-12345 terminated.'\", \"assert manage_instance('reboot', 'i-67890') == 'Instance i-67890 rebooted.'\", \"assert manage_instance('terminate', 'i-54321') == 'Instance i-54321 terminated.'\", \"assert manag... | {
"split": "train",
"index": 82570,
"acecode_id": "oss_1063",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts an array of integers in ascending order using the merge sort algorithm. The function should take a list of integers as input and return a new list that contains the sorted integers. For example, given the input [34, 19, 42, -9, 2018, 0, 105], the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sort([34, 19, 42, -9, 2018, 0, 105]) == [-9, 0, 19, 34, 42, 105, 2018]\", \"assert merge_sort([5, 1, 4, 2, 8]) == [1, 2, 4, 5, 8]\", \"assert merge_sort([3]) == [3]\", \"assert merge_sort([]) == []\", \"assert merge_sort([2, 1]) == [1, 2]\", \"assert m... | {
"split": "train",
"index": 82571,
"acecode_id": "evol_6573",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of migration operations and extracts the names of the models being created. Each migration operation is represented as a dictionary, and the model creation operations are represented by dictionaries that c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_model_names([{'type': 'CreateModel', 'name': 'Stops'}, {'type': 'CreateModel', 'name': 'Routes'}]) == ['Stops', 'Routes']\", \"assert extract_model_names([{'type': 'CreateModel', 'name': 'Users'}, {'type': 'CreateModel', 'name': 'Profiles'}, {'type':... | {
"split": "train",
"index": 82572,
"acecode_id": "oss_24375",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string contains a comma-separated list of words. Your task is to implement a function `extract_word_tuples(word_list: List[str]) -> List[Tuple[str]]` that extracts these words from each string and returns a list of tuples, where each t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_word_tuples([\\\"hello,world\\\", \\\"foo,bar,baz\\\"]) == [(\\\"hello\\\", \\\"world\\\"), (\\\"foo\\\", \\\"bar\\\", \\\"baz\\\")]\", \"assert extract_word_tuples([\\\"one,two,three\\\", \\\"four,five,six,seven\\\"]) == [(\\\"one\\\", \\\"two\\\", ... | {
"split": "train",
"index": 82573,
"acecode_id": "bigcode_python_fns_12396",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks whether all data stored in an ElastiCache Replication Group is securely encrypted at rest. Implement the function `check_encryption_at_rest(replication_group_id: str, encryption_status: str) -> Tuple[bool, str]`. The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_encryption_at_rest('rg-12345', 'encrypted') == (True, 'Data stored in the Elasticache Replication Group is securely encrypted at rest')\", \"assert check_encryption_at_rest('rg-67890', 'not encrypted') == (False, 'Data stored in the Elasticache Replica... | {
"split": "train",
"index": 82574,
"acecode_id": "oss_32123",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a code snippet containing a series of variable assignments. Each variable name follows a specific pattern: `name1_1_0_0_0_0_X`, where `X` is a number. The values assigned to these variables are all `None`. Your task is to write a Python function that takes the cod... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_variable_numbers('name1_1_0_0_0_0_1 = None\\\\nname1_1_0_0_0_0_2 = None\\\\nname1_1_0_0_0_0_3 = None') == [1, 2, 3]\", \"assert extract_variable_numbers('name1_1_0_0_0_0_10 = None\\\\nname1_1_0_0_0_0_5 = None\\\\nname1_1_0_0_0_0_7 = None') == [5, 7, ... | {
"split": "train",
"index": 82575,
"acecode_id": "oss_34510",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a simple warehouse system that allows for creating and destroying warehouses. Implement a function `manage_warehouse(action: str, warehouse_id: Optional[int] = None, owner_id: Optional[int] = None) -> str` that performs the following actions: 1. Whe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_warehouse('create', owner_id=1) == 'Warehouse created with ID: 1'\", \"assert manage_warehouse('destroy', warehouse_id=2) == 'Warehouse not found'\", \"assert manage_warehouse('create', owner_id=2) == 'Warehouse created with ID: 1'\", \"assert manage_... | {
"split": "train",
"index": 82576,
"acecode_id": "oss_1784",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function that checks if a numerical sequence contains symmetrical pairs and returns these pairs in the order of their appearance in the sequence. A symmetrical pair consists of identical numbers that are equidistant from the ends of the sequence. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_symmetrical_pairs([1, 2, 3]) == []\", \"assert check_symmetrical_pairs([1, 'a', 1]) == None\", \"assert check_symmetrical_pairs([1, 2, None, 2, 1]) == None\", \"assert check_symmetrical_pairs([]) == []\", \"assert check_symmetrical_pairs([1]) == []\", ... | {
"split": "train",
"index": 82577,
"acecode_id": "evol_23699",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates job submission to a cluster and retrieves the remote exit code. The function, named `simulate_job_submission`, will take the following parameters: `job_script` (a string representing the job script to be submitted) and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_job_submission('script3.sh', 'job_id_12347') == ('job_id_12345', 1)\", \"assert simulate_job_submission('script4.sh', 'job_id_12348') == ('job_id_12345', 0)\", \"assert simulate_job_submission('script5.sh', 'job_id_12349') == ('job_id_12345', 1)\", ... | {
"split": "train",
"index": 82578,
"acecode_id": "oss_15517",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string of space-separated words and returns a list of words that contain more than five characters. Words are defined by sequences of characters separated by spaces.\nPlease reason step by step, then write a self-contained Python solution. Give... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_words('Hello world this is a simple test') == ['simple']\", \"assert filter_words('Data structures and algorithms are essential') == ['structures', 'algorithms', 'essential']\", \"assert filter_words('The quick brown fox jumps over the lazy dog') == [... | {
"split": "train",
"index": 82579,
"acecode_id": "evol_14837",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a dictionary where the keys are integers representing the lengths of words, and the values are sets of words of those lengths. Your function should return this dictionary initialized with the following sets of words: for ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_word_sets() == {3: {'cat', 'dog', 'bat'}, 4: {'fish', 'bird', 'frog'}, 5: {'snake', 'horse', 'zebra'}}\", \"assert initialize_word_sets()[3] == {'cat', 'dog', 'bat'}\", \"assert initialize_word_sets()[4] == {'fish', 'bird', 'frog'}\", \"assert ini... | {
"split": "train",
"index": 82580,
"acecode_id": "oss_31211",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a game board for the game of Ataxx. The Ataxx game is played on a 7x7 square grid where each cell can contain one of four possible pieces: BLACK, WHITE, GAP, or EMPTY. Your function should take a list of commands that e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert play_ataxx(['set 0 0 BLACK', 'get 0 0']) == ['BLACK']\", \"assert play_ataxx(['set 1 1 WHITE', 'get 1 1']) == ['WHITE']\", \"assert play_ataxx(['set 0 0 BLACK', 'set 0 0 WHITE', 'get 0 0']) == ['WHITE']\", \"assert play_ataxx(['set 0 0 BLACK', 'set 1 1 WHITE... | {
"split": "train",
"index": 82581,
"acecode_id": "oss_18081",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and two integers, minimum and maximum. Your task is to create a function that modifies the list such that all elements that are strictly between the minimum and maximum values are replaced with None. The function should return the modified list.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mask_inside_range([10, 15, 20, 25, 30], 12, 28) == [10, None, None, None, 30]\", \"assert mask_inside_range([100, 200, 300, 400], 150, 350) == [100, None, None, 400]\", \"assert mask_inside_range([-10, -5, 0, 5, 10], -6, 6) == [-10, None, None, None, 10]\", ... | {
"split": "train",
"index": 82582,
"acecode_id": "bigcode_python_fns_7065",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given two strings that may contain alphabetic characters and non-alphabetic symbols. Your task is to implement a function that determines if the two strings are anagrams of each other, taking into account case sensitivity. Non-alphabetic symbols should be ignored in thi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert anagram_check('Eat!', 'tEa.') == True\", \"assert anagram_check('Hello, World!', 'dlroW ,olleH') == True\", \"assert anagram_check('Dormitory', 'Dirty room') == True\", \"assert anagram_check('123abc!@#', 'cba321') == True\", \"assert anagram_check('!@#$', '... | {
"split": "train",
"index": 82583,
"acecode_id": "evol_18268",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates adding a personalized reply to a comment. The function `add_personal_reply` takes in a string representing a comment and a dictionary containing response details. The dictionary has two keys: `hero_id` (a string represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_personal_reply('Great job on the project!', {'hero_id': 'user123', 'link': 'http://example.com/reply'}) == 'Reply from user123: Great job on the project! (See more at http://example.com/reply)'\", \"assert add_personal_reply('I love this feature!', {'her... | {
"split": "train",
"index": 82584,
"acecode_id": "bigcode_python_fns_32022",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a negative integer, implement a function that formats the number in a way that it shows the absolute value within parentheses, using locale formatting for the number representation. For example, for the input -1000, the output should be '(1,000)'. The function should only... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_negative_number(-42) == '(42)'\", \"assert format_negative_number(-1) == '(1)'\", \"assert format_negative_number(-100) == '(100)'\", \"assert format_negative_number(-150) == '(150)'\", \"assert format_negative_number(-999) == '(999)'\", \"assert form... | {
"split": "train",
"index": 82585,
"acecode_id": "bigcode_python_fns_31512",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a given time in Central European Time (CET) to Coordinated Universal Time (UTC) based on a specified UTC offset. The function should take into account daylight saving time adjustments. The input will be a datetime object representing the CET time ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_CET_to_UTC(datetime(2023, 1, 1, 12, 0), 0) == datetime(2023, 1, 1, 11, 0)\", \"assert convert_CET_to_UTC(datetime(2023, 6, 15, 12, 0), 0) == datetime(2023, 6, 15, 10, 0)\", \"assert convert_CET_to_UTC(datetime(2023, 3, 26, 12, 0), 0) == datetime(2023... | {
"split": "train",
"index": 82586,
"acecode_id": "evol_21434",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a rectangular bore field configuration for a series of boreholes. Each borehole has a specific length, buried depth, and radius. Given the number of boreholes in the x and y directions, along with the distance between adjacent boreholes, compute th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bore_field_coordinates(1, 1, 10.0, 10.0, 50.0, 5.0, 0.1) == [(0.0, 0.0)]\", \"assert bore_field_coordinates(5, 1, 3.0, 3.0, 15.0, 2.5, 0.1) == [(0.0, 0.0), (3.0, 0.0), (6.0, 0.0), (9.0, 0.0), (12.0, 0.0)]\", \"assert bore_field_coordinates(1, 5, 0.5, 1.5, 5.... | {
"split": "train",
"index": 82587,
"acecode_id": "bigcode_python_fns_8616",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a model's name in a machine learning framework. The function should be able to set and retrieve the model's name based on the input provided. The function should take two parameters: a string `action` that can either be 'set'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_model_name('set', 'post') == None\", \"assert manage_model_name('set', 'model_x') == None\", \"assert manage_model_name('set', '') == None\", \"assert manage_model_name('get', '') == ''\", \"assert manage_model_name('set', 'model_y') == None\", \"asse... | {
"split": "train",
"index": 82588,
"acecode_id": "oss_33975",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function to calculate the factorial of a given non-negative integer using recursion. The factorial of a non-negative integer `n`, denoted as `n!`, is the product of all positive integers less than or equal to `n`. For example, `5! = 5 *... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 82589,
"acecode_id": "oss_27538",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `get_even_numbers` that returns a new list containing only the even numbers from the original list, maintaining the original order. If there are no even numbers, return an empty list. The input list can contain both positive and negati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert get_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert get_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert get_even_numbers([1, 3, 5, 7]) == []\", \"assert get_even_numbers([]) == []\", \"... | {
"split": "train",
"index": 82590,
"acecode_id": "bigcode_python_fns_1348",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `median(l: List[int]) -> Union[float, None]:` that takes a list of integers and returns the median of the list. If the list is empty, the function should return None. The median is defined as follows: if the list has an odd number of elements, the median is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([1, 3, 2]) == 2.0\", \"assert median([1, 2]) == 1.5\", \"assert median([5, 1, 3, 2]) == 2.5\", \"assert median([7]) == 7.0\", \"assert median([3, 1, 4, 2]) == 2.5\", \"assert median([]) == None\", \"assert median([1, 2, 3, 4, 5]) == 3.0\", \"assert me... | {
"split": "train",
"index": 82591,
"acecode_id": "evol_15233",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of indices representing the nearest neighbors of a user-selected track in a music recommendation system. The function should take two arguments: a list of integers `nn_ids` which contains the indices of the neare... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_nn_ids([0, 1, 2, 3], 0) == [1, 2, 3]\", \"assert modify_nn_ids([1, 2, 3, 4], 0) == [1, 2, 3, 4]\", \"assert modify_nn_ids([2, 3, 4, 5], 2) == [3, 4, 5]\", \"assert modify_nn_ids([4, 5, 6, 7], 4) == [5, 6, 7]\", \"assert modify_nn_ids([0, 2, 3, 4], 0) ... | {
"split": "train",
"index": 82592,
"acecode_id": "oss_25764",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python program that calculates the total size of a list of files based on their names and a specified file extension. Additionally, you need to compute the time taken to process these files. You will be provided with a list of file names (without ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_size_and_time(['audio1'], '.mp3') == (1024, 0.1)\", \"assert calculate_total_size_and_time([], '.txt') == (0, 0)\", \"assert calculate_total_size_and_time(['fileA'], '.bin') == (1024, 0.1)\", \"assert calculate_total_size_and_time(['video1'],... | {
"split": "train",
"index": 82593,
"acecode_id": "oss_32018",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function `contains_abc(strings: List[str]) -> bool` that returns True if any string in the list contains the substring 'abc', and False otherwise. The input list will contain at least one string. You cannot use any external libraries or reso... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_abc(['hello', 'world', 'abc']) == True\", \"assert contains_abc(['test', 'example', 'sample']) == False\", \"assert contains_abc(['abcde', 'fghij', 'klmno']) == True\", \"assert contains_abc(['no match here', 'still no match']) == False\", \"assert ... | {
"split": "train",
"index": 82594,
"acecode_id": "bigcode_python_fns_11044",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `accumulate_on_condition(n: int, condition: Callable[[int], bool]) -> int` that calculates the accumulated total of integers from 1 to n (inclusive) that meet the criteria defined by the provided condition function. The function should sum all integers i wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert accumulate_on_condition(10, lambda x: x % 2 == 0) == 30\", \"assert accumulate_on_condition(5, lambda x: x % 2 != 0) == 9\", \"assert accumulate_on_condition(20, lambda x: x % 5 == 0) == 50\", \"assert accumulate_on_condition(15, lambda x: x < 10) == 45\", \... | {
"split": "train",
"index": 82595,
"acecode_id": "evol_13276",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a skyline. Your task is to implement a function that calculates the maximum area of a rectangle that can be formed under the skyline, where the rectangle can extend from one building to another. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxRectangleArea([2, 1, 5, 6, 2, 3]) == 10\", \"assert maxRectangleArea([1]) == 1\", \"assert maxRectangleArea([5, 4, 1, 2]) == 8\", \"assert maxRectangleArea([0, 0, 0]) == 0\", \"assert maxRectangleArea([1, 2, 3, 4, 5]) == 9\", \"assert maxRectangleArea([3,... | {
"split": "train",
"index": 82596,
"acecode_id": "bigcode_python_fns_49730",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function that finds the second largest number in a list of distinct integers. The function should take a list of integers as input and return the second largest integer from that list. The input list will always contain at least two distinct integers.\nPlease reason... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert penultimate_highest([1, 3, 4, 5, 9, 10, 11]) == 10\", \"assert penultimate_highest([2, 3, 1, 5]) == 3\", \"assert penultimate_highest([-1, -2, -3, -4]) == -2\", \"assert penultimate_highest([100, 200, 300]) == 200\", \"assert penultimate_highest([5, 6]) == 5... | {
"split": "train",
"index": 82597,
"acecode_id": "evol_31974",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a collection of skins, where each skin is associated with a set of properties. Your task is to implement a function that retrieves the 'base_url' for a given skin name from the skins dictionary. If the skin does not exist or does not have... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_skin_base_url('theme1', {'skins': {'theme1': {'base_url': 'http://example.com/theme1/'}}}) == 'http://example.com/theme1/'\", \"assert get_skin_base_url('theme2', {'skins': {'theme1': {'base_url': 'http://example.com/theme1/'}}}) == ''\", \"assert get_sk... | {
"split": "train",
"index": 82598,
"acecode_id": "bigcode_python_fns_45652",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to extract article titles from a list of predetermined URLs. Each URL corresponds to a specific article title. Write a Python function `extract_article_titles(urls)` that takes a list of URLs as input and returns a list of article tit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_article_titles(['https://medium.com/atoti/topic-modeling-on-twitter-using-sentence-bert-8acdad958eb1']) == ['Topic Modeling on Twitter using Sentence-BERT']\", \"assert extract_article_titles(['https://medium.com/analytics-vidhya/bert-for-topic-model... | {
"split": "train",
"index": 82599,
"acecode_id": "oss_9904",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.