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 an array of integers and two target sums, k and l, write a function that determines if there exists a pair of numbers in the array that sums up to k, and also checks if there is a triplet in the array that sums up to l. The function should return a tuple of two boolean va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_pair_and_triplet_sum([1, 2, 3, 4, 5], 7, 10) == (True, True)\", \"assert has_pair_and_triplet_sum([1, 2, 3, 4, 5], 10, 15) == (False, False)\", \"assert has_pair_and_triplet_sum([1, 1, 1, 1, 1], 2, 3) == (True, True)\", \"assert has_pair_and_triplet_sum(... | {
"split": "train",
"index": 5200,
"acecode_id": "evol_1789",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, implement a function that calculates the factorial of n using recursion. Additionally, return the number of trailing zeroes in the resultant factorial without using any external libraries. The trailing zeroes can be determined by counting how man... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial_and_trailing_zeroes(0) == (1, 0)\", \"assert factorial_and_trailing_zeroes(1) == (1, 0)\", \"assert factorial_and_trailing_zeroes(2) == (2, 0)\", \"assert factorial_and_trailing_zeroes(3) == (6, 0)\", \"assert factorial_and_trailing_zeroes(4) == (2... | {
"split": "train",
"index": 5201,
"acecode_id": "evol_3964",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that retrieves the kth prime number from the list. If there are fewer than k prime numbers in the list, the function should return None.\nPlease reason step by step, then write a self-contained Python solution. Give your final program ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_kth_prime_numbers([13, 18, 23, 17, 29, 34, 37], 1) == 13\", \"assert find_kth_prime_numbers([13, 18, 23, 17, 29, 34, 37], 4) == 29\", \"assert find_kth_prime_numbers([13, 18, 23, 17, 29, 34, 37], 5) == 37\", \"assert find_kth_prime_numbers([13, 18, 23, ... | {
"split": "train",
"index": 5202,
"acecode_id": "evol_27240",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an NxN grid filled with unique integers from 1 to N*N, implement a function that finds the smallest sum of values from any k elements connected through neighboring cells (up, down, left, right). The function should return the sorted sequence of these k values. If it is no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minPath([[1,2,3], [4,5,6], [7,8,9]], 3) == [1, 2, 3]\", \"assert minPath([[1,2,3], [4,5,6], [7,8,9]], 1) == [1]\", \"assert minPath([[5,1,2], [4,3,6], [7,8,9]], 2) == [1, 2]\", \"assert minPath([[9,8,7], [6,5,4], [3,2,1]], 4) == [1, 2, 3, 4]\", \"assert minP... | {
"split": "train",
"index": 5203,
"acecode_id": "evol_5449",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fast_hadamard_transform(data: List[int]) -> List[int]` that computes the Fast Walsh-Hadamard Transform (FWHT) of a given list of integers. The input list `data` will contain a number of elements that is a power of two (1, 2, 4, 8, 16, ...). The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fast_hadamard_transform([1]) == [1]\", \"assert fast_hadamard_transform([1, 1]) == [2, 0]\", \"assert fast_hadamard_transform([2, 2, 2, 2]) == [8, 0, 0, 0]\", \"assert fast_hadamard_transform([-1, -1]) == [-2, 0]\", \"assert fast_hadamard_transform([1, 0, 0,... | {
"split": "train",
"index": 5204,
"acecode_id": "bigcode_python_fns_9187",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes in a list of tetrahedrons, where each tetrahedron is represented by a list of 4 vectors in 3D space. Your goal is to compute the average vector for each corresponding vertex across all tetrahedrons and return this list of a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_tetrahedron_vectors([[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0], [1.0, 1.0, 1.0]], [[2.0, 0.0, 0.0], [0.0, 2.0, 0.0], [0.0, 0.0, 2.0], [2.0, 2.0, 2.0]]]) == [[1.5, 0.0, 0.0], [0.0, 1.5, 0.0], [0.0, 0.0, 1.5], [1.5, 1.5, 1.5]]\", \"assert aver... | {
"split": "train",
"index": 5205,
"acecode_id": "bigcode_python_fns_17266",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You need to validate user credentials for a system. Write a function `is_valid_user(username: str, password: str, is_valid_email: bool, error_message: str) -> str` that checks if a user's credentials are valid based on the following rules: 1. If the `username` is not provided o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_user('', 'Password123', False, 'Invalid UserId / Password') == 'Invalid UserId / Password'\", \"assert is_valid_user('user', '', False, 'Invalid UserId / Password') == 'Invalid UserId / Password'\", \"assert is_valid_user('user@example.com', 'pass',... | {
"split": "train",
"index": 5206,
"acecode_id": "oss_19020",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers `nums` and an integer `k`, return the total number of continuous subarrays whose sum equals `k`. Implement this function without using any built-in function or library.\nPlease reason step by step, then write a self-contained Python solution. Give you... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subarraySum([1, 1, 1], 2) == 2\", \"assert subarraySum([1, 2, 3], 3) == 2\", \"assert subarraySum([1, -1, 0], 0) == 3\", \"assert subarraySum([0, 0, 0], 0) == 6\", \"assert subarraySum([-1, -1, 1], 0) == 1\", \"assert subarraySum([5, 5, 5], 5) == 3\", \"asse... | {
"split": "train",
"index": 5207,
"acecode_id": "evol_21650",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the deletion of an order from a collection of orders. Each order is represented as a dictionary with an 'id' key. Your function should take an integer `id` as input, which represents the order ID to be deleted. You will... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_order([{'id': 1}, {'id': 2}], 1) == ({'order': {'id': 1}}, 200)\", \"assert delete_order([{'id': 1}, {'id': 2}], 3) == ({'message': 'Order not found'}, 404)\", \"assert delete_order([{'id': 1}, {'id': 2}, {'id': 3}], 2) == ({'order': {'id': 2}}, 200)\... | {
"split": "train",
"index": 5208,
"acecode_id": "oss_18739",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, return the total number of unique binary search trees that can be formed with n distinct nodes. The nodes are labeled from 1 to n. Implement a function named numUniqueBSTs that takes an integer n as input and returns the count of unique binary search trees. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numUniqueBSTs(0) == 1\", \"assert numUniqueBSTs(1) == 1\", \"assert numUniqueBSTs(2) == 2\", \"assert numUniqueBSTs(3) == 5\", \"assert numUniqueBSTs(4) == 14\", \"assert numUniqueBSTs(5) == 42\", \"assert numUniqueBSTs(6) == 132\", \"assert numUniqueBSTs(7)... | {
"split": "train",
"index": 5209,
"acecode_id": "evol_7037",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a list of unsigned 256-bit integers (uint256) into a single integer. The conversion is done by treating the list elements as base-2^256 coefficients. Specifically, the first element in the list is the least significant c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert uint256_list_to_int([]) == 0\", \"assert uint256_list_to_int([1]) == 1\", \"assert uint256_list_to_int([2]) == 2\", \"assert uint256_list_to_int([0, 1]) == 1 * (2 ** 256)\", \"assert uint256_list_to_int([1, 1, 1]) == 1 + 1 * (2 ** 256) + 1 * (2 ** 512)\", \"... | {
"split": "train",
"index": 5210,
"acecode_id": "oss_10319",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n)` that calculates the nth Fibonacci number using a recursive approach. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. Your function should return the nth Fibonacci number, where n is a no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 5211,
"acecode_id": "evol_11586",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the version number of a software project. The version number is provided as a string argument to the function. Your task is to implement a function named `get_version_number(version)` that takes a version string as input an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_version_number('1.0.0') == '1.0.0'\", \"assert get_version_number('2.5.1') == '2.5.1'\", \"assert get_version_number('0.1.2') == '0.1.2'\", \"assert get_version_number('5.0.0') == '5.0.0'\", \"assert get_version_number('10.10.10') == '10.10.10'\", \"asse... | {
"split": "train",
"index": 5212,
"acecode_id": "oss_3242",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary of books where the keys are book titles and the values are tuples containing the following details about each book: (price, rating, pages, year, sold, reviews, author, genre). Your task is to implement a function `filter_books(book_dict, min_values)` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_books({}, [10, 3, 100, 2000, 150, 100, 'Author1', 'Fiction']) == 'Dictionary is empty'\", \"assert filter_books({'Book1': (10, 3, 100, 2000, 150, 100, 'Author1', 'Fiction')}, []) == 'Minimum values should include 8 parameters'\", \"assert filter_books... | {
"split": "train",
"index": 5213,
"acecode_id": "evol_24368",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of connections in a neural network, where each connection is represented as a tuple (i, j, weight), indicating a connection from neuron i to neuron j with a given weight (a positive integer). Your task is to create an adjacency matrix for the neural network... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_adjacency_matrix([(0, 1, 5), (1, 2, 3)], 3) == [[0, 5, 0], [0, 0, 3], [0, 0, 0]]\", \"assert create_adjacency_matrix([(0, 1, 2), (0, 2, 4), (1, 2, 1)], 3) == [[0, 2, 4], [0, 0, 1], [0, 0, 0]]\", \"assert create_adjacency_matrix([(0, 0, 1)], 1) == [[1]... | {
"split": "train",
"index": 5214,
"acecode_id": "bigcode_python_fns_15957",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `scrutinise_string(s: str) -> Dict[str, Union[bool, int, List[Tuple[int, int]]]]` that takes a string `s` as input and returns a dictionary with three keys: 'ends_with_py' (a boolean indicating if the string ends with 'py'), 'count' (an integer representing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scrutinise_string('hello world') == {'ends_with_py': False, 'count': 0, 'positions': []}\", \"assert scrutinise_string('just a test string') == {'ends_with_py': False, 'count': 0, 'positions': []}\", \"assert scrutinise_string('No occurrences here') == {'end... | {
"split": "train",
"index": 5215,
"acecode_id": "evol_3774",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `clipboard_operations` that simulates a simple clipboard manager. The function takes a list of operations, where each operation is either a copy operation or a paste operation. The function should return a list of results for e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clipboard_operations(['COPY Hello', 'PASTE']) == ['Hello']\", \"assert clipboard_operations(['COPY World', 'COPY Hello', 'PASTE', 'PASTE']) == ['Hello', 'Hello']\", \"assert clipboard_operations(['PASTE', 'COPY Test', 'PASTE']) == ['', 'Test']\", \"assert cl... | {
"split": "train",
"index": 5216,
"acecode_id": "oss_37071",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 3D space represented by a list of points, each defined by its (x, y, z) coordinates. Your task is to implement a function that determines if the number of points in the 3D space is acceptable based on a defined maximum population threshold. If the number of poin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_population_acceptable([(0, 0, 0)], 1) == True\", \"assert is_population_acceptable([(0, 0, 0), (1, 1, 1)], 2) == True\", \"assert is_population_acceptable([(0, 0, 0), (1, 1, 1), (2, 2, 2)], 2) == False\", \"assert is_population_acceptable([], 0) == True\"... | {
"split": "train",
"index": 5217,
"acecode_id": "bigcode_python_fns_46061",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given piece of text to extract and count the occurrences of each word. The function should take in a string of text and return a dictionary where the keys are the unique words in the text and the values are the cou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_words('apple banana apple orange banana') == {'apple': 2, 'banana': 2, 'orange': 1}\", \"assert get_words('hello world hello') == {'hello': 2, 'world': 1}\", \"assert get_words('test test test test') == {'test': 4}\", \"assert get_words('') == {}\", \"as... | {
"split": "train",
"index": 5218,
"acecode_id": "oss_18579",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given an integer 'repeats' representing the number of times a block should repeat, and a float 'depth_coefficient' representing the depth multiplier, implement a function that calculates the new repeat number based on the formula: ceil(depth_coefficient * repeats). If the depth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert round_repeats(5, 2.0) == 10\", \"assert round_repeats(3, 1.5) == 5\", \"assert round_repeats(7, 0.0) == 7\", \"assert round_repeats(10, 0.5) == 5\", \"assert round_repeats(0, 1.0) == 0\", \"assert round_repeats(4, 2.25) == 9\", \"assert round_repeats(1, 3.0)... | {
"split": "train",
"index": 5219,
"acecode_id": "bigcode_python_fns_17151",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `consonant_count(s: str) -> int` that takes a string `s` as input and returns the total number of non-vowel alphabetic characters (consonants) present in the string. Vowels are defined as the characters 'a', 'e', 'i', 'o', 'u' (case insensitive). Non-alphab... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert consonant_count('') == 0\", \"assert consonant_count('Hello, World!') == 7\", \"assert consonant_count('aeiou') == 0\", \"assert consonant_count('The quick brown fox jumps over the lazy dog') == 24\", \"assert consonant_count('1234567890') == 0\", \"assert c... | {
"split": "train",
"index": 5220,
"acecode_id": "evol_19383",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with manipulating an input string 's' that contains words separated by various delimiters specified in 'delimiter_set'. Your goal is to split this string into words and create a list of the words in their original order, excluding any words that match the 'target... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert advanced_string_manipulation('Python is fun', 'Python', {' '}, True, False) == ['nuf', 'si']\", \"assert advanced_string_manipulation('Hello World', 'hello', {' '}, False, False) == ['World']\", \"assert advanced_string_manipulation('abc-def-ghi-jkl', 'ghi',... | {
"split": "train",
"index": 5221,
"acecode_id": "evol_32425",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a Boolean input into a string value. The function should return 'yes' if the input is True, and 'no' if the input is False. The function signature is as follows: def boolToYes(b: bool) -> str: where b is a Boolean value.\nPlease reason step by ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert boolToYes(True) == 'yes'\", \"assert boolToYes(False) == 'no'\", \"assert boolToYes(True) == 'yes'\", \"assert boolToYes(False) == 'no'\", \"assert boolToYes(True) == 'yes'\", \"assert boolToYes(False) == 'no'\", \"assert boolToYes(True) == 'yes'\", \"assert... | {
"split": "train",
"index": 5222,
"acecode_id": "bigcode_python_fns_13176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string that may contain letters and various types of brackets (including '()', '[]', and '{}'), determine if the brackets are correctly balanced. A string is considered balanced if every opening bracket has a corresponding closing bracket in the correct order. Letters i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multi_bracket_validation('hello[]world') == True\", \"assert multi_bracket_validation('hello{world}(test)') == True\", \"assert multi_bracket_validation('[') == False\", \"assert multi_bracket_validation(']') == False\", \"assert multi_bracket_validation('he... | {
"split": "train",
"index": 5223,
"acecode_id": "bigcode_python_fns_40045",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that checks if the list is a palindrome. A palindrome is a sequence that reads the same backward as forward. Your function should return True if the list is a palindrome, and False otherwise. For example, the list [1, 2, 3, 2, 1] is a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome([1, 2, 3, 2, 1]) == True\", \"assert is_palindrome([1, 2, 3]) == False\", \"assert is_palindrome([1]) == True\", \"assert is_palindrome([]) == True\", \"assert is_palindrome([1, 2, 1]) == True\", \"assert is_palindrome([1, 2, 3, 4, 5]) == False... | {
"split": "train",
"index": 5224,
"acecode_id": "bigcode_python_fns_40221",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `binary_search(arr: List[int], x: int) -> int` that employs a binary search technique to locate an element `x` within a chronologically ordered array `arr`. The function should return the index of `x` if it exists in the array, otherwise return -1.\nPlease ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert binary_search([2, 4, 6, 8, 10], 4) == 1\", \"assert binary_search([10, 20, 30, 40, 50], 25) == -1\", \"assert binary_search([], 1) == -1\", \"assert binary_search([1, 3, 5, 7, 9], 9) == 4\", \"assert binary_... | {
"split": "train",
"index": 5225,
"acecode_id": "evol_15039",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a comma-separated list of file names, write a function `convert_files_to_map(file_list: str) -> List[str]` that converts this list of files into a map. Each file name should be processed to create a corresponding map entry in the format 'File: {file_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_files_to_map('a.fits,b.fits,c.cat') == ['File: a.fits', 'File: b.fits', 'File: c.cat']\", \"assert convert_files_to_map('image1.png,image2.jpg') == ['File: image1.png', 'File: image2.jpg']\", \"assert convert_files_to_map('document.pdf') == ['File: d... | {
"split": "train",
"index": 5226,
"acecode_id": "bigcode_python_fns_33857",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two dictionaries D1 and D2, where each dictionary contains string keys and floating-point values, implement a function `inner_product(D1: Dict[str, float], D2: Dict[str, float]) -> float`. The function should calculate and return the inner product of the two frequency map... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert inner_product({'a': 1.0, 'b': 2.0}, {'b': 3.0, 'c': 4.0}) == 6.0\", \"assert inner_product({'x': 1.5, 'y': 2.5}, {'y': 2.5, 'z': 3.5}) == 6.25\", \"assert inner_product({'key1': 0.5}, {'key1': 1.0}) == 0.5\", \"assert inner_product({}, {}) == 0.0\", \"assert... | {
"split": "train",
"index": 5227,
"acecode_id": "bigcode_python_fns_46541",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a lattice type ('fcc' or 'bcc'), a list of miller indices, a host symbol representing an atom type, a lattice constant, a size tuple representing the supercell dimensions, and an optional dictionary of replacements for specific layers, write a function `create_slab(lattic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_slab('bcc', [[1, 1, 1]], 'W', 3.16, (1, 1, 1)) == [('W', [0.0, 0.0, 0.0])]\", \"assert create_slab('fcc', [[0, 0, 1]], 'Zn', 4.0, (1, 1, 3)) == [('Zn', [0.0, 0.0, 0.0]), ('Zn', [0.0, 0.0, 2.0]), ('Zn', [0.0, 0.0, 4.0])]\", \"assert create_slab('bcc', ... | {
"split": "train",
"index": 5228,
"acecode_id": "bigcode_python_fns_35187",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `convert_to_uppercase` that takes a single string argument and returns the string transformed into uppercase characters. For example, given the input 'hello world', the output should be 'HELLO WORLD'.\nPlease reason step by step, then write a self-co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_uppercase('this is a string') == 'THIS IS A STRING'\", \"assert convert_to_uppercase('hello world') == 'HELLO WORLD'\", \"assert convert_to_uppercase('python programming') == 'PYTHON PROGRAMMING'\", \"assert convert_to_uppercase('LeetCode Challeng... | {
"split": "train",
"index": 5229,
"acecode_id": "evol_13579",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of date strings and converts each date to ISO 8601 format (YYYY-MM-DD). Each date string must be in the format 'dd MMM yyyy'. If any date string is not in the expected format, the function should raise a ValueError. The input list can c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_dates_to_iso(['21 Dec 2021', '01 Jan 2022', '15 Feb 2023']) == ['2021-12-21', '2022-01-01', '2023-02-15']\", \"assert convert_dates_to_iso(['05 Jul 2020', '30 Aug 1999']) == ['2020-07-05', '1999-08-30']\", \"assert convert_dates_to_iso(['12 Nov 2021'... | {
"split": "train",
"index": 5230,
"acecode_id": "evol_17486",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of file sizes (in bytes) as input and returns the total size of all the files in the list. Additionally, the function should return a list of the sizes of each file in the input list. The function should handle the case ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_size([]) == (0, [])\", \"assert calculate_total_size([100]) == (100, [100])\", \"assert calculate_total_size([200, 300]) == (500, [200, 300])\", \"assert calculate_total_size([50, 150, 50]) == (250, [50, 150, 50])\", \"assert calculate_total_... | {
"split": "train",
"index": 5231,
"acecode_id": "oss_12079",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the generation of a graphical user interface (GUI) for displaying email information. Your function should take the sender's name, email subject, and background color as input and return a string that describes the generated... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_email_gui('John Doe', 'Meeting Agenda', 'lightblue') == 'Sender: John Doe, Subject: Meeting Agenda, Background Color: lightblue'\", \"assert create_email_gui('Alice Smith', 'Project Update', 'white') == 'Sender: Alice Smith, Subject: Project Update, B... | {
"split": "train",
"index": 5232,
"acecode_id": "oss_21337",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a response context from an API call. Your task is to validate the response by checking if it contains specific fields based on the status code. If the status code is 404, the response should include a 'message' field. For any other status code, the response should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_api_response({'response': {'status_code': 200, 'json': lambda: {'user_id': 123}}}) == True\", \"assert validate_api_response({'response': {'status_code': 200, 'json': lambda: {'status': 'success', 'user_id': 456}}}) == True\", \"assert validate_api_... | {
"split": "train",
"index": 5233,
"acecode_id": "bigcode_python_fns_44116",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a dataset. Your task is to implement a function that inserts a list of new integer features into this dataset. The function should take three parameters: the original dataset (list of integers), the new features (list of integers), ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_features([1, 2, 3], [4, 5], ['feature1', 'feature2']) == [1, 2, 3, 4, 5]\", \"assert insert_features([10, 20, 30], [40, 50, 60], ['feature1', 'feature2']) == [10, 20, 30, 40, 50]\", \"assert insert_features([1, 2, 3], [4, 5, 6, 7], ['feature1', 'featu... | {
"split": "train",
"index": 5234,
"acecode_id": "bigcode_python_fns_30659",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of companies and their employees, write a function that calculates the number of unique employees for a specified company. The input is a list of lists, where each sublist contains a company name followed by the names of its employees. Employees may work for multip... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert employee_count([['Apple', 'John', 'James'], ['Google', 'Adam', 'Steve', 'Joseph'], ['Facebook', 'Matt', 'Chris'], ['Apple', 'James', 'George']], 'Apple') == 3\", \"assert employee_count([['Apple', 'John', 'James'], ['Google', 'Adam', 'Steve', 'Joseph'], ['Fa... | {
"split": "train",
"index": 5235,
"acecode_id": "evol_16936",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a given string by performing several transformations to clean the text. The function should remove all non-ASCII characters, convert the text to lowercase, remove specific undesired punctuation characters (like '#', '|', '*... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_text('Hello, World!') == 'hello world'\", \"assert clean_text('This is a test: 1234') == 'this is a test'\", \"assert clean_text('Python is great! #Python3') == 'python is great python'\", \"assert clean_text(' Leading and trailing spaces ') == 'le... | {
"split": "train",
"index": 5236,
"acecode_id": "bigcode_python_fns_37189",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates loading an object from a JSON-like structure. The function should accept a string input representing the name of the object and return a dictionary that simulates the deserialized object. The function should assume that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_object('user') == {'name': 'Alice', 'age': 30}\", \"assert load_object('product') == {'id': 101, 'name': 'Laptop', 'price': 999.99}\", \"assert load_object('order') == {'order_id': 1, 'amount': 250.75}\", \"assert load_object('non_existing') == {}\", \"... | {
"split": "train",
"index": 5237,
"acecode_id": "oss_28433",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that compares two distinct lists, list1 and list2, to identify common elements, while also recording their respective indices in each list. The function should return the shared components and their indices in both lists as a dictionary. Do not use any... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_lists([1, 2, 3], [3, 4, 5]) == {3: [(2, 0)]}\", \"assert compare_lists([1, 1, 2], [1, 2, 3]) == {1: [(0, 0), (1, 0)], 2: [(2, 1)]}\", \"assert compare_lists([], []) == {}\", \"assert compare_lists([1, 2, 3], []) == {}\", \"assert compare_lists([], [1... | {
"split": "train",
"index": 5238,
"acecode_id": "evol_4618",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `longest_increasing_subsequence(nums)` that returns the longest increasing subsequence of the list. If there are multiple subsequences of the same maximum length, return any of them. If the input list is empty, return an empty list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_increasing_subsequence([3, 4, 5, 1, 2]) == [3, 4, 5]\", \"assert longest_increasing_subsequence([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert longest_increasing_subsequence([5, 4, 3, 2, 1]) == [5]\", \"assert longest_increasing_subsequence([]) == [... | {
"split": "train",
"index": 5239,
"acecode_id": "evol_23419",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a custom exception class in Python for handling a specific error scenario in a storage management system. The system manages various types of storage devices, including Fibre Channel volume devices. Your goal is to implement a custom exception class... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert NoFibreChannelVolumeDeviceFound.message == 'Unable to find a Fibre Channel volume device.'\", \"assert isinstance(NoFibreChannelVolumeDeviceFound('error').message, str) == True\", \"assert isinstance(NoFibreChannelVolumeDeviceFound.message, str) == True\", \... | {
"split": "train",
"index": 5240,
"acecode_id": "oss_6023",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `lcm_of_four_numbers(a, b, c, d)` that takes four integers as input and returns the Least Common Multiple (LCM) of those four integers. You can assume that the input numbers will always be positive integers.\nPlease reason step by step, then write a self-contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm_of_four_numbers(4, 5, 6, 7) == 420\", \"assert lcm_of_four_numbers(12, 15, 20, 30) == 60\", \"assert lcm_of_four_numbers(1, 2, 3, 4) == 12\", \"assert lcm_of_four_numbers(7, 14, 21, 28) == 84\", \"assert lcm_of_four_numbers(5, 10, 15, 20) == 60\", \"asse... | {
"split": "train",
"index": 5241,
"acecode_id": "evol_14388",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given three distinct non-negative and non-zero integers, write a function `compute_lcm(a, b, c)` that returns the Least Common Multiple (LCM) of these three integers. Your implementation should be efficient and easy to read.\nPlease reason step by step, then write a self-contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_lcm(2, 3, 5) == 30\", \"assert compute_lcm(4, 6, 8) == 24\", \"assert compute_lcm(7, 9, 10) == 630\", \"assert compute_lcm(12, 15, 20) == 60\", \"assert compute_lcm(5, 10, 15) == 30\", \"assert compute_lcm(3, 6, 9) == 18\", \"assert compute_lcm(8, 12... | {
"split": "train",
"index": 5242,
"acecode_id": "evol_34137",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists, `a` and `b`, where each element in `a` corresponds to an element in `b`, your task is to return two new lists, `aaa` and `bbb`, such that each element in `aaa` is unique and corresponds to a unique element in `bbb`. If an element in `a` maps to multiple element... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert argunique([1, 2, 3], [4, 5, 6]) == ([1, 2, 3], [4, 5, 6])\", \"assert argunique([1, 1, 2], [4, 5, 6]) == ([2], [6])\", \"assert argunique([1, 2, 3, 1], [4, 5, 6, 4]) == ([2, 3], [5, 6])\", \"assert argunique([1, 2, 2, 3], [4, 5, 5, 6]) == ([1, 3], [4, 6])\",... | {
"split": "train",
"index": 5243,
"acecode_id": "bigcode_python_fns_14674",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that takes this list and returns a new list that contains only the unique integers from the original list, maintaining the order in which they first appeared. The function should not modify the original list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 3, 1, 2, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([4, 4, 4, 4]) == [4]\", \"assert unique_integers([-1, -1, 0, 1, 1, 2]) == [-1, 0, 1, 2]\", \"assert unique_integers([]) == []\", \"assert unique_integers([1, 2, 3, 4, 5]) == [1, ... | {
"split": "train",
"index": 5244,
"acecode_id": "bigcode_python_fns_5198",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary matrix `grid` of dimensions `n x n`, implement a function `shortest_path_binary_matrix(grid: List[List[int]]) -> int` that computes the length of the shortest unobstructed path from the top-left cell (0, 0) to the bottom-right cell (n - 1, n - 1). An unobstructed... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_path_binary_matrix([[0,1],[1,0]]) == 2\", \"assert shortest_path_binary_matrix([[0,0,0],[1,1,0],[1,1,0]]) == 4\", \"assert shortest_path_binary_matrix([[1,0,0],[1,1,0],[1,1,0]]) == -1\", \"assert shortest_path_binary_matrix([[0]]) == 1\", \"assert s... | {
"split": "train",
"index": 5245,
"acecode_id": "evol_5252",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_adult(dob: str) -> bool` that checks if a person is an adult based on their date of birth (dob) provided as a string in the format 'YYYY-MM-DD'. The function should return True if the person is 18 years or older as of today's date, and False otherwise.\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_adult('2000-01-01') == True\", \"assert is_adult('1990-06-15') == True\", \"assert is_adult('1995-07-10') == True\", \"assert is_adult('2001-02-28') == True\", \"assert is_adult('1980-08-30') == True\", \"assert is_adult('2000-12-31') == True\", \"assert ... | {
"split": "train",
"index": 5246,
"acecode_id": "evol_34832",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_strictly_ascending_order(lst)` that verifies whether a given list of numerical values is in strictly ascending order. The list is considered strictly ascending if each element is greater than the previous one, meaning no two successive numbers can be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_strictly_ascending_order([]) == False\", \"assert check_strictly_ascending_order([1]) == False\", \"assert check_strictly_ascending_order([1, 2, 3]) == True\", \"assert check_strictly_ascending_order([1, 1, 2]) == False\", \"assert check_strictly_ascen... | {
"split": "train",
"index": 5247,
"acecode_id": "evol_18404",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an individual's details consisting of their name, age, and geographical location. Your task is to write a function that takes these details as input parameters and returns a valid JSON representation of the individual. The input parameters are a string for the nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_json('Alice', 28, 'Los Angeles') == '{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 28, \\\"location\\\": \\\"Los Angeles\\\"}'\", \"assert convert_to_json('Bob', 45, 'Chicago') == '{\\\"name\\\": \\\"Bob\\\", \\\"age\\\": 45, \\\"location\\\": \\\"Ch... | {
"split": "train",
"index": 5248,
"acecode_id": "evol_24530",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `distinct_fibonacci_heap_insert` that accepts a list of integers and constructs a distinct Fibonacci heap by inserting each integer into the heap. The function should return the minimum value from the heap after all integers have been inserted. You can assu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert distinct_fibonacci_heap_insert([25, 15, 36, 23, 47, 64, 59]) == 15\", \"assert distinct_fibonacci_heap_insert([10, 20, 30]) == 10\", \"assert distinct_fibonacci_heap_insert([5, 3, 8]) == 3\", \"assert distinct_fibonacci_heap_insert([100, 200, 50, 150]) == 50... | {
"split": "train",
"index": 5249,
"acecode_id": "evol_7614",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the even integers from the original list. The order of the even integers in the new list should be the same as their order in the original list. Implement a function nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([0, -2, -3, -4]) == [0, -2, -4]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([... | {
"split": "train",
"index": 5250,
"acecode_id": "oss_14336",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that marks a report as deleted in a given list of reports. Each report is represented as a dictionary with a unique 'uuid' and a 'deleted' status. Your function should take a report's uuid and a list of reports. If a report with the g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mark_report_deleted('123', [{'uuid': '123', 'deleted': 'false'}, {'uuid': '456', 'deleted': 'false'}]) == [{'uuid': '123', 'deleted': 'true'}, {'uuid': '456', 'deleted': 'false'}]\", \"assert mark_report_deleted('456', [{'uuid': '123', 'deleted': 'false'}, {... | {
"split": "train",
"index": 5251,
"acecode_id": "bigcode_python_fns_21357",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `set_trace_options(options: int) -> bool` that takes an integer `options` as input. This function simulates the posting of a 'set_bblk_trace_options()' request. The function should return `True` if the request was successful and `Fals... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_trace_options(0) == True\", \"assert set_trace_options(100) == True\", \"assert set_trace_options(50) == True\", \"assert set_trace_options(-1) == False\", \"assert set_trace_options(101) == False\", \"assert set_trace_options(75) == True\", \"assert set... | {
"split": "train",
"index": 5252,
"acecode_id": "bigcode_python_fns_15480",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function `find_least_multiple(n)` that returns the least positive integer that is divisible by every integer from 1 to n. The function should take a single parameter n (1 <= n <= 20) and return the corresponding least common multiple (LCM) of all int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_least_multiple(1) == 1\", \"assert find_least_multiple(2) == 2\", \"assert find_least_multiple(3) == 6\", \"assert find_least_multiple(4) == 12\", \"assert find_least_multiple(5) == 60\", \"assert find_least_multiple(6) == 60\", \"assert find_least_mult... | {
"split": "train",
"index": 5253,
"acecode_id": "evol_11604",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that generates all unique combinations (subsets) of characters from the string, without considering the order of elements. The function must first check if the input string contains only alphabetical characters (a-z, A-Z). If the string cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gen_combinations('ABC') == ['A', 'B', 'C', 'AB', 'AC', 'BC', 'ABC']\", \"assert gen_combinations('A') == ['A']\", \"assert gen_combinations('XYZ') == ['X', 'Y', 'Z', 'XY', 'XZ', 'YZ', 'XYZ']\", \"assert gen_combinations('ABCD') == ['A', 'B', 'C', 'D', 'AB', ... | {
"split": "train",
"index": 5254,
"acecode_id": "evol_2211",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the extraction of economic parameters needed for an economic model. Your function should return a dictionary containing the following keys and their respective values: 'IO' (a 2D list representing an input-output matrix), '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_economic_parameters() == {'IO': [[1, 2], [3, 4]], 'x_0': [100, 200], 'c_0': [150, 250], 'f_0': [50, 75], 'n': [10, 20], 'c_s': [5, 10], 'f_s': [3, 7], 'l_0': [1000, 2000], 'l_s': [800, 1600], 'C': [[1, 0], [0, 1]]}\", \"assert get_economic_parameters() =... | {
"split": "train",
"index": 5255,
"acecode_id": "bigcode_python_fns_46816",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to write a Python function `find_maximum` that takes a list of integers as input and returns the maximum integer from that list. If the list is empty, the function should return None. Please implement this function.\nPlease reason ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum([1, 2, 3, 4, 5]) == 5\", \"assert find_maximum([-1, -2, -3, -4, -5]) == -1\", \"assert find_maximum([0]) == 0\", \"assert find_maximum([]) == None\", \"assert find_maximum([10, 20, 30]) == 30\", \"assert find_maximum([3, 1, 4, 1, 5, 9]) == 9\", ... | {
"split": "train",
"index": 5256,
"acecode_id": "oss_13275",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates HTML table rows from a list of data records. Each record is represented as a dictionary containing field names and their corresponding values. Your function should take a list of such records and generate a list of stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_html_rows([{'name': 'Alice', 'age': 30, 'is_member': True}, {'name': 'Bob', 'age': None, 'is_member': False}]) == ['<tr><td>Alice</td><td>30</td><td>Yes</td></tr>', '<tr><td>Bob</td><td>N/A</td><td>No</td></tr>']\", \"assert generate_html_rows([{'it... | {
"split": "train",
"index": 5257,
"acecode_id": "bigcode_python_fns_17370",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns a specific string based on the input provided. The function `ret_str` should take no parameters and return the string 'Hello, World!'. Implement the function to satisfy this requirement.\nPlease reason step by step, then writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ret_str() == 'Hello, World!'\", \"assert ret_str() != 'Goodbye, World!'\", \"assert ret_str() == 'Hello, World!'\", \"assert ret_str() != 'Hello, Python!'\", \"assert ret_str() == 'Hello, World!'\", \"assert ret_str() == 'Hello, World!'\", \"assert ret_str()... | {
"split": "train",
"index": 5258,
"acecode_id": "bigcode_python_fns_34229",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_circle(radius: float, color: str) -> dict` that takes in the radius of a circle and its color, and returns a dictionary representation of the circle with the keys 'radius' and 'color'. The radius must be a non-negative float and the color must be a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_circle(5.0, 'red') == {'radius': 5.0, 'color': 'red'}\", \"assert create_circle(10.5, 'blue') == {'radius': 10.5, 'color': 'blue'}\", \"assert create_circle(0.0, 'green') == {'radius': 0.0, 'color': 'green'}\", \"assert create_circle(3.3, '') == {}\",... | {
"split": "train",
"index": 5259,
"acecode_id": "evol_27372",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of observations, return the same list without any modifications. Implement a function called `walker_input_formatter` that takes two parameters: an integer `t`, which represents the number of observations, and a list `obs` of length `t` containing the observations.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert walker_input_formatter(3, [1, 2, 3]) == [1, 2, 3]\", \"assert walker_input_formatter(0, []) == []\", \"assert walker_input_formatter(2, ['a', 'b']) == ['a', 'b']\", \"assert walker_input_formatter(5, [True, False, True, False, True]) == [True, False, True, F... | {
"split": "train",
"index": 5260,
"acecode_id": "bigcode_python_fns_18266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a series of metrics data for a specific target over a given time range. Each metric has associated field values that need to be collected and organized into structured data packets. Implement a function `process_metrics_data(data: List[Tuple[str, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_metrics_data([('target1', 'metric1', 1, 2, [('field1', 10.0), ('field2', 20.5)]), ('target1', 'metric2', 2, 3, [('field1', 15.0)])]) == [{'target': 'target1', 'metrics_data': [{'metric_name': 'metric1', 'start_time': 1, 'end_time': 2, 'fields': {'fie... | {
"split": "train",
"index": 5261,
"acecode_id": "bigcode_python_fns_36093",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of image paths and a corresponding list of labels. Your task is to create a dataset by filtering out invalid images and returning a dictionary containing valid image data and their labels. Implement a function `create_dataset(images_train: List[str], labels... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_dataset(['image1.jpg', 'image2.jpg', 'image3.jpg'], ['label1', 'label2', 'label3'], True) == {'image1.jpg': 'label1', 'image2.jpg': 'label2', 'image3.jpg': 'label3'}\", \"assert create_dataset(['image1.jpg', 'image2_invalid.jpg', 'image3.jpg'], ['labe... | {
"split": "train",
"index": 5262,
"acecode_id": "bigcode_python_fns_5268",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a software version as input and returns the URL from which the release archive can be downloaded. If the version is 'latest', the function should return the URL for the latest version. For any other version, the function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_download_url('latest') == 'https://www.unicode.org/Public/UNIDATA/UCD.zip'\", \"assert get_download_url('1.0') == 'https://www.unicode.org/Public/zipped/1.0/UCD.zip'\", \"assert get_download_url('2.0') == 'https://www.unicode.org/Public/zipped/2.0/UCD.zi... | {
"split": "train",
"index": 5263,
"acecode_id": "bigcode_python_fns_21201",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the processing of a form submission. The function should take a dictionary containing details of the form submission (including 'phone', 'name', 'email', 'web', and 'id_web') and return a dictionary with a 'redirect_url... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_form_submission({'phone': '1234567890', 'name': 'John Doe', 'email': 'john@example.com', 'web': 'example.com', 'id_web': '1'}) == {'redirect_url': '/done/'}\", \"assert process_form_submission({'phone': '', 'name': 'John Doe', 'email': 'john@example.... | {
"split": "train",
"index": 5264,
"acecode_id": "evol_31983",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates fetching the balance of a bank account. The function `get_account_balance` should return the balance of an account, which is fixed at 13500. Your job is to implement this function so that whenever it is called, it returns t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_account_balance() == 13500\", \"assert get_account_balance() == 13500\", \"assert get_account_balance() == 13500\", \"assert get_account_balance() == 13500\", \"assert get_account_balance() == 13500\", \"assert get_account_balance() == 13500\", \"assert ... | {
"split": "train",
"index": 5265,
"acecode_id": "oss_15094",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `substitute_nth_letter(text: str, n: int, replacement: str) -> str` that accepts a string `text`, an integer `n`, and a string `replacement`. The function should replace all occurrences of the nth letter in the English alphabet (case insensitive) that are not a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert substitute_nth_letter('hello world!', 5, '*') == 'h*llo world!'\", \"assert substitute_nth_letter('This is a test.', 1, '#') == 'This is # test.'\", \"assert substitute_nth_letter('No replacements here.', 2, '-') == 'No replacements here.'\", \"assert substi... | {
"split": "train",
"index": 5266,
"acecode_id": "evol_23600",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a multidimensional matrix of integers, implement a function `triple_and_sum(matrix)` that returns a new list where each inner list contains the elements of the original inner list tripled, along with the sum of those tripled elements as the last element of each inner list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert triple_and_sum([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [[3, 6, 9, 18], [12, 15, 18, 45], [21, 24, 27, 72]]\", \"assert triple_and_sum([[-1, -2], [-3, -4]]) == [[-3, -6, -9], [-9, -12, -21]]\", \"assert triple_and_sum([[10, 20], [30, 40]]) == [[30, 60, 90], [90... | {
"split": "train",
"index": 5267,
"acecode_id": "evol_2165",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a formatted string in Python using an f-string. Your task is to create a function that checks if the f-string contains any invalid string constants based on the predefined rules. A string constant is considered invalid if it is redefined, meaning it has been used ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_fstring_violation('f\\\"{0}\\\"') == False\", \"assert check_fstring_violation('f\\\"{name}\\\"') == False\", \"assert check_fstring_violation('f\\\"{name} is {name}\\\"') == True\", \"assert check_fstring_violation('f\\\"{age} years old, {age} years a... | {
"split": "train",
"index": 5268,
"acecode_id": "bigcode_python_fns_34381",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `train_sizes` and `accuracies`, write a function `build_figure` that constructs a line plot with the given data. The x-axis should represent `train_sizes` and the y-axis should represent `accuracies`. The function should return a dictionary containi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_figure([1, 2, 3], [0.5, 0.6, 0.7]) == {'x': [1, 2, 3], 'y': [0.5, 0.6, 0.7]}\", \"assert build_figure([10, 20, 30], [0.1, 0.2, 0.3]) == {'x': [10, 20, 30], 'y': [0.1, 0.2, 0.3]}\", \"assert build_figure([5, 15, 25], [0.9, 0.8, 0.7]) == {'x': [5, 15, 25... | {
"split": "train",
"index": 5269,
"acecode_id": "bigcode_python_fns_14873",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that may contain HTML-like tags. Your task is to write a function that replaces any occurrences of the tag '<sarcasm/>' in the string with its HTML entity equivalent '<sarcasm/>'. The function should return the modified string. Write a function `cle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_string('Yeah right <sarcasm/>') == 'Yeah right <sarcasm/>'\", \"assert clean_string('<sarcasm/> is a tag') == '<sarcasm/> is a tag'\", \"assert clean_string('No tags here!') == 'No tags here!'\", \"assert clean_string('Nested <sarcasm/> tag... | {
"split": "train",
"index": 5270,
"acecode_id": "bigcode_python_fns_15272",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a tuple of tuples, each containing integers, and returns the average value for each tuple as a list. The function should handle cases where the tuples contain erroneous data types (non-integer values) by returning an error message for those specific ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_tuples(((1, 2, 3), (4, 5, 6))) == [2.0, 5.0]\", \"assert average_tuples(((10, 20), (30, 40, 50))) == [15.0, 40.0]\", \"assert average_tuples(((1, 2), (3, 4), (5, 6))) == [1.5, 3.5, 5.5]\", \"assert average_tuples(((7, 8), (9, 10, 11))) == [7.5, 10.0]... | {
"split": "train",
"index": 5271,
"acecode_id": "evol_8489",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing timed values. Your task is to implement a function that processes these timed values by removing any values that have not changed compared to the previous input. You should return a new list that contains only the unique values that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_timed_values([], True) == []\", \"assert process_timed_values([1, 1, 1], True) == [1]\", \"assert process_timed_values([1, 2, 2, 3], True) == [1, 2, 3]\", \"assert process_timed_values([1, 2, 3, 4], True) == [1, 2, 3, 4]\", \"assert process_timed_val... | {
"split": "train",
"index": 5272,
"acecode_id": "bigcode_python_fns_40725",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a function `create_student_data` that takes four parameters: `full_name` (a string), `university` (a string), `grade_level` (a string), and `gpa` (a float). The function should return a dictionary containing the student's educational data with the keys 'full_name', 'unive... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_student_data('Alice Smith', 'Stanford University', 'Sophomore', 3.5) == {'full_name': 'Alice Smith', 'university': 'Stanford University', 'grade_level': 'Sophomore', 'gpa': 3.5}\", \"assert create_student_data('Bob Johnson', 'MIT', 'Senior', 3.9) == {... | {
"split": "train",
"index": 5273,
"acecode_id": "evol_22077",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an integer n as its parameter and returns a list of all perfect numbers less than or equal to n. A perfect number is a positive integer that is equal to the sum of its proper positive divisors, excluding the number itself.\nPlease reason step by ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perfect_numbers(1) == []\", \"assert perfect_numbers(6) == [6]\", \"assert perfect_numbers(8) == [6]\", \"assert perfect_numbers(10) == [6]\", \"assert perfect_numbers(12) == [6]\", \"assert perfect_numbers(15) == [6]\", \"assert perfect_numbers(16) == [6]\"... | {
"split": "train",
"index": 5274,
"acecode_id": "evol_3313",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of floating-point numbers 'fv' representing a series of values in a grid, write a function 'check_uniform_grid(fv, diff)' that checks if the differences between consecutive elements in 'fv' form a uniform grid based on a given 'diff' list. The function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_uniform_grid([0.0, 1.0, 2.0, 3.0], [1.0, 1.0, 1.0]) == 0\", \"assert check_uniform_grid([1.0, 3.0, 5.0, 7.0], [2.0, 2.0, 2.0]) == 0\", \"assert check_uniform_grid([2.0, 4.0, 6.0, 8.0], [2.0, 2.0, 2.0]) == 0\", \"assert check_uniform_grid([10.0, 20.0, 3... | {
"split": "train",
"index": 5275,
"acecode_id": "bigcode_python_fns_10898",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `data` that represents source code, and a string `varname` that represents a variable name, implement a function `find_assignment(data: str, varname: str) -> str` that finds the value assigned to the variable. The assignment pattern is defined as `varname = value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_assignment('x = 10', 'x') == '10'\", \"assert find_assignment('y = hello', 'y') == 'hello'\", \"assert find_assignment('a = 3.14', 'a') == '3.14'\", \"assert find_assignment('name = John Doe', 'name') == 'John Doe'\", \"assert find_assignment('foo = Tru... | {
"split": "train",
"index": 5276,
"acecode_id": "bigcode_python_fns_772",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a string representation of a JSON object, implement a function that converts it into a Python dictionary. If the string cannot be parsed as JSON, return the string itself. The function should handle any valid JSON input, including nested structures, arrays, and various da... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_json_string('{\\\"key\\\": \\\"value\\\"}') == {'key': 'value'}\", \"assert convert_json_string('{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30, \\\"city\\\": \\\"New York\\\"}') == {'name': 'John', 'age': 30, 'city': 'New York'}\", \"assert convert_js... | {
"split": "train",
"index": 5277,
"acecode_id": "bigcode_python_fns_44789",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains a sequence of movements represented as a string (e.g., 'lrldrrrllddrrlllrddd') and a tuple of strings representing specific movement patterns (e.g., ('ldl', 'rld')). Your task is to calculate the final position after app... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_movement_patterns([('rruu', ('ru',))]) == [(2, 1)]\", \"assert apply_movement_patterns([('r', ('r',))]) == [(1, 0)]\", \"assert apply_movement_patterns([('u', ('u',))]) == [(0, 1)]\", \"assert apply_movement_patterns([('l', ('l',))]) == [(-1, 0)]\", \"... | {
"split": "train",
"index": 5278,
"acecode_id": "oss_23304",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sort(nums)` that takes a list of integers and sorts it in ascending order using the Bubble Sort algorithm. The function should modify the input list in place and return the sorted list. Note that Bubble Sort works by repeatedly stepping through the list, c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort([5, 2, 9, 1, 5, 6]) == [1, 2, 5, 5, 6, 9]\", \"assert sort([3, 0, 2, 5, -1, 4, 1]) == [-1, 0, 1, 2, 3, 4, 5]\", \"assert sort([]) == []\", \"assert sort([1]) == [1]\", \"assert sort([2, 1]) == [1, 2]\", \"assert sort([10, 5, 3, 2, 8, 7]) == [2, 3, 5, 7,... | {
"split": "train",
"index": 5279,
"acecode_id": "evol_33647",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a series of records delimited by the sequence '\\n$$$$\\n'. Your task is to implement a function that takes this string as input and returns a list of individual records. Each record should also include the delimiter '\\n$$$$\\n' at the en... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_records('Record 1\\\\n$$$$\\\\nRecord 2\\\\n$$$$\\\\nRecord 3\\\\n$$$$\\\\n') == ['Record 1\\\\n$$$$\\\\n', 'Record 2\\\\n$$$$\\\\n', 'Record 3\\\\n$$$$\\\\n']\", \"assert extract_records('') == []\", \"assert extract_records('Incomplete Record') == ... | {
"split": "train",
"index": 5280,
"acecode_id": "bigcode_python_fns_44240",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to process a list of integers by applying a series of filter functions to the data. The function will take a separator string and a list of filter functions, and it should apply each filter function to the data sequentially. After app... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data(',', [], [1, 2, 3]) == '1,2,3'\", \"assert process_data(',', [], []) == ''\", \"assert process_data('-', [lambda x: [i for i in x if i % 2 == 0]], [1, 2, 3, 4]) == '2-4'\", \"assert process_data(' ', [lambda x: [i * 2 for i in x]], [1, 2, 3]) ==... | {
"split": "train",
"index": 5281,
"acecode_id": "oss_11073",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary containing information about new posts, where each key is a post identifier ending with ':description' and the associated value is the description of the post. Your task is to write a function that processes this dictionary and returns a new dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_posts({'post1:description': 'This is the description for post 1', 'post2:description': 'This is the description for post 2'}) == {'post1': 'This is the description for post 1', 'post2': 'This is the description for post 2'}\", \"assert update_posts({'... | {
"split": "train",
"index": 5282,
"acecode_id": "oss_14379",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of user IDs, implement a function `delete_users(user_ids: List[int]) -> List[Dict[str, int]]` that simulates the deletion of users from a hypothetical database. The function should return a list of dictionaries, where each dictionary contains the user ID of the del... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_users([1, 2, 3]) == [{'delete': 1}, {'delete': 2}, {'delete': 3}]\", \"assert delete_users([0, -1, 4]) == [{'delete': 4}]\", \"assert delete_users([]) == []\", \"assert delete_users([-5, -10, 3]) == [{'delete': 3}]\", \"assert delete_users([7]) == [{'... | {
"split": "train",
"index": 5283,
"acecode_id": "bigcode_python_fns_18303",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of owners for a specific object and a user, determine if the user is one of the owners of that object. Write a function `is_owner(obj_owners: List[str], user: str) -> bool` that takes in a list of owner names (strings) and a user name (string). The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_owner(['alice', 'bob', 'charlie'], 'bob') == True\", \"assert is_owner(['alice', 'bob', 'charlie'], 'dave') == False\", \"assert is_owner(['alice', 'bob', 'charlie', 'bob'], 'bob') == True\", \"assert is_owner([], 'alice') == False\", \"assert is_owner(['... | {
"split": "train",
"index": 5284,
"acecode_id": "bigcode_python_fns_42623",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that counts the total number of prime numbers and twin prime pairs in a given non-negative integer range. A twin prime pair is defined as two prime numbers that are exactly two units apart. The function should handle edge cases where the input is not a non-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_primes(0) == (0, 0)\", \"assert count_primes(1) == (0, 0)\", \"assert count_primes(4) == (2, 0)\", \"assert count_primes(5) == (3, 1)\", \"assert count_primes(6) == (3, 1)\", \"assert count_primes(30) == (10, 4)\", \"assert count_primes(100) == (25, 8)... | {
"split": "train",
"index": 5285,
"acecode_id": "evol_8194",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of expiration dates in the format of 'YYYY-MM-DD' representing the expiration dates of various products. Your task is to implement a function `get_exp_date_stats(exp_dates: List[str]) -> Dict[str, int]` that calculates the count of products for each unique ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_exp_date_stats(['2023-10-01', '2023-10-01', '2023-10-02']) == {'2023-10-01': 2, '2023-10-02': 1}\", \"assert get_exp_date_stats(['2023-11-01', '2023-11-01', '2023-11-01', '2023-11-02']) == {'2023-11-01': 3, '2023-11-02': 1}\", \"assert get_exp_date_stats... | {
"split": "train",
"index": 5286,
"acecode_id": "bigcode_python_fns_12335",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_vowel_positions(s: str) -> List[int]` that takes a string `s` as input and returns a list of indices where the vowels (a, e, i, o, u) appear within that string. The vowels should be checked in a case-insensitive manner. For example, in the string 'Hel... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_vowel_positions('') == []\", \"assert find_vowel_positions('xyz') == []\", \"assert find_vowel_positions('AEIOU') == [0, 1, 2, 3, 4]\", \"assert find_vowel_positions('aeiou') == [0, 1, 2, 3, 4]\", \"assert find_vowel_positions('bcd') == []\", \"assert f... | {
"split": "train",
"index": 5287,
"acecode_id": "evol_3438",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of strings and returns a modified list based on certain criteria. Write a function called `process_strings` that takes a list of strings as input and returns a modified list based on the following rules: 1. If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_strings(['hello', 'world', 'example']) == ['hello', 'world', 'example']\", \"assert process_strings(['error found', 'all good']) == ['all good']\", \"assert process_strings(['error', 'Error']) == []\", \"assert process_strings(['nothing to see here',... | {
"split": "train",
"index": 5288,
"acecode_id": "oss_4078",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a user input. Your task is to implement a function that validates this input based on the following rules: the input must be a valid integer (can be positive or negative) and must contain at most 3 characters. If the input is empty, it is con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_input('123') == True\", \"assert validate_input('12') == True\", \"assert validate_input('1') == True\", \"assert validate_input('-1') == True\", \"assert validate_input('99') == True\", \"assert validate_input('0') == True\", \"assert validate_inpu... | {
"split": "train",
"index": 5289,
"acecode_id": "bigcode_python_fns_27648",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks if a given string is a palindrome. A palindrome is a string that reads the same forwards and backwards, ignoring spaces, punctuation, and capitalization. Your function should take a single parameter: the string to be ch... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal, Panama') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Hello, World!') == False\", \"assert is_palindrome('') == True\", \"assert is_palindrome('Able was I ere I saw Elba') =... | {
"split": "train",
"index": 5290,
"acecode_id": "oss_5037",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique elements from the input list, preserving the order of their first appearance. Your function should be named `get_unique_elements`. \n\n### Input\n- A list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_elements([4, 5, 6, 4, 5, 6, 7]) == [4, 5, 6, 7]\", \"assert get_unique_elements([1, 2, 2, 3, 1]) == [1, 2, 3]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_elements([7, 8, 9, 10, 7, 8]) == [7, 8, 9, 10]\", \"assert get_unique_el... | {
"split": "train",
"index": 5291,
"acecode_id": "bigcode_python_fns_173",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a weighted directed graph represented as an adjacency list, implement a function `shortest_path(graph: Dict[str, Dict[str, int]], start: str, end: str) -> Tuple[List[str], Dict[str, int]]` that returns the shortest path from a start node to an end node, along with the dis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_path({'A': {'B': 3}, 'B': {'C': 1}, 'C': {'D': 2}, 'D': {}}, 'A', 'D') == (['A', 'B', 'C', 'D'], {'A': 0, 'B': 3, 'C': 4, 'D': 6})\", \"assert shortest_path({'A': {'B': 1}, 'B': {'C': 1}, 'C': {}}, 'A', 'C') == (['A', 'B', 'C'], {'A': 0, 'B': 1, 'C'... | {
"split": "train",
"index": 5292,
"acecode_id": "evol_4053",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a sentence consisting of lowercase words separated by spaces, implement a function `make_camel_case(sentence: str) -> str` that converts the sentence into CamelCase notation. This means that the first letter of each word should be capitalized, and all spaces should be rem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_camel_case('the quick brown fox') == 'TheQuickBrownFox'\", \"assert make_camel_case('hello world') == 'HelloWorld'\", \"assert make_camel_case('python programming') == 'PythonProgramming'\", \"assert make_camel_case('convert to camel case') == 'ConvertT... | {
"split": "train",
"index": 5293,
"acecode_id": "evol_25661",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of gene data where each gene is represented by a tuple containing the Gene ID (string), Gene Name (string), and Expression Level (float). Your task is to implement a function `identify_gene_interactions(gene_data: List[Tuple[str, str, float]], threshold: fl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert identify_gene_interactions([('G1', 'GeneA', 5.0), ('G2', 'GeneB', 6.0)], 2.0) == [{'Gene1 ID': 'G1', 'Gene1 Name': 'GeneA', 'Gene1 Expression Level': 5.0, 'Gene2 ID': 'G2', 'Gene2 Name': 'GeneB', 'Gene2 Expression Level': 6.0, 'Expression Difference': 1.0}]\... | {
"split": "train",
"index": 5294,
"acecode_id": "oss_27615",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of package names (strings) and a list of manifest file names (strings). Your task is to write a function that returns a dictionary where the keys are the package names and the values are the manifest file names that match each package name according to the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_matching_manifests(['pkg1', 'pkg2'], ['pkg1.json', 'pkg2.json', 'pkg3.json']) == {'pkg1': 'pkg1.json', 'pkg2': 'pkg2.json'}\", \"assert find_matching_manifests(['pkg1', 'pkg2'], ['pkg1.json', 'pkg3.json']) == {'pkg1': 'pkg1.json'}\", \"assert find_match... | {
"split": "train",
"index": 5295,
"acecode_id": "bigcode_python_fns_4979",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer `hdu` which represents a header data unit (HDU) number. Your task is to implement a function that modifies this HDU number based on its version. If the version is '12.0', you should return the HDU number incremented by 1. For any other version, simply r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_hdu(0) == 1\", \"assert modify_hdu(1) == 2\", \"assert modify_hdu(10) == 11\", \"assert modify_hdu(25) == 26\", \"assert modify_hdu(-1) == 0\", \"assert modify_hdu(12) == 13\", \"assert modify_hdu(100) == 101\", \"assert modify_hdu(999) == 1000\", \"a... | {
"split": "train",
"index": 5296,
"acecode_id": "bigcode_python_fns_20685",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts an integer input greater than 1. The function should return a dictionary containing the prime factors of the number as keys and their respective powers as values. The input must be validated to ensure it is a positive integer greater than 1. If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_factorization(2) == {2: 1}\", \"assert prime_factorization(3) == {3: 1}\", \"assert prime_factorization(4) == {2: 2}\", \"assert prime_factorization(5) == {5: 1}\", \"assert prime_factorization(6) == {2: 1, 3: 1}\", \"assert prime_factorization(7) == {... | {
"split": "train",
"index": 5297,
"acecode_id": "evol_30766",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of dictionaries representing response models and extracts specific information based on given criteria. Each dictionary represents a response model and contains information about the model, such as its name an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_models_by_tags([{'name': 'Token', 'tags': ['User']}, {'name': 'UserDetails', 'tags': ['User', 'Info']}, {'name': 'Product', 'tags': ['Item']}, {'name': 'Order', 'tags': ['Item', 'Info']}], ['User']) == ['Token', 'UserDetails']\", \"assert filter_model... | {
"split": "train",
"index": 5298,
"acecode_id": "oss_6750",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string input, write a function `is_question` that determines if the string is a question. A string is considered a question if it ends with a question mark ('?'). The function should return `True` if the string is a question and `False` otherwise. The input string may c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_question('What is your name?') == True\", \"assert is_question('Is this a question?') == True\", \"assert is_question('Hello') == False\", \"assert is_question('Is it raining?') == True\", \"assert is_question('') == False\", \"assert is_question('How are... | {
"split": "train",
"index": 5299,
"acecode_id": "bigcode_python_fns_35731",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.