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 string that contains a series of commands for processing image files in a specific format. Each command consists of a command type and a path to an input image file. Your task is to implement a function `process_commands` that takes a list of strings as input, w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_commands(['map /images/threshold1.tif', 'map /images/threshold2.tif']) == ['python /images/threshold1.tif -> /images/threshold1.shp', 'python /images/threshold2.tif -> /images/threshold2.shp']\", \"assert process_commands(['map /images/threshold1.tif... | {
"split": "train",
"index": 65800,
"acecode_id": "bigcode_python_fns_16037",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `cname` representing the name of a company. Your task is to write a function that extracts specific substrings from `cname` based on the given indices and returns them as a list. Write a function `extract_substrings(cname: str, indices: List[Tuple[int, in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_substrings('XYZ', [(0, 1), (1, 3)]) == ['X', 'YZ']\", \"assert extract_substrings('HelloWorld', [(0, 5), (5, 10)]) == ['Hello', 'World']\", \"assert extract_substrings('OpenAI', [(0, 6), (6, 8)]) == ['OpenAI', '']\", \"assert extract_substrings('Leet... | {
"split": "train",
"index": 65801,
"acecode_id": "oss_24315",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of groups, where each group is represented as a dictionary. Each dictionary may contain a key 'result_callback' which can be a callable or None. Your task is to implement a function `get_callback(group: Dict[str, Optional[Callable]]) -> Callable` that retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_callback({'result_callback': lambda: 'callback_1'})() == 'callback_1'\", \"assert get_callback({'result_callback': None})() is None\", \"assert get_callback({'resultcallback': lambda: 'callback_2'})() == 'callback_2'\", \"assert get_callback({'result_cal... | {
"split": "train",
"index": 65802,
"acecode_id": "bigcode_python_fns_33021",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `present_reversed(p1, p2, p3, p4, p5)` that accepts five parameters and returns a list containing those parameters in reverse order.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code blo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert present_reversed(1, 2, 3, 4, 5) == [5, 4, 3, 2, 1]\", \"assert present_reversed('a', 'b', 'c', 'd', 'e') == ['e', 'd', 'c', 'b', 'a']\", \"assert present_reversed(True, False, True, False, True) == [True, False, True, False, True]\", \"assert present_reverse... | {
"split": "train",
"index": 65803,
"acecode_id": "evol_7686",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, implement a function `count_primes_and_twin_primes(n)` that returns a tuple containing two values: the count of prime numbers less than n and the count of twin prime pairs less than n. A twin prime pair is defined as a pair of prime numbers that differ by tw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_primes_and_twin_primes(30) == (10, 4)\", \"assert count_primes_and_twin_primes(50) == (15, 6)\", \"assert count_primes_and_twin_primes(1) == (0, 0)\", \"assert count_primes_and_twin_primes(2) == (0, 0)\", \"assert count_primes_and_twin_primes(3) == (1,... | {
"split": "train",
"index": 65804,
"acecode_id": "evol_29220",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing lines from a file. Each line can contain different types of information: a date line formatted as '/* <date> */', a license line formatted as '/<license_text>', or a microcode line formatted as '/* <name>.inc */'. Your task is to wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_lines(['/* 2023-07-20 */', '/* microcode5.inc */', 'line7', 'line8']) == ('2023-07-20', [], {'microcode5': ['line7', 'line8']})\", \"assert parse_lines(['/* 2023-05-01 */', '/* microcode7.inc */', 'line10', 'line11', '/* microcode8.inc */', 'line12']) ... | {
"split": "train",
"index": 65805,
"acecode_id": "bigcode_python_fns_16096",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a file extension registration system for a software application. The system should allow the registration of file extensions as 'unsniffable,' meaning that the application will not attempt to automatically detect the file type based on its conte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_unsniffable_binary_ext('.txt') == True\", \"assert register_unsniffable_binary_ext('.jpeg') == True\", \"assert register_unsniffable_binary_ext('.tar') == True\", \"assert register_unsniffable_binary_ext('.zip') == True\", \"assert register_unsniffa... | {
"split": "train",
"index": 65806,
"acecode_id": "oss_32648",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function called `sentence_case` that converts the first character of the string to uppercase and the rest of the characters to lowercase. If the string is empty, return an empty string. The function should handle leading and trailing whitespace correctly... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sentence_case('hello world') == 'Hello world'\", \"assert sentence_case('HELLO WORLD') == 'Hello world'\", \"assert sentence_case('hELLo WoRLD') == 'Hello world'\", \"assert sentence_case(' python programming ') == 'Python programming'\", \"assert sentence... | {
"split": "train",
"index": 65807,
"acecode_id": "evol_8281",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a player's position matches any of the specified winning positions in a game. The player is represented by its position as a tuple of (x, y) coordinates. You are also provided with a list of winning positions, which are als... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_win_condition((0, 0), [(1, 1), (0, 0), (2, 2)]) == True\", \"assert check_win_condition((1, 1), [(1, 1), (2, 2)]) == True\", \"assert check_win_condition((2, 2), [(1, 1), (3, 3)]) == False\", \"assert check_win_condition((5, 5), [(5, 5), (6, 6), (7, 7)... | {
"split": "train",
"index": 65808,
"acecode_id": "oss_25718",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a set of items, each with a weight and a value, and a maximum weight limit for a knapsack. Your task is to implement a function called `max_knapsack_value` that takes three parameters: a list of tuples `items` where each tuple contains two integers (weight and val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_knapsack_value([(2, 3), (3, 4), (4, 5)], 5) == 7\", \"assert max_knapsack_value([(1, 1), (2, 2), (3, 3)], 3) == 3\", \"assert max_knapsack_value([(5, 10), (4, 40), (6, 30), (3, 50)], 10) == 90\", \"assert max_knapsack_value([(1, 1)], 2) == 1\", \"assert ... | {
"split": "train",
"index": 65809,
"acecode_id": "oss_17262",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, determine if the sequence forms a geometric progression. If it does, return the common ratio. If it does not, return the outliers that break the progression. A geometric progression is defined as a sequence where each term after the first is found by m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_geometric([2, 4, 8, 16, 20, 40]) == 'The sequence does not form a geometric progression. The outliers are: [20]'\", \"assert check_geometric([3, 9, 27, 81]) == 'The sequence forms a geometric progression with a common ratio of: 3.0'\", \"assert check_g... | {
"split": "train",
"index": 65810,
"acecode_id": "evol_35313",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset represented as a dictionary containing various variables and their respective coordinates. Implement a function `extract_coordinates(source_dataset: Dict[str, Any], config: Dict[str, Any], model_profile: Dict[str, Any]) -> Dict[str, Any]` that extracts a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_coordinates({'time': [0, 1, 2], 'depth': [0, 1], 'gridY': [0, 1, 2], 'gridX': [0, 1, 2]}, {'selection': {'time interval': 1, 'depth': {'depth min': 0, 'depth max': 1, 'depth interval': 1}, 'grid y': {'y min': 0, 'y max': 2, 'y interval': 1}, 'grid x'... | {
"split": "train",
"index": 65811,
"acecode_id": "bigcode_python_fns_37125",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `jacobsthal_lucas(n: int, m: int) -> int` that computes the nth term of the Jacobsthal-Lucas sequence modulo m. The function should validate that both n and m are positive integers. The Jacobsthal-Lucas sequence is defined as follows: J(0) = 2, J(1) = 1, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert jacobsthal_lucas(1, 3) == 1\", \"assert jacobsthal_lucas(5, 3) == 2\", \"assert jacobsthal_lucas(7, 3) == 0\", \"assert jacobsthal_lucas(9, 5) == 1\", \"assert jacobsthal_lucas(11, 5) == 2\"]}"
} | {
"split": "train",
"index": 65812,
"acecode_id": "evol_10701",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `update_dependencies(dep_comparison: List[int]) -> List[int]` that takes a list of integers representing dependencies and updates the list by incrementing each integer by 1. The function should return the updated list of integers. If t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_dependencies([1, 2, 3]) == [2, 3, 4]\", \"assert update_dependencies([0]) == [1]\", \"assert update_dependencies([-1, -2, -3]) == [0, -1, -2]\", \"assert update_dependencies([]) == []\", \"assert update_dependencies([10, 20, 30]) == [11, 21, 31]\", \"... | {
"split": "train",
"index": 65813,
"acecode_id": "bigcode_python_fns_10297",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `S` consisting of uppercase letters. The uniqueness of a letter is determined by the number of occurrences of that letter in the string. The uniqueness of a letter at a specific index `i` is defined as the number of occurrences of the letter at index `i` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert uniqueLetterString('A') == 1\", \"assert uniqueLetterString('ABA') == 8\", \"assert uniqueLetterString('ABC') == 10\", \"assert uniqueLetterString('AA') == 2\", \"assert uniqueLetterString('LEETCODE') == 92\", \"assert uniqueLetterString('AABAA') == 15\", \"... | {
"split": "train",
"index": 65814,
"acecode_id": "oss_34716",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a sequence of characters. Your task is to implement a function that normalizes the string by applying a series of transformations: removing leading and trailing whitespace, converting all characters to lowercase, and replacing every occurrenc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_string(' AbC ') == 'xyz'\", \"assert normalize_string(' aBc def ghi ') == 'xyz def ghi'\", \"assert normalize_string('abcabc') == 'xyzxyz'\", \"assert normalize_string('abCxyz') == 'xyzxyz'\", \"assert normalize_string(' abc ') == 'xyz'\", \"... | {
"split": "train",
"index": 65815,
"acecode_id": "bigcode_python_fns_37013",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining if all raw data files have been processed and stored in a specified directory. You are provided with two lists: `raw_files` and `processed_files`, which represent the names of files in the raw directory and the processed directory respectively. Y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_cache(['file1.txt', 'file2.txt'], ['file1.txt', 'file2.txt', 'file3.txt']) == True\", \"assert has_cache(['file1.txt'], ['file1.txt']) == True\", \"assert has_cache(['file1.txt'], ['file2.txt']) == False\", \"assert has_cache([], ['file1.txt']) == True\"... | {
"split": "train",
"index": 65816,
"acecode_id": "oss_24530",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_geometric_sequence(first_term: int, common_ratio: int, total_terms: int) -> List[int]` that generates a geometric sequence based on the provided first term, common ratio, and total number of terms. The function should return a list containing the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_geometric_sequence(1, 2, 10) == [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]\", \"assert generate_geometric_sequence(3, 3, 5) == [3, 9, 27, 81, 243]\", \"assert generate_geometric_sequence(5, 1, 7) == [5, 5, 5, 5, 5, 5, 5]\", \"assert generate_geometric_... | {
"split": "train",
"index": 65817,
"acecode_id": "evol_8607",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing an entity with various attributes. Implement a function `identify_category(entity)` that takes in this dictionary and returns 'Person' if it contains the keys 'name', 'age', and 'sex'. If any of these keys are missing, return 'Unknown'.\n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert identify_category({'name': 'Alice', 'age': 30, 'sex': 'female'}) == 'Person'\", \"assert identify_category({'name': 'Bob', 'age': 25}) == 'Unknown'\", \"assert identify_category({'name': 'Charlie', 'sex': 'male'}) == 'Unknown'\", \"assert identify_category({... | {
"split": "train",
"index": 65818,
"acecode_id": "evol_17759",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `cumulative_sum(n)` that computes the cumulative sum from 0 to n (inclusive). The function should handle the following cases: if the input is not an integer, it should raise a TypeError with the message 'Input should be an integer'; if the input is a negati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cumulative_sum(0) == 0\", \"assert cumulative_sum(1) == 1\", \"assert cumulative_sum(2) == 3\", \"assert cumulative_sum(3) == 6\", \"assert cumulative_sum(4) == 10\", \"assert cumulative_sum(5) == 15\", \"assert cumulative_sum(10) == 55\", \"assert cumulativ... | {
"split": "train",
"index": 65819,
"acecode_id": "evol_10333",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `set_verbosity(verbosity: int) -> None` that takes a single integer argument `verbosity` and sets a global variable to the provided value. The function should enforce the following constraints: the input must be an integer and must be greater than or equal ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_verbosity(0) is None\", \"assert set_verbosity(1) is None\", \"assert set_verbosity(5) is None\", \"assert set_verbosity(10) is None\", \"assert set_verbosity(100) is None\", \"assert set_verbosity(0) is None\", \"assert set_verbosity(3) is None\", \"ass... | {
"split": "train",
"index": 65820,
"acecode_id": "bigcode_python_fns_45171",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves the core configuration of a chemical element based on its atomic number. The core configuration is defined as a string that describes the arrangement of electrons in the atomic orbitals. You need to create a function `g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_coreconfig(1) == '1s1'\", \"assert get_coreconfig(2) == '1s2'\", \"assert get_coreconfig(3) == '1s2 2s1'\", \"assert get_coreconfig(4) == '1s2 2s2'\", \"assert get_coreconfig(5) == '1s2 2s2 2p1'\", \"assert get_coreconfig(6) == '1s2 2s2 2p2'\", \"assert ... | {
"split": "train",
"index": 65821,
"acecode_id": "bigcode_python_fns_37455",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that takes a list of employee records and a specific city as input, and returns a list of names of all employees who are located in that city. Each employee record is represented as a dictionary with keys 'name', 'id', and 'city'. If there are no employees in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_employees_in_city([{'name': 'Alice', 'id': 1, 'city': 'New York'}, {'name': 'Bob', 'id': 2, 'city': 'Los Angeles'}, {'name': 'Charlie', 'id': 3, 'city': 'New York'}], 'New York') == ['Alice', 'Charlie']\", \"assert find_employees_in_city([{'name': 'Davi... | {
"split": "train",
"index": 65822,
"acecode_id": "evol_10958",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function sum_of_uniques(limit) that finds the sum of all unique prime numbers below a given positive integer limit. A prime number is considered unique if it does not have any repeated digits. If the limit is less than 2, your function should return 0. The 'limit' param... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_uniques(10) == 17\", \"assert sum_of_uniques(2) == 0\", \"assert sum_of_uniques(0) == 0\", \"assert sum_of_uniques(1) == 0\", \"assert sum_of_uniques(11) == 17\", \"assert sum_of_uniques(12) == 17\"]}"
} | {
"split": "train",
"index": 65823,
"acecode_id": "evol_25414",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the updating of firmware for a Zigbee device based on the provided host address and whether a custom firmware version is specified. The function, `update_firmware(host: str, custom: bool)`, should take two parameters: a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_firmware('10.0.0.1', True) == False\", \"assert update_firmware('10.0.0.2', False) == True\", \"assert update_firmware('172.16.0.1', True) == True\", \"assert update_firmware('192.168.0.20', False) == True\", \"assert update_firmware('10.1.1.1', True)... | {
"split": "train",
"index": 65824,
"acecode_id": "bigcode_python_fns_49057",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function that returns a list containing the first n odd numbers starting from 1. The function should return the odd numbers in ascending order. For example, if n is 5, the output should be [1, 3, 5, 7, 9].\nPlease reason step by step, then write a se... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert odd_numbers_list(1) == [1]\", \"assert odd_numbers_list(2) == [1, 3]\", \"assert odd_numbers_list(3) == [1, 3, 5]\", \"assert odd_numbers_list(4) == [1, 3, 5, 7]\", \"assert odd_numbers_list(5) == [1, 3, 5, 7, 9]\", \"assert odd_numbers_list(6) == [1, 3, 5, ... | {
"split": "train",
"index": 65825,
"acecode_id": "bigcode_python_fns_35756",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python decorator named `log_execution_time` that logs the execution time of a function. The decorator should print the name of the function, its execution time, and the arguments passed to the function. The decorator must handle both positiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_execution_time(example_function)(1, 2, c=3) == 6\", \"assert log_execution_time(example_function)(5, 5) == 10\", \"assert log_execution_time(example_function)(10, 20, c=30) == 60\", \"assert log_execution_time(example_function)(0, 0) == 0\", \"assert log... | {
"split": "train",
"index": 65826,
"acecode_id": "oss_27545",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple video sharing feature for a short video application. Your goal is to create a function that allows users to upload a video by providing the necessary details such as title, description, and video file. The function should validate the i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert upload_video('My First Video', 'This is a description', 'path/to/video.mp4') == 'Video uploaded successfully.'\", \"assert upload_video('', 'This is a description', 'path/to/video.mp4') == 'Error: Title is required.'\", \"assert upload_video('My First Video'... | {
"split": "train",
"index": 65827,
"acecode_id": "evol_9471",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function `find_longest_word(words)` that returns the length of the longest string in the list. If the list is empty, return 0.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_longest_word(['apple', 'banana', 'cherry']) == 6\", \"assert find_longest_word(['dog', 'cat', 'elephant', 'giraffe']) == 8\", \"assert find_longest_word(['a', 'ab', 'abc']) == 3\", \"assert find_longest_word(['']) == 0\", \"assert find_longest_word(['th... | {
"split": "train",
"index": 65828,
"acecode_id": "evol_1928",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns the maximum sum of any contiguous subarray within the list. A contiguous subarray is defined as a sequence of elements that are adjacent in the array. You may assume the input list is non-empty. Implement the function `max... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2, -3, -1]) == -1\", \"assert max_subarray_sum([2, 1, -5, 4, 3, -2, 2]) == 7\", \"assert max_subarray_sum([1, 2, 3, 4, 5]) == 15\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([0, 0, 0, 0]) == 0\", \"asse... | {
"split": "train",
"index": 65829,
"acecode_id": "bigcode_python_fns_40834",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a formatted message. The function should return a dictionary containing a 'subject' key with the value 'Test message' and a 'message' key with the value 'This is a test message'. Please implement the function 'generate_mess... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_message() == {'subject': 'Test message', 'message': 'This is a test message'}\", \"assert generate_message()['subject'] == 'Test message'\", \"assert generate_message()['message'] == 'This is a test message'\", \"assert isinstance(generate_message()... | {
"split": "train",
"index": 65830,
"acecode_id": "bigcode_python_fns_4562",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a header element with specified attributes. The function should take any number of keyword arguments representing the attributes of the header element and return a dictionary that represents the header element with its attr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_header(style='color:red;', lang='en') == {'tag': 'header', 'style': 'color:red;', 'lang': 'en'}\", \"assert create_header(title='Welcome', data_attribute='value') == {'tag': 'header', 'title': 'Welcome', 'data_attribute': 'value'}\", \"assert create_h... | {
"split": "train",
"index": 65831,
"acecode_id": "bigcode_python_fns_2364",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple inventory management system for a grocery store. The function should allow users to perform the following operations in a single call: add items, remove an item, update the quantity of an item, view the current inv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_inventory([('add', 'apple', 10), ('add', 'banana', 15)]) == ({'apple': 10, 'banana': 15}, 0)\", \"assert manage_inventory([('add', 'apple', 10), ('update', 'apple', 20), ('search', 'apple', 0)]) == ({'apple': 20}, 20)\", \"assert manage_inventory([('a... | {
"split": "train",
"index": 65832,
"acecode_id": "oss_21715",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function closest_armstrong_number(n) that determines if n is an Armstrong number. If n is an Armstrong number, return n; otherwise, return the Armstrong number closest to n. An Armstrong number for a given number of digits d is an integer such that t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert closest_armstrong_number(153) == 153\", \"assert closest_armstrong_number(370) == 370\", \"assert closest_armstrong_number(9474) == 9474\", \"assert closest_armstrong_number(9475) == 9474\", \"assert closest_armstrong_number(9) == 9\", \"assert closest_armst... | {
"split": "train",
"index": 65833,
"acecode_id": "evol_21867",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of unique integers, implement a function `lcm(numbers: List[int])` that efficiently calculates the least common multiple (LCM) of these integers. The list will contain at least 2 and at most 10 unique integers where each integer n satisfies 1 <= n <= 10^9. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm([4, 6]) == 12\", \"assert lcm([21, 14, 7]) == 42\", \"assert lcm([10, 25, 5]) == 50\", \"assert lcm([12, 15, 20]) == 60\", \"assert lcm([1, 2]) == 2\", \"assert lcm([5, 10]) == 10\", \"assert lcm([3, 4, 5]) == 60\", \"assert lcm([8, 12]) == 24\", \"asser... | {
"split": "train",
"index": 65834,
"acecode_id": "evol_31228",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a standardized rule name for a CloudWatch event based on the application name and the rule details provided. Write a function that takes in the application name, environment, region, and a dictionary containing the rule details, and returns a prop... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_rule_name('MyApp', {'rule_name': 'Daily Trigger'}) == 'MyApp_Daily_Trigger'\", \"assert generate_rule_name('TestApp', {'rule_name': 'Weekly Task'}) == 'TestApp_Weekly_Task'\", \"assert generate_rule_name('ExampleApp', {'rule_name': 'Monthly Event'})... | {
"split": "train",
"index": 65835,
"acecode_id": "bigcode_python_fns_39272",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a path in a file system, and this path may contain a prefix consisting of any combination of '~', '+', and '/'. Your task is to write a function that removes this prefix and returns the remaining path. The prefix can appear at the beginnin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_prefix_path('~+/home/user/docs') == 'home/user/docs'\", \"assert remove_prefix_path('~/my_folder') == 'my_folder'\", \"assert remove_prefix_path('++hello/world') == 'hello/world'\", \"assert remove_prefix_path('') == ''\", \"assert remove_prefix_path(... | {
"split": "train",
"index": 65836,
"acecode_id": "bigcode_python_fns_21748",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a sequence of numerical inputs, implement a function that calculates the sum of their absolute values, excluding Fibonacci numbers, after rounding up to the nearest integer. For simplicity, consider only positive integers as Fibonacci numbers. Write a function called `cal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sum_without_fibonacci([-8.7, 2, 2]) == 0\", \"assert calculate_sum_without_fibonacci([1, 1, 1]) == 0\", \"assert calculate_sum_without_fibonacci([21, 34, 55]) == 0\", \"assert calculate_sum_without_fibonacci([100, 1, -1]) == 100\", \"assert calcula... | {
"split": "train",
"index": 65837,
"acecode_id": "evol_8299",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates a given aviation weather report type. The report type can either be 'METAR', 'SPECI', or a correction for a METAR report which is represented as 'METAR COR'. The function should return the report type if it is valid, or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_report_type('METAR') == 'METAR'\", \"assert validate_report_type('SPECI') == 'SPECI'\", \"assert validate_report_type('METAR COR') == 'METAR COR'\", \"assert validate_report_type('METAR COR') == 'METAR COR'\", \"assert validate_report_type('SPECI') ... | {
"split": "train",
"index": 65838,
"acecode_id": "bigcode_python_fns_46897",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages OpenAPI Components. The function should support adding and retrieving schemas, responses, parameters, and request bodies using a dictionary structure. You need to implement a function `manage_components(operations)` that take... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_components([{'type': 'add_schema', 'name': 'User', 'schema': {'type': 'object', 'properties': {'id': {'type': 'integer'}, 'name': {'type': 'string'}}}}]) == []\", \"assert manage_components([{'type': 'add_response', 'name': 'UserResponse', 'response':... | {
"split": "train",
"index": 65839,
"acecode_id": "oss_18377",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_anagram_of_palindrome(s: str) -> Tuple[bool, str]` that determines if the input string `s` is an anagram of a palindrome. The string may contain special characters, and only alphanumeric characters should be considered for the palindrome. The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_anagram_of_palindrome('racecar') == (True, 'racecar')\", \"assert is_anagram_of_palindrome('abc') == (False, '')\", \"assert is_anagram_of_palindrome('') == (True, '')\", \"assert is_anagram_of_palindrome('aabb') == (True, 'abba')\", \"assert is_anagram_o... | {
"split": "train",
"index": 65840,
"acecode_id": "evol_35983",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters and returns a list of users based on their permissions. The function should take in a dictionary of users and their corresponding permissions and return a list of users who have been granted access based on specific permi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_authorized_users({'user1': ['read', 'write'], 'user2': ['no_access'], 'user3': ['admin'], 'user4': ['write'], 'user5': ['guest']}) == ['user1', 'user3', 'user4']\", \"assert get_authorized_users({'userA': ['read'], 'userB': ['write'], 'userC': ['admin']}... | {
"split": "train",
"index": 65841,
"acecode_id": "oss_11754",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of labels for a line chart. Your function should return exactly 7 labels, each label being a string in the format 'LabelX', where X is a number from 1 to 7. Implement the function `generate_labels()` that returns thi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_labels() == ['Label1', 'Label2', 'Label3', 'Label4', 'Label5', 'Label6', 'Label7']\", \"assert len(generate_labels()) == 7\", \"assert generate_labels()[0] == 'Label1'\", \"assert generate_labels()[1] == 'Label2'\", \"assert generate_labels()[2] == ... | {
"split": "train",
"index": 65842,
"acecode_id": "oss_18365",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing file paths in a directory structure. Your task is to implement a function `count_files_and_directories(paths: List[str]) -> Tuple[int, int]` that returns a tuple containing the number of files and the number of directories in the giv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_files_and_directories(['file1.txt', 'file2.txt', 'directory1', 'directory2']) == (2, 2)\", \"assert count_files_and_directories(['file1', 'file2', 'directory1', 'directory2', 'directory3']) == (0, 5)\", \"assert count_files_and_directories(['single_fil... | {
"split": "train",
"index": 65843,
"acecode_id": "bigcode_python_fns_10789",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a smart meter's behavior by returning its model based on a given unique identifier. The function should take a unique identifier for a smart meter as input and return a dictionary containing two keys: 'model' for the meter ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_meter_info('aabbccddeeff123456') == {'model': 'Model X', 'friendly_name': 'Product Name (aabbccddeeff123456) Smart Meter Model'}\", \"assert get_meter_info('aabbccddeeff') == {'model': 'Model X', 'friendly_name': 'Product Name (aabbccddeeff) Smart Meter ... | {
"split": "train",
"index": 65844,
"acecode_id": "bigcode_python_fns_7840",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of words and concatenates them into a single string, with each word separated by a space. Write a function `concatenate_greeting(words: List[str]) -> str` that does this. The input will be a list of strings, where each s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate_greeting(['Hello', 'world', 'how', 'are', 'you']) == 'Hello world how are you'\", \"assert concatenate_greeting(['Good', 'morning']) == 'Good morning'\", \"assert concatenate_greeting(['Python', 'is', 'awesome']) == 'Python is awesome'\", \"asser... | {
"split": "train",
"index": 65845,
"acecode_id": "oss_7158",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `find_fibonacci_index(n)` that takes a positive integer n as input and returns the index of n in the Fibonacci sequence. If n is not a positive integer, return 'Error: Input is not a positive integer'. If n does not exist in the Fibonacci sequence, retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_fibonacci_index(1) == 1\", \"assert find_fibonacci_index(0) == 0\", \"assert find_fibonacci_index(2) == 3\", \"assert find_fibonacci_index(3) == 4\", \"assert find_fibonacci_index(5) == 5\", \"assert find_fibonacci_index(8) == 6\", \"assert find_fibonac... | {
"split": "train",
"index": 65846,
"acecode_id": "evol_1768",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates an event authorization check. The function will take an event ID as a string input and return a status code. If the event ID is valid (i.e., it starts with 'event_id_'), the function should return 200, indicating that the a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_event_authorization('event_id_1') == 200\", \"assert check_event_authorization('event_id_2') == 200\", \"assert check_event_authorization('event_id_3') == 200\", \"assert check_event_authorization('invalid_event_1') == 401\", \"assert check_event_autho... | {
"split": "train",
"index": 65847,
"acecode_id": "bigcode_python_fns_9953",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a string containing credit card information and extracts the default card details. The credit card information is provided in the following format: \"Default Card: {card_type}*{last4} Expires {exp_month}/{exp_year} |... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_default_card_details('Default Card: Visa*1234 Expires 12/25 | ') == {'card_type': 'Visa', 'last4': '1234', 'exp_month': '12', 'exp_year': '25'}\", \"assert extract_default_card_details('Default Card: MasterCard*5678 Expires 11/26 | ') == {'card_type'... | {
"split": "train",
"index": 65848,
"acecode_id": "oss_35143",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of positive integers representing the weights of stones. In each round, you select the two heaviest stones and collide them. If the weights of the stones are `x` and `y` where `x <= y`, the outcome is: if `x == y`, both stones are completely destroyed; if `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lastStoneWeight([2, 7, 4, 1, 8, 1]) == 1\", \"assert lastStoneWeight([1, 3, 2, 2]) == 0\", \"assert lastStoneWeight([10, 4, 2, 10]) == 2\", \"assert lastStoneWeight([5, 5, 5, 5]) == 0\", \"assert lastStoneWeight([1]) == 1\", \"assert lastStoneWeight([1, 1]) ... | {
"split": "train",
"index": 65849,
"acecode_id": "evol_27970",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes incoming messages. Your function should check if the message contains the keyword 'ドナルド' (Donald). If the message contains this keyword, your function should return a random response from a predefined list of responses. If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert donald_response('\\u4eca\\u65e5\\u306f\\u30c9\\u30ca\\u30eb\\u30c9\\u306b\\u3064\\u3044\\u3066\\u8a71\\u3057\\u307e\\u3057\\u3087\\u3046\\uff01') in ['\\u30c9\\u30ca\\u30eb\\u30c9\\u306f\\u5049\\u5927\\u306a\\u30ea\\u30fc\\u30c0\\u30fc\\u3067\\u3059\\u3002',... | {
"split": "train",
"index": 65850,
"acecode_id": "oss_25513",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing network IDs, write a function that returns the ID of the network with the highest value. If the list is empty, return -1. The function should be defined as follows: def get_highest_network_id(network_ids: List[int]) -> int: where network_id... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_highest_network_id([1, 2, 3, 4, 5]) == 5\", \"assert get_highest_network_id([10, 20, 30]) == 30\", \"assert get_highest_network_id([-1, -2, -3]) == -1\", \"assert get_highest_network_id([7, 7, 7]) == 7\", \"assert get_highest_network_id([100, 2, 99]) == ... | {
"split": "train",
"index": 65851,
"acecode_id": "bigcode_python_fns_38069",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of event records and returns the oldest and newest event start times based on their start times. Each event record is represented as a dictionary containing the following keys: 'type' (a string representing th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_oldest_and_newest_events([{'type': 'login', 'started': datetime(2022, 1, 15, 8, 0), 'result': 'success'}, {'type': 'logout', 'started': datetime(2022, 1, 15, 12, 0), 'result': 'success'}, {'type': 'payment', 'started': datetime(2022, 1, 15, 10, 0), 'res... | {
"split": "train",
"index": 65852,
"acecode_id": "oss_17512",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that processes a list of GitHub repository URLs and extracts the username and repository name from each URL. Write a function `extract_repo_info` that takes a list of GitHub repository URLs as input and returns a list of tuples, where each... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_repo_info([\\\"https://github.com/XenoXilus/dl\\\", \\\"https://github.com/user/repo\\\", \\\"https://github.com/username/repository\\\"]) == [(\\\"XenoXilus\\\", \\\"dl\\\"), (\\\"user\\\", \\\"repo\\\"), (\\\"username\\\", \\\"repository\\\")]\", \... | {
"split": "train",
"index": 65853,
"acecode_id": "oss_29212",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Write a function `count_positive_numbers(input_numbers)` that returns the count of positive integers in the list. A positive integer is defined as any integer greater than zero. The function should take a single parameter, which is the list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_positive_numbers([-1, -43, 2, 6, 0, 18]) == 3\", \"assert count_positive_numbers([0, 0, 0]) == 0\", \"assert count_positive_numbers([1, 2, 3, 4, 5]) == 5\", \"assert count_positive_numbers([-1, -2, -3]) == 0\", \"assert count_positive_numbers([5, 10, -... | {
"split": "train",
"index": 65854,
"acecode_id": "evol_19449",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary search tree (BST), implement a function `depth_of_bst(root: TreeNode) -> int` that returns the depth of the BST. The depth of a tree is defined as the number of edges in the longest path from the root node to a leaf node. If the tree is empty, return 0. A leaf no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert depth_of_bst(None) == 0\", \"assert depth_of_bst(TreeNode(1)) == 1\", \"assert depth_of_bst(TreeNode(1, TreeNode(2))) == 2\", \"assert depth_of_bst(TreeNode(1, None, TreeNode(3))) == 2\", \"assert depth_of_bst(TreeNode(4, TreeNode(2, TreeNode(1), TreeNode(3)... | {
"split": "train",
"index": 65855,
"acecode_id": "bigcode_python_fns_19319",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats genomic data into a tabular string representation based on given inputs. The function should take in the following parameters: \n\n1. `peak_id` (str): Identifier for the peak. \n2. `chrom` (str): Chromosome number. \n3. `psta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_table('peak1', 'chr1', 100, 200, 150.0, [10, ['featureA', 100, 200, '+', 'attribute1']], ['attribute1'], 90, 'loc1', True, False, 1) == 'peak1\\\\tchr1\\\\t100\\\\t150.0\\\\t200\\\\tfeatureA\\\\t100\\\\t200\\\\t+\\\\t90\\\\t10\\\\tloc1\\\\tTrue\\\\tFa... | {
"split": "train",
"index": 65856,
"acecode_id": "bigcode_python_fns_14987",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of font file names, write a function `filter_fonts(fonts: List[str]) -> List[str]` that returns a new list containing only the font files with extensions `.ttf` or `.otf`. The input list may contain font file names with various extensions and you should ignore case... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_fonts(['font1.ttf', 'font2.otf', 'font3.jpg']) == ['font1.ttf', 'font2.otf']\", \"assert filter_fonts(['FONT1.TTF', 'FONT2.OTF', 'FONT3.PNG']) == ['FONT1.TTF', 'FONT2.OTF']\", \"assert filter_fonts(['font1.TtF', 'font2.oTf']) == ['font1.TtF', 'font2.o... | {
"split": "train",
"index": 65857,
"acecode_id": "bigcode_python_fns_12238",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a JSON schema represented as a dictionary, write a function that checks if all required keys are present in the schema. The required keys must include 'name', 'type', and 'nullable'. If any of these keys are missing, raise a KeyError with a message indicating which key is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert json_to_spark_schema({'name': 'age', 'type': 'integer', 'nullable': True}) is None\", \"assert json_to_spark_schema({'name': 'age', 'type': 'integer', 'nullable': False}) is None\", \"assert json_to_spark_schema({'name': 'height', 'type': 'float', 'nullable'... | {
"split": "train",
"index": 65858,
"acecode_id": "bigcode_python_fns_4489",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the execution of a command to remove a file from a hypothetical storage system. The function should take two parameters: a string representing the file path (fpath) and an optional string representing the host (host). I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_command('/valid/file.txt') == 0\", \"assert execute_command('/invalid/file.txt') == -1\", \"assert execute_command('/valid/another_file.txt') == 0\", \"assert execute_command('/invalid/another_file.txt') == -1\", \"assert execute_command('/valid/test... | {
"split": "train",
"index": 65859,
"acecode_id": "bigcode_python_fns_28469",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of Python versions used in a CI/CD pipeline. Your task is to implement a function that takes in a list of Python versions and updates a given results dictionary. The results dictionary is structured such that each key corresponds to a module and contains an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_python_versions(['3.7'], {'module2': {'python_versions': ['3.6']}}, 'module2') == None and {'module2': {'python_versions': ['3.7']}} == {'module2': {'python_versions': ['3.7']}}\", \"assert update_python_versions(['3.6', '3.9'], {'module3': {}}, 'modu... | {
"split": "train",
"index": 65860,
"acecode_id": "bigcode_python_fns_28713",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates adding books to a library's collection. Implement a function called `add_book_to_collection` that takes a list of book titles and returns a list of unique titles in the order they were added. If a title is added more than o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_book_to_collection(['Python Programming', 'Data Science', 'Python Programming']) == ['Python Programming', 'Data Science']\", \"assert add_book_to_collection(['Harry Potter', 'The Hobbit', 'Harry Potter', '1984']) == ['Harry Potter', 'The Hobbit', '1984'... | {
"split": "train",
"index": 65861,
"acecode_id": "oss_3035",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to process a URL and extract a DOI from a given string. The function should return a list of object URIs, including the URL and the DOI if it exists. The DOI is considered valid if it consists of two parts separated by a slash, and bo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_object_uris('example.com', '1234/5678') == ['example.com/1234/5678']\", \"assert process_object_uris('example.com', '1234/abcd') == ['example.com']\", \"assert process_object_uris('example.com', 'abcd/5678') == ['example.com']\", \"assert process_obj... | {
"split": "train",
"index": 65862,
"acecode_id": "oss_6296",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_second_last_element(input_list)` that returns the second-last element of a list. If the list has fewer than two elements, the function should return 'Error: The length of the list is less than 2'.\nPlease reason step by step, then write a self-containe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_second_last_element([1, 2, 3, 4]) == 3\", \"assert get_second_last_element(['a', 'b', 'c']) == 'b'\", \"assert get_second_last_element([True, False, True]) == False\", \"assert get_second_last_element([10]) == 'Error: The length of the list is less than ... | {
"split": "train",
"index": 65863,
"acecode_id": "evol_11547",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are working on a machine learning project and have been monitoring the training and validation losses of your model over multiple epochs. You have collected the mean and standard deviation of the training and validation losses for each epoch. Your task is to write a functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert plot_losses([0.3, 0.25, 0.2, 0.15, 0.1], [0.02, 0.015, 0.01, 0.008, 0.005], [0.4, 0.35, 0.3, 0.25, 0.2], [0.03, 0.025, 0.02, 0.015, 0.01], 0, 5) == {'train_mean': [0.3, 0.25, 0.2, 0.15, 0.1], 'train_std': [0.02, 0.015, 0.01, 0.008, 0.005], 'val_mean': [0.4, ... | {
"split": "train",
"index": 65864,
"acecode_id": "oss_18740",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string `token`, implement a function `check_token` that returns `True` if the `token` is a valid XML token according to XML Schema Part 2 rules. A valid XML token can be an empty string or must satisfy the following conditions: it should not start or end with whitespace... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_token('') == True\", \"assert check_token('validToken') == True\", \"assert check_token(' validToken') == False\", \"assert check_token('validToken ') == False\", \"assert check_token('valid Token') == True\", \"assert check_token('valid\\tToken') == F... | {
"split": "train",
"index": 65865,
"acecode_id": "bigcode_python_fns_10496",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes candidate end-effector poses for a robotic arm. The function should take in a list of candidate poses and perform several operations on them. Your task is to implement the `process_poses` function to satisfy the foll... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_poses(['pose1'], lambda x: ['conf1', 'conf2'], None) == ['conf1', 'conf2']\", \"assert process_poses(['pose2'], lambda x: ['conf3', 'conf4'], None) == ['conf3', 'conf4']\", \"assert process_poses(['pose3'], lambda x: ['conf5'], None) == ['conf5']\", ... | {
"split": "train",
"index": 65866,
"acecode_id": "oss_25217",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents a resource cache containing various Kubernetes resources, along with a string specifying the ingress controller used in a deployment. Your task is to define a function that determines if there are any services in the resource cache tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert define_service_to_ingress_relationships({'services': {'count': 2}, 'http_proxies': {'count': 1}}, 'CONTOUR') == ['http_proxies']\", \"assert define_service_to_ingress_relationships({'services': {'count': 2}, 'virtual_services': {'count': 0}}, 'ISTIO') == []\... | {
"split": "train",
"index": 65867,
"acecode_id": "bigcode_python_fns_49714",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the parameters of an asteroid impact on Earth, determine the outcome of the impact event based on the size, speed, density, and energy of the asteroid. The outcome can be one of three types: 'Airburst', 'Impact', or 'No Impact'. An asteroid is classified as an Airburst if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert impact_outcome(9.75, 19000, 3300, 2000000) == 'Airburst'\", \"assert impact_outcome(1.0, 5000, 2500, 500000) == 'No Impact'\", \"assert impact_outcome(10.0, 20000, 3500, 5000000) == 'Airburst'\", \"assert impact_outcome(0.5, 1000, 2000, 10000) == 'No Impact'... | {
"split": "train",
"index": 65868,
"acecode_id": "bigcode_python_fns_44888",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_properties(num: int) -> Tuple[str, str, bool]` that takes an integer `num` as input and returns a tuple containing three elements: a string indicating whether the number is 'Even' or 'Odd', its binary representation as a string, and a boolean indicat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_properties(2) == ('Even', '0b10', False)\", \"assert check_properties(3) == ('Odd', '0b11', False)\", \"assert check_properties(4) == ('Even', '0b100', True)\", \"assert check_properties(5) == ('Odd', '0b101', False)\", \"assert check_properties(0) == ... | {
"split": "train",
"index": 65869,
"acecode_id": "evol_19185",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_of_squares` that returns the sum of the squares of all the even integers in the list. If there are no even integers, return 0. The function should take a single parameter, `numbers`, which is a list of integers. For example, for t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares([1, 2, 3, 4]) == 20\", \"assert sum_of_squares([0, 1, 2, 3, 4]) == 20\", \"assert sum_of_squares([5, 7, 9]) == 0\", \"assert sum_of_squares([-2, -4, 3, 5]) == 20\", \"assert sum_of_squares([2, 2, 2]) == 12\", \"assert sum_of_squares([]) == 0\"... | {
"split": "train",
"index": 65870,
"acecode_id": "bigcode_python_fns_15073",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a prompt text based on a configuration setting. The function should take a dictionary as input, which contains a key 'static_what'. If the value of 'static_what' is True, the function should return the string 'Metric na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_prompt({'static_what': True}) == 'Metric names. Example - field1:new_name1 field2:new_name2'\", \"assert generate_prompt({'static_what': False}) == ''\", \"assert generate_prompt({'static_what': True}) == 'Metric names. Example - field1:new_name1 fi... | {
"split": "train",
"index": 65871,
"acecode_id": "oss_35757",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two floating-point numbers, v1 and v2, write a function `calculate_samples(v1: float, v2: float) -> int` that returns an integer representing the number of samples to be taken in a blending tool process. The function should consider the following rules: if v1 and v2 are b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_samples(3.5, 2.1) == 5\", \"assert calculate_samples(0.0, 0.0) == 1\", \"assert calculate_samples(-1.5, 2.0) == 0\", \"assert calculate_samples(1.5, -2.0) == 0\", \"assert calculate_samples(2.7, 3.3) == 5\", \"assert calculate_samples(5.0, 5.0) == ... | {
"split": "train",
"index": 65872,
"acecode_id": "bigcode_python_fns_9881",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of stock symbols and a list of columns you want to retrieve information for. Your task is to create a function `get_stock_info(symbol_list: List[str], columns: List[str]) -> Dict[str, Any]` that simulates retrieving the latest stock data for the provided sy... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_stock_info(['AAPL', 'GOOGL'], ['price', 'volume']) == {'AAPL': {'price': 150.0, 'volume': 1000}, 'GOOGL': {'price': 2800.0, 'volume': 500}}\", \"assert get_stock_info(['AAPL'], ['price']) == {'AAPL': {'price': 150.0}}\", \"assert get_stock_info([], ['pri... | {
"split": "train",
"index": 65873,
"acecode_id": "bigcode_python_fns_6466",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that simulates a simple input mechanism for reading an integer. The function should take a list of integers as input and return the integer that occurs most frequently in the list. If there is a tie, return the smallest integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert most_frequent_integer([1, 2, 3, 1, 2, 1]) == 1\", \"assert most_frequent_integer([4, 5, 6, 5, 6, 6]) == 6\", \"assert most_frequent_integer([7, 8, 9, 7, 8, 9]) == 7\", \"assert most_frequent_integer([10, 10, 10, 11, 11]) == 10\", \"assert most_frequent_integ... | {
"split": "train",
"index": 65874,
"acecode_id": "oss_36862",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_even_numbers(string: str) -> List[str]` that takes a string as input and returns a list of all numeric segments in the string that represent even numbers. A numeric segment is defined as a contiguous sequence of digits, and an even number is one that ends... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_even_numbers('There are 12 apples and 13 oranges.') == ['12']\", \"assert find_even_numbers('My phone number is 202 and my ID is 12345.') == ['202']\", \"assert find_even_numbers('I have 4 dogs, 5 cats, and 6 birds.') == ['4', '6']\", \"assert find_even... | {
"split": "train",
"index": 65875,
"acecode_id": "evol_3657",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `store_user_data(name: str, email: str, phone: str) -> str` that simulates storing user data in a database. The function should accept a user's name, email, and phone number as input parameters, and return a success message if the user is added successfully... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert store_user_data('John Doe', 'john.doe@example.com', '123-456-7890') == 'User added successfully'\", \"assert store_user_data('Jane Smith', 'jane.smith@example.com', '987-654-3210') == 'User added successfully'\", \"assert store_user_data('Alice', 'alice@exam... | {
"split": "train",
"index": 65876,
"acecode_id": "evol_1249",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `lcm(a: int, b: int) -> int` that calculates the Least Common Multiple (LCM) of two given integers `a` and `b` using the Euclidean algorithm. The LCM can be calculated using the formula: lcm(a, b) = (a * b) / gcd(a, b), where gcd is the Greatest Common Divi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm(15, 10) == 30\", \"assert lcm(1, 1) == 1\", \"assert lcm(0, 10) == 0\", \"assert lcm(10, 0) == 0\", \"assert lcm(5, 0) == 0\", \"assert lcm(0, 5) == 0\", \"assert lcm(12, 15) == 60\", \"assert lcm(6, 8) == 24\", \"assert lcm(7, 5) == 35\", \"assert lcm(9... | {
"split": "train",
"index": 65877,
"acecode_id": "evol_19651",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are working on a data processing application that deals with stock market data. You have been given a list of column names representing various features and a result feature. Your task is to write a function that takes the list of column names, removes any duplicates, and r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates(['feature1', 'feature2', 'feature3', 'feature1', 'feature4'], 'result') == ['feature1', 'feature2', 'feature3', 'feature4', 'result']\", \"assert remove_duplicates(['a', 'b', 'a', 'c', 'b'], 'final') == ['a', 'b', 'c', 'final']\", \"assert ... | {
"split": "train",
"index": 65878,
"acecode_id": "oss_23429",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of tuples representing points in a scatter plot. Your function should take two lists of equal length, `x_values` and `y_values`, and return a list of tuples where each tuple consists of a corresponding x and y value ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_scatter_points([1, 2, 3], [4, 5, 6]) == [(1, 4), (2, 5), (3, 6)]\", \"assert generate_scatter_points([0, 0, 0], [1, 2, 3]) == [(0, 1), (0, 2), (0, 3)]\", \"assert generate_scatter_points([], []) == []\", \"assert generate_scatter_points([1], [1]) ==... | {
"split": "train",
"index": 65879,
"acecode_id": "bigcode_python_fns_23862",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `shared_chars(string1: str, string2: str) -> Set[str]` that receives two strings and returns a set of unique characters that are present in both strings. The function should isolate unique characters from both input strings and then determine which characte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shared_chars('python', 'java') == set()\", \"assert shared_chars('abcd', 'efgh') == set()\", \"assert shared_chars('test', 'set') == {'t', 'e', 's'}\", \"assert shared_chars('apple', 'orange') == {'a', 'e'}\", \"assert shared_chars('12345', '54321') == {'1',... | {
"split": "train",
"index": 65880,
"acecode_id": "evol_7766",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Design a function that sorts an array of words in alphabetical order and conducts a binary search for a given target word. The function should return the index of the target word if found, or -1 if it is not present in the array. Implement this in a single function called `sear... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_word(['banana', 'apple', 'orange'], 'apple') == 0\", \"assert search_word(['banana', 'apple', 'orange'], 'banana') == 1\", \"assert search_word(['banana', 'apple', 'orange'], 'orange') == 2\", \"assert search_word(['banana', 'apple', 'orange'], 'grape... | {
"split": "train",
"index": 65881,
"acecode_id": "evol_5345",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a command-line argument parser that supports parsing long-form arguments in the format `--key value`. Each argument may have an optional value associated with it. If no value is provided, the argument should default to a boolean `True`. The pars... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments(['--verbose', '--output', 'output.txt', '--config']) == {'verbose': True, 'output': 'output.txt', 'config': True}\", \"assert parse_arguments(['--key1', '--key2']) == {'key1': True, 'key2': True}\", \"assert parse_arguments(['--input', 'data.... | {
"split": "train",
"index": 65882,
"acecode_id": "oss_23333",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of items and returns a list of formatted strings based on the type of each item. The function should take in a variable number of arguments and iterate through them, performing different actions based on their... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_example('hello', 5, 3.14, [1, 2, 3]) == ['String: hello', 'Integer: 5', 'Float: 3.14', 'List: [1, 2, 3]']\", \"assert list_example(10, 'world', [4, 5], 2.5) == ['Integer: 10', 'String: world', 'List: [4, 5]', 'Float: 2.5']\", \"assert list_example('appl... | {
"split": "train",
"index": 65883,
"acecode_id": "oss_7546",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes a list of URLs as input and returns a dictionary containing the unique domain names as keys and the count of occurrences as values. The domain name should be extracted from the URLs, and any subdomains or paths shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_domain_occurrences(['http://example.com', 'http://example.com/path']) == {'example.com': 2}\", \"assert count_domain_occurrences(['http://test.example.com', 'http://test.example.com/path']) == {'test.example.com': 2}\", \"assert count_domain_occurrence... | {
"split": "train",
"index": 65884,
"acecode_id": "oss_4438",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists representing word distributions for various topics in a Latent Dirichlet Allocation (LDA) model. Each inner list contains probabilities of different words belonging to a specific topic. Your task is to implement a function that takes this list of w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_topic_words([[0.3, 0.1], [0.5, 0.5]], 1) == ['Topic 0: Word 1: 0.3', 'Topic 1: Word 1: 0.5']\", \"assert print_topic_words([[0.4, 0.4, 0.2], [0.1, 0.8, 0.1]], 2) == ['Topic 0: Word 1: 0.4', 'Topic 0: Word 2: 0.4', 'Topic 1: Word 2: 0.8', 'Topic 1: Word... | {
"split": "train",
"index": 65885,
"acecode_id": "oss_21670",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `string_contains_x(test_string: str) -> bool` that checks if the string `test_string` contains at least one occurrence of the alphabetic character 'X'. The function should return `True` if 'X' is present, and `False` otherwise.\nPlease reason step by step, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_contains_x('Hello, World!') == False\", \"assert string_contains_x('X marks the spot') == True\", \"assert string_contains_x('Example text') == False\", \"assert string_contains_x('XYZ') == True\", \"assert string_contains_x('No X here') == True\", \"... | {
"split": "train",
"index": 65886,
"acecode_id": "evol_2511",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function `find_coprime_max_sum(array: list) -> int` to calculate the highest sum of any subarray where the elements are non-neighboring and do not share any common divisor greater than one. A subarray is defined by its starting and ending ind... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_coprime_max_sum([2, 3, 5, 7]) == 10\", \"assert find_coprime_max_sum([1, 2, 3, 4, 5]) == 9\", \"assert find_coprime_max_sum([1, 3, 4, 9, 10]) == 13\", \"assert find_coprime_max_sum([2, 3, 4, 5, 6]) == 8\", \"assert find_coprime_max_sum([1, 4, 7, 10]) ==... | {
"split": "train",
"index": 65887,
"acecode_id": "evol_13744",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of objects, each representing a character with a 'bloodline' attribute that is a list of other characters, implement a function `get_bloodline_character(bloodlines: List[Character], index: int) -> str` that returns the race of the character at the specified index i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_bloodline_character([Character(['Elf', 'Human']), Character(['Orc'])], 0) == 'Elf'\", \"assert get_bloodline_character([Character(['Dwarf']), Character(['Goblin'])], 0) == 'Dwarf'\", \"assert get_bloodline_character([Character([]), Character(['Elf', 'Hum... | {
"split": "train",
"index": 65888,
"acecode_id": "bigcode_python_fns_35990",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that manages library patrons' borrowing records. The function should take a list of borrowing records, with each record containing a patron ID, book title, borrowing date, and return date. The function should return a dictionary where each patron ID maps to a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert overdue_books([{'patron_id': 1, 'book_title': 'Book A', 'borrow_date': '2023-01-01', 'return_date': None}, {'patron_id': 1, 'book_title': 'Book B', 'borrow_date': '2023-01-05', 'return_date': None}, {'patron_id': 2, 'book_title': 'Book C', 'borrow_date': '20... | {
"split": "train",
"index": 65889,
"acecode_id": "evol_1621",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer year, determine if it is a leap year. A leap year is defined as follows: a year is a leap year if it is evenly divisible by 4, except for end-of-century years, which must be evenly divisible by 400 to be considered a leap year. Implement a function `is_leap_yea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_leap_year(2000) == True\", \"assert is_leap_year(1900) == False\", \"assert is_leap_year(2020) == True\", \"assert is_leap_year(2021) == False\", \"assert is_leap_year(1600) == True\", \"assert is_leap_year(1700) == False\", \"assert is_leap_year(2004) ==... | {
"split": "train",
"index": 65890,
"acecode_id": "oss_34033",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers (which can be both positive and negative), implement a function `sum_of_primes(list_num)` that returns the sum of all prime numbers found in the list. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_primes([2, 3, 5, 7, 11, -2, -3]) == 28\", \"assert sum_of_primes([4, 6, 8, 10, 12]) == 0\", \"assert sum_of_primes([-1, -5, -10]) == 0\", \"assert sum_of_primes([0, 1, 2]) == 2\", \"assert sum_of_primes([13, 17, 19, 23]) == 72\", \"assert sum_of_prime... | {
"split": "train",
"index": 65891,
"acecode_id": "evol_21286",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of numerical data points, and you need to implement a function that performs a high-pass filter on this data. The high-pass filter should allow frequencies lower than a specified cutoff frequency to be removed from the data. Your task is to create a functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert highpass_filter([1.0, 2.0, 3.0], 1.5) == [2.0, 3.0]\", \"assert highpass_filter([10.0, 20.0, 30.0], 15.0) == [20.0, 30.0]\", \"assert highpass_filter([-5.0, 0.0, 5.0], 0.0) == [5.0]\", \"assert highpass_filter([0.1, 0.2, 0.3], 0.2) == [0.3]\", \"assert highp... | {
"split": "train",
"index": 65892,
"acecode_id": "bigcode_python_fns_26515",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns a list of required fields for a base asset in a system. The function should not take any input parameters and should return a predefined list of strings representing the required fields. The required fields include: 'assetInf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_base_required_fields() == ['assetInfo', 'assetType', 'dataSource', 'deployment_numbers', 'deployment_number', 'depth', 'editPhase', 'latitude', 'longitude', 'manufactureInfo', 'mobile', 'notes', 'orbitRadius', 'partData', 'physicalInfo', 'purchaseAndDeli... | {
"split": "train",
"index": 65893,
"acecode_id": "bigcode_python_fns_26586",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string of binary data, convert the binary data into its corresponding Unicode characters. Each character is represented by an 8-bit binary sequence. Implement the function `binary_to_unicode(binary: str) -> str`, where `binary` is a string consisting of '0's and '1's. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_to_unicode('0110100001100101011011000110110001101111') == 'hello'\", \"assert binary_to_unicode('0100100001100101011011000110110001101111') == 'Hello'\", \"assert binary_to_unicode('001100010011001000110011') == '123'\", \"assert binary_to_unicode('01... | {
"split": "train",
"index": 65894,
"acecode_id": "evol_32634",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns an instance of a data collector based on the provided data source type. The function should take two parameters: a string representing the data source and a dictionary containing configuration details. The available data sour... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isinstance(get_data_collector_instance('RSS', {'base_url': 'http://test.com', 'rss_header': 'header_info'}), RssDataCollector)\", \"assert isinstance(get_data_collector_instance('REDDIT', {'reddit_client_id': 'client_id', 'reddit_client_secret': 'client_secr... | {
"split": "train",
"index": 65895,
"acecode_id": "bigcode_python_fns_5502",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that, given a string, counts the number of unique words in the string and returns the frequency of each word in a dictionary. The string may contain punctuation, and variations in case should be treated as the same word (e.g., 'Apple' and 'apple' are the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_count('This is a test.') == (4, {'this': 1, 'is': 1, 'a': 1, 'test': 1})\", \"assert word_count('A B C a b c') == (3, {'a': 2, 'b': 2, 'c': 2})\", \"assert word_count('No punctuation here') == (3, {'no': 1, 'punctuation': 1, 'here': 1})\", \"assert word... | {
"split": "train",
"index": 65896,
"acecode_id": "evol_14952",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple command-line tool for a role-playing game (RPG) using Python. The game has a command-line interface where players can input commands to interact with the game world. Your task is to implement a function that simulates the processing of user... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_command('help') == 'Available commands: help, look, move <direction>, attack <enemy>, inventory'\", \"assert process_command('look') == 'You are in the Town Square.'\", \"assert process_command('attack goblin') == 'You attack the goblin.'\", \"assert... | {
"split": "train",
"index": 65897,
"acecode_id": "oss_33687",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list called `cells`, where each inner list represents a cell. Each inner list contains four elements: an integer index, and three `None` values. Your task is to implement a function `process_cells(cells)` that performs the following operations: For each inner... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_cells([[0, None, None, None], [1, None, None, None], [2, None, None, None]]) == [[0, 0, None, 0], [1, None, 1, 1], [2, 4, None, 4]]\", \"assert process_cells([[6, None, None, None], [7, None, None, None]]) == [[6, 12, None, 12], [7, None, 49, 49]]\",... | {
"split": "train",
"index": 65898,
"acecode_id": "oss_18391",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns a new string where all characters are converted to lowercase, except for those characters that are at every 4th index if the length of the string is a multiple of 5. If the length of the string is not a multiple of 5... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lowercase_except_4th_multiple_of_5('Hello World') == 'hello world'\", \"assert lowercase_except_4th_multiple_of_5('Python') == 'python'\", \"assert lowercase_except_4th_multiple_of_5('abcdefghij') == 'abcdefghij'\", \"assert lowercase_except_4th_multiple_of_... | {
"split": "train",
"index": 65899,
"acecode_id": "evol_17840",
"num_tests": 14
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.