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 implementing a function that takes a list of reviews and their corresponding ratings and returns a dictionary where the keys are unique ratings and the values are lists of reviews corresponding to each rating. The input will be a list of tuples, where each t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_reviews_by_rating([('Great product!', 5), ('Not worth the price.', 2), ('Excellent quality!', 5), ('Would not recommend.', 1)]) == {5: ['Great product!', 'Excellent quality!'], 2: ['Not worth the price.'], 1: ['Would not recommend.']}\", \"assert group...
{ "split": "train", "index": 80400, "acecode_id": "evol_17614", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples where each tuple contains two elements: a delay (in seconds) and a string. Your task is to implement a function `say_after_tuples(tuples: List[Tuple[int, str]]) -> List[str]` that returns a list of strings where each string corresponds to the seco...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert say_after_tuples([(1, 'hello'), (2, 'world'), (3, 'foo'), (4, 'bar')]) == ['hello', 'world', 'foo', 'bar']\", \"assert say_after_tuples([(5, 'apple'), (3, 'banana'), (1, 'cherry')]) == ['cherry', 'banana', 'apple']\", \"assert say_after_tuples([(10, 'dog'), ...
{ "split": "train", "index": 80401, "acecode_id": "bigcode_python_fns_40416", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that rotates elements within a numerical list by a single position towards the right, maintaining the order of neighboring elements. The first element of the list becomes the last element. For example, given the input [1, 2, 3, 4], the output should be [4, 1,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transpose_list([1, 2, 3, 4]) == [4, 1, 2, 3]\", \"assert transpose_list([5, 6, 7]) == [7, 5, 6]\", \"assert transpose_list([10]) == [10]\", \"assert transpose_list([]) == []\", \"assert transpose_list([1, 2]) == [2, 1]\", \"assert transpose_list([8, 0, 4, 2]...
{ "split": "train", "index": 80402, "acecode_id": "evol_31828", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of stock prices represented as a list of floats and an integer `n` representing the number of days for the trading window. Your task is to implement a function `trading_window(prices: List[float], n: int) -> List[Optional[float]]` that takes the list of sto...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert trading_window([10.0, 20.5, 15.0, 30.0, 25.0], 2) == [15.0, 30.0, 25.0, None, None]\", \"assert trading_window([5.5, 7.0, 8.5, 6.0, 9.0], 3) == [6.0, 9.0, None, None, None]\", \"assert trading_window([100.0, 200.0, 300.0, 400.0], 1) == [200.0, 300.0, 400.0, ...
{ "split": "train", "index": 80403, "acecode_id": "oss_17880", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers, rows and columns, implement a function `crescentOrderArray(rows, columns)` that returns a 2D array (list of lists) filled with integers in a crescent order starting from 1. The 2D array should have the specified number of rows and columns, with each row fill...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert crescentOrderArray(1, 1) == [[1]]\", \"assert crescentOrderArray(1, 2) == [[1, 2]]\", \"assert crescentOrderArray(2, 1) == [[1], [2]]\", \"assert crescentOrderArray(2, 2) == [[1, 2], [3, 4]]\", \"assert crescentOrderArray(2, 3) == [[1, 2, 3], [4, 5, 6]]\", \...
{ "split": "train", "index": 80404, "acecode_id": "evol_24225", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the finalization of a hashing process using a simplified version of the Blake2b hashing algorithm. Given a byte string `statebuf` representing the current state of the hash and an integer `digest_size` that specifies th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert finalize_hash(b'\\\\x01\\\\x02\\\\x03\\\\x04\\\\x05\\\\x06\\\\x07\\\\x08', 4) == b'\\\\x01\\\\x02\\\\x03\\\\x04'\", \"assert finalize_hash(b'\\\\x01\\\\x02\\\\x03\\\\x04\\\\x05\\\\x06\\\\x07\\\\x08', 8) == b'\\\\x01\\\\x02\\\\x03\\\\x04\\\\x05\\\\x06\\\\x07\...
{ "split": "train", "index": 80405, "acecode_id": "bigcode_python_fns_18265", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers and a skip value. Your task is to return the count of integers in the array after skipping the first 'n' elements specified by the skip value. If the skip value is greater than or equal to the length of the array, return 0. Implement the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_after_skip([1, 2, 3, 4, 5], 2) == 3\", \"assert count_after_skip([10, 20, 30], 1) == 2\", \"assert count_after_skip([5, 15, 25, 35], 4) == 0\", \"assert count_after_skip([], 0) == 0\", \"assert count_after_skip([1, 2, 3], 0) == 3\", \"assert count_afte...
{ "split": "train", "index": 80406, "acecode_id": "bigcode_python_fns_5623", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that sorts a list of integers using a binary search based insertion sort algorithm. The function should take a list of integers as input and return a new list that contains the same integers in sorted order. Do not modify the input list. For example, given ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insertion_sort([8, 6, 1, 9, 4]) == [1, 4, 6, 8, 9]\", \"assert insertion_sort([5]) == [5]\", \"assert insertion_sort([]) == []\", \"assert insertion_sort([3, 2, 1]) == [1, 2, 3]\", \"assert insertion_sort([1, 2, 3]) == [1, 2, 3]\", \"assert insertion_sort([1...
{ "split": "train", "index": 80407, "acecode_id": "evol_1577", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked to create a function called `manage_runners` that simulates the management of different types of runners for executing jobs. The function should accept a list of runner commands, where each command is a dictionary representing the action to be performed. The poss...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_runners([{'action': 'add', 'type': 'AWS_BATCH', 'runner': 'AWSBatchRunner'}, {'action': 'execute'}]) == ['Executed jobs for AWS_BATCH']\", \"assert manage_runners([{'action': 'add', 'type': 'INPROCESS', 'runner': 'InProcessRunner'}, {'action': 'execut...
{ "split": "train", "index": 80408, "acecode_id": "oss_24692", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple command handler for a chatbot that processes commands from users. Implement a function `handle_command(command: str) -> str` that takes a command as input and returns the appropriate response based on the following rules: If the command is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_command('!hello') == 'Hello, world!'\", \"assert handle_command('!time') == '2023-10-01 12:00:00'\", \"assert handle_command('!unknown') == 'Unknown command'\", \"assert handle_command('!time') == '2023-10-01 12:00:00'\", \"assert handle_command('!hel...
{ "split": "train", "index": 80409, "acecode_id": "oss_13324", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a basic calculator function that performs addition, subtraction, multiplication, or division based on the provided operation. The function should take three parameters: two numbers (x and y) and a string operation which can be 'add', 'subtract', 'multiply', or 'divide...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculator(10, 5, 'add') == 15\", \"assert calculator(10, 5, 'subtract') == 5\", \"assert calculator(10, 5, 'multiply') == 50\", \"assert calculator(10, 5, 'divide') == 2.0\", \"assert calculator(10, 0, 'divide') == 'Error! Division by zero is not allowed'\"...
{ "split": "train", "index": 80410, "acecode_id": "evol_32002", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_trade` that takes in a symbol (string), price (float), quantity (int), and strategy (string). The function should create a new trade object and return it. The `Trade` class has the following attributes: id (int), symbol (str), price (float), quantit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_trade('AAPL', 150.0, 10, 'order_imbalance').symbol == 'AAPL'\", \"assert create_trade('GOOGL', 2800.0, 5, 'index_arbitrage').price == 2800.0\", \"assert create_trade('MSFT', 290.0, 20, 'order_imbalance').quantity == 20\", \"assert create_trade('TSLA',...
{ "split": "train", "index": 80411, "acecode_id": "evol_14334", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that translates a provided numeric date in the format DDMMYYYY into its corresponding day of the week and computes the Julian date, which is the number of days that have passed since the beginning of the year. The program should verify if the entered date i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_day_and_julian('01012000') == ('Saturday', 1)\", \"assert find_day_and_julian('29022000') == ('Tuesday', 60)\", \"assert find_day_and_julian('01012001') == ('Monday', 1)\", \"assert find_day_and_julian('29022001') == ('Invalid Date')\", \"assert find_da...
{ "split": "train", "index": 80412, "acecode_id": "evol_29300", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two integers as arguments and returns a tuple containing the maximum value and the minimum value of the two integers.\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 max_min(5, 10) == (10, 5)\", \"assert max_min(-3, -7) == (-3, -7)\", \"assert max_min(0, 0) == (0, 0)\", \"assert max_min(-1, 1) == (1, -1)\", \"assert max_min(100, 50) == (100, 50)\", \"assert max_min(15, 15) == (15, 15)\", \"assert max_min(-10, 10) == (10,...
{ "split": "train", "index": 80413, "acecode_id": "evol_23918", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `print_string_n_times(input_str: str, n: int)` that takes a string `input_str` and an integer `n` as input, and returns a single string that contains `input_str` concatenated `n` times. For example, if `input_str` is 'hello' and `n` is 3, the output should be '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_string_n_times('hello', 3) == 'hellohellohello'\", \"assert print_string_n_times('abc', 0) == ''\", \"assert print_string_n_times('test', 1) == 'test'\", \"assert print_string_n_times('', 5) == ''\", \"assert print_string_n_times('x', -2) == ''\", \"as...
{ "split": "train", "index": 80414, "acecode_id": "evol_16077", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that initializes a dictionary of hyperparameters for a machine learning model. The function should return a dictionary containing the following hyperparameters: 'batch_size', 'num_hidden_layers', 'hidden_size', 'filter_size', 'num_hea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_hyperparameters() == {'batch_size': 4096, 'num_hidden_layers': 6, 'hidden_size': 512, 'filter_size': 2048, 'num_heads': 8, 'latent_size': 512, 'n_posterior_layers': 4, 'n_decoder_layers': 6, 'dropout': 0.1, 'layer_prepostprocess_dropout': 0.1, 'at...
{ "split": "train", "index": 80415, "acecode_id": "bigcode_python_fns_39268", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a park code. Your task is to determine if the park code is valid or not. A valid park code must be exactly 4 characters long and contain only uppercase letters. Write a function `is_valid_park_code(park_code: str) -> bool` that returns True i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_park_code('YELL') == True\", \"assert is_valid_park_code('YEL') == False\", \"assert is_valid_park_code('YEL123') == False\", \"assert is_valid_park_code('YELL123') == False\", \"assert is_valid_park_code('Y') == False\", \"assert is_valid_park_code...
{ "split": "train", "index": 80416, "acecode_id": "bigcode_python_fns_15611", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `bucket_operations(bucket_name: str, region: str) -> List[str]` that takes a bucket name and a region as parameters. This function should simulate the operations of creating a bucket, deleting a bucket, uploading a file to the bucket, downloading a file fro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bucket_operations('my-test-bucket', 'us-east-2') == ['Bucket created', 'Bucket deleted', 'File uploaded', 'File downloaded', 'Files listed']\", \"assert bucket_operations('another-bucket', 'us-west-1') == ['Bucket created', 'Bucket deleted', 'File uploaded',...
{ "split": "train", "index": 80417, "acecode_id": "evol_29836", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a file's content. Your task is to implement a function that overwrites the first character of the string with the character 'x'. If the string is empty, return an empty string. The function should return the modified string. Write a function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert overwrite_first_character('Hello') == 'xello'\", \"assert overwrite_first_character('World') == 'xorld'\", \"assert overwrite_first_character('') == ''\", \"assert overwrite_first_character('Python') == 'xython'\", \"assert overwrite_first_character('a') == ...
{ "split": "train", "index": 80418, "acecode_id": "bigcode_python_fns_44636", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of voting methods represented as strings. Your task is to implement a function that generates a sequence of tuples. Each tuple should contain the index (from 0 to 14) and the list of voting methods. The function should yield these tuples one by one. Impleme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list(case_args(['First-Past-The-Post', 'Ranked Choice Voting'])) == [(0, ['First-Past-The-Post', 'Ranked Choice Voting']), (1, ['First-Past-The-Post', 'Ranked Choice Voting']), (2, ['First-Past-The-Post', 'Ranked Choice Voting']), (3, ['First-Past-The-Post',...
{ "split": "train", "index": 80419, "acecode_id": "bigcode_python_fns_43912", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a two-dimensional matrix of dimensions NxN, where each cell contains a unique integer value ranging from 1 to N*N, implement a function `minPath(grid, k)` that returns a list of the k smallest values from the matrix. You can start from any cell and move to adjacent cells ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minPath([[1,2,3], [4,5,6], [7,8,9]], 3) == [1, 2, 3]\", \"assert minPath([[1, 10], [2, 9]], 2) == [1, 2]\", \"assert minPath([[5, 8, 1], [4, 3, 2], [6, 7, 9]], 4) == [1, 2, 3, 4]\", \"assert minPath([[9, 8, 7], [6, 5, 4], [3, 2, 1]], 3) == [1, 2, 3]\", \"ass...
{ "split": "train", "index": 80420, "acecode_id": "evol_8730", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_first_n_fibonacci(n: int) -> List[int]` that returns the first `n` values in the Fibonacci sequence. The Fibonacci sequence is defined as follows: the first two values are 0 and 1, and each subsequent value is the sum of the two preceding values. Your ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_first_n_fibonacci(0) == []\", \"assert get_first_n_fibonacci(1) == [0]\", \"assert get_first_n_fibonacci(2) == [0, 1]\", \"assert get_first_n_fibonacci(3) == [0, 1, 1]\", \"assert get_first_n_fibonacci(4) == [0, 1, 1, 2]\", \"assert get_first_n_fibonacci...
{ "split": "train", "index": 80421, "acecode_id": "evol_15865", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_user_profile(user_id: str, user_name: str, user_email: str, profession: str, experience_level: str) -> dict` that takes in user profile data and returns a dictionary representing the user profile. Each profile should include the keys 'user_id', 'use...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_user_profile('1', 'Alice', 'alice@example.com', 'Engineer', 'Senior') == {'user_id': '1', 'user_name': 'Alice', 'user_email': 'alice@example.com', 'profession': 'Engineer', 'experience_level': 'Senior'}\", \"assert create_user_profile('2', 'Bob', 'bob...
{ "split": "train", "index": 80422, "acecode_id": "evol_24714", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given three float numbers: Stokes I, Stokes Q, and Stokes U. Write a function `calc_fraction(i: float, q: float, u: float, transmission_correction: float = 1) -> float` that calculates the fractional polarization based on the following formula: \n\n pol_fraction = sq...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_fraction(1.0, 0.0, 0.0) == 0.0\", \"assert calc_fraction(5.0, 0.0, 0.0) == 0.0\", \"assert calc_fraction(0.0, 1.0, 1.0) == float('inf')\", \"assert calc_fraction(2.0, 0.0, 0.0) == 0.0\", \"assert calc_fraction(0.0, 0.0, 0.0) == float('inf')\", \"assert ...
{ "split": "train", "index": 80423, "acecode_id": "bigcode_python_fns_41968", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a dictionary-like object called `Packet`. This object only allows you to set values for a specific key, which is `uint8`. The value assigned to `uint8` must be an integer between 0 and 255, inclusive. If the value is outside this range or is of a type other than a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_uint8_value(Packet(), 0) is None\", \"assert set_uint8_value(Packet(), 255) is None\", \"assert set_uint8_value(Packet(), 128) is None\", \"assert set_uint8_value(Packet(), 255) is None\", \"assert set_uint8_value(Packet(), 100) is None\", \"assert set_u...
{ "split": "train", "index": 80424, "acecode_id": "bigcode_python_fns_9215", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing the accuracy of language recognition models. Create a function `calculate_language_accuracy(results)` that takes a dictionary `results` as input, where the keys are language names and the values are lists of three integers: the number of correct id...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_language_accuracy({'Python': [90, 100, 90], 'Java': [80, 100, 80], 'C++': [70, 100, 70]}) == [('Python', 90.0), ('Java', 80.0), ('C++', 70.0)]\", \"assert calculate_language_accuracy({'Mandarin': [100, 100, 100], 'Japanese': [90, 100, 90], 'Korean'...
{ "split": "train", "index": 80425, "acecode_id": "oss_20372", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given three numbers x, c, and e, write a function that checks if the number x lies within the epsilon neighborhood of c. The epsilon neighborhood is defined as the interval [c - e, c + e]. Your function should return True if x is within this interval, otherwise return False. Yo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lies_in_epsilon(5, 10, 5) == True\", \"assert lies_in_epsilon(10, 10, 0) == True\", \"assert lies_in_epsilon(10, 10, 10) == True\", \"assert lies_in_epsilon(0, 10, 10) == True\", \"assert lies_in_epsilon(10, 10, 1) == True\", \"assert lies_in_epsilon(9, 10, ...
{ "split": "train", "index": 80426, "acecode_id": "bigcode_python_fns_28077", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `manage_cache` that simulates a simple cache mechanism. The function should accept a list of operations where each operation is a tuple consisting of an action ('get', 'put', 'delete') followed by the relevant parameters. The 'put' operation includes an ID ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_cache([('put', 1, 'A'), ('put', 2, 'B'), ('put', 3, 'C'), ('get', 1)]) == ['A']\", \"assert manage_cache([('put', 1, 'A'), ('put', 2, 'B'), ('get', 3)]) == [-1]\", \"assert manage_cache([('put', 1, 'A'), ('put', 2, 'B'), ('put', 3, 'C'), ('put', 4, 'D...
{ "split": "train", "index": 80427, "acecode_id": "evol_9119", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of strings, each representing the name of a winner in a competition. Your task is to write a function that combines these names into a single string, with each name separated by a comma and a space. If the input list is empty, the function should return an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_winner_list([]) == ''\", \"assert generate_winner_list(['Alice']) == 'Alice'\", \"assert generate_winner_list(['Bob', 'Carol']) == 'Bob, Carol'\", \"assert generate_winner_list(['Dave', 'Eve', 'Frank']) == 'Dave, Eve, Frank'\", \"assert generate_win...
{ "split": "train", "index": 80428, "acecode_id": "bigcode_python_fns_10802", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Determine if a given number is a Lychrel number. A Lychrel number is defined as a number that does not form a palindrome within 50 iterations of repeatedly reversing its digits and adding the result to the original number. Implement a function that takes an integer n (1 <= n < ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_lychrel(196) == True\", \"assert is_lychrel(4994) == True\", \"assert is_lychrel(349) == False\", \"assert is_lychrel(47) == False\", \"assert is_lychrel(123) == False\", \"assert is_lychrel(100) == False\", \"assert is_lychrel(9999) == True\", \"assert i...
{ "split": "train", "index": 80429, "acecode_id": "evol_18464", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a mock representation of an air conditioner. Your function should simulate the behavior of an air conditioner by returning predefined values for various attributes and methods. Implement a function called `get_air_conditioner_mock(said: str) -> dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_air_conditioner_mock('Living Room') == {'name': 'TestZone', 'is_online': True, 'is_power_on': True, 'mode': 'Cool', 'fan_speed': 'Auto', 'current_temp': 15, 'desired_temp': 20, 'current_humidity': 80, 'desired_humidity': 50, 'h_louver_swing': True}\", \"...
{ "split": "train", "index": 80430, "acecode_id": "bigcode_python_fns_35326", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers representing unique volume IDs and simulates the creation of snapshots for each volume. Your function should iterate through the list of volume IDs and perform a snapshot operation for each one. Since we cann...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_snapshots([1, 2, 3]) == ['Snapshot created for volume ID: 1', 'Snapshot created for volume ID: 2', 'Snapshot created for volume ID: 3']\", \"assert create_snapshots([10, 20, 30]) == ['Snapshot created for volume ID: 10', 'Snapshot created for volume I...
{ "split": "train", "index": 80431, "acecode_id": "bigcode_python_fns_40519", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating mouse events by implementing a function `generate_mouse_events(flags: int, x: int, y: int, data: int = 0) -> str`. The function should return a string that describes the type of mouse event generated based on the provided `flags`, `x`, `y`, and `d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_mouse_events(1, 100, 200) == 'Left button clicked'\", \"assert generate_mouse_events(2, 150, 250) == 'Right button clicked'\", \"assert generate_mouse_events(4, 300, 400) == 'Mouse moved to (300, 400)'\", \"assert generate_mouse_events(3, 100, 100) ...
{ "split": "train", "index": 80432, "acecode_id": "bigcode_python_fns_9043", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working on a machine learning project and need to implement a scoring function. Your task is to implement a function `calculate_scores(confidence, class_probs, classes)` that calculates the final scores based on the following rules: \n- If `classes` is equal to 1, the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_scores([[0.9]], [[0.5]], 1) == [[0.9]]\", \"assert calculate_scores([[0.5, 0.5]], [[0.1, 0.1]], 2) == [[0.05, 0.05]]\", \"assert calculate_scores([[0.0, 0.0]], [[0.1, 0.2]], 2) == [[0.0, 0.0]]\", \"assert calculate_scores([[0.3]], [[0.4]], 1) == [[...
{ "split": "train", "index": 80433, "acecode_id": "oss_17624", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a user is the owner of a resource. The function should take two parameters: `user_id` (an integer representing the ID of the user) and `resource_owner_id` (an integer representing the ID of the owner of the resource). The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_owner(1, 1) == True\", \"assert is_owner(2, 2) == True\", \"assert is_owner(3, 4) == False\", \"assert is_owner(10, 10) == True\", \"assert is_owner(0, 0) == True\", \"assert is_owner(-1, -1) == True\", \"assert is_owner(5, 6) == False\", \"assert is_owne...
{ "split": "train", "index": 80434, "acecode_id": "oss_30896", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that manages a list of Tmux sessions. Your function should handle the scenario where there are no existing Tmux sessions. If the list is empty, the function should return a message indicating that a new session should be added. Oth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_tmux_sessions([]) == 'No Tmux sessions exist. Please add a new session.'\", \"assert manage_tmux_sessions(['session1']) == 'Tmux sessions already exist.'\", \"assert manage_tmux_sessions(['session1', 'session2']) == 'Tmux sessions already exist.'\", \...
{ "split": "train", "index": 80435, "acecode_id": "oss_27319", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of words and their corresponding definitions. Each word is associated with one or more definitions. Your goal is to extract and format these definitions into a specific string format. The function should take ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_definitions({'apple': ['A fruit', 'A tech company'], 'banana': ['A yellow fruit'], 'cherry': []}) == ['Word: apple\\\\nDefinitions: A fruit; A tech company', 'Word: banana\\\\nDefinitions: A yellow fruit', 'Word: cherry\\\\nDefinitions: None']\", \"as...
{ "split": "train", "index": 80436, "acecode_id": "oss_11693", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two integers, start and end, and returns a list of the cubed values of all whole numbers in the inclusive range from start to end. The function should ensure that both inputs are integers and that start is less than or equal to end. If the inputs...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cubed_range(1, 3) == [1, 8, 27]\", \"assert cubed_range(0, 2) == [0, 1, 8]\", \"assert cubed_range(-2, 2) == [-8, -1, 0, 1, 8]\", \"assert cubed_range(-1, 1) == [-1, 0, 1]\", \"assert cubed_range(5, 5) == [125]\", \"assert cubed_range(2, 4) == [8, 27, 64]\",...
{ "split": "train", "index": 80437, "acecode_id": "evol_7034", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates a MongoDB role definition ID. The function should take a dictionary as input, where the key 'mongo_role_definition_id' may contain a string representing the ID or None. If the ID is not None, the function should return the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_mongo_role_definition_id({'mongo_role_definition_id': '12345'}) == _parse_resource_path('12345', False, 'mongodbRoleDefinitions')\", \"assert validate_mongo_role_definition_id({'mongo_role_definition_id': None}) == None\", \"assert validate_mongo_ro...
{ "split": "train", "index": 80438, "acecode_id": "bigcode_python_fns_31708", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers, `a` and `b`, implement a function that returns their least common multiple (LCM). The LCM of two integers is the smallest positive integer that is divisible by both numbers. Write a function `compute_lcm(a: int, b: int) -> int` that computes the LCM of `a` a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_lcm(4, 10) == 20\", \"assert compute_lcm(12, 15) == 60\", \"assert compute_lcm(7, 3) == 21\", \"assert compute_lcm(5, 10) == 10\", \"assert compute_lcm(9, 6) == 18\", \"assert compute_lcm(8, 12) == 24\", \"assert compute_lcm(21, 14) == 42\", \"assert...
{ "split": "train", "index": 80439, "acecode_id": "evol_23431", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing the provinces of a country. Each province has a short name and contains information about the number of cases and deaths due to a disease. Write a function that checks if each province in the provided dictionary has valid entries for both...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_provinces({'AB': {'c': 10, 'd': 1}, 'BC': {'c': 5, 'd': 2}}) == True\", \"assert validate_provinces({'AB': {'c': 0, 'd': 1}, 'BC': {'c': 5, 'd': 2}}) == False\", \"assert validate_provinces({'AB': {'c': 10, 'd': 0}, 'BC': {'c': 5, 'd': 2}}) == False...
{ "split": "train", "index": 80440, "acecode_id": "bigcode_python_fns_5972", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `can_sort_with_operations(numbers)` that takes a list of integers, `numbers`, which contains N integers from 1 to 10^6 in random order. Your task is to determine if it's possible to sort this list into non-decreasing order by performing the following operat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_sort_with_operations([]) == True\", \"assert can_sort_with_operations([1, 2, 3]) == True\", \"assert can_sort_with_operations([1, 3, 2, 4]) == True\", \"assert can_sort_with_operations([1, 2, 4, 3]) == True\", \"assert can_sort_with_operations([10]) == T...
{ "split": "train", "index": 80441, "acecode_id": "evol_1240", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function `count_unique_elements(arr)` that takes an unsorted array of integers and returns a tuple containing two elements: the count of unique numerical elements and a dictionary that maps each unique element to its frequency in the array. The function should consider ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_elements([1, 2, 2, 5, 5, 5, 0, 7, 7, 7, 7, 10, 10]) == (6, {1: 1, 2: 2, 5: 3, 0: 1, 7: 4, 10: 2})\", \"assert count_unique_elements([]) == (0, {})\", \"assert count_unique_elements([0, 0, 0, 0]) == (1, {0: 4})\", \"assert count_unique_elements([...
{ "split": "train", "index": 80442, "acecode_id": "evol_4542", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to write a function `find_unique_numbers(nums: List[int]) -> List[int]` that returns a list of unique integers from the input list in the order they first appeared. A unique integer is defined as one that appears exactly once in th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_unique_numbers([1, 2, 2, 3, 4, 4]) == [1, 3]\", \"assert find_unique_numbers([5, 5, 5, 6, 7, 7]) == [6]\", \"assert find_unique_numbers([8, 9, 10, 10, 11, 12, 8]) == [9, 11, 12]\", \"assert find_unique_numbers([1, 2, 3, 1, 2, 3]) == []\", \"assert find_...
{ "split": "train", "index": 80443, "acecode_id": "oss_7717", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a two-dimensional list (matrix) of integers, implement a function that returns a list of the integers in a clockwise winding order starting from the top-left corner of the matrix. The function should handle matrices of varying sizes, including empty matrices. For example,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clockwise_rotation([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [1, 2, 3, 6, 9, 8, 7, 4, 5]\", \"assert clockwise_rotation([[1]]) == [1]\", \"assert clockwise_rotation([[1, 2], [3, 4]]) == [1, 2, 4, 3]\", \"assert clockwise_rotation([[1, 2, 3, 4], [5, 6, 7, 8], [9,...
{ "split": "train", "index": 80444, "acecode_id": "evol_12534", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats an error message for a command-line application. The function should take two parameters: a string `app_name` which represents the name of the application, and a string `message` which represents the error message. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_error_message('app.py', 'File not found') == 'app.py: error: File not found'\", \"assert format_error_message('test_script', 'Invalid input') == 'test_script: error: Invalid input'\", \"assert format_error_message('main', 'Connection timed out') == 'm...
{ "split": "train", "index": 80445, "acecode_id": "bigcode_python_fns_40955", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers as input and returns a dictionary where each unique integer is a key, and the value is the count of how many times that integer appears in the list. Implement a function `count_integers(nums: List[int]) -> Di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_integers([1, 2, 2, 3, 3, 3]) == {1: 1, 2: 2, 3: 3}\", \"assert count_integers([]) == {}\", \"assert count_integers([5]) == {5: 1}\", \"assert count_integers([1, 1, 1, 1]) == {1: 4}\", \"assert count_integers([0, 0, 1, 1, 2]) == {0: 2, 1: 2, 2: 1}\", \"...
{ "split": "train", "index": 80446, "acecode_id": "bigcode_python_fns_14456", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a webpage title. Your task is to determine if the title of the webpage indicates that it is the home page or the login page. The home page title is defined as containing the phrase 'AAA Home', while the login page title must contain the phras...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_page_title('AAA Home') == 'Home'\", \"assert check_page_title('AAA Log in') == 'Login'\", \"assert check_page_title('Welcome to the AAA website') == 'Unknown'\", \"assert check_page_title('AAA Home Page') == 'Home'\", \"assert check_page_title('Login t...
{ "split": "train", "index": 80447, "acecode_id": "bigcode_python_fns_11413", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given three integers A, B, and C. Write a function to calculate the minimum number of times you need to add C to A such that the result is greater than B. If it is not possible to make A greater than B by adding C, return -1. Your function should take three parameters A...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_additions(10, 30, 5) == 4\", \"assert min_additions(10, 30, 0) == -1\", \"assert min_additions(5, 25, 5) == 4\", \"assert min_additions(10, 30, 20) == 1\", \"assert min_additions(100, 200, 10) == 10\", \"assert min_additions(1, 2, 1) == 1\", \"assert min...
{ "split": "train", "index": 80448, "acecode_id": "oss_37387", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `add_to_lexicon(keytype: str, description: str) -> None` that adds a specific form of Keytype and its corresponding description to a global lexicon dictionary. The function should not return any value. The lexicon is defined as a global dictionary that star...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_to_lexicon('KeyType1', 'Description of KeyType1') is None\", \"assert add_to_lexicon('KeyType2', 'Description of KeyType2') is None\", \"assert add_to_lexicon('KeyType3', 'Description of KeyType3') is None\", \"assert add_to_lexicon('KeyType1', 'Updated ...
{ "split": "train", "index": 80449, "acecode_id": "evol_26021", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings, `string` and `sub`, write a function `is_subsequence(string: str, sub: str) -> bool` that determines whether `sub` is a subsequence of `string`. A subsequence is defined as a sequence that appears in the same relative order, but not necessarily contiguous. Fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_subsequence('abcde', 'ace') == True\", \"assert is_subsequence('abc', 'abc') == True\", \"assert is_subsequence('hello', 'hlo') == True\", \"assert is_subsequence('abcdef', 'ace') == True\", \"assert is_subsequence('abcdef', 'aec') == False\", \"assert is...
{ "split": "train", "index": 80450, "acecode_id": "evol_23227", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that takes a list of integers as input and returns the sum of all the odd numbers in the list. If the input list is empty or does not contain any odd numbers, the function should return 0. Write a function named `sum_of_odd_num...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_odd_numbers([]) == 0\", \"assert sum_of_odd_numbers([2, 4, 6, 8]) == 0\", \"assert sum_of_odd_numbers([1, 3, 5]) == 9\", \"assert sum_of_odd_numbers([1, 2, 3, 4]) == 4\", \"assert sum_of_odd_numbers([0, 1, 2, 3]) == 4\", \"assert sum_of_odd_numbers([1...
{ "split": "train", "index": 80451, "acecode_id": "oss_6271", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes data from a music forum and generates a dictionary containing information about the forum topics and their corresponding responses. The function should take a list of topic dictionaries as input, where each dictionar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_music_forum_dict([{'_id': 1, 'author': 'Alice', 'title': 'Best Albums', 'responses': [{'title': 'I agree!', 'author': 'Bob'}, {'title': 'Check this out!', 'author': 'Charlie'}]}]) == {'topics': [{'topic_id': '1', 'author': 'Alice', 'title': 'Best Al...
{ "split": "train", "index": 80452, "acecode_id": "oss_12092", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function named `super_categories` that determines the categories of a given finite dimensional algebraic structure known as a Hopf algebra with a basis over the rational numbers. The function should return a list of strings representing the ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert super_categories() == ['Category of finite dimensional bialgebras with basis over Rational Field', 'Category of hopf algebras with basis over Rational Field']\", \"assert super_categories() == ['Category of finite dimensional bialgebras with basis over Ratio...
{ "split": "train", "index": 80453, "acecode_id": "oss_30712", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns the maximum sum of non-adjacent elements from the list. The function should ensure that no two selected numbers are adjacent to each other. For example, given the input list [2, 4, 6, 2, 5], the m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_non_adjacent_sum([1, 2, 3, 4, 5]) == 9\", \"assert max_non_adjacent_sum([5]) == 5\", \"assert max_non_adjacent_sum([3, 2, 7, 10]) == 13\", \"assert max_non_adjacent_sum([1, 2, 3, 1]) == 4\", \"assert max_non_adjacent_sum([2, 1, 3, 4]) == 6\", \"assert ma...
{ "split": "train", "index": 80454, "acecode_id": "bigcode_python_fns_38576", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with comparing the configurations of network devices. Implement a function `compare_configurations(devices: Dict[str, Tuple[str, int, str]], old_devices: Dict[str, Tuple[str, int, str]]) -> List[str]` that takes two dictionaries as input. Each dictionary contains...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_configurations({'device1': ('192.168.1.1', 8080, 'configA')}, {'device1': ('192.168.1.1', 8080, 'configA')}) == []\", \"assert compare_configurations({'device1': ('192.168.1.1', 8080, 'configA')}, {'device1': ('192.168.1.1', 8080, 'configB')}) == ['d...
{ "split": "train", "index": 80455, "acecode_id": "oss_153", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of transactions, where each transaction is represented by a tuple containing the supplier alias, company alias, and new owner alias. Your task is to implement a function that processes these transactions and returns a list of strings indicating the result o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transfer_ownership([('supplier1', 'company1', 'new_owner1'), ('supplier2', 'company2', 'new_owner2')]) == ['supplier1 successfully sent a account ownership transfer request to new_owner1 new_owner1@example.com', 'supplier2 successfully sent a account ownersh...
{ "split": "train", "index": 80456, "acecode_id": "bigcode_python_fns_48040", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves the original URL from a shortened URL ID. Given an integer ID, the function should return the original URL as a string if it exists; otherwise, return 'Link not found'. You can assume that there is a predefined mapping ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_original_url(1) == 'https://www.example.com'\", \"assert get_original_url(2) == 'https://www.test.com'\", \"assert get_original_url(3) == 'https://www.openai.com'\", \"assert get_original_url(4) == 'Link not found'\", \"assert get_original_url(0) == 'Lin...
{ "split": "train", "index": 80457, "acecode_id": "oss_25016", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of contours represented as tuples, where each tuple contains the coordinates (cX, cY) of the contour center and a boolean indicating whether the contour should be filtered out, implement a function `filter_contours(contours: List[Tuple[int, int, bool]]) -> List[Tup...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_contours([(100, 200, True), (150, 250, False), (200, 300, False)]) == [(150, 250), (200, 300)]\", \"assert filter_contours([(50, 75, True), (60, 80, True), (70, 90, True)]) == []\", \"assert filter_contours([(10, 20, False), (30, 40, True), (50, 60, F...
{ "split": "train", "index": 80458, "acecode_id": "bigcode_python_fns_4840", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 9x9 Sudoku board represented as a list of lists, where empty cells are denoted by 0, implement a function named `solve_sudoku` that fills in the board such that each row, column, and 3x3 sub-box contains all digits from 1 to 9. The Sudoku board has a unique solution tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve_sudoku([[5, 3, 0, 0, 7, 0, 0, 0, 0], [6, 0, 0, 1, 9, 5, 0, 0, 0], [0, 9, 8, 0, 0, 0, 0, 6, 0], [8, 0, 0, 0, 6, 0, 0, 0, 3], [4, 0, 0, 8, 0, 3, 0, 0, 1], [7, 0, 0, 0, 2, 0, 0, 0, 6], [0, 6, 0, 0, 0, 0, 2, 8, 0], [0, 0, 0, 4, 1, 9, 0, 0, 5], [0, 0, 0, 0,...
{ "split": "train", "index": 80459, "acecode_id": "evol_15322", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a string `a_string` that contains only digits. Write a function `calculate_sum_and_sequence(a_string)` that computes the sum of all the digits in the string and constructs a string representation of the addition sequence of those digits. The function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum_and_sequence('12345') == ['1+2+3+4+5', 15]\", \"assert calculate_sum_and_sequence('00007') == ['0+0+0+0+7', 7]\", \"assert calculate_sum_and_sequence('9876543210') == ['9+8+7+6+5+4+3+2+1+0', 45]\", \"assert calculate_sum_and_sequence('1') == ['...
{ "split": "train", "index": 80460, "acecode_id": "oss_2663", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `text` and a regular expression `pattern` which extracts a specific field from the text. Implement a function `extract_field(text: str, field: str, pattern: str) -> str` that returns the value of the specified field if it matches the pattern, or 'None' if...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_field('Name: John, Age: 30', 'Age', r'Age: (?P<Age>\\\\d+)') == '30'\", \"assert extract_field('User: Alice; Score: 85', 'Score', r'Score: (?P<Score>\\\\d+)') == '85'\", \"assert extract_field('Temperature: 22 degrees', 'Temperature', r'Temperature: ...
{ "split": "train", "index": 80461, "acecode_id": "bigcode_python_fns_20103", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of 32-bit unsigned integers represented in little-endian format. Your task is to implement a function that calculates the sum of all the integers in the list. The function should take a single parameter, which is a list of integers, and return the sum of th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_integers([1, 2, 3]) == 6\", \"assert sum_of_integers([0]) == 0\", \"assert sum_of_integers([]) == 0\", \"assert sum_of_integers([100, 200, 300, 400]) == 1000\", \"assert sum_of_integers([10, 20, 30]) == 60\", \"assert sum_of_integers([5, 15, 25]) == 4...
{ "split": "train", "index": 80462, "acecode_id": "oss_13228", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `retry_api_call` that attempts to make an API call with a retry mechanism. The function should take two parameters: `max_retries` (an integer) and `make_api_call` (a function that simulates making an API call). The `make_api_call` function raises a `CustomA...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retry_api_call(5, make_api_call) is None\", \"assert retry_api_call(0, make_api_call) is None\", \"assert retry_api_call(3, make_api_call) is None\", \"assert retry_api_call(5, make_api_call) is None\", \"assert retry_api_call(4, make_api_call) is None\", \"...
{ "split": "train", "index": 80463, "acecode_id": "evol_7191", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a string representing a sentence. Your task is to implement a function that counts the number of distinct words in the sentence. A word is defined as a sequence of characters separated by spaces, and words are case-insensitive. For example, 'Hello world' and 'hell...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_distinct_words('Hello world') == 2\", \"assert count_distinct_words('hello WORLD') == 2\", \"assert count_distinct_words('This is a test') == 4\", \"assert count_distinct_words('Test test test') == 1\", \"assert count_distinct_words('') == 0\", \"asser...
{ "split": "train", "index": 80464, "acecode_id": "oss_18590", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of times each emotion was recorded. Your task is to implement a function that determines if there are at least 20 occurrences for all emotions in the input list. Return True if every emotion has at least 20 occurrences, o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_emotion_data([25, 30, 20, 22, 15]) == False\", \"assert validate_emotion_data([20, 20, 20, 20, 20]) == True\", \"assert validate_emotion_data([21, 22, 20, 19, 25]) == False\", \"assert validate_emotion_data([30, 30, 30, 30]) == True\", \"assert vali...
{ "split": "train", "index": 80465, "acecode_id": "bigcode_python_fns_48059", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a role in a fictional game. The function should take a string representing the role name and determine if the role already exists based on predefined role names. The role names are stored in a list. If the r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_role('Admin') == 'Role: admin already exists.'\", \"assert create_role('Moderator') == 'Role: moderator already exists.'\", \"assert create_role('Player') == 'Role: player already exists.'\", \"assert create_role('guest') == 'Role: guest has been crea...
{ "split": "train", "index": 80466, "acecode_id": "bigcode_python_fns_48011", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates a list of words from a given dictionary that start with a specified prefix. The function should take in a list of words (dictionary) and a string (prefix) and return a list of words that begin with that prefix. The function signature is: def ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert autocomplete(['apple', 'banana', 'apricot', 'grape', 'avocado'], 'ap') == ['apple', 'apricot']\", \"assert autocomplete(['dog', 'deer', 'deal', 'dungeon', 'dark', 'dusk'], 'd') == ['dog', 'deer', 'deal', 'dungeon', 'dark', 'dusk']\", \"assert autocomplete(['...
{ "split": "train", "index": 80467, "acecode_id": "evol_11606", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a floating-point number, format it as a percent value rounded to two decimal places. The output should be a string representing the percentage, with a '%' symbol appended to the end. For example, if the input is 0.2345, the output should be '23.45%'. Write a function `for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_percent(0.0) == '0.00%'\", \"assert format_percent(0.1) == '10.00%'\", \"assert format_percent(0.2345) == '23.45%'\", \"assert format_percent(1.0) == '100.00%'\", \"assert format_percent(2.5) == '250.00%'\", \"assert format_percent(-0.5) == '-50.00%'\...
{ "split": "train", "index": 80468, "acecode_id": "evol_26435", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings and a set of instructions to extract a specific item from the list based on its index. Implement a function `extract_item(strings: List[str], index: int) -> str` that takes a list of strings and an integer index as input. The function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_item(['apple', 'banana', 'cherry'], 1) == 'banana'\", \"assert extract_item(['apple', 'banana', 'cherry'], 0) == 'apple'\", \"assert extract_item(['apple', 'banana', 'cherry'], 2) == 'cherry'\", \"assert extract_item(['apple', 'banana', 'cherry'], 3)...
{ "split": "train", "index": 80469, "acecode_id": "bigcode_python_fns_31943", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that performs a specific mathematical operation on a list of numbers. The function should take a list of integers and an integer representing an axis (0 or 1). Your function should compute the element-wise square of each integer in th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_sum_of_squares([1, 2, 3], 0) == 14\", \"assert custom_sum_of_squares([1, 2, 3], 1) == [1, 4, 9]\", \"assert custom_sum_of_squares([0, 0, 0], 0) == 0\", \"assert custom_sum_of_squares([0, 0, 0], 1) == [0, 0, 0]\", \"assert custom_sum_of_squares([-1, -2...
{ "split": "train", "index": 80470, "acecode_id": "oss_5352", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of earthquakes with their corresponding magnitudes, write a function that returns the count of earthquakes that are greater than or equal to a specified minimum magnitude. The function should take two parameters: an integer `min_magnitude` and a list of integers `m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_earthquakes(7, [6, 7, 8, 9]) == 3\", \"assert count_earthquakes(5, [5, 4, 3, 2]) == 1\", \"assert count_earthquakes(10, [10, 10, 10]) == 3\", \"assert count_earthquakes(0, [1, 2, 3, 4, 5]) == 5\", \"assert count_earthquakes(6, []) == 0\", \"assert coun...
{ "split": "train", "index": 80471, "acecode_id": "bigcode_python_fns_19635", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that accepts a list of numbers and computes both the mean and median of the numbers in the list. The function should return a dictionary where the keys are 'mean' and 'median' and the respective values are the computed values. The function should raise a ValueE...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_statistics([1, 2, 3, 4]) == {'mean': 2.5, 'median': 2.5}\", \"assert calculate_statistics([1, 3, 3, 6, 7, 8, 9]) == {'mean': 5.285714285714286, 'median': 6}\", \"assert calculate_statistics([1.5, 2.5, 3.5]) == {'mean': 2.5, 'median': 2.5}\", \"asse...
{ "split": "train", "index": 80472, "acecode_id": "evol_1368", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to create a function `get_block_path(tag: str, block_number: int) -> str` that generates a unique absolute path for a specific block based on a given tag and block number. The function will follow these rules:\n1. The `tag` is a string that represents the type of data ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_block_path('Image', 42) == 'image/42.block'\", \"assert get_block_path('Data', 1) == 'data/1.block'\", \"assert get_block_path('File', 100) == 'file/100.block'\", \"assert get_block_path('Document', 2023) == 'document/2023.block'\", \"assert get_block_pa...
{ "split": "train", "index": 80473, "acecode_id": "bigcode_python_fns_44469", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer x, complete the function `reverse` that returns the integer obtained by reversing the digits of x. If x is negative, return the negative of the reversed absolute value. The function should also ensure that the returned integer is within the 32-bit signed intege...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse(123) == 321\", \"assert reverse(-456) == -654\", \"assert reverse(0) == 0\", \"assert reverse(-1) == -1\", \"assert reverse(100) == 1\", \"assert reverse(-100) == -1\", \"assert reverse(10) == 1\", \"assert reverse(-10) == -1\", \"assert reverse(1534...
{ "split": "train", "index": 80474, "acecode_id": "oss_33003", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the depths of a geological striplog, implement a function that calculates the porosity at each depth. The porosity is defined as the ratio of the depth value to 100. The function should return a list of computed porosity values correspondin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_porosity([0]) == [0.0]\", \"assert calculate_porosity([100]) == [1.0]\", \"assert calculate_porosity([200, 300]) == [2.0, 3.0]\", \"assert calculate_porosity([0, 50, 100, 150]) == [0.0, 0.5, 1.0, 1.5]\", \"assert calculate_porosity([400, 500, 600])...
{ "split": "train", "index": 80475, "acecode_id": "bigcode_python_fns_8629", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integer peaks representing the heights of mountains and a threshold value. Your task is to implement a function that groups the peaks into clusters based on their heights. A peak can be grouped with the previous peak if the absolute difference between th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findClusters([1, 2, 3, 10, 11, 12], 2) == [[1, 2, 3], [10, 11, 12]]\", \"assert findClusters([5, 6, 7, 15, 16, 17], 3) == [[5, 6, 7], [15, 16, 17]]\", \"assert findClusters([1, 10, 20, 30, 40], 5) == [[1], [10], [20], [30], [40]]\", \"assert findClusters([2,...
{ "split": "train", "index": 80476, "acecode_id": "bigcode_python_fns_20303", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a point in a 2D space and a polygon defined by a list of points. Your task is to write a function `point_in_poly(point, polygon)` that determines whether the given point lies inside the polygon or on its boundary. The point is represented as a tuple `(x, y)` where...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert point_in_poly((2, 2), [(1, 1), (4, 1), (4, 4), (1, 4)]) == True\", \"assert point_in_poly((4, 4), [(1, 1), (4, 1), (4, 4), (1, 4)]) == True\", \"assert point_in_poly((2, 3), [(1, 1), (4, 1), (4, 4), (1, 4)]) == True\", \"assert point_in_poly((0, 0), [(1, 1),...
{ "split": "train", "index": 80477, "acecode_id": "oss_14996", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with formatting Unix epoch timestamps into a specified string format. Write a function `get_formatted_timestamps(timestamps: List[int], format: str) -> List[str]` that takes a list of timestamps in Unix epoch format (integers representing the number of seconds si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_formatted_timestamps([0], '%Y-%m-%d') == ['1970-01-01']\", \"assert get_formatted_timestamps([1609459200], '%Y/%m/%d') == ['2021/01/01']\", \"assert get_formatted_timestamps([1620000000], '%H:%M:%S') == ['00:00:00']\", \"assert get_formatted_timestamps([...
{ "split": "train", "index": 80478, "acecode_id": "oss_8611", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to determine if there are any open challenges for a given user in a specified ladder. The function should check the user's rank and the challenges available in the ladder to see if there are any challenges that the user is eligible to par...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert open_challenges_exist(5, [(1, 10, False), (3, 6, True), (5, 5, False)]) == True\", \"assert open_challenges_exist(4, [(1, 5, False), (5, 10, False), (6, 10, False)]) == True\", \"assert open_challenges_exist(10, [(1, 10, False)]) == True\", \"assert open_cha...
{ "split": "train", "index": 80479, "acecode_id": "oss_7528", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, create a function `transpose_list(arr: List[int]) -> List[Dict[str, int]]` that takes an array of integers and returns a list of dictionaries. Each dictionary should have a single key-value pair where the key is 'value' and the value is the correspondi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transpose_list([1, 2, 3]) == [{'value': 1}, {'value': 2}, {'value': 3}]\", \"assert transpose_list([10, 20, 30, 40]) == [{'value': 10}, {'value': 20}, {'value': 30}, {'value': 40}]\", \"assert transpose_list([-1, -2, -3]) == [{'value': -1}, {'value': -2}, {'...
{ "split": "train", "index": 80480, "acecode_id": "bigcode_python_fns_47591", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary where each key is a filename (string) and each value is a string containing text. Your task is to implement a function that processes each text by splitting it into sentences and tokenizing each sentence into words. For each word in the sentences, you...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert createDefaultClasses({'file1.txt': 'Hello world. This is a test.', 'file2.txt': 'Another file with text.'}) == {'file1.txt': [[0, 0], [0, 0, 0, 0]], 'file2.txt': [[0, 0, 0, 0]]}\", \"assert createDefaultClasses({'file1.txt': 'A B C. D E F.'}) == {'file1.txt'...
{ "split": "train", "index": 80481, "acecode_id": "bigcode_python_fns_24294", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the total number of elements in the list and the number of prime numbers present in it. The function should return a tuple where the first element is the total count of numbers and the second element is the count of prime ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_numbers_and_primes([4, 6, 8, 10]) == (4, 0)\", \"assert count_numbers_and_primes([2, 3, 5, 7]) == (4, 4)\", \"assert count_numbers_and_primes([1, 4, 6, 8, 9, 10]) == (6, 0)\", \"assert count_numbers_and_primes([11, 13, 17, 19, 23]) == (5, 5)\", \"asser...
{ "split": "train", "index": 80482, "acecode_id": "evol_2130", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of FileLocation objects, implement a function that returns a dictionary containing the count of unique file names and the total number of occurrences for each file name. Each FileLocation object contains the file name, line number, and column number. Your function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_file_occurrences([FileLocation('file1.py', 1, 1), FileLocation('file1.py', 2, 1)]) == {'file1.py': (2, 2)}\", \"assert count_file_occurrences([FileLocation('file2.py', 1, 1), FileLocation('file3.py', 2, 1), FileLocation('file2.py', 3, 1)]) == {'file2.p...
{ "split": "train", "index": 80483, "acecode_id": "oss_27158", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and inserts a specific integer into the list while maintaining the order of the list. The integer should be inserted at the correct position such that the list remains sorted in ascending order. Write a funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_into_sorted_list([1, 2, 3], 4) == [1, 2, 3, 4]\", \"assert insert_into_sorted_list([1, 2, 3], 0) == [0, 1, 2, 3]\", \"assert insert_into_sorted_list([], 5) == [5]\", \"assert insert_into_sorted_list([1, 3, 5], 3) == [1, 3, 3, 5]\", \"assert insert_int...
{ "split": "train", "index": 80484, "acecode_id": "bigcode_python_fns_30975", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `linear_search` that takes a list of integers and a target integer as inputs, and returns the index of the target integer in the list. If the target integer is not found in the list, return None. You may assume that the list contains unique integers.\nPleas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_search([1, 9, 4, 8, 5], 9) == 1\", \"assert linear_search([1, 9, 4, 8, 5], 1) == 0\", \"assert linear_search([1, 9, 4, 8, 5], 4) == 2\", \"assert linear_search([1, 9, 4, 8, 5], 8) == 3\", \"assert linear_search([1, 9, 4, 8, 5], 5) == 4\", \"assert lin...
{ "split": "train", "index": 80485, "acecode_id": "evol_22430", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of elements representing HTML list items (each item is a dictionary containing a 'tag' key with the value '{http://www.w3.org/1999/xhtml}li' for valid items), and an integer representing the depth of a nested unordered list, implement a function that generates a fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_ul_fragment_patch([{'tag': '{http://www.w3.org/1999/xhtml}li'}, {'tag': '{http://www.w3.org/1999/xhtml}li'}], 1) == [' * ', ' * ']\", \"assert generate_ul_fragment_patch([{'tag': '{http://www.w3.org/1999/xhtml}li'}, {'tag': '{http://www.w3.org/1...
{ "split": "train", "index": 80486, "acecode_id": "bigcode_python_fns_28890", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with normalizing a given float value based on specific minimum and maximum ranges. Write a function `normalize_trigger(value: float) -> float` that takes a float `value` as input and normalizes it to a new range defined by intended minimum (`INTENDED_TRIGGER_MIN`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_trigger(-0.5) == -1.0\", \"assert normalize_trigger(0.0) == -1.0\", \"assert normalize_trigger(0.5) == 0.0\", \"assert normalize_trigger(1.0) == 1.0\", \"assert normalize_trigger(1.5) == 1.0\", \"assert normalize_trigger(-1.0) == -1.0\", \"assert n...
{ "split": "train", "index": 80487, "acecode_id": "bigcode_python_fns_12142", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a help system for a command-line utility. Your goal is to create a function `get_help(command: str) -> str` that provides help information about specific commands. The function should return predefined help messages based on the command name giv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_help('util') == 'Utility commands help information.'\", \"assert get_help('calc') == 'Calculator commands help information.'\", \"assert get_help('unknown') == 'Unknown command: unknown'\", \"assert get_help('') == 'Unknown command: '\", \"assert get_hel...
{ "split": "train", "index": 80488, "acecode_id": "oss_33936", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a circular list of integers, implement a function `total_matching_neighbours(circ_number: List[int]) -> int` that returns the total count of adjacent pairs of numbers that are equal to each other. The list is circular, meaning the first element is considered adjacent to t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_matching_neighbours([1, 2, 3, 4, 5]) == 0\", \"assert total_matching_neighbours([1, 1, 1, 1]) == 4\", \"assert total_matching_neighbours([0, 0]) == 2\", \"assert total_matching_neighbours([1, 2, 3, 1]) == 1\", \"assert total_matching_neighbours([3, 3, ...
{ "split": "train", "index": 80489, "acecode_id": "bigcode_python_fns_30002", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a city. Your task is to implement a function called `max_visible_buildings` that returns the maximum number of buildings that can be seen from the first building when looking to the right. A building is c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_visible_buildings([3, 1, 4, 2, 5]) == 2\", \"assert max_visible_buildings([1, 2, 3, 4, 5]) == 4\", \"assert max_visible_buildings([5, 4, 3, 2, 1]) == 0\", \"assert max_visible_buildings([2, 3, 1, 4, 5]) == 3\", \"assert max_visible_buildings([1]) == 0\",...
{ "split": "train", "index": 80490, "acecode_id": "oss_14172", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `count_even_numbers(nums)` that returns the count of even numbers in the list. The input list can contain both positive and negative integers. If the list is empty, return 0. \n\n### Example\nInput: `nums = [1, 2, 3, 4, 5]`\nOutput: `2...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_even_numbers([1, 2, 3, 4, 5]) == 2\", \"assert count_even_numbers([-2, -4, 0, 1, 3]) == 3\", \"assert count_even_numbers([]) == 0\", \"assert count_even_numbers([2, 4, 6, 8]) == 4\", \"assert count_even_numbers([-1, -3, -5]) == 0\", \"assert count_even...
{ "split": "train", "index": 80491, "acecode_id": "bigcode_python_fns_11875", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a string representation of a job. The job consists of a function name, its positional arguments, and its keyword arguments. Your function should take in a callable (function), a tuple of positional arguments, and a dictiona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert job_representation(lambda x: None, ('a',), {'msg': 'a'}) == \\\"Job(function=<lambda>, args=('a',), kwargs={'msg': 'a'})\\\"\", \"assert job_representation(len, ('hello',), {}) == \\\"Job(function=len, args=('hello',), kwargs={})\\\"\", \"assert job_represen...
{ "split": "train", "index": 80492, "acecode_id": "bigcode_python_fns_28813", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `get_positive_and_sort(l: list) -> list` that filters all positive integers from the input list `l`, removes duplicates, and returns them sorted in ascending order without using the built-in `sort()` or `sorted()` functions. You should create a helper funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_positive_and_sort([-1, 2, -4, 5, 6]) == [2, 5, 6]\", \"assert get_positive_and_sort([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [1, 2, 3, 5, 9, 123]\", \"assert get_positive_and_sort([]) == []\", \"assert get_positive_and_sort([-1, -2, -3]) == []\", \"as...
{ "split": "train", "index": 80493, "acecode_id": "evol_20475", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the download URL for a software package based on its version and type. The input to the function is a string representing the version in the format 'type/version'. The type can either be 'release' for official versions or ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_download_url('release:4.3') == 'https://downloads.example.com/community/4.3'\", \"assert get_download_url('release:4.2.1') == 'https://downloads.example.com/community/4.2.1'\", \"assert get_download_url('release:2020.1') == 'https://downloads.example.com...
{ "split": "train", "index": 80494, "acecode_id": "bigcode_python_fns_48496", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of user tokens and a list of corresponding validity statuses, where each token can either be valid, expired, or invalid. Your task is to implement a function that returns a list of messages based on the validity of each token. The messages should be as foll...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_tokens([('token1', 'valid'), ('token2', 'expired'), ('token3', 'invalid'), ('token4', 'nonexistent')]) == ['Your password has been updated.', 'Your password is expired.', 'Your password token is invalid.', 'Token not found.']\", \"assert check_tokens([...
{ "split": "train", "index": 80495, "acecode_id": "bigcode_python_fns_26372", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that filters a list of integers based on a given condition. The function should accept a list of integers and a condition function, and return a new list containing only the integers that meet the condition specified by the function. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_items([], lambda x: x % 2 == 0) == []\", \"assert filter_items([1, 2, 3, 4], lambda x: x % 2 == 0) == [2, 4]\", \"assert filter_items([1, 3, 5, 7], lambda x: x % 2 == 0) == []\", \"assert filter_items([10, 20, 30], lambda x: x > 15) == [20, 30]\", \"a...
{ "split": "train", "index": 80496, "acecode_id": "oss_32827", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the cumulative product of non-negative integers in an array, where each non-negative integer is multiplied by its index in the array. Ignore any negative integers in the array. The function should take a list of integers as input and return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_cumulative_product([-1, -2, -3]) == 0\", \"assert calculate_cumulative_product([]) == 0\", \"assert calculate_cumulative_product([0]) == 0\", \"assert calculate_cumulative_product([-4, -5, 0, 3]) == 0\", \"assert calculate_cumulative_product([0, 0,...
{ "split": "train", "index": 80497, "acecode_id": "evol_32391", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function called `setup_development_environment` that simulates the preparation of a local development environment for a project. The function takes a boolean parameter `vagrant`. If `vagrant` is `True`, the function should return a string indicati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_development_environment(True) == 'Setting up Vagrant environment... Installing requirements... Creating database...'\", \"assert setup_development_environment(False) == 'Preparing local machine for development... Installing requirements... Creating dat...
{ "split": "train", "index": 80498, "acecode_id": "bigcode_python_fns_2181", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom tuple class in Python named `CustomTuple`. This class should allow you to create a tuple-like object that can store multiple elements. Your implementation must include the following features: \n1. The class should have a constructor tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert repr(CustomTuple(1, 2, 3)) == 'CustomTuple<1, 2, 3>'\", \"assert repr(CustomTuple('a', 'b', 'c')) == \\\"CustomTuple<'a', 'b', 'c'>\\\"\", \"assert repr(CustomTuple(1.1, 2.2, 3.3)) == 'CustomTuple<1.1, 2.2, 3.3>'\", \"assert repr(CustomTuple()) == 'CustomTup...
{ "split": "train", "index": 80499, "acecode_id": "oss_7375", "num_tests": 16 }