data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Given a 2D array of integers, implement a function that identifies sub-arrays containing at least one unpaired number. For each sub-array that contains an unpaired number, return the index of that sub-array along with the unpaired number. If no sub-array contains unpaired numbe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_unpaired([[1, 2, 3, 1, 2]]) == [(0, 3)]\", \"assert find_unpaired([[1, 1], [2, 2], [3]]) == [(2, 3)]\", \"assert find_unpaired([[], [], []]) == []\", \"assert find_unpaired([[4, 4], [5, 6, 5, 6, 7]]) == [(1, 7)]\", \"assert find_unpaired([[12, 12, 12], ... | {
"split": "train",
"index": 71400,
"acecode_id": "evol_31110",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `run_in_parallel(func, *args, **kwargs)` that simulates the behavior of running a given function `func` with specified arguments `args` and keyword arguments `kwargs` in a separate thread. The function should return a string indicating th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_in_parallel(lambda x: x, 1) == 'Running <lambda> in parallel'\", \"assert run_in_parallel(lambda x, y: x + y, 1, 2) == 'Running <lambda> in parallel'\", \"assert run_in_parallel(str, 123) == 'Running str in parallel'\", \"assert run_in_parallel(max, [1, ... | {
"split": "train",
"index": 71401,
"acecode_id": "bigcode_python_fns_7910",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `next_emirp(n: int) -> int` that returns the next closest emirp number greater than the given integer n. An emirp number is a non-palindromic prime number whose reverse is also a prime number. If no such emirp number exists, return -1.\nPlease reason step b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_emirp(10) == 13\", \"assert next_emirp(12) == 13\", \"assert next_emirp(13) == 17\", \"assert next_emirp(14) == 17\", \"assert next_emirp(30) == 31\", \"assert next_emirp(31) == 37\", \"assert next_emirp(90) == 97\", \"assert next_emirp(110) == 113\", \... | {
"split": "train",
"index": 71402,
"acecode_id": "evol_6435",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Construct a function that computes the aggregate count of consonants from a specified list of sentences. You should only consider sentences that do not start with a vowel, end with a consonant, do not contain numbers or special characters, and are at least 5 words long. The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_consonants(['numbers 1234 are here.', 'This sentence is valid but has a number 1.']) == 0\", \"assert count_consonants(['What about this? Special character!']) == 0\", \"assert count_consonants(['Only five words here.', 'No consonants in this one!']) =... | {
"split": "train",
"index": 71403,
"acecode_id": "evol_19302",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of transaction operations represented by integers, where positive integers indicate deposits and negative integers indicate withdrawals, implement a function `handle_transactions(transactionOperations: List[int], transactionsToUndo: int) -> int` that calculates the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_transactions([-1, -1, -1], 2) == 0\", \"assert handle_transactions([2, 3, -5, 4], 1) == 4\", \"assert handle_transactions([5, -3, 4, -1], 2) == 5\", \"assert handle_transactions([1, 1, 1, -3], 3) == 0\", \"assert handle_transactions([0, 0, 0], 2) == 0... | {
"split": "train",
"index": 71404,
"acecode_id": "evol_31107",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a given dictionary of key-value pairs into a specific formatted string. The function should take a dictionary as input and return a string where each key-value pair is formatted as 'key: value', with each pair separated ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_dictionary({'name': 'Alice', 'age': 30, 'city': 'New York'}) == 'name: Alice, age: 30, city: New York'\", \"assert format_dictionary({'key1': 'value1', 'key2': 'value2'}) == 'key1: value1, key2: value2'\", \"assert format_dictionary({'a': 1, 'b': 2, '... | {
"split": "train",
"index": 71405,
"acecode_id": "oss_1238",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the amount of fuel required for a spacecraft based on its mass. The fuel required can be determined using the following formula: for a given mass, the fuel required is the integer division of the mass by 3, minus 2. Write a function `get_fuel_fro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_fuel_from(12) == 2\", \"assert get_fuel_from(14) == 2\", \"assert get_fuel_from(1969) == 654\", \"assert get_fuel_from(100756) == 33583\", \"assert get_fuel_from(3) == 0\", \"assert get_fuel_from(0) == 0\", \"assert get_fuel_from(2) == 0\", \"assert get_... | {
"split": "train",
"index": 71406,
"acecode_id": "bigcode_python_fns_27048",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to write a function that returns a new list containing only the unique integers from the original list, preserving the order in which they first appeared. The input list may contain both positive and negative integers, and the outp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([3, 5, 3, 2, -1, 2, 5]) == [3, 5, 2, -1]\", \"assert unique_integers([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([1, 1, 1, 1]) == [1]\", \"assert unique_integers([10, 20, 10, 30, 20]) == [10, 20, 30]\", \"assert unique_int... | {
"split": "train",
"index": 71407,
"acecode_id": "oss_3551",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary containing information about a Chebyshev polynomial model, implement a function that constructs and returns the parameters of a Chebyshev1D model. The input dictionary will contain the following keys: 'order' (an integer representing the order of the polynomi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_chebyshev_model({'order': 2, 'pmin': 0.0, 'pmax': 2.0, 'fpar': [1.0, 0.5]}) == ([1.0, 0.5], (0.0, 2.0))\", \"assert construct_chebyshev_model({'order': 4, 'pmin': -1.0, 'pmax': 1.0, 'fpar': [0.0, 1.0, 0.0, -1.0]}) == ([0.0, 1.0, 0.0, -1.0], (-1.0, ... | {
"split": "train",
"index": 71408,
"acecode_id": "bigcode_python_fns_41034",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings. Your task is to count how many buildings are visible from the left side. A building is considered visible from the left if there are no taller buildings to its left. Implement a function `count_visible_buil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_visible_buildings([1]) == 1\", \"assert count_visible_buildings([1, 2, 3]) == 3\", \"assert count_visible_buildings([3, 2, 1]) == 1\", \"assert count_visible_buildings([1, 3, 2]) == 2\", \"assert count_visible_buildings([1, 2, 1, 2]) == 2\", \"assert c... | {
"split": "train",
"index": 71409,
"acecode_id": "bigcode_python_fns_8962",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `snippet_data_json` representing JSON data and a string `root_dir` representing the root directory of a codebase. Your task is to implement a function `analyze_codebase(snippet_data_json: str, root_dir: str) -> Tuple[Set[str], Set[str], Set[str], List[str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_codebase('{\\\"methods\\\": [{\\\"name\\\": \\\"baz\\\", \\\"region_tags\\\": []}]}', '/another/path') == (set([]), set([]), set([]), ['baz'])\", \"assert analyze_codebase('{\\\"methods\\\": [{\\\"name\\\": \\\"test\\\", \\\"region_tags\\\": [\\\"tag... | {
"split": "train",
"index": 71410,
"acecode_id": "bigcode_python_fns_21167",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing URLs of reports. Your task is to extract valid absolute URLs from these report strings. A valid URL is one that starts with 'http://' or 'https://'. If a URL contains query parameters (indicated by a '?' character), remove everything... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_valid_urls(['http://example.com/report1', 'https://example.com/report2?param=value', 'http://example.com/report3']) == ['http://example.com/report1', 'https://example.com/report2', 'http://example.com/report3']\", \"assert extract_valid_urls(['http:/... | {
"split": "train",
"index": 71411,
"acecode_id": "bigcode_python_fns_17460",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `sum_of_primes(arr: List[int]) -> int` that takes a list of integers and returns the sum of all prime numbers in the list. The function should handle large arrays efficiently.\nPlease reason step by step, then write a self-contained Python solution. Give your f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_primes([1, 2, 3, 4, 5]) == 10\", \"assert sum_of_primes([10, 11, 12, 13, 14]) == 24\", \"assert sum_of_primes([14, 15, 16, 17, 18]) == 17\", \"assert sum_of_primes([23, 24, 25, 26, 27]) == 23\", \"assert sum_of_primes([29, 30, 31, 32, 33]) == 60\", \"... | {
"split": "train",
"index": 71412,
"acecode_id": "evol_30019",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified representation of a control flow graph (CFG) in a programming language. In this problem, you will create two classes: `Block` and `ConditionalBranch`. The `Block` class should represent a basic block in the CFG with a unique identif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ConditionalBranch().setFalseBlock(Block('Block 1')) == Block('Block 1')\", \"assert ConditionalBranch().setFalseBlock(Block('Block 2')) == Block('Block 2')\", \"assert ConditionalBranch().setFalseBlock(Block('Block 3')) == Block('Block 3')\", \"assert Condit... | {
"split": "train",
"index": 71413,
"acecode_id": "oss_35880",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates an array containing the Fibonacci sequence values that are prime numbers, up to a given range, n. The Fibonacci sequence should be returned in reverse order. Use memoization to optimize the calculation of Fibonacci numbers.\nPlease reason ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibo_prime_in_reverse(0) == []\", \"assert fibo_prime_in_reverse(1) == []\", \"assert fibo_prime_in_reverse(3) == [2]\", \"assert fibo_prime_in_reverse(4) == [3, 2]\", \"assert fibo_prime_in_reverse(5) == [5, 3, 2]\", \"assert fibo_prime_in_reverse(6) == [5,... | {
"split": "train",
"index": 71414,
"acecode_id": "evol_2440",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `reset_device_command(commands: List[str]) -> str` that simulates a simple device reset mechanism. The function receives a list of commands as input. If the command 'CTRL+D' is present in the list, the function should return 'Device reset... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reset_device_command(['COMMAND1', 'COMMAND2']) == 'Error: Invalid command.'\", \"assert reset_device_command(['CTRL+D']) == 'Device reset.'\", \"assert reset_device_command(['COMMAND1', 'CTRL+D', 'COMMAND2']) == 'Device reset.'\", \"assert reset_device_comma... | {
"split": "train",
"index": 71415,
"acecode_id": "oss_33207",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes image detection configurations for a specific application. The function should take in two parameters: `chip_options` and `predict_options`, which are both dictionaries representing various options for processing image ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_object_detection_config({'size': 'small', 'format': 'jpg'}, {'threshold': 0.5, 'model': 'yolo'}) == {'size': 'small', 'format': 'jpg', 'threshold': 0.5, 'model': 'yolo', 'status': 'Configuration built successfully.'}\", \"assert build_object_detection_... | {
"split": "train",
"index": 71416,
"acecode_id": "oss_7232",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes a list of integers representing audio sample values and returns the maximum amplitude of the audio signal. The maximum amplitude is defined as the highest absolute value among the samples. Your function should handle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_amplitude([1, -2, 3, -4, 5]) == 5\", \"assert max_amplitude([-1, -2, -3, -4, -5]) == 5\", \"assert max_amplitude([0, 0, 0]) == 0\", \"assert max_amplitude([10, -10, 20, -20]) == 20\", \"assert max_amplitude([]) == 0\", \"assert max_amplitude([7]) == 7\",... | {
"split": "train",
"index": 71417,
"acecode_id": "oss_31380",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that computes the sum of all even integers and the product of all odd integers in the list. If there are no even integers, return -1 for the sum. If there are no odd integers, return 1 for the product. The function should return a tupl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_even_sum_and_odd_product([1, 2, 3, 4, 5]) == (6, 15)\", \"assert compute_even_sum_and_odd_product([0, 1, 2, 3]) == (2, 3)\", \"assert compute_even_sum_and_odd_product([1, 3, 5, 7]) == (-1, 105)\", \"assert compute_even_sum_and_odd_product([2, 4, 6, 8... | {
"split": "train",
"index": 71418,
"acecode_id": "bigcode_python_fns_20860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string 'surface' that may contain various unwanted characters and formatting codes. Your task is to implement a function that normalizes this string by removing specific unwanted characters and returning a tuple containing the original string and the cleaned str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_token(None) == (None, None)\", \"assert check_token('hello world') == ('hello world', 'helloworld')\", \"assert check_token('test xxx example') == ('test xxx example', 'testexample')\", \"assert check_token('hello\\u2021world') == ('hello\\u2021world',... | {
"split": "train",
"index": 71419,
"acecode_id": "bigcode_python_fns_41009",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given two binary strings a and b, perform a binary XOR operation on them and return the longest alternating subsequence from the result. An alternating subsequence is defined as a sequence that has no consecutive identical elements. The input strings will only contain the chara... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_alternating_xor('010', '001') == '01'\", \"assert binary_alternating_xor('111', '000') == '1'\", \"assert binary_alternating_xor('0000', '0000') == '0'\", \"assert binary_alternating_xor('111000', '000111') == '1'\", \"assert binary_alternating_xor('1... | {
"split": "train",
"index": 71420,
"acecode_id": "evol_22311",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs the Smith-Waterman algorithm for local sequence alignment of two DNA sequences. The function should take two DNA sequences as input and return the maximum alignment score based on a simple scoring scheme: +3 for a match, -3 for a mismatch, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smith_waterman('ACTG', 'ACGT') == 7\", \"assert smith_waterman('AGCT', 'AGCT') == 12\", \"assert smith_waterman('AAAA', 'AA') == 6\", \"assert smith_waterman('A', 'A') == 3\", \"assert smith_waterman('ACGT', 'ACGT') == 12\", \"assert smith_waterman('TTT', 'T... | {
"split": "train",
"index": 71421,
"acecode_id": "evol_32590",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of bytes that represent UTF-8 encoded strings. Write a function `decode_bytes_to_strings(byte_list: List[bytes]) -> List[str]` that decodes each byte string in the list to a standard Python string using UTF-8 decoding. If any of the byte strings cannot be d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_bytes_to_strings([b'hello', b'world']) == ['hello', 'world']\", \"assert decode_bytes_to_strings([b'foo', b'bar', b'baz']) == ['foo', 'bar', 'baz']\", \"assert decode_bytes_to_strings([b'abc', b'def']) == ['abc', 'def']\", \"assert decode_bytes_to_str... | {
"split": "train",
"index": 71422,
"acecode_id": "bigcode_python_fns_36078",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `bubble_sort` that takes a list of integers as input and returns a new list containing the same integers sorted in ascending order. You should use the bubble sort algorithm to achieve this. The input list may contain duplicate values and can be of any lengt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([10, 4, 5, 7, 2]) == [2, 4, 5, 7, 10]\", \"assert bubble_sort([3, 1, 4, 1, 5]) == [1, 1, 3, 4, 5]\", \"assert bubble_sort([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert bubble_sort([]) == []\", \"assert bubble_sort([1]) == [1]\", \"assert bubble_sort(... | {
"split": "train",
"index": 71423,
"acecode_id": "evol_35014",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that validates the parameters for a server configuration based on specific rules. The function should take the following parameters: controller (string), server (string), export (string), nodes (integer), domains (integer), mtype (string),... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_parameters('controller', 'server', '/export', 1, 1, 'nfs3', '192.168.1.1', '192.168.1.2', 'native') == True\", \"assert validate_parameters('controller', 'server', '', 1, 1, 'nfs3', '192.168.1.1', '192.168.1.2', 'native') == False\", \"assert valida... | {
"split": "train",
"index": 71424,
"acecode_id": "bigcode_python_fns_14384",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing the name of an activation function, return a corresponding string that describes the function's behavior. The function can be one of the following: 'sigmoid', 'identity', 'relu', or 'tanh'. If the input does not match any of these, return 'Unknown ac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_activation_description('sigmoid') == '1 / (1 + exp(-x))'\", \"assert get_activation_description('identity') == 'x'\", \"assert get_activation_description('relu') == 'max(0, x)'\", \"assert get_activation_description('tanh') == '2/(1+exp(-2x)) - 1'\", \"a... | {
"split": "train",
"index": 71425,
"acecode_id": "bigcode_python_fns_35724",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string sentence, an integer num, and a string symbol as input. The function should output the sentence with each word repeated the specified number of times. Each repetition of a word should have its characters reversed, and the repetitions should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert repeat_and_reverse('Hello world', 3, '#') == 'olleH#olleH#olleH#dlrow#dlrow#dlrow'\", \"assert repeat_and_reverse('Single word', 1, '@') == 'elgniS@drow'\", \"assert repeat_and_reverse('', 5) == ''\", \"assert repeat_and_reverse('A B C D', 4, ',') == 'A,A,A,... | {
"split": "train",
"index": 71426,
"acecode_id": "evol_289",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple event handling system for a space-themed game. You need to create a class called `EventDispatcher` that will manage the dispatching of events to appropriate event handlers. The `EventDispatcher` class should have the following functiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isinstance(dispatcher.event_handlers, dict)\", \"assert len(dispatcher.event_handlers) == 1\", \"assert KeyPressedEvent in dispatcher.event_handlers\"]}"
} | {
"split": "train",
"index": 71427,
"acecode_id": "oss_12922",
"num_tests": 3
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a decimal number (0 - 255) to its corresponding hexadecimal representation. Your solution should not make use of any built-in hexadecimal conversion functions.\nPlease reason step by step, then write a self-contained Python solution. Give your fin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dec_to_hex(0) == '0'\", \"assert dec_to_hex(1) == '1'\", \"assert dec_to_hex(10) == 'A'\", \"assert dec_to_hex(15) == 'F'\", \"assert dec_to_hex(16) == '10'\", \"assert dec_to_hex(31) == '1F'\", \"assert dec_to_hex(32) == '20'\", \"assert dec_to_hex(99) == '... | {
"split": "train",
"index": 71428,
"acecode_id": "evol_4860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of nested dictionaries, where each dictionary can contain other dictionaries as values. Each dictionary has a 'name' key that is a string and optionally contains a '_p_mongo_sub_object' key set to True or False. Write a function `extract_names(data: List[Di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_names([{'name': 'one', '_p_mongo_sub_object': False}, {'name': 'two'}]) == ['one', 'two']\", \"assert extract_names([{'name': 'one', '_p_mongo_sub_object': True}, {'name': 'two'}]) == ['two']\", \"assert extract_names([{'name': 'one', 'child': {'name... | {
"split": "train",
"index": 71429,
"acecode_id": "bigcode_python_fns_22005",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that adds a given character to the front of a specified string until the string reaches a specified minimum length. Implement the function `pad_string(s: str, min_len: int, char: str) -> str` which takes in a string `s`, an integer `min_len`, and a char... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pad_string('test', 8, '*') == '****test'\", \"assert pad_string('hello', 10, '#') == '#####hello'\", \"assert pad_string('world', 5, '@') == 'world'\", \"assert pad_string('python', 6, '$') == 'python'\", \"assert pad_string('', 5, '0') == '00000'\", \"asser... | {
"split": "train",
"index": 71430,
"acecode_id": "evol_8876",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the y-coordinate of the center of mass of a processed image represented as a 2D list of integers. Each non-zero integer represents a pixel, while zero represents an empty pixel. The center of mass is defined as the average y-coordinate of all non... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_image([[0, 0, 0], [0, 1, 0], [0, 0, 0]]) == 1.0\", \"assert process_image([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == 0.0\", \"assert process_image([[0, 1, 0], [0, 1, 0], [0, 1, 0]]) == 1.0\", \"assert process_image([[1, 1, 1], [0, 0, 0], [0, 0, 0]]) == 0.... | {
"split": "train",
"index": 71431,
"acecode_id": "oss_23430",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a matrix of m*n size with various characters, implement a function that finds the largest numerical number in the matrix. If the matrix contains no numerical entries, the function should return an error message indicating that no numerical entries were found.\nPlease reas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_largest_number([['a', 'b', 'c'], [4, 5, 'f'], [7, 'h', 9]]) == 9\", \"assert find_largest_number([[1, 'x', 'y'], [2, 'z', 3]]) == 3\", \"assert find_largest_number([[10, 20], ['a', 'b']]) == 20\", \"assert find_largest_number([[None, 'hello'], [5, 8, 3]... | {
"split": "train",
"index": 71432,
"acecode_id": "evol_19624",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a hierarchical configuration represented as a dictionary into a Human-Optimized Config Object Notation (HOCON) format. The function should take a dictionary as input, where the keys are strings representing configuration key... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_hocon({'key1': 'value1', 'key2': 42}) == 'key1: value1\\\\nkey2: 42\\\\n'\", \"assert convert_to_hocon({'key1': {'subkey1': 'subvalue1'}}) == 'key1 {\\\\n subkey1: subvalue1\\\\n}\\\\n'\", \"assert convert_to_hocon({'key1': 1, 'key2': 2, 'key3': ... | {
"split": "train",
"index": 71433,
"acecode_id": "oss_30713",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of boxes, where each box is represented by a list of five numbers: [x1, y1, x2, y2, score]. Here (x1, y1) and (x2, y2) are the coordinates of the bottom-left and top-right corners of the box respectively, and score is a probability score associated with the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_boxes([[0, 0, 1, 1, 0.9], [1, 1, 2, 2, 0.8]], 0.5) == [[0, 0, 1, 1, 0.9], [1, 1, 2, 2, 0.8]]\", \"assert select_boxes([[0, 0, 1, 1, 0.6], [2, 2, 3, 3, 0.5]], 0.1) == [[0, 0, 1, 1, 0.6], [2, 2, 3, 3, 0.5]]\", \"assert select_boxes([[0, 0, 1, 1, 0.7], [... | {
"split": "train",
"index": 71434,
"acecode_id": "bigcode_python_fns_18687",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `calculate_sum` which computes the sum of the products of two lists: `coefficients` and `variables`. The function should take two parameters: `coefficients`, a list of integers representing the coefficients, and `variables`, a list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sum([1, 2, 3], [4, 5, 6]) == 32\", \"assert calculate_sum([0, 0, 0], [1, 2, 3]) == 0\", \"assert calculate_sum([-1, -2, -3], [1, 2, 3]) == -14\", \"assert calculate_sum([1, 2, 3], [-1, -2, -3]) == -14\", \"assert calculate_sum([1], [1]) == 1\", \"a... | {
"split": "train",
"index": 71435,
"acecode_id": "oss_18973",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_primes_excluding_five(n: int) -> List[int]` that returns a list of all prime numbers from 0 to n, excluding those that are divisible by 5. Do not use built-in functions to determine if a number is prime.\nPlease reason step by step, then write a self-c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_primes_excluding_five(0) == []\", \"assert get_primes_excluding_five(1) == []\", \"assert get_primes_excluding_five(2) == [2]\", \"assert get_primes_excluding_five(3) == [2, 3]\", \"assert get_primes_excluding_five(4) == [2, 3]\", \"assert get_primes_exc... | {
"split": "train",
"index": 71436,
"acecode_id": "evol_4944",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a list of their squares. The function should handle an empty list by returning an empty list. The input list can contain both positive and negative integers. Your function should be named `squ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_numbers([]) == []\", \"assert square_numbers([1]) == [1]\", \"assert square_numbers([-1]) == [1]\", \"assert square_numbers([0]) == [0]\", \"assert square_numbers([1, 2, 3]) == [1, 4, 9]\", \"assert square_numbers([-1, -2, -3]) == [1, 4, 9]\", \"asser... | {
"split": "train",
"index": 71437,
"acecode_id": "oss_23490",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats sensor data received in JSON format based on the type of sensor. The function `formatSensorData` should take four parameters: `json_data` (a dictionary containing sensor readings), `timestamp` (a string representing the time ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert formatSensorData({'flex': [1, 2, 3], 'temperature': [22], 'humidity': [50]}, '2023-10-03T10:00:00Z', 'sensor1', 'flex') == sensorFormat([1, 2, 3], '2023-10-03T10:00:00Z', 'sensor1')\", \"assert formatSensorData({'flex': [1, 2, 3], 'weight': [5], 'position': ... | {
"split": "train",
"index": 71438,
"acecode_id": "oss_28781",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary that represents a simulation setup. Your task is to modify this dictionary by removing a specific key and updating another key with a new file path that is derived from a temporary directory. Implement a function `modify_config(cfg: dict... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_config({'setup_grid': {'lgr': 'value'}, 'simulation': {'sim_ws': 'old_path'}}, 'temp') == {'setup_grid': {}, 'simulation': {'sim_ws': 'temp/pleasant_lgr_just_parent'}}\", \"assert modify_config({'setup_grid': {'lgr': 'old_value'}, 'simulation': {'sim_... | {
"split": "train",
"index": 71439,
"acecode_id": "bigcode_python_fns_10806",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that analyzes a poker hand represented by two lists: `color_all` and `size_all`. The `color_all` list contains the colors of the cards as strings, and the `size_all` list contains the sizes of the cards as integers. The sizes repre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_poker_hand(['red', 'red', 'red', 'red', 'red'], [2, 3, 4, 5, 6]) == ('Straight flush', 6)\", \"assert analyze_poker_hand(['red', 'red', 'red', 'red', 'red'], [10, 11, 12, 13, 14]) == ('Straight flush', 14)\", \"assert analyze_poker_hand(['blue', 'blu... | {
"split": "train",
"index": 71440,
"acecode_id": "oss_30027",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a sequence of words as a string, write a function `predict_next_word(sequence: str) -> str` that predicts the most likely next word based on the provided sequence. You can assume that the input sequence will contain valid words. The function should return the predicted ne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_next_word('the') == 'quick'\", \"assert predict_next_word('quick') == 'brown'\", \"assert predict_next_word('brown') == 'fox'\", \"assert predict_next_word('fox') == 'jumps'\", \"assert predict_next_word('jumps') == 'over'\", \"assert predict_next_wo... | {
"split": "train",
"index": 71441,
"acecode_id": "evol_34809",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of user objects, each represented as a dictionary with the following keys: 'notificationsetting', 'organization_id', and 'is_staff'. Your task is to write a Python function `filter_users(users, email)` that filters out users who have daily batch sample noti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_users([{'notificationsetting': {'daily_batch_sample': True}, 'organization_id': 1, 'is_staff': True, 'email': 'user1@example.com'}, {'notificationsetting': {'daily_batch_sample': False}, 'organization_id': 1, 'is_staff': True, 'email': 'user2@example.... | {
"split": "train",
"index": 71442,
"acecode_id": "oss_24635",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a list of LESS file paths into their corresponding CSS file paths. The function should take a list of strings, where each string represents a LESS file path. The output should be a list of strings, where each string is t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_less_to_css(['/path/to/file1.less', '/path/to/file2.less']) == ['/path/to/file1.css', '/path/to/file2.css']\", \"assert convert_less_to_css(['/folder1/folder2/style.less']) == ['/folder1/folder2/style.css']\", \"assert convert_less_to_css(['/some/pat... | {
"split": "train",
"index": 71443,
"acecode_id": "bigcode_python_fns_15375",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `evaluate_expression(expr_string: str, value_dict: dict) -> float` that evaluates a given mathematical expression represented as a string using the provided variable values. The expression can contain various mathematical operations including addition, subt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expression('2*x + 3', {'x': 1}) == 5.0\", \"assert evaluate_expression('sin(x)', {'x': 0}) == 0.0\", \"assert evaluate_expression('log(x)', {'x': 10}) == 2.302585092994046\", \"assert evaluate_expression('2*x**2 + 3*x + 1', {'x': 2}) == 15.0\", \"as... | {
"split": "train",
"index": 71444,
"acecode_id": "evol_30030",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a directory structure represented as a list of file paths, write a function `filter_files` that takes two parameters: a list of file paths and a list of ignore patterns. The function should return a new list containing only the file paths that do not match any of the igno... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_files(['file1.txt', 'file2.txt', 'temp_file.txt'], ['temp']) == ['file1.txt', 'file2.txt']\", \"assert filter_files(['data1.csv', 'data2.csv', 'archive.zip'], ['archive']) == ['data1.csv', 'data2.csv']\", \"assert filter_files(['image1.png', 'image2.p... | {
"split": "train",
"index": 71445,
"acecode_id": "bigcode_python_fns_24453",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the definition of a binary tree node, your task is to implement a function `diameter_of_binary_tree(root: BinaryTreeNode) -> int` that calculates the diameter of a binary tree. The diameter is defined as the number of nodes on the longest path between any two leaf nodes i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert diameter_of_binary_tree(None) == 0\", \"assert diameter_of_binary_tree(BinaryTreeNode(1)) == 1\", \"assert diameter_of_binary_tree(BinaryTreeNode(1, BinaryTreeNode(2), None)) == 2\", \"assert diameter_of_binary_tree(BinaryTreeNode(1, None, BinaryTreeNode(3))... | {
"split": "train",
"index": 71446,
"acecode_id": "oss_31475",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing project data for an adviser. You need to implement a function that takes in five lists of project IDs and returns the total number of unique projects. The input parameters are: \n1. `prospect_projects`: A list of project IDs that are being consider... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_projects([1, 2, 3], [3, 4], [4, 5], [5, 6], [6, 7]) == 7\", \"assert count_unique_projects([1, 1, 2], [2, 3], [], [3], [4, 4]) == 4\", \"assert count_unique_projects([], [], [], [], []) == 0\", \"assert count_unique_projects([10], [20], [30], [4... | {
"split": "train",
"index": 71447,
"acecode_id": "bigcode_python_fns_26571",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `check_number_properties(num: int) -> str` that takes an integer `num` as input and returns a string based on the following conditions: If `num` is divisible by 3 and is a perfect square, return 'The number is divisible by 3 and is a perfect square.' If `num` i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_number_properties(9) == 'The number is divisible by 3 and is a perfect square.'\", \"assert check_number_properties(27) == 'The number is divisible by 3 but is not a perfect square.'\", \"assert check_number_properties(16) == 'The number is a perfect s... | {
"split": "train",
"index": 71448,
"acecode_id": "evol_13828",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_password()` that constructs a password consisting of at least 10 characters. The password must include at least one numerical digit and one Greek character, while the rest of the characters should be non-alphanumeric symbols. The function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_password()) >= 10\", \"assert any(char.isdigit() for char in generate_password())\", \"assert any('\\u0391' <= char <= '\\u03a1' or '\\u03b1' <= char <= '\\u03c1' for char in generate_password())\", \"assert all(char in string.punctuation for ch... | {
"split": "train",
"index": 71449,
"acecode_id": "evol_6124",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that extracts the value associated with a specific command-line argument from a list of arguments. Implement a function `parse_mcic_id(args: List[str]) -> Optional[str]` that takes a list of strings representing command-line arguments and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_mcic_id(['--mcic_id', '12345', '--other_arg', 'value']) == '12345'\", \"assert parse_mcic_id(['--mcic_id', '67890']) == '67890'\", \"assert parse_mcic_id(['--mcic_id', '']) == ''\", \"assert parse_mcic_id(['--mcic_id', 'abc123', '--another_arg', 'xyz']... | {
"split": "train",
"index": 71450,
"acecode_id": "oss_4838",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether a server configuration can be migrated to a new host based on its availability. The function `can_migrate(hostname: str, username: str, password: str) -> bool` should take three parameters: `hostname`, `username`, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_migrate('server1.com', 'admin', 'pass123') == True\", \"assert can_migrate('server2.com', 'user', 'mypassword') == True\", \"assert can_migrate('server3.com', 'test', 'testpass') == True\", \"assert can_migrate('server4.com', 'admin', 'pass123') == False... | {
"split": "train",
"index": 71451,
"acecode_id": "oss_33412",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of users, where each user is represented as a dictionary with a 'last_name' and an 'age'. Write a function `sort_users(users)` that sorts the users in reverse alphabetical order by their last name. If two users have the same last name, order them in ascendi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_users([{'last_name': 'John', 'age': 25}, {'last_name': 'Alice', 'age': 28}, {'last_name': 'Bob', 'age': 39}, {'last_name': 'Alice', 'age': 23}]) == [{'last_name': 'John', 'age': 25}, {'last_name': 'Bob', 'age': 39}, {'last_name': 'Alice', 'age': 23}, {'... | {
"split": "train",
"index": 71452,
"acecode_id": "evol_29183",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates configuration settings for a Jupyter Notebook server based on specific parameters. Implement a function `configure_jupyter_server` that accepts the following parameters: \n\n- `token` (str): A string representing the token ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_jupyter_server('', '', True, 8888, False, '') == \\\"\\\\nc.NotebookApp.token = ''\\\\nc.NotebookApp.password = ''\\\\nc.NotebookApp.open_browser = true\\\\nc.NotebookApp.port = 8888\\\\nc.NotebookApp.allow_remote_access = false\\\\nc.NotebookApp.a... | {
"split": "train",
"index": 71453,
"acecode_id": "oss_618",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `build_connection_string` that constructs a database connection string from given connection parameters. The function should take in five parameters: `db_engine` (a string representing the type of database, e.g., 'mysql', 'postgresql'), `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_connection_string('mysql', 'admin', 'password', 'localhost', 3306, 'mydb') == 'mysql://admin:password@localhost:3306/mydb'\", \"assert build_connection_string('postgresql', 'user', 'pass', '127.0.0.1', 5432, 'testdb') == 'postgresql://user:pass@127.0.0... | {
"split": "train",
"index": 71454,
"acecode_id": "bigcode_python_fns_8867",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that can process a list of integers and return the sum of the even numbers in that list. Implement a function named `sum_even_numbers` that takes a single parameter, `numbers`, which is a list of integers. The function should return an in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_even_numbers([10, 15, 20, 25]) == 30\", \"assert sum_even_numbers([0, -2, -4, 7]) == -6\", \"assert sum_even_numbers([-1, -3, 5]) == 0\", \"assert sum_even_numbers([]) == 0\", \"assert sum_even_numbers([... | {
"split": "train",
"index": 71455,
"acecode_id": "oss_20219",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates writing a value to a configuration entry. The function `write_entry` should take two parameters: a `entry` string and a `value` string. The function should return the `value` if the `entry` is valid (i.e., it contains at le... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert write_entry('network.settings', 'enabled') == 'enabled'\", \"assert write_entry('user.preferences.theme', 'dark') == 'dark'\", \"assert write_entry('system.logging.level', 'info') == 'info'\", \"assert write_entry('database.config.url', 'localhost') == 'loca... | {
"split": "train",
"index": 71456,
"acecode_id": "bigcode_python_fns_41578",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that accepts a tuple of numerical values (t_1,...,t_{N+1}) and returns a tuple of length N, where the i-th element of the output tuple is the product of t_i and t_{i+1}. The function should handle negative numbers, zeros, and be able to process tuples of varyin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_consecutives((1, 2, 3)) == (2, 6)\", \"assert product_of_consecutives((-1, -2, -3)) == (2, 6)\", \"assert product_of_consecutives((0, 2, 3)) == (0, 6)\", \"assert product_of_consecutives((1.5, 2.5, 3.5)) == (3.75, 8.75)\", \"assert product_of_cons... | {
"split": "train",
"index": 71457,
"acecode_id": "evol_12521",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that filters a dictionary by removing specific keys. The function should take a dictionary and a list of keys as input, and return a new dictionary containing only the key-value pairs that are not listed in the keys to be remov... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_dictionary({'a': 1, 'b': 2, 'c': 3, 'self': 4, '__class__': 5}, ['self', '__class__']) == {'a': 1, 'b': 2, 'c': 3}\", \"assert filter_dictionary({'x': 10, 'y': 20, 'z': 30}, ['y']) == {'x': 10, 'z': 30}\", \"assert filter_dictionary({}, ['a']) == {}\"... | {
"split": "train",
"index": 71458,
"acecode_id": "oss_189",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a text input field based on specific criteria. Write a function `validate_text_field(text: str) -> str` that takes a string `text` as input and returns a validation message. The validation criteria are as follows: 1. The text must not be empty. 2.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_text_field('') == 'Input cannot be empty'\", \"assert validate_text_field('abc') == 'Input must be at least 5 characters long'\", \"assert validate_text_field('abcd') == 'Input must be at least 5 characters long'\", \"assert validate_text_field('val... | {
"split": "train",
"index": 71459,
"acecode_id": "bigcode_python_fns_4343",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: one containing dates and the other containing corresponding values of a specific observed property. Write a function that takes in these two lists and returns a list of strings, where each string represents a formatted entry in the format: 'Date: [date]... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_time_series([], [], 'Temperature', 'C') == []\", \"assert format_time_series([datetime(2023, 1, 1)], [10.0], 'Temperature', 'C') == ['Date: 2023-01-01 00:00:00, Value: 10.0 Temperature (C)']\", \"assert format_time_series([datetime(2023, 1, 1), dateti... | {
"split": "train",
"index": 71460,
"acecode_id": "bigcode_python_fns_6698",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing the availability of products in a fulfillment system. Each product can be represented by a dictionary containing the following fields: 'variant' (which itself is a dictionary with a boolean field 'track_inventory') and 'quantity' (an integer). Your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_availability([{'variant': {'track_inventory': True}, 'quantity': 5}, {'variant': {'track_inventory': False}, 'quantity': 3}]) == [6, 3]\", \"assert update_availability([{'variant': {'track_inventory': True}, 'quantity': 1}, {'variant': {'track_invento... | {
"split": "train",
"index": 71461,
"acecode_id": "bigcode_python_fns_6467",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer d, return the count of reduced proper fractions for d such that n < d and the greatest common divisor (gcd) of n and d is 1. A reduced proper fraction is defined as a fraction where the numerator is less than the denominator and both are positive intege... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_reduced_proper_fractions(1) == 0\", \"assert count_reduced_proper_fractions(2) == 1\", \"assert count_reduced_proper_fractions(3) == 2\", \"assert count_reduced_proper_fractions(5) == 4\", \"assert count_reduced_proper_fractions(7) == 6\", \"assert cou... | {
"split": "train",
"index": 71462,
"acecode_id": "evol_3875",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a series of buildings, where the buildings are positioned consecutively along a street. Your task is to implement a function that calculates the maximum area of a rectangular region that can be formed by selecting con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_rectangle_area([1, 2, 3, 4]) == 6\", \"assert max_rectangle_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_rectangle_area([1]) == 1\", \"assert max_rectangle_area([5, 2, 1, 3]) == 5\", \"assert max_rectangle_area([1, 1, 1, 1]) == 4\", \"assert max_rectan... | {
"split": "train",
"index": 71463,
"acecode_id": "bigcode_python_fns_1601",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given an integer array representing distinct denominations of coins and an integer amount, implement a function that calculates the minimum number of coins required to make up that amount. If it is not possible to form the amount using any combination of the given denominations... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minCoins([1, 2, 5], 11) == 3\", \"assert minCoins([2], 3) == -1\", \"assert minCoins([1], 0) == 0\", \"assert minCoins([1, 3, 4], 6) == 2\", \"assert minCoins([1, 2, 3], 4) == 2\", \"assert minCoins([1, 2, 5], 3) == 2\", \"assert minCoins([1, 2, 3], 5) == 2\... | {
"split": "train",
"index": 71464,
"acecode_id": "evol_2771",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a ternary search on a sorted list of integers and returns the index of a given target value. If the target value is not found in the list, the function should return -1. The function signature is: `def ternary_search(arr: List[int], key: int) ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ternary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert ternary_search([1, 2, 3, 4, 5], 1) == 0\", \"assert ternary_search([1, 2, 3, 4, 5], 5) == 4\", \"assert ternary_search([1, 2, 3, 4, 5], 6) == -1\", \"assert ternary_search([], 1) == -1\", \"assert ternary_s... | {
"split": "train",
"index": 71465,
"acecode_id": "evol_22601",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a set of integers and an integer value to add to the set. Implement a function `add_to_set(arbset: Set[int], addthis: int) -> Set[int]` that takes a set of integers `arbset` and an integer `addthis`, adds `addthis` to the set, and returns the updated set. Note tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_to_set({1, 2}, 3) == {1, 2, 3}\", \"assert add_to_set({5, 6, 7}, 8) == {5, 6, 7, 8}\", \"assert add_to_set({1}, 1) == {1}\", \"assert add_to_set({0, -1}, 1) == {0, -1, 1}\", \"assert add_to_set(set(), 4) == {4}\", \"assert add_to_set({3, 4, 5}, 6) == {3,... | {
"split": "train",
"index": 71466,
"acecode_id": "bigcode_python_fns_14074",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns the string reversed. The function should handle empty strings and strings containing special characters and spaces correctly.\nPlease reason step by step, then write a self-contained Python solution. Give your final ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('') == ''\", \"assert reverse_string('a') == 'a'\", \"assert reverse_string('abc') == 'cba'\", \"assert reverse_string('racecar') == 'racecar'\", \"assert reverse_string('12345') == '54321'\", \"a... | {
"split": "train",
"index": 71467,
"acecode_id": "evol_10921",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You have a list `arr` of all integers in the range `[1, n]` sorted in a strictly increasing order. Apply the following algorithm on `arr`: Starting from left to right, remove the first number and every other number afterward until you reach the end of the list. Repeat the previ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lastRemaining(1) == 1\", \"assert lastRemaining(3) == 2\", \"assert lastRemaining(7) == 4\", \"assert lastRemaining(9) == 4\", \"assert lastRemaining(15) == 8\"]}"
} | {
"split": "train",
"index": 71468,
"acecode_id": "evol_21341",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to check the strength of passwords from a list. The function should take a list of passwords as input and return a list of weak passwords. A weak password is defined as one that is less than 6 characters long or entirely numeric. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_weak_passwords(['123456', 'password', 'abc', '123', 'letmein', '4567']) == ['123456', 'abc', '123', '4567']\", \"assert find_weak_passwords(['securepassword', '1', '12', '123', '1234']) == ['1', '12', '123', '1234']\", \"assert find_weak_passwords(['str... | {
"split": "train",
"index": 71469,
"acecode_id": "oss_34801",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of words and a target string, implement a function `find_palindrome(words, target)` that returns True if the target string exists in the list and is a palindrome (a word that reads the same forwards and backwards). Otherwise, return False.\nPlease reason step by st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_palindrome(['racecar', 'level', 'deed', 'swap', 'keel'], 'racecar') == True\", \"assert find_palindrome(['racecar', 'level', 'deed', 'swap', 'keel'], 'level') == True\", \"assert find_palindrome(['racecar', 'level', 'deed', 'swap', 'keel'], 'deed') == T... | {
"split": "train",
"index": 71470,
"acecode_id": "evol_15608",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a scale factor represented as a list of integers and a mapping that indicates which dimensions of the scale should be reshaped. Your task is to create a function that reshapes the scale factor to a new shape based on the specified mapping. The mapping consists of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reshape_scale([1, 2, 3], [(0, [0])]) == [-1, 2, 3]\", \"assert reshape_scale([10, 20, 30], [(0, [0]), (1, [1])]) == [-1, -1, 30]\", \"assert reshape_scale([5], [(0, [0])]) == [-1]\", \"assert reshape_scale([10, 20, 30, 40], [(0, [2])]) == [10, 20, -1, 40]\",... | {
"split": "train",
"index": 71471,
"acecode_id": "bigcode_python_fns_34217",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of user IDs and a target user ID to remove from the list. Implement a function `remove_user(user_ids: List[int], target_id: int) -> List[int]` that removes the target user ID from the list of user IDs and returns the updated list. If the target user ID is n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_user([1, 2, 3, 4, 5], 3) == [1, 2, 4, 5]\", \"assert remove_user([10, 20, 30], 20) == [10, 30]\", \"assert remove_user([100], 100) == []\", \"assert remove_user([], 1) == []\", \"assert remove_user([1, 2, 3], 4) == [1, 2, 3]\", \"assert remove_user([5... | {
"split": "train",
"index": 71472,
"acecode_id": "bigcode_python_fns_49599",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the balances of two accounts A and B in a payment channel. Your task is to implement a function that simulates the settlement of the channel after a series of transactions. The function should take the following parameters: a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert settle_channel([10, 5], 1) == [5, 10]\", \"assert settle_channel([5, 5], 1) == [0, 10]\", \"assert settle_channel([7, 5], 1) == [2, 10]\", \"assert settle_channel([15, 5], 1) == [10, 10]\", \"assert settle_channel([10, 0], 1) == [5, 5]\", \"assert settle_cha... | {
"split": "train",
"index": 71473,
"acecode_id": "bigcode_python_fns_49902",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates summary statistics for a given dataset represented as a list of dictionaries. The function should take in this list, the name of the dataset, and an optional unit for the statistics. The statistics to be calculated ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_statistics([{'A': 1, 'B': 4}, {'A': 2, 'B': 5}, {'A': 3, 'B': 6}], 'Sample Data', 'm') == {'A': {'mean (m)': 2.0, 'median (m)': 2.0, 'std (m)': 1.0, 'range (m)': 2}, 'B': {'mean (m)': 5.0, 'median (m)': 5.0, 'std (m)': 1.0, 'range (m)': 2}}\", \"assert g... | {
"split": "train",
"index": 71474,
"acecode_id": "oss_32816",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with retrieving details about pre-trained depth estimation models used in a computer vision project. Write a function `get_depth_model_details(model_name)` that takes a string `model_name` as input and returns a dictionary containing the model's dimensions and ch... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_depth_model_details('alexnet') == {'dimensions': 4096, 'channels': 256}\", \"assert get_depth_model_details('resnet18') == {'dimensions': 512, 'channels': 256}\", \"assert get_depth_model_details('resnet50') == {'dimensions': 2048, 'channels': 1024}\", \... | {
"split": "train",
"index": 71475,
"acecode_id": "oss_31122",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function `get_func_result` that calculates the result of a quadratic equation based on the formula `a*(x**2) + b*x + c`, where `a`, `x`, `b`, and `c` are integer parameters. Your task is to implement a function `calculate_quadratic` that takes four integer param... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_quadratic(0, 0, 0, 0) == 0\", \"assert calculate_quadratic(1, -1, 1, 1) == 1\", \"assert calculate_quadratic(2, 2, 2, 2) == 14\", \"assert calculate_quadratic(1, 0, 0, 0) == 0\", \"assert calculate_quadratic(3, 1, 0, 0) == 3\", \"assert calculate_q... | {
"split": "train",
"index": 71476,
"acecode_id": "oss_2186",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a triangle represented as a list of lists, where each list represents a row of the triangle, write a function `minimumTotal(triangle)` that finds the minimum path sum from the top to the bottom of the triangle. You may move to adjacent numbers on the row below. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimumTotal([[2], [3, 4], [6, 5, 7], [4, 1, 8, 3]]) == 11\", \"assert minimumTotal([[1], [2, 3], [4, 5, 6]]) == 7\", \"assert minimumTotal([[10], [20, 30], [40, 50, 60]]) == 70\", \"assert minimumTotal([[1], [1, 1], [1, 1, 1]]) == 3\", \"assert minimumTotal... | {
"split": "train",
"index": 71477,
"acecode_id": "oss_10417",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where the keys are symptoms and the values are their corresponding counts, write a function `top_symptoms(dic)` that returns a list of the top 5 symptoms with the highest counts. If there are fewer than 5 symptoms, return as many as are available. The list sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert top_symptoms({'cough': 10, 'fever': 20, 'headache': 15, 'nausea': 5, 'fatigue': 8}) == ['fever', 'headache', 'cough', 'fatigue', 'nausea']\", \"assert top_symptoms({'fever': 2, 'cough': 2, 'headache': 2}) == ['cough', 'fever', 'headache']\", \"assert top_sym... | {
"split": "train",
"index": 71478,
"acecode_id": "bigcode_python_fns_13177",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing unformatted sheet music, where notes are separated by commas. Your task is to format this sheet music into multiple lines based on the specified line length limit and line count limit. Each line should contain as many notes as possible withou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert explode_sheet_music('A,B,C,D') == ['A,B,C,D']\", \"assert explode_sheet_music('') == []\", \"assert explode_sheet_music('A,B,C,D,E,F,G') == ['A,B,C,D,E,F,G']\", \"assert explode_sheet_music('A,B,C,D,E,F,G,H,I,J,K') == ['A,B,C,D,E,F,G,H,I,J,K']\", \"assert ex... | {
"split": "train",
"index": 71479,
"acecode_id": "bigcode_python_fns_6483",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of server routes represented by strings. Your goal is to implement a function that can perform the following operations on a list of routes: add a new route, remove an existing route, and retrieve all current routes. Write a function `m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_routes([('add', '/home'), ('add', '/about'), ('remove', '/home'), ('get', '')]) == ['/about']\", \"assert manage_routes([('add', '/home'), ('add', '/home'), ('get', '')]) == ['/home']\", \"assert manage_routes([('remove', '/nonexistent'), ('get', '')]... | {
"split": "train",
"index": 71480,
"acecode_id": "oss_28326",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `path`, transform it into a camel case format. The camel case format requires that the first character of the string should be capitalized, and all subsequent underscores (`_`) and the character that follows them should also be capitalized. Return the resulting c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert camelcase('hello_world') == 'HelloWorld'\", \"assert camelcase('this_is_a_test') == 'ThisIsATest'\", \"assert camelcase('make_this_camel_case') == 'MakeThisCamelCase'\", \"assert camelcase('singleword') == 'Singleword'\", \"assert camelcase('another_example_... | {
"split": "train",
"index": 71481,
"acecode_id": "bigcode_python_fns_37003",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two matrices represented by their shapes as tuples (x1_shape and x2_shape), and two boolean values (transpose_x1 and transpose_x2) that indicate whether to transpose each matrix during multiplication, implement a function that determines the appropriate matrix multiplicat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matmul_op_select((1,), (1,), False, False) == 'Mul'\", \"assert matmul_op_select((2, 2), (2, 2), False, False) == 'MatMul'\", \"assert matmul_op_select((2, 3), (3, 4), False, True) == 'MatMul'\", \"assert matmul_op_select((1,), (3, 4, 5), False, True) == 'Ba... | {
"split": "train",
"index": 71482,
"acecode_id": "bigcode_python_fns_8365",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a method to manage a simple graph represented using an adjacency list. Your goal is to complete the method `add_node(graph, new_node, state)` that takes three parameters: `graph` (a dictionary representing the adjacency list), `new_node` (the no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_node({}, 'A', 1) == {'A': 1}\", \"assert add_node({'A': 1}, 'B', 2) == {'A': 1, 'B': 2}\", \"assert add_node({'A': 1, 'B': 2}, 'A', 3) == {'A': 3, 'B': 2}\", \"assert add_node({'A': 1}, 'C', 4) == {'A': 1, 'C': 4}\", \"assert add_node({'A': 1, 'C': 4}, '... | {
"split": "train",
"index": 71483,
"acecode_id": "oss_18312",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string s of lowercase English alphabets with no special characters. Implement a function `isValidString(s)` that determines if the string is valid. A string is valid if: 1. Its length is at least 4. 2. Every four consecutive characters are distinct. 3. Every uni... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isValidString('a') == False\", \"assert isValidString('aa') == False\", \"assert isValidString('abcd') == False\", \"assert isValidString('adbbd') == False\", \"assert isValidString('xxyz') == False\", \"assert isValidString('abcdeabcd') == False\", \"assert... | {
"split": "train",
"index": 71484,
"acecode_id": "evol_2617",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of target keys and a function that retrieves a corresponding value for each key. Your task is to implement a function `get_targets_as_list(key_list: List[str]) -> List[Any]` that takes a list of strings (target keys) as input and returns a list of values co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_targets_as_list(['key1', 'key2']) == ['value1', 'value2']\", \"assert get_targets_as_list(['keyA', 'keyB', 'keyC']) == ['valueA', 'valueB', 'valueC']\", \"assert get_targets_as_list([]) == []\", \"assert get_targets_as_list(['key1', 'key1']) == ['value1'... | {
"split": "train",
"index": 71485,
"acecode_id": "bigcode_python_fns_46715",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of bounding boxes, each represented as a tuple of two points (top-left and bottom-right coordinates), and a corresponding list of confidence scores for each bounding box, write a function `filter_person_boxes(bounding_boxes: List[Tuple[Tuple[int, int], Tuple[int, i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_person_boxes([((0, 0), (1, 1)), ((1, 1), (2, 2))], [0.4, 0.8], 0.5) == [((1, 1), (2, 2))]\", \"assert filter_person_boxes([((0, 0), (1, 1)), ((1, 1), (2, 2))], [0.6, 0.2], 0.5) == [((0, 0), (1, 1))]\", \"assert filter_person_boxes([((0, 0), (1, 1)), (... | {
"split": "train",
"index": 71486,
"acecode_id": "bigcode_python_fns_19395",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates command-line argument parsing for a text segmentation model. The function should accept four optional parameters: 'action', 'corpus', 'vocab_model', and 'lstm_model'. If the 'action' parameter is not provided, it should def... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments() == {'action': 'predict', 'corpus': 'data/msr_train.txt', 'vocab_model': 'model/vocab_model.pkl', 'lstm_model': 'model/bi-lstm.ckpt-6'}\", \"assert parse_arguments(action='train') == {'action': 'train', 'corpus': 'data/msr_train.txt', 'vocab... | {
"split": "train",
"index": 71487,
"acecode_id": "oss_9166",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing cities and the paths between them. Each path has an associated distance and cost. Your task is to implement a function `find_best_path(cities, start, end)` that finds the best path from the `start` city to the `end` city. The best path is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_best_path(cities, 'Los Angeles', 'Chicago') == ['Los Angeles', 'Chicago']\", \"assert find_best_path(cities, 'Los Angeles', 'New York') == ['Los Angeles', 'New York']\", \"assert find_best_path(cities, 'Los Angeles', 'Los Angeles') == ['Los Angeles']\",... | {
"split": "train",
"index": 71488,
"acecode_id": "evol_10802",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a dictionary containing the count of each unique integer in the list. Your function should handle an empty list by returning an empty dictionary. The function signature should be: `def count_u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_integers([]) == {}\", \"assert count_unique_integers([1, 2, 3]) == {1: 1, 2: 1, 3: 1}\", \"assert count_unique_integers([1, 1, 2, 3]) == {1: 2, 2: 1, 3: 1}\", \"assert count_unique_integers([-1, 0, 1]) == {-1: 1, 0: 1, 1: 1}\", \"assert count_un... | {
"split": "train",
"index": 71489,
"acecode_id": "bigcode_python_fns_15920",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function to check if a user has reserved a lecture room for a specific course at a given time. Your function should take three parameters: the course code (as a string), the start time (as a string formatted in 'YYYY-MM-DD HH:MM' format), and the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_reservation('CS101', '2023-10-01 10:00', 'student1') == True\", \"assert check_reservation('CS101', '2023-10-01 10:00', 'student2') == False\", \"assert check_reservation('MA201', '2023-10-02 14:00', 'student3') == False\", \"assert check_reservation('... | {
"split": "train",
"index": 71490,
"acecode_id": "oss_14825",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a value that can be of any type, implement a function `sanitize_bool(val)` that converts the value into a boolean. The function should interpret the string 'true' (case insensitive) as True, and any other string as False. If the value is already a boolean, it should be re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sanitize_bool('true') == True\", \"assert sanitize_bool('True') == True\", \"assert sanitize_bool('TRUE') == True\", \"assert sanitize_bool('false') == False\", \"assert sanitize_bool('False') == False\", \"assert sanitize_bool('FALSE') == False\", \"assert ... | {
"split": "train",
"index": 71491,
"acecode_id": "bigcode_python_fns_17336",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to calculate the total size of files in a simplified file system. The function should take in a list of file paths and return the total size of all the files. The file paths can be either absolute or relative, and each path is asso... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_file_size(['data/file1.txt', 'data/file2.txt']) == 3000\", \"assert calculate_total_file_size(['data/file1.txt', 'data/nonexistent_file.txt']) == 1000\", \"assert calculate_total_file_size(['data/nonexistent_file.txt', 'data/file2.txt']) == 2... | {
"split": "train",
"index": 71492,
"acecode_id": "oss_32987",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates writing data to a file. The function should take two parameters: a string `data` which represents the contents to be written, and an optional string `owner` which represents the owner of the file. If the `owner` is provided... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert write_data('Hello, World!') == 'Data written to file.'\", \"assert write_data('Test data', 'User1') == 'Data written to file. Ownership set to User1.'\", \"assert write_data('Another test case') == 'Data written to file.'\", \"assert write_data('Sample text'... | {
"split": "train",
"index": 71493,
"acecode_id": "bigcode_python_fns_44525",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a Unicode category as a string input and returns a list of glyph names for the characters within that category. The function should utilize a predefined dictionary that maps Unicode categories to their respective glyph names. Y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getGlyphNames('Alphabetic Presentation Forms') == ['glyph1', 'glyph2', 'glyph3']\", \"assert getGlyphNames('Alphabetic Presentation Forms') == ['glyph1', 'glyph2', 'glyph3']\", \"assert getGlyphNames('Nonexistent Category') == []\", \"assert getGlyphNames('A... | {
"split": "train",
"index": 71494,
"acecode_id": "oss_31776",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function to calculate the n-th Catalan number using a recursive approach. The function should accept a single integer n (0 <= n <= 30) and return the n-th Catalan number.\nPlease reason step by step, then write a self-contained Python solution. Give your final progr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert catalan(0) == 1\", \"assert catalan(1) == 1\", \"assert catalan(2) == 2\", \"assert catalan(3) == 5\", \"assert catalan(4) == 14\", \"assert catalan(5) == 42\", \"assert catalan(6) == 132\", \"assert catalan(7) == 429\", \"assert catalan(8) == 1430\", \"asse... | {
"split": "train",
"index": 71495,
"acecode_id": "evol_24244",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of citizens where each citizen has a unique identification number, name, gender, birth date, town, and a list of their relatives' identification numbers, implement a function that adds a new relative to a citizen's list of relatives. The function should take three ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_relative([{'citizen_id': 1, 'name': 'Jane', 'gender': 'male', 'birth_date': '13.09.1945', 'town': 'New York', 'relatives': []}], 1, 1) == [{'citizen_id': 1, 'name': 'Jane', 'gender': 'male', 'birth_date': '13.09.1945', 'town': 'New York', 'relatives': [1... | {
"split": "train",
"index": 71496,
"acecode_id": "bigcode_python_fns_1006",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `parse_music` that takes a string representing musical notes and returns a list of integers corresponding to the beat duration of each note. The conversion follows these rules: 'o' indicates a full note (4 beats), 'o|' indicates a half note (2 beats),... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_music('o o| .| o| o| .| .| .| .| o o') == [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\", \"assert parse_music('.| .| .| .|') == [1, 1, 1, 1]\", \"assert parse_music('o o o o') == [4, 4, 4, 4]\", \"assert parse_music('') == []\", \"assert parse_music('o| .|') == ... | {
"split": "train",
"index": 71497,
"acecode_id": "evol_20218",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple in-memory cache system in Python. Your goal is to create a function `cache_operations(operations: List[Tuple[str, str]]) -> List[Optional[str]]` that simulates a cache system. The input to the function is a list of operations, where eac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cache_operations([('set', '123:Event 1'), ('set', '456:Event 2'), ('get', '123')]) == ['Event 1']\", \"assert cache_operations([('set', '123:Event 1'), ('get', '456')]) == [None]\", \"assert cache_operations([('set', '789:Event 3'), ('get', '789')]) == ['Eve... | {
"split": "train",
"index": 71498,
"acecode_id": "oss_11209",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a dictionary of parameters and generates an annotation legend based on the key-value pairs. The annotation legend should be formatted as a string that includes the keys and their corresponding values from the input d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_annotation_legend({'color': 'blue', 'shape': 'circle', 'size': 'large'}) == 'Annotation Legend : color - blue, shape - circle, size - large'\", \"assert generate_annotation_legend({'fruit': 'apple', 'vegetable': 'carrot'}) == 'Annotation Legend ... | {
"split": "train",
"index": 71499,
"acecode_id": "oss_4775",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.