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 tasked with creating a function that simulates a command execution in a build environment. The function should take a list of command-line arguments and optional parameters for bind mounts and read-only bind mounts. If a specified directory path is provided, it should b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_command_execution(['ls', '-l'], None, None, var='/tmp') == 'Executed command: ls -l | Directory deleted: True'\", \"assert simulate_command_execution(['pwd'], None, None, var='/home/user') == 'Executed command: pwd | Directory deleted: True'\", \"as...
{ "split": "train", "index": 62000, "acecode_id": "oss_28734", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents a mapping of different environments to their respective states. Each environment can have multiple states, represented as a list of strings. Your task is to write a function `filter_states_by_environment(env_dict: Dict[str, List[str]],...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_states_by_environment({'foo': ['foo_foo'], 'bar': ['bar_foo']}, 'foo') == {'foo': ['foo_foo']}\", \"assert filter_states_by_environment({'foo': ['foo_foo'], 'bar': ['bar_foo']}, 'bar') == {'bar': ['bar_foo']}\", \"assert filter_states_by_environment({...
{ "split": "train", "index": 62001, "acecode_id": "bigcode_python_fns_43596", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that counts the number of occurrences of a given word in a provided string. The search should be case-sensitive and should count overlapping occurrences of the word. Implement the function `count_occurrences(string: str, word: str) -> int` where `string` is the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_occurrences('Hello World, Hello Programmers', 'Hello') == 2\", \"assert count_occurrences('Hello Hello Hello', 'Hello') == 3\", \"assert count_occurrences('abcabcabc', 'abc') == 3\", \"assert count_occurrences('aaa', 'aa') == 2\", \"assert count_occurr...
{ "split": "train", "index": 62002, "acecode_id": "evol_24211", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a file upload system for a data analysis project. You need to create a function called `upload_file` that takes three parameters: `file_name` (a string representing the name of the file), `file_type` (a string representing ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upload_file('data.txt', 'txt', 1) == {'file_name': 'data.txt', 'file_type': 'txt', 'analysis_id': 1}\", \"assert upload_file('report.csv', 'csv', 2) == {'file_name': 'report.csv', 'file_type': 'csv', 'analysis_id': 2}\", \"assert upload_file('summary.xlsx', ...
{ "split": "train", "index": 62003, "acecode_id": "oss_24940", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given three lists of equal length: `input_list`, `annotation_list`, and `output_list`. Your task is to create a function `create_iterator` that returns a generator which yields tuples of the form `(input_item, annotation_item, output_item)` for each corresponding item f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list(create_iterator([1, 2, 3], [4, 5, 6], [7, 8, 9])) == [(1, 4, 7), (2, 5, 8), (3, 6, 9)]\", \"assert list(create_iterator([], [], [])) == []\", \"assert list(create_iterator([-1, -2, -3], [0, 0, 0], [1, 1, 1])) == [(-1, 0, 1), (-2, 0, 1), (-3, 0, 1)]\", \...
{ "split": "train", "index": 62004, "acecode_id": "bigcode_python_fns_25853", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a nested list of integers and calculates the average of each sublist. The function should return a sorted list of these averages in descending order. If a sublist is empty, its average should be considered as 0. Your function should be able to handle...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert averages_descending([[], [], []]) == [0, 0, 0]\", \"assert averages_descending([[1, 2], [3, 4, 5], [6, 7, 8], []]) == [7.0, 4.0, 1.5, 0]\", \"assert averages_descending([[0], [0], [0]]) == [0, 0, 0]\", \"assert averages_descending([[], [1, 2, 3, 4], [5, 5, 5...
{ "split": "train", "index": 62005, "acecode_id": "evol_20297", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `rectangle_area(l, w, input_unit, output_unit)` that calculates the surface area of a rectangle given its length and width in a specified measurement unit. The function should convert the area to the specified output unit. Ensure all inputs are positive num...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rectangle_area(1, 1, 'in', 'in') == 1\", \"assert rectangle_area(1, 1, 'm', 'm') == 1\", \"assert rectangle_area(1, 1, 'cm', 'cm') == 1\", \"assert rectangle_area(1, 1, 'in', 'cm') == 6.4516\", \"assert rectangle_area(10, 5, 'cm', 'm') == 0.005\"]}" }
{ "split": "train", "index": 62006, "acecode_id": "evol_4254", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `has_access(user_roles: List[str], required_roles: List[str]) -> bool` that determines if a user has access to a certain area based on their roles. The function should return True if the user has at least one of the required roles, and False otherwise. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_access(['admin', 'editor'], ['admin']) == True\", \"assert has_access(['user'], ['admin']) == False\", \"assert has_access(['manager', 'user'], ['manager']) == True\", \"assert has_access(['guest'], ['admin', 'editor']) == False\", \"assert has_access(['...
{ "split": "train", "index": 62007, "acecode_id": "evol_10739", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `nth_prime_fibonacci(n: int) -> int` that returns the n-th prime Fibonacci number. A Fibonacci number is defined as a number in the Fibonacci sequence, starting with 0 and 1, where each subsequent number is the sum of the two preceding ones. A prime number ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nth_prime_fibonacci(1) == 2\", \"assert nth_prime_fibonacci(2) == 3\", \"assert nth_prime_fibonacci(3) == 5\", \"assert nth_prime_fibonacci(4) == 13\", \"assert nth_prime_fibonacci(5) == 89\", \"assert nth_prime_fibonacci(6) == 233\", \"assert nth_prime_fibo...
{ "split": "train", "index": 62008, "acecode_id": "evol_26890", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a cumulative test loss, the index of the current batch, the loss value for that batch, and the output probabilities from a model. Your task is to implement a function `calculate_moving_average_and_extract_classes(test_loss, batch_idx, loss, output)` that calculate...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_moving_average_and_extract_classes(0, 0, 10, [[0.1, 0.9], [0.8, 0.2]]) == (10.0, [1, 0])\", \"assert calculate_moving_average_and_extract_classes(0, 1, 20, [[0.3, 0.7], [0.6, 0.4]]) == (10.0, [1, 0])\", \"assert calculate_moving_average_and_extract...
{ "split": "train", "index": 62009, "acecode_id": "oss_37315", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `handle_exceptions(func: Callable) -> Callable` that takes a function as an argument and returns a wrapper function. The wrapper function should execute the input function and handle specific exceptions that may be raised during its e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_exceptions(lambda: 1)() == 1\", \"assert handle_exceptions(lambda: {}['key'])() == 'An error with the cipher has occurred. See documentation in GitHub to resolve: https://github.com/f4ll-py/ytdownloader.'\", \"assert handle_exceptions(lambda: 'Hello W...
{ "split": "train", "index": 62010, "acecode_id": "bigcode_python_fns_35974", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of values and an input data to produce a transformed output. The function will take the following parameters: \n 1. `values`: A list of transformation operations represented as strings. \n 2. `data`: The input data t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prepare_test(['increment'], 1, 2) == True\", \"assert prepare_test(['decrement'], 2, 1) == True\", \"assert prepare_test(['double'], 3, 6) == True\", \"assert prepare_test(['halve'], 4, 2) == True\", \"assert prepare_test(['increment', 'double'], 1, 4) == Tr...
{ "split": "train", "index": 62011, "acecode_id": "oss_8141", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string representation of an attribute list and returns a dictionary containing the key-value pairs. The attribute list is formatted with keys and values separated by colons and enclosed in curly braces. For example, the i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_attribute_list('{color:red, size:large, price:25.00}') == {'color': 'red', 'size': 'large', 'price': '25.00'}\", \"assert parse_attribute_list('{height:180, weight:75}') == {'height': '180', 'weight': '75'}\", \"assert parse_attribute_list('{name:John,...
{ "split": "train", "index": 62012, "acecode_id": "oss_19856", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, implement a function that generates two lists of rolling maximum elements. The first list should contain the maximum values observed up to each index in the first input list, and the second list should do the same for the second input list. If eithe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rolling_max([], []) == ([], [])\", \"assert rolling_max([1, 2, 3], [4, 5, 6]) == ([1, 2, 3], [4, 5, 6])\", \"assert rolling_max([3, 2, 1], [1, 2, 3]) == ([3, 3, 3], [1, 2, 3])\", \"assert rolling_max([5, 1, 5], [2, 3, 1]) == ([5, 5, 5], [2, 3, 3])\", \"asser...
{ "split": "train", "index": 62013, "acecode_id": "evol_34155", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates running a specific action and checks if it completes successfully. The function will take two parameters: an action (represented as a string) and the name of the person performing the action (also a string). The possibl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert run_successful_task('run', 'John') == 'Success'\", \"assert run_successful_task('run', 'Alice') == 'Success'\", \"assert run_successful_task('build', 'Alice') == 'Success'\", \"assert run_successful_task('build', 'Bob') == 'Failure'\", \"assert run_successfu...
{ "split": "train", "index": 62014, "acecode_id": "bigcode_python_fns_8789", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary where each key represents a car manufacturer and its corresponding value is a list of car models produced by that manufacturer. Write a function `get_first_model_each_manufacturer(cars)` that returns a list of the first car model from each manufacture...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_first_model_each_manufacturer({'Toyota': ['Camry', 'Corolla'], 'Honda': ['Civic', 'Accord'], 'Ford': ['Focus', 'Fiesta']}) == ['Camry', 'Civic', 'Focus']\", \"assert get_first_model_each_manufacturer({'BMW': ['X5', 'X3'], 'Audi': ['A4', 'Q5']}) == ['X5',...
{ "split": "train", "index": 62015, "acecode_id": "bigcode_python_fns_18985", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two masks, m1 and m2, represented as 2D arrays of the same dimensions containing binary values (0s and 1s). Your task is to implement a function that checks if these two masks are equal. A mask is considered equal to another if they contain the same number of rows...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_masks_equal([[1, 0], [0, 1]], [[1, 0], [0, 1]]) == True\", \"assert are_masks_equal([[1, 1], [0, 0]], [[1, 1], [0, 0]]) == True\", \"assert are_masks_equal([[0]], [[0]]) == True\", \"assert are_masks_equal([[], []], [[], []]) == True\", \"assert are_mask...
{ "split": "train", "index": 62016, "acecode_id": "bigcode_python_fns_6948", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary representing a context with specific parameters, implement a function `extract_ingestion_params(context)` that extracts the ingestion task parameters based on the following rules: 1. The function should retrieve the value of 'featureset' from the context and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_ingestion_params({'featureset': 'fs1', 'source': 's1', 'targets': ['t1', 't2'], 'infer_options': 'opt1'}) == ('fs1', 's1', ['t1', 't2'], 'opt1')\", \"assert extract_ingestion_params({'featureset': 'fs2'}) == ('fs2', None, [], None)\", \"assert extrac...
{ "split": "train", "index": 62017, "acecode_id": "bigcode_python_fns_21074", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple Minesweeper game action based on user input. The function should take a 2D list representing the Minesweeper grid and a string indicating the action to be performed. The grid contains cells that can either be r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minesweeper_action([['C', 'C', 'C'], ['C', 'C', 'C'], ['C', 'C', 'C']], [(0, 0, 'R')]) == [['R', 'C', 'C'], ['C', 'C', 'C'], ['C', 'C', 'C']]\", \"assert minesweeper_action([['C', 'C', 'C'], ['C', 'C', 'C'], ['C', 'C', 'C']], [(1, 1, 'S')]) == [['C', 'C', 'C...
{ "split": "train", "index": 62018, "acecode_id": "bigcode_python_fns_21687", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a series of lexemes (words) and a numerical factorial, implement a function that calculates the number of lexemes in the series that have a length equal to the factorial of the provided number. The input will be a string consisting of words separated by spaces and a non-n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_lexeme_len_from_fact('Hello World', 5) == 0\", \"assert find_lexeme_len_from_fact('A quick brown fox', 3) == 0\", \"assert find_lexeme_len_from_fact('Python programming', 4) == 0\", \"assert find_lexeme_len_from_fact('The quick brown fox jumps', 4) == 0...
{ "split": "train", "index": 62019, "acecode_id": "evol_18989", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function `first_two_elements` that returns the first two elements of a given input if it is a string, list, or tuple containing at least two elements. If the input contains fewer than two elements, return the message 'Input is too short'. If the input type is not one o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert first_two_elements('Hello') == 'He'\", \"assert first_two_elements('A') == 'Input is too short'\", \"assert first_two_elements('') == 'Input is too short'\", \"assert first_two_elements([1, 2, 3]) == [1, 2]\", \"assert first_two_elements([1]) == 'Input is to...
{ "split": "train", "index": 62020, "acecode_id": "evol_30723", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the creation of a convolutional module for a neural network. The function should take parameters that define the characteristics of the convolutional layer, including the number of filters, filter size, whether to inclu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_conv_module(32, (3, 3)) == {'filters': 32, 'filter_size': (3, 3), 'bias': 0.0, 'crop': 0, 'pool_size': (2, 2), 'batch_norm': False, 'dropout': False, 'p_dropout': None}\", \"assert create_conv_module(64, (5, 5), crop=1) == {'filters': 64, 'filter_size...
{ "split": "train", "index": 62021, "acecode_id": "bigcode_python_fns_49008", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a string `S` representing the initial state of dominoes in a line, where each character can be 'L' (falling left), 'R' (falling right), '.' (upright), or 'O' (obstacle). Your task is to implement a function `push_dominoes(S: str) -> str` that simulates the falling...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert push_dominoes('.L.R...LR..L..') == 'LL.RR.LLRRLL..'\", \"assert push_dominoes('RR.L') == 'RR.L'\", \"assert push_dominoes('...') == '...'\", \"assert push_dominoes('R..L') == 'RRLL'\", \"assert push_dominoes('L..R') == 'L..R'\", \"assert push_dominoes('R..R'...
{ "split": "train", "index": 62022, "acecode_id": "evol_17815", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a response from an API call. The dictionary contains a key 'imdata', which is a list of items. Each item in this list may or may not contain an 'error' key. If an item contains the 'error' key, it has a nested structure where 'attributes'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_api_error({'imdata': [{'error': {'attributes': {'code': 404, 'text': 'Not Found'}}}]}) == 'API-Errorcode 404: Not Found'\", \"assert parse_api_error({'imdata': [{'error': {'attributes': {'code': 500, 'text': 'Internal Server Error'}}}]}) == 'API-Errorc...
{ "split": "train", "index": 62023, "acecode_id": "bigcode_python_fns_14550", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to manage a list of allies for a fictional game. Each ally has a name, level, and class. Your task is to write a function `get_allies_by_class(allies, class_type)` that takes a list of allies (where each ally is represented as a dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_allies_by_class([{'name': 'Aragorn', 'level': 20, 'class_type': 'Warrior'}, {'name': 'Gandalf', 'level': 25, 'class_type': 'Mage'}, {'name': 'Legolas', 'level': 18, 'class_type': 'Archer'}], 'Mage') == ['Gandalf']\", \"assert get_allies_by_class([{'name'...
{ "split": "train", "index": 62024, "acecode_id": "oss_32845", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of tuples representing file names and their corresponding version numbers. Each tuple contains a file name as a string and a version number as an integer. Your function should return a dictionary containin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_highest_versions([('blog', 100), ('index', 50), ('blog', 150), ('about', 200), ('index', 70), ('blog', 120)]) == {'blog': 150, 'index': 70, 'about': 200}\", \"assert find_highest_versions([('file1', 1), ('file2', 2), ('file1', 3)]) == {'file1': 3, 'file...
{ "split": "train", "index": 62025, "acecode_id": "oss_28753", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `process_persons(persons: List[Dict[str, Union[str, int]]]) -> Tuple[float, Dict[str, Union[str, int]], List[Dict[str, Union[str, int]]]]` that takes a list of dictionaries representing persons, where each dictionary contains 'name', 'age', and 'country' as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_persons([{'name': 'Alice', 'age': 30, 'country': 'USA'}, {'name': 'Bob', 'age': 25, 'country': 'UK'}]) == (27.5, {'name': 'Bob', 'age': 25, 'country': 'UK'}, [{'name': 'Alice', 'age': 30, 'country': 'USA'}, {'name': 'Bob', 'age': 25, 'country': 'UK'}...
{ "split": "train", "index": 62026, "acecode_id": "evol_34436", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `align_formula` that takes a string `formula` as input, representing a chemical formula where the body elements are enclosed in parentheses. Your goal is to return a modified version of the formula where the body elements within the p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert align_formula('H2(SO4)2') == 'H2(SO4)2'\", \"assert align_formula('C6H12O6') == 'C6H12O6'\", \"assert align_formula('Mg(OH)2') == 'Mg(OH)2'\", \"assert align_formula('NaCl') == 'NaCl'\", \"assert align_formula('Fe2(SO4)3') == 'Fe2(SO4)3'\", \"assert align_fo...
{ "split": "train", "index": 62027, "acecode_id": "oss_36574", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary of models where each model has a path and a seal function, and a list of inputs, write a function `build_model(model_keyvalue: str, inputs: List[float]) -> float` that takes a model identifier and a list of properly formatted inputs. The function should retri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_model('model1', [1.0, 2.0, 3.0]) == 6.0\", \"assert build_model('model2', [1.0, 2.0, 3.0]) == 3.0\", \"assert build_model('model3', [1.0, 2.0, 3.0]) == 1.0\", \"assert build_model('model1', [0.5, 1.5]) == 2.0\", \"assert build_model('model2', [5.0, 3.0...
{ "split": "train", "index": 62028, "acecode_id": "bigcode_python_fns_72", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `validate_ipv6(ipv6: str) -> bool` that checks if a given string is a valid IPv6 address. The function should correctly handle the full notation as well as shorthand notations for IPv6 addresses. A valid IPv6 address consists of eight groups of four hexadec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_ipv6('2001:0db8:85a3:0000:0000:8a2e:0370:7334') == True\", \"assert validate_ipv6('2001:db8:85a3:0:0:8a2e:370:7334') == True\", \"assert validate_ipv6('::1') == True\", \"assert validate_ipv6('::') == True\", \"assert validate_ipv6('2001:db8::1:0:1'...
{ "split": "train", "index": 62029, "acecode_id": "evol_5458", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D grid representing a game board. Each cell in the grid can be either an open space (denoted by 1) or an obstacle (denoted by 0). Your task is to find the length of the longest path from the top-left corner of the grid to the bottom-right corner, moving only th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longestPath([[1, 0], [0, 1]]) == -1\", \"assert longestPath([[0, 0], [0, 0]]) == -1\", \"assert longestPath([[1, 1, 1], [1, 0, 0], [1, 1, 1]]) == 5\", \"assert longestPath([[1, 1], [1, 0], [1, 1]]) == 4\", \"assert longestPath([[1, 1, 0], [1, 1, 1], [0, 1, 1...
{ "split": "train", "index": 62030, "acecode_id": "oss_24829", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `is_any_port_in_use` that checks if any of the provided ports are currently in use on the specified hostname. The function should take a string `hostname` and a list of integers `ports`. It should return `True` if at least one of the p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_any_port_in_use('localhost', [80]) == True\", \"assert is_any_port_in_use('localhost', [443]) == True\", \"assert is_any_port_in_use('localhost', [8080]) == True\", \"assert is_any_port_in_use('localhost', [21]) == False\", \"assert is_any_port_in_use('lo...
{ "split": "train", "index": 62031, "acecode_id": "bigcode_python_fns_4155", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the process of clearing all cached data from a system. The function should take two lists as input: one containing strings representing chart data keys and another containing strings representing project list keys. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clear_cache(['key1', 'key2', 'key3'], ['key2', 'key4']) == ['key1', 'key2', 'key3', 'key4']\", \"assert clear_cache(['a', 'b', 'c'], ['b', 'c', 'd']) == ['a', 'b', 'c', 'd']\", \"assert clear_cache([], ['key1']) == ['key1']\", \"assert clear_cache(['key1', '...
{ "split": "train", "index": 62032, "acecode_id": "bigcode_python_fns_370", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a point represented by its coordinates (px, py) and an origin point (ox, oy), implement a function that rotates the point counterclockwise by a specified angle in radians around the origin. The function should return the new coordinates of the point after the rotation. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_point((0, 0), (1, 0), 0) == (1.0, 0.0)\", \"assert rotate_point((1, 1), (2, 2), 0) == (2.0, 2.0)\", \"assert rotate_point((1, 1), (0, 0), math.pi) == (2.0, 2.0)\", \"assert rotate_point((0, 0), (5, 0), math.pi/3) == (2.5000000000000004, 4.330127018922...
{ "split": "train", "index": 62033, "acecode_id": "bigcode_python_fns_34552", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a 3D list (tensor) of dimensions M x N x P, where M, N, and P are the sizes of the respective dimensions. Your task is to resize this 3D list along a specific axis (0, 1, or 2) to a new specified size. The resizing operation should keep the data along the specifie...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resize_tensor([[[1, 2, 3]]], 2, 0) == [[[1, 2, 3]], [[0, 0, 0]]]\", \"assert resize_tensor([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], 1, 1) == [[[1, 2]], [[5, 6]]]\", \"assert resize_tensor([[[1]]], 2, 0) == [[[1]], [[0]]]\", \"assert resize_tensor([[[1, 2]], [[3...
{ "split": "train", "index": 62034, "acecode_id": "bigcode_python_fns_44147", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the retrieval of data from a remote storage system. The function `retrieve_data` takes a dictionary `pipeline_upload` which contains the keys 'study_id' and 's3_path', and it returns a tuple containing the original `pip...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_data({'study_id': 2, 's3_path': 'another/path'}) == ({'study_id': 2, 's3_path': 'another/path'}, 'another/pathstudy_id=2')\", \"assert retrieve_data({'study_id': 3, 's3_path': 'different/path'}) == ({'study_id': 3, 's3_path': 'different/path'}, 'dif...
{ "split": "train", "index": 62035, "acecode_id": "bigcode_python_fns_39875", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two lists of integers and returns a tuple containing three lists: the union, intersection, and difference (A - B) of the two lists. The function should not use any built-in set functions in Python. Each list should contain unique elements without...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_operations([1, 2, 3], [2, 3, 4]) == ([1, 2, 3, 4], [2, 3], [1])\", \"assert list_operations([1, 2, 3, 4], [5, 6, 7]) == ([1, 2, 3, 4, 5, 6, 7], [], [1, 2, 3, 4])\", \"assert list_operations([], [1, 2, 3]) == ([1, 2, 3], [], [])\", \"assert list_operatio...
{ "split": "train", "index": 62036, "acecode_id": "evol_8807", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries, write a function that returns a list containing the sum of all numerical values for each dictionary. Each dictionary can contain various types of values, but only numerical values (integers and floats) should be summed. If a dictionary is empty or ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_dictionary_values([{'a': 1, 'b': 2}, {'x': 3.5, 'y': 'test'}, {}]) == [3, 3.5, 0]\", \"assert sum_dictionary_values([{'key1': 10, 'key2': 5}, {'key3': 3.5, 'key4': 2.5}, {'key5': 'string'}]) == [15, 6.0, 0]\", \"assert sum_dictionary_values([{}, {'a': 'h...
{ "split": "train", "index": 62037, "acecode_id": "evol_4770", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a list of dictionaries, where each dictionary contains a 'name' and an 'age' key. The function should return a new list of dictionaries sorted by the 'age' key in ascending order. If two dictionaries have the same age, their order should be pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert organize_list([{'name': 'a', 'age': 23}, {'name': 'b', 'age': 19}, {'name': 'c', 'age': 36}]) == [{'name': 'b', 'age': 19}, {'name': 'a', 'age': 23}, {'name': 'c', 'age': 36}]\", \"assert organize_list([{'name': 'z', 'age': 30}, {'name': 'y', 'age': 25}, {'n...
{ "split": "train", "index": 62038, "acecode_id": "evol_16300", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of words, create two dictionaries where each word is a key and its respective length is the value. The first list contains simple words, and the second list contains complex words. Subtract the lengths of values from the first dictionary from the lengths of valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_word_lengths(['one', 'two'], ['one', 'two', 'three', 'four']) == {'one': 0, 'two': 0, 'three': 5, 'four': 4}\", \"assert compare_word_lengths([], ['onlyone']) == {'onlyone': 7}\", \"assert compare_word_lengths(['single'], ['single', 'double', 'triple...
{ "split": "train", "index": 62039, "acecode_id": "evol_2083", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of pairs representing interactions between proteins. Each pair consists of two strings: the names of the interacting proteins. Your task is to return an adjacency matrix and a sorted list of unique protein names. The adjacency matrix should have dimensions ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_adjacency_matrix([('A', 'B'), ('B', 'C')]) == ([[0, 1, 0], [1, 0, 1], [0, 1, 0]], ['A', 'B', 'C'])\", \"assert create_adjacency_matrix([('A', 'A')]) == ([[1]], ['A'])\", \"assert create_adjacency_matrix([('A', 'B'), ('B', 'A')]) == ([[0, 1], [1, 0]], ...
{ "split": "train", "index": 62040, "acecode_id": "bigcode_python_fns_4961", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of tasks represented as tuples where each tuple contains the task name and its duration (in hours), write a function `efficient_order(tasks: List[Tuple[str, int]]) -> List[str]` that returns a list of task names sorted in ascending order of their duration. If two t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert efficient_order([('Task1', 3), ('Task2', 1), ('Task3', 4), ('Task4', 2), ('Task5', 5)]) == ['Task2', 'Task4', 'Task1', 'Task3', 'Task5']\", \"assert efficient_order([('TaskA', 2), ('TaskB', 2), ('TaskC', 1)]) == ['TaskC', 'TaskA', 'TaskB']\", \"assert effici...
{ "split": "train", "index": 62041, "acecode_id": "evol_9334", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list `B` containing distinct integers and an integer `a`. Your task is to write a Python function `find_element(B, a)` that returns the element at index `a` in the list `B`. If the index `a` is out of range for the list `B`, the function should return 'Index out...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_element([10, 20, 30, 40, 50], 2) == 30\", \"assert find_element([1, 2, 3, 4, 5], 0) == 1\", \"assert find_element([100], 0) == 100\", \"assert find_element([], 0) == 'Index out of range'\", \"assert find_element([5, 10, 15], 3) == 'Index out of range'\"...
{ "split": "train", "index": 62042, "acecode_id": "oss_4272", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates an HTML form for uploading JPEG image files. The function should take two parameters: 'server_ip' (a string representing the server's IP address) and 'server_port' (an integer representing the server's port). The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_upload_form('127.0.0.1', 8080) == '<p>RICGA:please upload a picture(jpeg)</p>\\\\n <form method=\\\"post\\\" action=\\\"http://127.0.0.1:8080\\\" enctype=\\\"multipart/form-data\\\">\\\\n <input ...
{ "split": "train", "index": 62043, "acecode_id": "oss_3215", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a base URL, client ID, client secret, and an optional grant type, implement a function that generates an OAuth 2.0 authorization header. If any of the required parameters (base URL, client ID, or client secret) are None, return None. If grant type is not provided, default...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_oauth_header('https://api.example.com', 'myClientId', None, 'client_credentials') == None\", \"assert generate_oauth_header('https://api.example.com', None, 'myClientSecret', 'client_credentials') == None\", \"assert generate_oauth_header(None, 'myC...
{ "split": "train", "index": 62044, "acecode_id": "bigcode_python_fns_27308", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a Python entity that can be a dictionary, list, tuple, or set, write a function `authenticate_empty_entities(entity)` that checks if the entity is empty. An entity is considered empty if it contains no items or if all of its items/keys are themselves empty entities. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert authenticate_empty_entities({}) == (True, 1)\", \"assert authenticate_empty_entities({'a': {}, 'b': 1}) == (False, 1)\", \"assert authenticate_empty_entities([]) == (True, 1)\", \"assert authenticate_empty_entities([1, 2, 3]) == (False, 0)\", \"assert authen...
{ "split": "train", "index": 62045, "acecode_id": "evol_17424", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a string, implement a function that creates a dictionary where each character in the string is a key, and its corresponding ASCII value is the value. The function should return this dictionary.\nPlease reason step by step, then write a self-contained Python solution. Give...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ascii_dict('Prompt') == {'P': 80, 'r': 114, 'o': 111, 'm': 109, 'p': 112, 't': 116}\", \"assert ascii_dict('abc') == {'a': 97, 'b': 98, 'c': 99}\", \"assert ascii_dict('A') == {'A': 65}\", \"assert ascii_dict('') == {}\", \"assert ascii_dict('123') == {'1': ...
{ "split": "train", "index": 62046, "acecode_id": "evol_1043", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_max(a, b, c)` that takes three numerical inputs and returns the maximum value among them.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max(1, 2, 3) == 3\", \"assert find_max(-1, -2, -3) == -1\", \"assert find_max(5, 5, 5) == 5\", \"assert find_max(10, 20, 15) == 20\", \"assert find_max(0, 0, 0) == 0\", \"assert find_max(-10, -5, 0) == 0\", \"assert find_max(100, 50, 75) == 100\", \"ass...
{ "split": "train", "index": 62047, "acecode_id": "evol_29691", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that multiplies all elements of a given array and returns the product modulo a specified number. The array consists of positive integers, and you need to ensure that the result is always in the range of 0 to mod - 1. The function should take two parameters:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_modulo([1, 1, 1, 1], 10) == 1\", \"assert multiply_modulo([100], 99) == 1\", \"assert multiply_modulo([1, 1, 1, 1, 1], 2) == 1\", \"assert multiply_modulo([2, 3, 6], 5) == 1\", \"assert multiply_modulo([1, 2, 3, 4, 5], 6) == 0\"]}" }
{ "split": "train", "index": 62048, "acecode_id": "evol_9396", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `convert_environment` that takes no parameters. This function simulates the conversion of a parallel environment to an AEC (Agent-Environment-Communication) environment by performing two operations sequentially: first, it creat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_environment() == 'AEC Environment'\", \"assert convert_environment() is not None\", \"assert convert_environment() == transform_to_aec(create_parallel_env())\", \"assert isinstance(convert_environment(), str)\", \"assert 'AEC' in convert_environment(...
{ "split": "train", "index": 62049, "acecode_id": "bigcode_python_fns_15616", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_primes_and_average` that takes two integers, `start` and `end`, as inputs and returns a list of all prime numbers between `start` and `end`, the average of these prime numbers, and two lists: one containing the prime numbers above the average and anot...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_primes_and_average(20, 30) == ([23, 29], 26.0, [29], [23])\", \"assert generate_primes_and_average(1, 10) == ([2, 3, 5, 7], 4.25, [5, 7], [2, 3])\", \"assert generate_primes_and_average(10, 20) == ([11, 13, 17, 19], 15.0, [17, 19], [11, 13])\", \"as...
{ "split": "train", "index": 62050, "acecode_id": "evol_10917", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `is_fibonacci(n: int) -> str` that takes an integer n as input and returns 'yes' if n is a Fibonacci number, and 'no' if it is not. A Fibonacci number is defined as a number in the sequence where each number is the sum of the two preceding ones, starting fr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_fibonacci(0) == 'yes'\", \"assert is_fibonacci(1) == 'yes'\", \"assert is_fibonacci(2) == 'yes'\", \"assert is_fibonacci(3) == 'yes'\", \"assert is_fibonacci(4) == 'no'\", \"assert is_fibonacci(5) == 'yes'\", \"assert is_fibonacci(6) == 'no'\", \"assert i...
{ "split": "train", "index": 62051, "acecode_id": "evol_16247", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer `value` and a non-negative integer `n`, implement a function `createList(value: int, n: int) -> List[int]` that creates and returns a list of size `n` where each element is initialized to `value`. If `n` is 0, return an empty list. The function should handle an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert createList(5, 3) == [5, 5, 5]\", \"assert createList(0, 0) == []\", \"assert createList(-1, 4) == [-1, -1, -1, -1]\", \"assert createList(10, 2) == [10, 10]\", \"assert createList(7, 5) == [7, 7, 7, 7, 7]\", \"assert createList(1, 1) == [1]\", \"assert creat...
{ "split": "train", "index": 62052, "acecode_id": "bigcode_python_fns_446", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that may represent a number, a boolean value, or a special float value (like 'inf', '-inf', 'nan'). Your task is to implement a function that converts this string to its appropriate Python data type. The function should handle the following cases: 1) If t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_value('') is None\", \"assert convert_value(' ') is None\", \"assert convert_value('123') == 123\", \"assert convert_value('-456') == -456\", \"assert convert_value('3.14') == 3.14\", \"assert convert_value('-0.001') == -0.001\", \"assert convert_v...
{ "split": "train", "index": 62053, "acecode_id": "bigcode_python_fns_38016", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `value` which can either be 'PBR' or any other string. You need to implement a function `get_version(value: str) -> str` that returns a version number based on the input string. If the input string is 'PBR', the function should return the version '1.0.0'....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_version('PBR') == '1.0.0'\", \"assert get_version('other') == '0.0.1'\", \"assert get_version('example') == '0.0.1'\", \"assert get_version('test') == '0.0.1'\", \"assert get_version('PBR') == '1.0.0'\", \"assert get_version('string') == '0.0.1'\", \"ass...
{ "split": "train", "index": 62054, "acecode_id": "bigcode_python_fns_19479", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of bars in a histogram. Write a function `largestRectangleArea(heights: List[int]) -> int` that calculates the area of the largest rectangle that can be formed within the histogram. The function should return a single in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largestRectangleArea([2, 1, 5, 6, 2, 3]) == 10\", \"assert largestRectangleArea([1, 1, 1, 1]) == 4\", \"assert largestRectangleArea([0, 2, 0]) == 2\", \"assert largestRectangleArea([1, 3, 2, 5, 4]) == 8\", \"assert largestRectangleArea([1, 2, 3, 4, 5]) == 9\...
{ "split": "train", "index": 62055, "acecode_id": "bigcode_python_fns_26740", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that returns a new array containing only the prime numbers from the input array. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Write a function `fil...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_primes([11, 14, 23, 26, 29, 31, 35]) == [11, 23, 29, 31]\", \"assert filter_primes([4, 6, 8, 10]) == []\", \"assert filter_primes([1, 2, 3, 4, 5]) == [2, 3, 5]\", \"assert filter_primes([15, 21, 22, 24, 25]) == []\", \"assert filter_primes([]) == []\"...
{ "split": "train", "index": 62056, "acecode_id": "evol_2351", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, compute the product of all odd numbers that are located at even indices within the list and are also multiples of 3. Implement a function called `multiply` that takes in a list of integers and returns the computed product. If there are no qualifying nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply([3, 5, 7, 8, 9]) == 27\", \"assert multiply([3, 6, 9, 12]) == 27\", \"assert multiply([0, 3, 6, 9, 12]) == 1\", \"assert multiply([3, 5, 7, 2, 9]) == 27\", \"assert multiply([3, 1, 5, 2, 9, 3]) == 27\", \"assert multiply([12, 3, 4, 9, 15]) == 15\", ...
{ "split": "train", "index": 62057, "acecode_id": "evol_24025", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of strings representing translations and returns a dictionary mapping the original strings to their translated versions. Each translated version is formed by prefixing the original string with 'Translated_'. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_translations(['Hello']) == {'Hello': 'Translated_Hello'}\", \"assert process_translations(['Goodbye']) == {'Goodbye': 'Translated_Goodbye'}\", \"assert process_translations(['Yes']) == {'Yes': 'Translated_Yes'}\", \"assert process_translations(['No']...
{ "split": "train", "index": 62058, "acecode_id": "oss_21066", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `heritability_analysis(snps_data: List[Dict[str, Union[str, float]]], n_patients: int, n_snps: int, fix_intercept: bool) -> Dict[str, float]` that analyzes a dataset of SNPs (Single Nucleotide Polymorphisms) and computes various herit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert heritability_analysis([{'gene': 'geneA', 'l': 0.5, 'stats': 0.4}, {'gene': 'geneB', 'l': 0.5, 'stats': 0.4}], 50, 2, True) == {'heritability_mean': 0.4, 'heritability_std': 0.0}\", \"assert heritability_analysis([{'gene': 'gene1', 'l': 1.0, 'stats': 0.5}], 1...
{ "split": "train", "index": 62059, "acecode_id": "bigcode_python_fns_41669", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that constructs a simple alias for a given method name. The function `create_alias` takes two arguments: `method_name`, a string representing the name of the method you want to create an alias for, and `alias_name`, a string re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_alias('foo', 'bar') == {'bar': 'foo'}\", \"assert create_alias('methodA', 'aliasA') == {'aliasA': 'methodA'}\", \"assert create_alias('test', 'test_alias') == {'test_alias': 'test'}\", \"assert create_alias('functionX', 'function_alias') == {'function...
{ "split": "train", "index": 62060, "acecode_id": "oss_21960", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing wall colors, floor colors, object colors, and object IDs. Each color and ID is represented by a non-negative integer. Your task is to create a function called `sym2img_conversion_check` that takes in this list and returns a list of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sym2img_conversion_check([0]) == [0]\", \"assert sym2img_conversion_check([0, 0, 0]) == [0]\", \"assert sym2img_conversion_check([1, 2, 3]) == []\", \"assert sym2img_conversion_check([0, 0, 0, 0]) == [0]\", \"assert sym2img_conversion_check([2, 2, 2, 2]) == ...
{ "split": "train", "index": 62061, "acecode_id": "bigcode_python_fns_31906", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are working on a project that involves a model called `Flat`. The `Flat` model has a field called `liked_by`, which represents the users who have liked the flat. Your task is to implement a function `alter_liked_by_field()` that takes a list of users (represented as strings...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert alter_liked_by_field([]) == {'blank': True, 'related_name': 'liked_posts'}\", \"assert alter_liked_by_field(['user1']) == {'blank': True, 'related_name': 'liked_posts'}\", \"assert alter_liked_by_field(['user1', 'user2']) == {'blank': True, 'related_name': '...
{ "split": "train", "index": 62062, "acecode_id": "oss_10914", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves a specific part of an article based on given parameters. The function should take in the article ID, version, and part name as input and return the corresponding part of the article as a string. If the specified part do...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_article_part(123, 1, 'Introduction') == 'This is the introduction of article 123 version 1'\", \"assert retrieve_article_part(123, 2, 'Introduction') == 'This is the introduction of article 123 version 2'\", \"assert retrieve_article_part(124, 1, 'I...
{ "split": "train", "index": 62063, "acecode_id": "oss_22286", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that replaces all numerical characters in a given string with asterisks. Each digit or multi-digit number should be replaced by a sequence of asterisks corresponding to the integer value of that digit or number. For example, in the string 'abc2def3', the ou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_with_asterisks('abc2def3') == 'abc**def***'\", \"assert replace_with_asterisks('noNumbersHere') == 'noNumbersHere'\", \"assert replace_with_asterisks('12 apples') == '************ apples'\", \"assert replace_with_asterisks('quantity5') == 'quantity**...
{ "split": "train", "index": 62064, "acecode_id": "evol_12867", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of file paths (strings) that represent source files. Your task is to create a function that generates a list of new file paths based on the specified parameters: a prefix to strip from the start of each file path and a destination directory where the new fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_new_file_paths(['/home/user/docs/file1.txt', '/home/user/docs/file2.txt'], '/home/user/docs/', '/home/user/backup/') == ['/home/user/backup/file1.txt', '/home/user/backup/file2.txt']\", \"assert generate_new_file_paths(['/var/www/html/index.html', '...
{ "split": "train", "index": 62065, "acecode_id": "bigcode_python_fns_4691", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that classifies audio samples based on a given model. The function should take in the following parameters: a string representing the model path, a callback function that processes the classification results, a float representing the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_audio('model.tflite', lambda label, score: True, 0.1, 2.0, 0.1) == 'Audio classification system set up successfully.'\", \"assert classify_audio('model.tflite', lambda label, score: True, 0.0, 2.0, 0.1) == 'Audio classification system set up success...
{ "split": "train", "index": 62066, "acecode_id": "bigcode_python_fns_4977", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `execute_graphql_query(query: str, parameters: dict) -> Any` that takes a GraphQL query string and a dictionary of parameters, simulating the execution of the query against a Cassandra database. The function should return a string response indicating whethe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_graphql_query('query { users { id name } }', {'id': 1}) == 'Query executed successfully'\", \"assert execute_graphql_query('mutation { createUser(name: \\\"Alice\\\") }', {'name': 'Alice'}) == 'Invalid query or parameters'\", \"assert execute_graphql...
{ "split": "train", "index": 62067, "acecode_id": "evol_15435", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `bubble_sort(array)` that takes a list of integers as input and sorts the list in ascending order using the bubble sort algorithm. You should not use any built-in sorting functions, and the function should return the sorted list.\nPlease reason step by step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bubble_sort([5, 3, 8, 1, 2]) == [1, 2, 3, 5, 8]\", \"assert bubble_sort([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]\", \"assert bubble_sort([]) == []\", \"assert bubble_sort([1]) == [1]\", \"assert bubble_sort([4, 2, 2, 8, 3, 3, 1]) == [1, 2, 2, 3, 3, 4, 8]\...
{ "split": "train", "index": 62068, "acecode_id": "evol_3662", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simplified function to manage metadata for a scientific experiment. Write a Python function called `set_experiment_metadata` that takes in an experiment ID as a parameter and returns a dictionary with the experiment ID included as metadata. The fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_experiment_metadata('exp001') == {'experiment_id': 'exp001', 'status': 'pending', 'description': 'No description provided'}\", \"assert set_experiment_metadata('exp002') == {'experiment_id': 'exp002', 'status': 'pending', 'description': 'No description p...
{ "split": "train", "index": 62069, "acecode_id": "oss_8898", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple stock portfolio management system. Write a function `calculate_portfolio_value(initial_investment: float, stock_prices: List[float]) -> float` that calculates the total value of the stock portfolio after purchasing stocks at the given sto...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_portfolio_value(10000, [200, 220, 210]) == 10500.0\", \"assert calculate_portfolio_value(8000, [250, 300, 275]) == 8800.0\", \"assert calculate_portfolio_value(12000, [400, 450, 420]) == 12600.0\", \"assert calculate_portfolio_value(1000, [50, 60, ...
{ "split": "train", "index": 62070, "acecode_id": "oss_28302", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string and a terminal width, implement a function `ljust(string: str, width: int) -> str` that left-justifies the input string by padding it with spaces on the right until the total length of the string reaches the specified width. If the width is less than or equal to ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ljust('Hello', 10) == 'Hello '\", \"assert ljust('Data', 4) == 'Data'\", \"assert ljust('OpenAI', 5) == 'OpenAI'\", \"assert ljust('', 10) == ' '\", \"assert ljust('End', 3) == 'End'\", \"assert ljust('Trailing', 10) == 'Trailing '\", \"assert ...
{ "split": "train", "index": 62071, "acecode_id": "bigcode_python_fns_18897", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a string representing the name of a JavaScript file (without the .js extension). Your task is to implement a function `retrieve_javascript(name: str) -> str` that returns the content of the JavaScript file as a string. For the purposes of this problem, you can sim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_javascript('script1') == 'console.log(\\\"Hello World\\\");'\", \"assert retrieve_javascript('script2') == 'function test() { return true; }'\", \"assert retrieve_javascript('script3') == 'let x = 5;'\", \"assert retrieve_javascript('script4') == 'F...
{ "split": "train", "index": 62072, "acecode_id": "bigcode_python_fns_15521", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dataset containing information about students' exam scores and study hours. Your task is to implement a function that takes this dataset as input and returns a list of tuples, where each tuple contains a student's name, their exam score, and their study hours in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_student_data() == [('Student E', 95, 8), ('Student B', 90, 7), ('Student A', 85, 6), ('Student C', 74, 5), ('Student D', 60, 3)]\", \"assert get_student_data() != [('Student D', 60, 3), ('Student C', 74, 5), ('Student A', 85, 6), ('Student B', 90, 7), ('...
{ "split": "train", "index": 62073, "acecode_id": "oss_27233", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in a name and an address as strings, and returns a formatted string that combines both the name and address in a specific format. The format should be: 'Service: [name], Address: [address]'. Write a function called 'format_soci...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_social_address('Facebook', '1 Hacker Way') == 'Service: Facebook, Address: 1 Hacker Way'\", \"assert format_social_address('Google', '1600 Amphitheatre Parkway') == 'Service: Google, Address: 1600 Amphitheatre Parkway'\", \"assert format_social_addres...
{ "split": "train", "index": 62074, "acecode_id": "bigcode_python_fns_41983", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of filter words, which can be either a single word or multiple words separated by ' OR '. Your function should take a string of filter words as input and return a tuple containing two elements: a list of individual f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_filter_words('apple') == (['apple'], 'apple')\", \"assert process_filter_words('banana OR cherry') == (['banana', 'cherry'], 'banana|cherry')\", \"assert process_filter_words('dog OR cat OR mouse') == (['dog', 'cat', 'mouse'], 'dog|cat|mouse')\", \"a...
{ "split": "train", "index": 62075, "acecode_id": "bigcode_python_fns_26463", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `set_operations` that takes two sets as input and returns their union and intersection. The union of two sets is the set of all unique elements present in either set, while the intersection is the set of elements that are present in both sets. The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_operations({1, 2, 3}, {2, 3, 4}) == ({1, 2, 3, 4}, {2, 3})\", \"assert set_operations({'a', 'b'}, {'b', 'c'}) == ({'a', 'b', 'c'}, {'b'})\", \"assert set_operations({10, 20, 30}, {30, 40, 50}) == ({10, 20, 30, 40, 50}, {30})\", \"assert set_operations({'...
{ "split": "train", "index": 62076, "acecode_id": "evol_12486", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `check_ascending_order(lst)` that checks if a list of numerical values is in ascending order. The function should return True if the list is empty, and it should also handle nested lists, where each nested list is checked for ascending order as well. If the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_ascending_order([]) == True\", \"assert check_ascending_order([1, 2, 3]) == True\", \"assert check_ascending_order([1, 2, 2, 3]) == True\", \"assert check_ascending_order([1.0, 2.0, 3.0]) == True\", \"assert check_ascending_order([[1, 2], [3, 4]]) == T...
{ "split": "train", "index": 62077, "acecode_id": "evol_15311", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates sending a file to a router for deployment. The function should take in a list of commands, a file path, and a boolean indicating whether to log the operation. If the file path is None, the function should raise a ValueError...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_file_to_router(['command1', 'command2'], '/tmp/foo.sh', True) == 'Successfully sent commands to /tmp/foo.sh'\", \"assert send_file_to_router(['command1'], '/tmp/foo.sh', False) == 'Successfully sent commands to /tmp/foo.sh'\", \"assert send_file_to_rout...
{ "split": "train", "index": 62078, "acecode_id": "bigcode_python_fns_10063", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the prices of items in a store. Your task is to implement a function that calculates the maximum profit you can achieve by buying and selling one item. You may only complete one transaction, meaning you must buy the item before you ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([1, 2, 3, 4, 5]) == 4\", \"assert max_profit([5, 4, 3, 2, 1]) == 0\", \"assert max_profit([2, 1, 2, 1, 2]) == 1\", \"assert max_profit([1, 5, 3, 6, 4]) ==...
{ "split": "train", "index": 62079, "acecode_id": "bigcode_python_fns_45164", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a class `MyObject` which has a method `getValue()`. Your task is to implement a function `calculateValue(obj: MyObject) -> int` that takes an instance of `MyObject` as input and returns the value obtained by calling `obj.getValue()` and adding 2 to it. The method ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculateValue(MockMyObject(0)) == 2\", \"assert calculateValue(MockMyObject(1)) == 3\", \"assert calculateValue(MockMyObject(10)) == 12\", \"assert calculateValue(MockMyObject(100)) == 102\", \"assert calculateValue(MockMyObject(999)) == 1001\", \"assert ca...
{ "split": "train", "index": 62080, "acecode_id": "bigcode_python_fns_25085", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers and an integer n, implement a function `chunkify(arr: List[int], n: int) -> List[List[int]]` that divides the array into n-sized chunks. If the last chunk has fewer than n elements, it should still be included in the result. The function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert chunkify([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\", \"assert chunkify([1, 2, 3, 4, 5], 3) == [[1, 2, 3], [4, 5]]\", \"assert chunkify([], 2) == []\", \"assert chunkify([10, 20, 30], 1) == [[10], [20], [30]]\", \"assert chunkify([1, 2, 3, 4], 4) == [[1, ...
{ "split": "train", "index": 62081, "acecode_id": "bigcode_python_fns_14347", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `median(my_list)` that takes a list of numbers and returns the median value. The median is defined as the middle element in the sorted list. If the list has an even number of elements, return the average of the two middle elements. The input list may contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median([1, 3, 2]) == 2\", \"assert median([1, 5, 3, 2]) == 2.5\", \"assert median([7, 1, 3, 4, 2]) == 3\", \"assert median([5, 6, 8, 1, 2, 4]) == 4.5\", \"assert median([10]) == 10\", \"assert median([1, 2]) == 1.5\", \"assert median([1, 2, 3, 4, 5]) == 3\",...
{ "split": "train", "index": 62082, "acecode_id": "evol_12155", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `monotonic_advanced(l: list, strict: bool = False, zero_crossing: bool = False, progression: str = None) -> bool` that checks if the elements in the list are monotonically increasing or decreasing while also adhering to specific conditions based on the para...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert monotonic_advanced([1, 2, 3, 4], strict=False, zero_crossing=False, progression=None) == True\", \"assert monotonic_advanced([4, 3, 2, 1], strict=False, zero_crossing=False, progression=None) == True\", \"assert monotonic_advanced([1, 2, 3, 4], strict=True, ...
{ "split": "train", "index": 62083, "acecode_id": "evol_11922", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the submission of a Spark job in a cloud environment. Create a function named `submit_spark_job` that takes the following parameters: \n- `project_id` (str): The ID of the Google Cloud Platform project that the cluster belongs to. \n- `region` (st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert submit_spark_job('project1', 'us-central1', 'cluster1', 'output/path') == {'sparkJob': {}}\", \"assert submit_spark_job('project1', 'us-central1', 'cluster1', 'output/path', main_jar_file_uri='gs://bucket/jarfile.jar') == {'sparkJob': {'mainJarFileUri': 'gs:...
{ "split": "train", "index": 62084, "acecode_id": "bigcode_python_fns_39565", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating file paths for time-series data files based on specific parameters. You need to implement a function that constructs file paths for given file IDs and time instances. The file paths should follow a specific format based on the provided base direct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_paths('/data', ['file1'], ['t1'], 5) == ['/data/2022/5/file1_t1.csv']\", \"assert find_paths('/data', ['file1', 'file2'], ['t1'], 5) == ['/data/2022/5/file1_t1.csv', '/data/2022/5/file2_t1.csv']\", \"assert find_paths('/data', ['file1'], ['t1', 't2'], 5...
{ "split": "train", "index": 62085, "acecode_id": "oss_29266", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and a target sum, write a function that calculates the number of distinct pairs (i, j) such that the sum of the integers at these indices equals the target sum. A pair (i, j) is considered the same as (j, i) and should only be counted once. The function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_pairs([1, 2, 3, 4, 5], 5) == 2\", \"assert count_pairs([1, 1, 1, 1], 2) == 1\", \"assert count_pairs([0, 0, 0, 0], 0) == 1\", \"assert count_pairs([1, 2, 3, 4, 5, 6], 7) == 3\", \"assert count_pairs([-1, 1, -2, 2, -3, 3], 0) == 3\", \"assert count_pair...
{ "split": "train", "index": 62086, "acecode_id": "evol_31342", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of users and a corresponding list of puzzles, implement a function `get_user_puzzles(users: List[str], puzzles: List[Tuple[str, int, str]]) -> List[Dict[str, Any]]`. Each user is represented by their username, and each puzzle is represented as a tuple containing th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_puzzles(['alice', 'bob', 'charlie'], [('alice', 1, '2023-01-01'), ('bob', 2, '2022-12-31'), ('alice', 3, '2023-02-01'), ('charlie', 4, '2023-01-15')], '2023-02-01') == [{'name': 'alice', 'puzzles': [{'number': 3, 'date': '2023-02-01'}, {'number': 1,...
{ "split": "train", "index": 62087, "acecode_id": "bigcode_python_fns_6520", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a 1D list of integers, where each integer represents a coefficient in a polynomial. Your task is to implement a function that computes the value of the polynomial at a given integer x. The polynomial is defined as follows: if the input list is coefficients = [c0, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_polynomial([1, 2, 3], 2) == 17\", \"assert evaluate_polynomial([0, 0, 0], 5) == 0\", \"assert evaluate_polynomial([1], 1) == 1\", \"assert evaluate_polynomial([2, 3, 4], 0) == 2\", \"assert evaluate_polynomial([-1, 0, 1], 2) == 3\", \"assert evaluat...
{ "split": "train", "index": 62088, "acecode_id": "bigcode_python_fns_40625", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of event locations represented as strings. Your task is to return a list of unique event locations, formatted in a specific way. Each location string should be formatted by appending a specified scope (e.g., 'building', 'city', 'country') to it. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_event_locations(['Conference Room', 'Main Hall', 'Conference Room', 'Auditorium'], 'building') == ['Conference Room (building)', 'Main Hall (building)', 'Auditorium (building)']\", \"assert get_unique_event_locations(['New York', 'Los Angeles', 'N...
{ "split": "train", "index": 62089, "acecode_id": "bigcode_python_fns_49566", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string input and returns a list of characters in the order they appear in the string. Each character in the output list should be a single character from the input string. Your function should handle an empty string as in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_characters('hello') == ['h', 'e', 'l', 'l', 'o']\", \"assert extract_characters('') == []\", \"assert extract_characters('world') == ['w', 'o', 'r', 'l', 'd']\", \"assert extract_characters('12345') == ['1', '2', '3', '4', '5']\", \"assert extract_ch...
{ "split": "train", "index": 62090, "acecode_id": "bigcode_python_fns_46925", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string as input and returns a new string that contains the original string duplicated, after removing all punctuation marks, numeric characters, and converting all letters to lowercase. The returned string should only include alphabetic characters....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert duplicate_seq('Hello, World!') == 'helloworldhelloworld'\", \"assert duplicate_seq('1234Numbers!') == 'numbersnumbers'\", \"assert duplicate_seq('Goodbye!') == 'goodbyegoodbye'\", \"assert duplicate_seq('') == ''\", \"assert duplicate_seq('Spaces and tabs\\...
{ "split": "train", "index": 62091, "acecode_id": "evol_9547", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that performs a binary search on a sorted array. The function should take a sorted array and a target value as inputs and return the index of the target value in the array if it exists, or -1 if it does not. The array will be guaranteed to be sorted ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 6) == 5\", \"assert binary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1) == 0\", \"assert binary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10) == 9\", \"assert binary_search([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 0) == -1\...
{ "split": "train", "index": 62092, "acecode_id": "evol_26804", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `lcm(w: int, x: int, y: int, z: int) -> int` that computes the Least Common Multiple (LCM) for a quadruplet of positive integers (w, x, y, z). The function should return an error message if any input is negative or exceeds one billion. Your implementation shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lcm(2, 3, 4, 5) == 60\", \"assert lcm(7, 14, 21, 28) == 84\", \"assert lcm(1, 2, 3, 4) == 12\", \"assert lcm(1, 1, 1, 1) == 1\", \"assert lcm(6, 8, 12, 18) == 72\", \"assert lcm(1000000000, 500000000, 250000000, 125000000) == 1000000000\", \"assert lcm(99999...
{ "split": "train", "index": 62093, "acecode_id": "evol_16794", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of numerical predictions and their corresponding true values, implement a function that calculates the mean absolute error (MAE) between the predictions and the true values. The function should also return the standard deviation of the prediction errors. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_predictions([1.0, 2.0, 3.0], [1.0, 2.0, 3.0]) == (0.0, 0.0)\", \"assert evaluate_predictions([0.0, 0.0, 0.0], [1.0, 1.0, 1.0]) == (1.0, 0.0)\", \"assert evaluate_predictions([1.0, 2.0, 3.0, 4.0], [2.0, 3.0, 4.0, 5.0]) == (1.0, 0.0)\", \"assert evalu...
{ "split": "train", "index": 62094, "acecode_id": "bigcode_python_fns_24204", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given two lists of tuples, `A` and `B`, where each tuple represents a hit in a BLAST search result in the format `(query, subject)`, determine the reciprocal best hits for each query in list `A` when compared to list `B`. A reciprocal best hit means that if `A[i]` has a subject...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reciprocal_best_hits([('A1', 'B1'), ('A2', 'B2')], [('B3', 'A3')]) == []\", \"assert reciprocal_best_hits([], [('B1', 'A1')]) == []\", \"assert reciprocal_best_hits([('A1', 'B1')], []) == []\", \"assert reciprocal_best_hits([('A1', 'B2'), ('A2', 'B3')], [('B...
{ "split": "train", "index": 62095, "acecode_id": "bigcode_python_fns_5715", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of notices from a university's information system, where each notice is represented as a dictionary containing 'title', 'date', and 'url'. Your task is to implement a function that takes this list of notices and returns a list of formatted strings, where ea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_notices([]) == []\", \"assert format_notices([{'title': 'Notice 1', 'date': '2023-09-01', 'url': 'http://example.com/1'}]) == ['Title: Notice 1, Date: 2023-09-01, URL: http://example.com/1']\", \"assert format_notices([{'title': 'Notice 2', 'date': '2...
{ "split": "train", "index": 62096, "acecode_id": "oss_8030", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with testing the functionality of a simple addition function. Implement a function called `is_addition_correct` that verifies if the addition of two integers a and b equals their expected sum. The function should return True if the addition is correct and False o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_addition_correct(2, 3, 5) == True\", \"assert is_addition_correct(10, 5, 15) == True\", \"assert is_addition_correct(-1, 1, 0) == True\", \"assert is_addition_correct(0, 0, 0) == True\", \"assert is_addition_correct(100, 200, 300) == True\", \"assert is_a...
{ "split": "train", "index": 62097, "acecode_id": "bigcode_python_fns_22964", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a stock trading decision-making function. The function should determine whether to 'buy', 'sell', or 'hold' a stock based on the provided stock price and a simple rule. The rule is as follows: if the stock price is below 100, the function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert trading_decision(95) == 'buy'\", \"assert trading_decision(100) == 'hold'\", \"assert trading_decision(110) == 'hold'\", \"assert trading_decision(120) == 'hold'\", \"assert trading_decision(125) == 'sell'\", \"assert trading_decision(130) == 'sell'\", \"ass...
{ "split": "train", "index": 62098, "acecode_id": "oss_24024", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings, `s` and `t`, write a function `is_anagram(s: str, t: str) -> bool` that determines whether `t` is an anagram of `s`. An anagram is a word formed by rearranging the letters of a different word using all the original letters exactly once. The function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_anagram('listen', 'silent') == True\", \"assert is_anagram('triangle', 'integral') == True\", \"assert is_anagram('hello', 'world') == False\", \"assert is_anagram('aabbcc', 'abcabc') == True\", \"assert is_anagram('rat', 'car') == False\", \"assert is_an...
{ "split": "train", "index": 62099, "acecode_id": "oss_20963", "num_tests": 16 }