data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a user authentication process. The function, `test_auth`, should take a single parameter, `request`, which is a dictionary containing user information. If the dictionary contains a key `username` with a non-empty string val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert test_auth({'username': 'user1', 'password': 'pass1'}) == {'message': 'You successfully authenticated!'}\", \"assert test_auth({'username': 'user1', 'password': ''}) == {'message': 'Authentication failed!'}\", \"assert test_auth({'username': '', 'password': '... | {
"split": "train",
"index": 64000,
"acecode_id": "bigcode_python_fns_16813",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that calculates the product of all the integers in the list. The function should raise an exception if the input is null or not a list, or if any element in the list is not an integer. Define the function as `def calculate_product(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_product([-1, -2, -3]) == -6\", \"assert calculate_product([1, 2, 3, 4]) == 24\", \"assert calculate_product([0, 2, 3]) == 0\", \"assert calculate_product([10]) == 10\", \"assert calculate_product([5, 5, 5]) == 125\", \"assert calculate_product([1, ... | {
"split": "train",
"index": 64001,
"acecode_id": "evol_34003",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `below_zero` that takes a list of banking transactions performed on a zero-balance account and an optional case-insensitivity flag. Each transaction is represented as a tuple containing an operation type ('deposit' or 'withdraw') and an operation val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_zero([('deposit', 100), ('withdraw', 50)], case_insensitive=False) == False\", \"assert below_zero([('deposit', 100), ('withdraw', 150)], case_insensitive=False) == True\", \"assert below_zero([('withdraw', 100)], case_insensitive=False) == True\", \"a... | {
"split": "train",
"index": 64002,
"acecode_id": "evol_18003",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a scoring system for a sports event. The scoring system involves updating a dictionary of scores based on scoring events and calculating the total number of ways to achieve each score. Your task is to write a function that takes in a list of sco... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_scores([(1, 1), (1, 1), (1, 1)]) == [1, 2, 3]\", \"assert calculate_scores([(10, 2)]) == [2]\", \"assert calculate_scores([(2, 1), (2, 1)]) == [1, 2]\", \"assert calculate_scores([(4, 1), (4, 1), (4, 1)]) == [1, 2, 3]\", \"assert calculate_scores([... | {
"split": "train",
"index": 64003,
"acecode_id": "oss_236",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a 3D array representing a tube, where each row corresponds to a different time step and contains three values: time, density (rho), and pressure (p). Your task is to implement a function that extracts the time values and either the density or pressure values based... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_values([[1, 10, 100], [2, 20, 200], [3, 30, 300]], 1) == ([1, 2, 3], [10, 20, 30])\", \"assert extract_values([[0, 5, 50], [1, 6, 60], [2, 7, 70]], 2) == ([0, 1, 2], [50, 60, 70])\", \"assert extract_values([[10, 100, 1000], [20, 200, 2000], [30, 300... | {
"split": "train",
"index": 64004,
"acecode_id": "bigcode_python_fns_48082",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the nth Fibonacci number using recursion. 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 take a single integer n (where n >= 0) and return the nth Fibonacci number.\... | 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": 64005,
"acecode_id": "evol_21736",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a sorted list of integers, write a function that removes duplicate elements in the list and returns a new list containing only the unique elements in the same order. The original list will be provided as input, and the output should be a new list with duplicates removed. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_dup([1, 1, 2]) == [1, 2]\", \"assert remove_dup([0, 0, 1, 1, 2, 2]) == [0, 1, 2]\", \"assert remove_dup([-1, -1, 0, 0, 1, 1]) == [-1, 0, 1]\", \"assert remove_dup([5, 5, 5, 5, 5]) == [5]\", \"assert remove_dup([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"... | {
"split": "train",
"index": 64006,
"acecode_id": "bigcode_python_fns_25612",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that verifies if a provided API version string is valid. The API version string follows the format 'X.Y.Z', where X, Y, and Z are non-negative integers. The version is considered valid if: 1. The major version (X) is greater than or equal ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_api_version('1.0.0') == True\", \"assert is_valid_api_version('2.3.4') == True\", \"assert is_valid_api_version('1.99.99') == True\", \"assert is_valid_api_version('1.0.100') == False\", \"assert is_valid_api_version('0.5.6') == False\", \"assert is... | {
"split": "train",
"index": 64007,
"acecode_id": "bigcode_python_fns_32292",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that sorts a list of tuples based on the second item of each tuple. If the second items of some tuples are the same, those tuples should be sorted based on the first item. Implement a function called `sort_tuples` that takes a list of tuples as input and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_tuples([(1,2), (3,3), (1,1)]) == [(1,1), (1,2), (3,3)]\", \"assert sort_tuples([(1,2), (3,2), (1,1)]) == [(1,1), (1,2), (3,2)]\", \"assert sort_tuples([(5,5), (3,2), (1,1), (4,2)]) == [(1,1), (3,2), (4,2), (5,5)]\", \"assert sort_tuples([(1,3), (2,2), (... | {
"split": "train",
"index": 64008,
"acecode_id": "evol_18304",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a string and a tuple as input, appends the string to itself and the tuple to itself, and returns both results. The function should demonstrate the concept of immutability by showing how new objects are created when performing these operations.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert demonstrate_immutability('Hello', (1, 2, 3)) == ('HelloHello', (1, 2, 3, 1, 2, 3))\", \"assert demonstrate_immutability('Python', (4, 5)) == ('PythonPython', (4, 5, 4, 5))\", \"assert demonstrate_immutability('', ()) == ('', ())\", \"assert demonstrate_immut... | {
"split": "train",
"index": 64009,
"acecode_id": "evol_34336",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a module name in Python. Your task is to write a function that converts this module name to a proper test filename by prefixing it with 'test_' and appending the '.py' extension. The module name will contain only lowercase letters, numbers, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert module_to_test_filename('example_module') == 'test_example_module.py'\", \"assert module_to_test_filename('my_module') == 'test_my_module.py'\", \"assert module_to_test_filename('test_module') == 'test_test_module.py'\", \"assert module_to_test_filename('sam... | {
"split": "train",
"index": 64010,
"acecode_id": "bigcode_python_fns_20059",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats an email message. The function should take in a subject, sender, a list of recipients, a text body, and an HTML body. It should return a formatted email message as a dictionary containing the subject, sender, recipients, text... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_email('Test Subject', 'test@example.com', ['recipient1@example.com', 'recipient2@example.com'], 'This is a plain text body.', '<p>This is an HTML body.</p>') == {'subject': 'Test Subject', 'sender': 'test@example.com', 'recipients': ['recipient1@examp... | {
"split": "train",
"index": 64011,
"acecode_id": "bigcode_python_fns_25195",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_tables()` that initializes the necessary SQLite database tables for a news recommendation system. The tables should include a `users` table with columns for `id`, `username`, `password`, `interests`, and `reading_habits`; and an `articles` table wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_tables() is None\", \"assert create_tables('test.db') is None\", \"assert create_tables() is None\", \"assert create_tables() is None\", \"assert create_tables('another_test.db') is None\", \"assert get_tables('non_existing.db') == []\"]}"
} | {
"split": "train",
"index": 64012,
"acecode_id": "evol_2983",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of metadata strings and categorizes them based on their content. Each metadata string represents a tag associated with a software package and follows the format 'Category :: Subcategory'. Your program should c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_metadata(['A :: B', 'A :: C', 'A :: B']) == {'A': {'B': 2, 'C': 1}}\", \"assert categorize_metadata(['X :: Y', 'Z :: Y', 'X :: Y', 'X :: Z']) == {'X': {'Y': 2, 'Z': 1}, 'Z': {'Y': 1}}\", \"assert categorize_metadata(['Category1 :: Subcat1', 'Categ... | {
"split": "train",
"index": 64013,
"acecode_id": "oss_14248",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to calculate the performance ratings of baseball players based on their statistics. The function should take a list of dictionaries where each dictionary contains the player's statistics, including their name, the number of hits, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_player_performance([{'name': 'Player2', 'hits': 30, 'at_bats': 90, 'rbis': 15}]) == {'Player2': 50.0}\", \"assert calculate_player_performance([{'name': 'Player3', 'hits': 20, 'at_bats': 70, 'rbis': 10}]) == {'Player3': 42.86}\", \"assert calculate... | {
"split": "train",
"index": 64014,
"acecode_id": "oss_22997",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a city skyline. Your task is to write a function that calculates the total area of the skyline formed by these buildings. The width of each building is considered to be 1 unit. The skyline is represented ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_skyline_area([1, 3, 2]) == 6\", \"assert calculate_skyline_area([2, 4, 3, 5, 1]) == 15\", \"assert calculate_skyline_area([1, 1, 1]) == 3\", \"assert calculate_skyline_area([0, 2, 0, 3, 4]) == 9\", \"assert calculate_skyline_area([5, 0, 0, 5]) == 1... | {
"split": "train",
"index": 64015,
"acecode_id": "bigcode_python_fns_5946",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a new list containing only the elements that are greater than a specified threshold. You need to implement the function called `filter_greater_than_threshold(nums: List[int], threshold: int) -> List[int]` where `nums` is a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_greater_than_threshold([1, 2, 3, 4, 5], 3) == [4, 5]\", \"assert filter_greater_than_threshold([10, 20, 30, 40], 25) == [30, 40]\", \"assert filter_greater_than_threshold([-1, -2, -3, -4], -2) == [-1]\", \"assert filter_greater_than_threshold([5, 5, 5... | {
"split": "train",
"index": 64016,
"acecode_id": "bigcode_python_fns_38112",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_password` that creates a random password of length 8 characters. The password must include at least 1 uppercase letter, 1 lowercase letter, 1 number, and 1 special character. The function should return the generated password as a string.\nPlease r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_password()) == 8\", \"assert any(c.isupper() for c in generate_password())\", \"assert any(c.islower() for c in generate_password())\", \"assert any(c.isdigit() for c in generate_password())\", \"assert any(c in string.punctuation for c in gener... | {
"split": "train",
"index": 64017,
"acecode_id": "evol_22243",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a binary number given as a string to its octal equivalent, and handles invalid inputs by returning an error message. The function should have the following signature: `def binary_to_octal(binary_str: str) -> str:`. Invalid binary inputs should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_to_octal('1000') == '10'\", \"assert binary_to_octal('1111') == '17'\", \"assert binary_to_octal('11010') == '32'\", \"assert binary_to_octal('2') == 'Error: Invalid binary number'\", \"assert binary_to_octal('abc') == 'Error: Invalid binary number'\"... | {
"split": "train",
"index": 64018,
"acecode_id": "evol_28093",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified version of a task manager system. The system should execute tasks based on their priority and deadline. Each task has a priority level (an integer) and a deadline (a positive integer representing the number of days from the current ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_total_priority([(1, 1), (2, 2), (3, 3)]) == 6\", \"assert max_total_priority([(10, 10), (15, 9), (20, 8)]) == 45\", \"assert max_total_priority([(1, 1), (1, 1), (1, 1)]) == 1\", \"assert max_total_priority([(1, 5), (2, 5), (3, 5)]) == 6\", \"assert max_t... | {
"split": "train",
"index": 64019,
"acecode_id": "oss_19437",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that calculates the total size of a directory given a list of its files and their respective sizes. The function should take in a list of integers representing the sizes of the files in the directory and return the total size of the direct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_directory_size([500]) == '500 bytes'\", \"assert calculate_directory_size([1024]) == '1 KB'\", \"assert calculate_directory_size([2048]) == '2 KB'\", \"assert calculate_directory_size([1048576]) == '1 MB'\", \"assert calculate_directory_size([52428... | {
"split": "train",
"index": 64020,
"acecode_id": "bigcode_python_fns_20006",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of non-repeating integers, implement a function to find the 3rd largest number in the array without using any inbuilt sorting function. You may assume that the array will always have at least three elements.\nPlease reason step by step, then write a self-containe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert third_largest([6,4,7,1,3,5,9,11]) == 7\", \"assert third_largest([10, 20, 30, 40, 50]) == 30\", \"assert third_largest([2, 3, 1, 4, 5]) == 3\", \"assert third_largest([8, 3, 5, 2, 1]) == 3\", \"assert third_largest([60, 30, 20, 10]) == 20\", \"assert third_l... | {
"split": "train",
"index": 64021,
"acecode_id": "evol_6545",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with building a function that simulates retrieving the amount of free memory available on a set of GPUs. The function should take a list of integers representing the free memory in MB for each GPU and return a dictionary where the keys are the GPU device IDs (sta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_gpu_memory_map([2048, 4096, 1024]) == {0: 2048, 1: 4096, 2: 1024}\", \"assert get_gpu_memory_map([0, 0, 0]) == {0: 0, 1: 0, 2: 0}\", \"assert get_gpu_memory_map([512]) == {0: 512}\", \"assert get_gpu_memory_map([]) == {}\", \"assert get_gpu_memory_map([1... | {
"split": "train",
"index": 64022,
"acecode_id": "bigcode_python_fns_7085",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of individuals in a population. Your task is to write a function that filters out individuals whose height is below a certain threshold. The function should return a new list containing only the heights that are greater ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_heights([150, 160, 170, 180], 160) == [160, 170, 180]\", \"assert filter_heights([140, 155, 165, 175], 160) == [165, 175]\", \"assert filter_heights([130, 140, 150], 160) == []\", \"assert filter_heights([160, 162, 164, 158, 172], 162) == [162, 164, 1... | {
"split": "train",
"index": 64023,
"acecode_id": "bigcode_python_fns_7151",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that computes the n-th term of the FibFib sequence. The FibFib sequence is defined as follows: fibfib(0) = 0, fibfib(1) = 0, fibfib(2) = 1, and for n >= 3, fibfib(n) = fibfib(n-1) + fibfib(n-2) + fibfib(n-3). Implement the function: \... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibfib(0) == 0\", \"assert fibfib(1) == 0\", \"assert fibfib(2) == 1\", \"assert fibfib(3) == 1\", \"assert fibfib(4) == 2\", \"assert fibfib(5) == 4\", \"assert fibfib(6) == 7\", \"assert fibfib(7) == 13\", \"assert fibfib(8) == 24\", \"assert fibfib(9) == ... | {
"split": "train",
"index": 64024,
"acecode_id": "evol_32082",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a basis type and a projection value to determine the appropriate quantum gate operation to be applied to a quantum circuit. The basis can be either 'X', 'Y', or 'Z', and the projection can either be 0 or 1. Your task is to implement a function that returns the cor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gate_operation('X', 1) == 'H.X'\", \"assert gate_operation('X', 0) == 'H'\", \"assert gate_operation('Y', 1) == 'S.H.X'\", \"assert gate_operation('Y', 0) == 'S.H'\", \"assert gate_operation('Z', 1) == 'U3(pi, 0, pi)'\", \"assert gate_operation('Z', 0) == 'I... | {
"split": "train",
"index": 64025,
"acecode_id": "bigcode_python_fns_39616",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing an email address in the format 'username@domain', write a function that extracts the username and domain and returns them as a tuple (username, domain). If the input string is not a valid email address, return an empty tuple. A valid email address mu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_email_parts('smith@example.com') == ('smith', 'example.com')\", \"assert extract_email_parts('john.doe@gmail.com') == ('john.doe', 'gmail.com')\", \"assert extract_email_parts('alice@wonderland.org') == ('alice', 'wonderland.org')\", \"assert extract... | {
"split": "train",
"index": 64026,
"acecode_id": "bigcode_python_fns_18666",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves embeddings for a given set of keys based on specific configurations. The function should handle the following requirements: \n1. If the input `keys` is an empty string, it should return a zero embedding. \n2. If the `se... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_embeddings('', 'config1', 'var1', 'address1', False, 1000) == [0.0]\", \"assert retrieve_embeddings('key1', 'config1', 'var1', 'address1', False, 1000) == [1.0, 2.0, 3.0]\", \"assert retrieve_embeddings('', 'config1', 'var1', '', False, 1000) == [0.... | {
"split": "train",
"index": 64027,
"acecode_id": "oss_8644",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a mock BLE (Bluetooth Low Energy) interface connection. The function should take a string argument representing a device name and return a string message indicating the connection status and a mock informational message... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mock_ble_connection('foo') == 'Connected to radio: foo\\\\ninside mocked showInfo'\", \"assert mock_ble_connection('bar') == 'Connected to radio: bar\\\\ninside mocked showInfo'\", \"assert mock_ble_connection('device1') == 'Connected to radio: device1\\\\ni... | {
"split": "train",
"index": 64028,
"acecode_id": "bigcode_python_fns_36704",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes two dictionaries as input and returns a new dictionary that merges the key-value pairs from the input dictionaries. If a key exists in both input dictionaries, the value from the second dictionary should replace the value f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_dicts({'a': {'aa': 1}, 'b': {'bb': 2}}, {'c': {'cc': 3}, 'b': {'bb': 4}}) == {'a': {'aa': 1}, 'b': {'bb': 4}, 'c': {'cc': 3}}\", \"assert merge_dicts({'x': {'xx': 10}}, {'y': {'yy': 20}}) == {'x': {'xx': 10}, 'y': {'yy': 20}}\", \"assert merge_dicts({}... | {
"split": "train",
"index": 64029,
"acecode_id": "oss_2512",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of messages and updates their statuses based on specific criteria. Each message is represented as a dictionary containing 'id' and 'status'. The function should take a list of messages and return a new list where... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_message_status([{'id': '1', 'status': 'pending'}, {'id': '2', 'status': 'in_progress'}, {'id': '3', 'status': 'completed'}]) == [{'id': '1', 'status': 'in_progress'}, {'id': '2', 'status': 'completed'}, {'id': '3', 'status': 'archived'}]\", \"assert u... | {
"split": "train",
"index": 64030,
"acecode_id": "bigcode_python_fns_3515",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `identify_month(date: str) -> str` that takes a date in the format 'DD/MM/YYYY' as input and returns the name of the month corresponding to the given date. If the month is invalid (not between '01' and '12'), the function should return 'Invalid month'.\nPle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert identify_month('13/01/1998') == 'January'\", \"assert identify_month('04/02/2020') == 'February'\", \"assert identify_month('15/03/2015') == 'March'\", \"assert identify_month('21/04/2000') == 'April'\", \"assert identify_month('10/05/2010') == 'May'\", \"as... | {
"split": "train",
"index": 64031,
"acecode_id": "evol_17689",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a city. Your task is to implement a function that returns a list of integers where each integer at index `i` represents the number of buildings that are taller than the building at index `i`. If there are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_taller_buildings([1, 2, 3]) == [2, 1, 0]\", \"assert count_taller_buildings([5, 5, 5]) == [0, 0, 0]\", \"assert count_taller_buildings([1]) == [0]\", \"assert count_taller_buildings([2, 2, 2, 5]) == [1, 1, 1, 0]\", \"assert count_taller_buildings([0, 0... | {
"split": "train",
"index": 64032,
"acecode_id": "bigcode_python_fns_34058",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and an integer index, return the value at that index in the list. If the index is out of bounds (less than 0 or greater than or equal to the length of the list), return -1. Implement a single function called 'get_value_at_index' that takes in a list and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_value_at_index([1, 2, 3, 4, 5], 0) == 1\", \"assert get_value_at_index([10, 20, 30, 40], 2) == 30\", \"assert get_value_at_index([-1, -2, -3, -4], 1) == -2\", \"assert get_value_at_index([5], 0) == 5\", \"assert get_value_at_index([], 0) == -1\", \"asser... | {
"split": "train",
"index": 64033,
"acecode_id": "bigcode_python_fns_1921",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with defining a User class that represents a user in a system. This class should include three attributes: an auto-incremented primary key 'id', a unique 'email', and a boolean 'is_admin'. Implement a function that initializes a User object with 'email' and 'is_a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert User('test@example.com', True).email == 'test@example.com'\", \"assert User('user1@example.com', False).is_admin == False\", \"assert User('admin@example.com', True).is_admin == True\", \"assert User('user2@example.com', True).email == 'user2@example.com'\",... | {
"split": "train",
"index": 64034,
"acecode_id": "evol_19470",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a singly linked list, implement a function `search_linked_list(head: Node, target: int) -> bool` that checks whether a specific element `target` is present in the linked list. The linked list is represented by its head node. The function should return `True` if the target... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_linked_list(Node(3, Node(2, Node(1))), 2) == True\", \"assert search_linked_list(Node(3, Node(2, Node(1))), 4) == False\", \"assert search_linked_list(Node(1), 1) == True\", \"assert search_linked_list(Node(1), 2) == False\", \"assert search_linked_li... | {
"split": "train",
"index": 64035,
"acecode_id": "evol_32579",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `word`, implement a function `is_palindrome(word)` that checks if the string is a palindrome. A palindrome is a word that reads the same backward as forward, ignoring case sensitivity. The function should return `True` if the input is a palindrome and `False` oth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('kite') == False\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('A man a plan a canal Panama') == False\", \"assert is_palindrome('No lemon no melon') == False\", \"assert is_palindrome('madam') == True\", \"assert is_pa... | {
"split": "train",
"index": 64036,
"acecode_id": "evol_26768",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a command to move a robot to a specific location based on given coordinates. The function should take a dictionary of parameters containing the target coordinates and return a string indicating the successful movement of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_robot({'coordinates': (3, 4)}) == 'Robot moved to (3, 4)'\", \"assert move_robot({'coordinates': (0, 0)}) == 'Robot moved to (0, 0)'\", \"assert move_robot({'coordinates': (10, 5)}) == 'Robot moved to (10, 5)'\", \"assert move_robot({'coordinates': (-1,... | {
"split": "train",
"index": 64037,
"acecode_id": "oss_29096",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with configuring a link based on three parameters: reset, loopback, and scrambling. Write a function `link_configuration` that takes three integer parameters: `reset`, `loopback`, and `scrambling`. The function should compute a configuration value based on the fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert link_configuration(0, 0, 1) == 0\", \"assert link_configuration(0, 0, 0) == 8\", \"assert link_configuration(0, 1, 1) == 4\", \"assert link_configuration(0, 1, 0) == 12\", \"assert link_configuration(1, 0, 1) == 1\", \"assert link_configuration(1, 0, 0) == 9... | {
"split": "train",
"index": 64038,
"acecode_id": "bigcode_python_fns_5385",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `cycpattern_check(a: str, b: str) -> bool` that evaluates whether the second string or any of its cyclic permutations are found as a continuous subsequence within the first string. The function should ignore case and special characters, handle language-spec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cycpattern_check('Hello', 'ELl') == True\", \"assert cycpattern_check('AbcD', 'aBd') == False\", \"assert cycpattern_check('aB!ab', 'BAa') == True\", \"assert cycpattern_check('Whas$sup', 'pSUs') == False\", \"assert cycpattern_check('EfEF', 'EeFf') == False... | {
"split": "train",
"index": 64039,
"acecode_id": "evol_35423",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of sentences, where each sentence is a string. Your task is to split this list into three parts: a training set, a testing set, and a development set based on specified rates for training, testing, and development. The sum of the three rates should equal 1.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_data(['a', 'b', 'c', 'd'], 0.5, 0.5) == (['a', 'b'], ['c', 'd'], [])\", \"assert split_data(['one', 'two', 'three', 'four', 'five', 'six'], 0.6, 0.2) == (['one', 'two', 'three'], ['four'], ['five', 'six'])\", \"assert split_data(['apple', 'banana', 'ch... | {
"split": "train",
"index": 64040,
"acecode_id": "bigcode_python_fns_36162",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a global variable called '_debug' is set to True or False. Implement a function `is_debug()` that returns True if '_debug' is set to True, and returns False otherwise. The function should not take any parameters and should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_debug() == False\", \"assert is_debug() == False\", \"assert is_debug() == False\", \"assert is_debug() == False\", \"assert is_debug() == False\", \"assert is_debug() == False\", \"assert is_debug() == False\", \"assert is_debug() == False\", \"assert is... | {
"split": "train",
"index": 64041,
"acecode_id": "bigcode_python_fns_17893",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that filters out positive prime numbers from a given list. The function should implement a caching mechanism to store previously computed prime results. The function should ignore negative numbers and should only determine positive prime numbers. You nee... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_positive_primes([2, 3, 4, 5, -7, -9, 10, 37, -49, 81]) == [2, 3, 5, 37]\", \"assert filter_positive_primes([-1, -2, -3]) == []\", \"assert filter_positive_primes([1, 4, 6, 8]) == []\", \"assert filter_positive_primes([11, 13, 17, 19]) == [11, 13, 17, ... | {
"split": "train",
"index": 64042,
"acecode_id": "evol_16748",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of operations to be performed on a stack. The operations are represented as strings in the following format: - \"PUSH X\": Push the integer X onto the stack. - \"POP\": Pop the top element from the stack. - \"INC Y Z\": Increment the bottom Y elements of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_stack_state(['PUSH 1', 'PUSH 2', 'POP', 'PUSH 3', 'INC 2 1']) == [2, 4]\", \"assert final_stack_state(['PUSH 5', 'PUSH 6', 'PUSH 7', 'INC 1 3']) == [8, 6, 7]\", \"assert final_stack_state(['PUSH 10', 'PUSH 20', 'POP', 'INC 2 5']) == [15]\", \"assert fi... | {
"split": "train",
"index": 64043,
"acecode_id": "oss_11243",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that returns the first N numbers from the Fibonacci sequence, where N is a given input. The function should take an integer N as its parameter and return a list containing the Fibonacci numbers from index 0 to N-1.\nPlease reason step by step, then write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1... | {
"split": "train",
"index": 64044,
"acecode_id": "evol_29591",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to generate a boot sector for a FAT32 file system. The boot sector is a crucial part of the file system, containing essential information for the system to boot and access the file system. Your function should construct and return a b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_boot_sector()[0:12] == b'\\\\x00' * 12\", \"assert generate_boot_sector()[13] == 0x00\", \"assert generate_boot_sector()[510] == 0x55\", \"assert generate_boot_sector()[511] == 0xAA\", \"assert generate_boot_sector()[1:3] == b'\\\\x00' * 2\", \"asse... | {
"split": "train",
"index": 64045,
"acecode_id": "oss_12964",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given two strings as input, concatenate them, transform the resulting string to upper case, and return the result. If either of the input strings is null or empty, raise a ValueError with the message 'Null or empty string not allowed'. Implement a function named `concat_upper_s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concat_upper_string('Hello', 'World') == 'HELLOWORLD'\", \"assert concat_upper_string('First', 'Second') == 'FIRSTSECOND'\", \"assert concat_upper_string('Python', 'Programming') == 'PYTHONPROGRAMMING'\", \"assert concat_upper_string('test ', 'case') == 'TES... | {
"split": "train",
"index": 64046,
"acecode_id": "evol_19938",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of monthly temperature readings and a corresponding list of monthly precipitation readings for a specific region. Your task is to calculate the average temperature and total precipitation for the months where the temperature is above a certain threshold. Im... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_and_total([60.0, 62.0, 58.0, 65.0], [1.0, 2.0, 1.5, 0.5], 65.0) == (0.0, 0.0)\", \"assert calculate_average_and_total([55.0, 60.0, 65.0, 70.0], [0.0, 0.0, 0.0, 0.0], 50.0) == (62.5, 0.0)\", \"assert calculate_average_and_total([90.0, 88.0, ... | {
"split": "train",
"index": 64047,
"acecode_id": "bigcode_python_fns_7662",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves the neighbors of a node in a graph based on the type of edges specified (real or fake). A graph is represented by two dictionaries: one for real edges and another for fake edges. Your function should take a node and a b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_neighbors({'A': ['B'], 'B': ['A']}, {'A': ['C'], 'C': ['A']}, 'A', True) == ['B']\", \"assert get_neighbors({'A': ['B'], 'B': ['A']}, {'A': ['C'], 'C': ['A']}, 'A', False) == ['C']\", \"assert get_neighbors({'A': ['B'], 'B': ['A']}, {'A': ['C'], 'C': ['A... | {
"split": "train",
"index": 64048,
"acecode_id": "oss_22706",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `find_longest_string` that takes an array of strings as input and returns the string with the maximum length. If there are multiple strings with the same maximum length, return the first one that appears in the array. The input array will contain at ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_longest_string(['Apple', 'Banana', 'Orange']) == 'Banana'\", \"assert find_longest_string(['cat', 'dog', 'elephant']) == 'elephant'\", \"assert find_longest_string(['a', 'ab', 'abc', 'abcd']) == 'abcd'\", \"assert find_longest_string(['hello', 'world'])... | {
"split": "train",
"index": 64049,
"acecode_id": "evol_28316",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates the requested API version based on a predefined set of valid versions. The function should take two parameters: `api_version` (an integer representing the requested API version) and `valid_versions` (a list of integers repr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_api_version(1, [1, 2, 3]) == True\", \"assert validate_api_version(2, [1, 2, 3]) == True\", \"assert validate_api_version(3, [1, 2, 3]) == True\", \"assert validate_api_version(4, [1, 2, 3]) == False\", \"assert validate_api_version(1, [2, 3, 4]) ==... | {
"split": "train",
"index": 64050,
"acecode_id": "bigcode_python_fns_43070",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a validation process based on given context data. Write a function `validate_context(context: dict) -> str` that takes a dictionary `context` as input. If the dictionary contains a key `context_data`, the function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_context({'context_data': 'some_value'}) == 'have context data'\", \"assert validate_context({'other_key': 'value'}) == 'hello'\", \"assert validate_context({'context_data': 123}) == 'have context data'\", \"assert validate_context({'context_data': N... | {
"split": "train",
"index": 64051,
"acecode_id": "oss_14805",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries representing documents, implement a function that creates a copy of each document while allowing certain fields to be excluded from the copy. Each document is represented as a dictionary with various fields. The function should take two parameters: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert copy_docs([{'id': 1, 'title': 'Doc 1', 'content': 'Content 1'}, {'id': 2, 'title': 'Doc 2', 'content': 'Content 2'}], ['content']) == [{'id': 1, 'title': 'Doc 1', 'content': None}, {'id': 2, 'title': 'Doc 2', 'content': None}]\", \"assert copy_docs([{'id': 1... | {
"split": "train",
"index": 64052,
"acecode_id": "bigcode_python_fns_34207",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that determines the total number of elements in a list, including elements in any nested lists, regardless of their depth. The function should count each individual element only once, whether it is a direct element in the list or an element found within a neste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert size_of_list([1,2,[3,4,[5,6],7],[8,9]]) == 9\", \"assert size_of_list([]) == 0\", \"assert size_of_list([1,2,3]) == 3\", \"assert size_of_list([[1,2],[3,4]]) == 4\", \"assert size_of_list([1,[2,[3,[4]]]]) == 4\", \"assert size_of_list([1, [2], [3, [4, [5]]]]... | {
"split": "train",
"index": 64053,
"acecode_id": "evol_15864",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the behavior of an application's state management system. The application maintains a stack of states, and the operations include saving the current state and reverting to the previous state. You need to implement a function `manage_states(operati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_states([('save', 'state1')]) == 'state1'\", \"assert manage_states([('save', 'state1'), ('save', 'state2'), ('undo', None)]) == 'state1'\", \"assert manage_states([('save', 'state1'), ('undo', None)]) == None\", \"assert manage_states([('undo', None)]... | {
"split": "train",
"index": 64054,
"acecode_id": "oss_3787",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a series of bars in a histogram. Write a function that calculates the maximum area of a rectangle that can be formed within the histogram. The function should take the list of integers as input and return the maximum ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_histogram_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_histogram_area([1, 1, 1, 1]) == 4\", \"assert max_histogram_area([6, 2, 5, 4, 5, 1, 6]) == 12\", \"assert max_histogram_area([1, 3, 2, 5, 4, 1]) == 8\", \"assert max_histogram_area([0, 1, 0, 2]) ==... | {
"split": "train",
"index": 64055,
"acecode_id": "bigcode_python_fns_36110",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary of promotional codes where each key represents a promo code and each value is a list containing two elements: the expiration date (as a string in 'YYYY-MM-DD' format) and a description (as a string). Your task is to implement a function `filter_new_co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_new_codes({'PROMO1': ['2023-12-31', 'Discount 10%']}, {'PROMO1': ['2023-12-31', 'Discount 10%'], 'PROMO2': ['2024-01-15', 'Free Shipping']}) == {'PROMO2': ['2024-01-15', 'Free Shipping']}\", \"assert filter_new_codes({}, {'PROMO1': ['2023-12-31', 'Dis... | {
"split": "train",
"index": 64056,
"acecode_id": "bigcode_python_fns_21059",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the boot strapping setting of a given port based on its status. The function should accept an integer `port_id` which represents the identifier of the port. The function should return a dictionary containing the port's sta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_boot_strap_setting(1) == {'Port State': 'Off', 'Boot Strap': 'Normal'}\", \"assert get_boot_strap_setting(2) == {'Port State': 'On', 'Boot Strap': 'Network'}\", \"assert get_boot_strap_setting(5) == {'Port State': None}\", \"assert get_boot_strap_setting... | {
"split": "train",
"index": 64057,
"acecode_id": "bigcode_python_fns_43048",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a single parameter `container` which can be one of the following types: a dictionary, a set, or an Enum. Your task is to implement a function `mapper_or_checker(container)` that checks the type of `container` and returns a specific output based on its type. If `co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mapper_or_checker({True: 42}) == 42\", \"assert mapper_or_checker({1: 'one', 2: 'two'}) == 'one'\", \"assert mapper_or_checker({'a': 1, 'b': 2}) == 1\", \"assert mapper_or_checker(set([1, 2, 3])) == 3\", \"assert mapper_or_checker(set()) == 0\", \"assert map... | {
"split": "train",
"index": 64058,
"acecode_id": "bigcode_python_fns_48841",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of equal length, `y_true` and `y_pred`, representing the true values and the predicted values respectively. Your task is to compute the Mean Squared Error (MSE) between the two lists, ignoring any entries in `y_true` that are zero. The MSE is calculated ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_mse([1, 2, 3], [1, 2, 3]) == 0.0\", \"assert compute_mse([0, 0, 0], [1, 2, 3]) == 0.0\", \"assert compute_mse([0, 2, 0], [1, 2, 3]) == 0.0\", \"assert compute_mse([1, 1, 1], [2, 2, 2]) == 1.0\", \"assert compute_mse([2, 2, 2], [1, 1, 1]) == 1.0\", \"... | {
"split": "train",
"index": 64059,
"acecode_id": "bigcode_python_fns_18793",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function named `initialize_service` that sets up a data processing service's configuration. The function should take the following parameters: a string `kafka_group_id`, an integer `input_port`, a dictionary `postgres_config`, and a string `in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_service('group_id', 1234, {'dbname': 'db1', 'user': 'user1', 'password': 'pass1', 'host': 'localhost', 'port': '5432'}, 'CREATE TABLE IF NOT EXISTS test_table (id SERIAL PRIMARY KEY);') == {'kafka_group_id': 'group_id', 'input_port': 1234, 'postgr... | {
"split": "train",
"index": 64060,
"acecode_id": "oss_36834",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the creation of two files based on given input filenames. The function takes two string parameters, `file1` and `file2`, representing the names of the files to be created. Your function should return a dictionary with t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_files('new_file_1.txt', 'new_file_2.txt') == {'newfile1': 'new_file_1.txt', 'newfile2': 'new_file_2.txt', 'return_code': 0}\", \"assert create_files('new_file_1.txt', '') == {'newfile1': 'new_file_1.txt', 'return_code': 1}\", \"assert create_files('',... | {
"split": "train",
"index": 64061,
"acecode_id": "bigcode_python_fns_43253",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a directed graph represented as an adjacency list, write a function `shortest_path(graph: Dict[str, Dict[str, int]], start: str, end: str) -> Tuple[int, List[str]]` that finds the shortest path and its distance from a start node to an end node. The function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_path({'A': {'B': 1, 'C': 3}, 'B': {'C': 1}, 'C': {}}, 'A', 'C') == (2, ['A', 'B', 'C'])\", \"assert shortest_path({'A': {'B': 1}, 'B': {'C': 2}, 'C': {}}, 'A', 'C') == (3, ['A', 'B', 'C'])\", \"assert shortest_path({'A': {'B': 3}, 'B': {'C': 2}, 'C'... | {
"split": "train",
"index": 64062,
"acecode_id": "evol_20221",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates operations on a simple linked list. The function should take a list of operations as input and return the value of the last node after performing all operations. The operations can be of three types: 'add', 'get', and '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert linked_list_operations([('add', 1), ('add', 2), ('get', None), ('remove', None)]) == 2\", \"assert linked_list_operations([('add', 3), ('remove', None), ('get', None)]) == None\", \"assert linked_list_operations([('add', 4), ('add', 5), ('remove', None), ('g... | {
"split": "train",
"index": 64063,
"acecode_id": "oss_21973",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `format_number(value: float, digit: int, is_pct: bool) -> str` that formats a given floating-point number. The function should take the following parameters: \n\n- `value`: A float that you want to format. \n- `digit`: An integer that specifies the number o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_number(100000, 0, False) == '100,000'\", \"assert format_number(100000, 1, False) == '100,000.0'\", \"assert format_number(0.2, -1, True) == ' 20.0%'\", \"assert format_number(-0.2, -1, True) == '-20.0%'\", \"assert format_number(1234567.89, 2, False)... | {
"split": "train",
"index": 64064,
"acecode_id": "bigcode_python_fns_35997",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a motion detection system. Write a Python function that simulates the behavior of a motion sensor detecting motion a specified number of times. The function should take an integer parameter, `iterations`, which represents the number of times the m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_motion_detection(0) == 0\", \"assert simulate_motion_detection(1) == 1\", \"assert simulate_motion_detection(2) == 2\", \"assert simulate_motion_detection(3) == 3\", \"assert simulate_motion_detection(4) == 4\", \"assert simulate_motion_detection(5)... | {
"split": "train",
"index": 64065,
"acecode_id": "oss_14204",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `binary_search_roman(roman_list: List[str], target: str) -> Optional[int]` that searches for a given Roman numeral `target` in a list of Roman numerals sorted in descending order. If the target is found, return its index. If it is not found, return None. Yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search_roman(['X', 'V', 'I', 'D', 'C', 'L', 'M'], 'D') == 3\", \"assert binary_search_roman(['X', 'V', 'I', 'D', 'C', 'L', 'M'], 'C') == 4\", \"assert binary_search_roman(['X', 'V', 'I', 'D', 'C', 'L', 'M'], 'L') == 5\", \"assert binary_search_roman([... | {
"split": "train",
"index": 64066,
"acecode_id": "evol_21159",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a dictionary containing application settings and returns a modified dictionary with specific settings updated based on a given list of key-value pairs. The settings are represented as key-value pairs in the dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_settings({'theme': 'light', 'font_size': 12, 'show_notifications': True}, [('theme', 'dark'), ('font_size', 14)]) == {'theme': 'dark', 'font_size': 14, 'show_notifications': True}\", \"assert update_settings({'volume': 10, 'brightness': 50}, [('volume... | {
"split": "train",
"index": 64067,
"acecode_id": "oss_33822",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of page progress data for a book reading application. Each element in the list contains two integers: the first integer represents the total number of pages in the book, and the second integer represents the number of pages that have been read. Your task is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_completion_percentage([(10, 5), (20, 15), (30, 0)]) == [50.0, 75.0, 0.0]\", \"assert calculate_completion_percentage([(0, 0), (5, 2)]) == [0.0, 40.0]\", \"assert calculate_completion_percentage([(100, 100), (50, 0)]) == [100.0, 0.0]\", \"assert cal... | {
"split": "train",
"index": 64068,
"acecode_id": "oss_33866",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `classify_triangle(a: int, b: int, c: int) -> str` that classifies a triangle based on the lengths of its sides. The function should return 'Not a valid triangle' if the sides do not form a valid triangle. If the sides form a valid triangle, return 'Equilat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_triangle(3, 3, 3) == 'Equilateral triangle'\", \"assert classify_triangle(3, 4, 5) == 'Scalene triangle'\", \"assert classify_triangle(2, 2, 3) == 'Isosceles triangle'\", \"assert classify_triangle(1, 1, 1) == 'Equilateral triangle'\", \"assert clas... | {
"split": "train",
"index": 64069,
"acecode_id": "evol_18154",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple HTTP PUT request to update a resource identified by a unique `tool_id` and `version_id`. The function should take in three parameters: `tool_id`, `version_id`, and `data`. The function should return a dictionary re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert put_request_update(1, 1, {'version': '1.0'}) == {'status_code': 200, 'message': 'Update successful'}\", \"assert put_request_update(1, 1, None) == {'status_code': 400, 'message': 'No data provided'}\", \"assert put_request_update(1, 1, {}) == {'status_code':... | {
"split": "train",
"index": 64070,
"acecode_id": "bigcode_python_fns_46901",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given the dimensions of a convolution operation, and your task is to determine the output length of the convolution given the parameters of the input length, filter size, border mode, stride, and dilation rate. Implement a function `conv_output_length(input_length: int,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert conv_output_length(10, 3, 'same', 1) == 10\", \"assert conv_output_length(10, 3, 'valid', 1) == 8\", \"assert conv_output_length(10, 3, 'full', 1) == 12\", \"assert conv_output_length(10, 5, 'same', 2) == 5\", \"assert conv_output_length(10, 5, 'valid', 2) =... | {
"split": "train",
"index": 64071,
"acecode_id": "bigcode_python_fns_3420",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of words and a list of corresponding word embeddings represented as lists of floats. Your task is to write a function `load_word_vecs(words: List[str], embeddings: List[List[float]]) -> Dict[str, List[float]]` that creates a dictionary mapping each word to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_word_vecs(['apple', 'banana'], [[0.1]*300, [0.2]*300]) == {'apple': [0.1]*300, 'banana': [0.2]*300}\", \"assert load_word_vecs(['cat', 'dog'], [[0.3]*300]) == {'cat': [0.3]*300}\", \"assert load_word_vecs(['fish', 'bird'], [[0.4]*300, [0.5]*300]) == {'f... | {
"split": "train",
"index": 64072,
"acecode_id": "bigcode_python_fns_36393",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers `arr` and an integer `k`, write a function that returns a new list where each integer in `arr` is repeated `k` times in the same order. The input list can contain both positive and negative integers. The function should return the new list as output.\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert repeat_interleave([1, 2, 3], 2) == [1, 1, 2, 2, 3, 3]\", \"assert repeat_interleave([0, -1, -2], 3) == [0, 0, 0, -1, -1, -1, -2, -2, -2]\", \"assert repeat_interleave([], 5) == []\", \"assert repeat_interleave([4, 5], 1) == [4, 5]\", \"assert repeat_interlea... | {
"split": "train",
"index": 64073,
"acecode_id": "bigcode_python_fns_1714",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and your task is to calculate the average, maximum, and minimum values of the integers in the list. Write a function `calculate_statistics(numbers: List[int]) -> Tuple[float, int, int]` that takes a list of integers as input and returns a tuple ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_statistics([1, 2, 3, 4, 5]) == (3.0, 5, 1)\", \"assert calculate_statistics([-1, -2, -3, -4, -5]) == (-3.0, -1, -5)\", \"assert calculate_statistics([10, 20, 30]) == (20.0, 30, 10)\", \"assert calculate_statistics([5]) == (5.0, 5, 5)\", \"assert ca... | {
"split": "train",
"index": 64074,
"acecode_id": "oss_15855",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a duration of time in a specific format. The format can include days, hours, minutes, and seconds, with the following abbreviations: 'd' for days, 'h' for hours, 'm' for minutes, and 's' for seconds. Your task is to create a function `parse_t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_timedelta('2d8h5m20s') == (2, 8, 5, 20)\", \"assert parse_timedelta('1h') == (0, 1, 0, 0)\", \"assert parse_timedelta('3m') == (0, 0, 3, 0)\", \"assert parse_timedelta('5s') == (0, 0, 0, 5)\", \"assert parse_timedelta('1d1h1m1s') == (1, 1, 1, 1)\", \"a... | {
"split": "train",
"index": 64075,
"acecode_id": "bigcode_python_fns_41978",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the average of a list of numbers, excluding the minimum and maximum values. The function should take a list of integers as input and return the average of the remaining values. If the input list has fewer than three eleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average([10, 20, 30]) == 20.0\", \"assert calculate_average([1, 2]) == 0\", \"assert calculate_average([100, 200, 300, 400, 500]) == 300.0\", \"assert calculate_average([0, 0, 0, 0]) == 0.0\", \... | {
"split": "train",
"index": 64076,
"acecode_id": "oss_23866",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a login validation function. The function should take two parameters: a username and a password. It will validate the login attempt against a predefined list of users, where each user is represented as a dictionary with 'username' and 'password'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_login('test_user', 'password123') == 'Login successful'\", \"assert validate_login('admin', 'adminpass') == 'Login successful'\", \"assert validate_login('guest', 'guestpass') == 'Login successful'\", \"assert validate_login('test_user', 'wrongpassw... | {
"split": "train",
"index": 64077,
"acecode_id": "bigcode_python_fns_9975",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that adds a new integer to the list if it does not already exist in the list. If the integer already exists, return the list unchanged. The function should return the modified list. Write a function `add_unique_integer(nums: List[i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_unique_integer([1, 2, 3], 4) == [1, 2, 3, 4]\", \"assert add_unique_integer([1, 2, 3], 1) == [1, 2, 3]\", \"assert add_unique_integer([], 5) == [5]\", \"assert add_unique_integer([4, 5, 6], 6) == [4, 5, 6]\", \"assert add_unique_integer([1, 2, 1, 3], 2) ... | {
"split": "train",
"index": 64078,
"acecode_id": "bigcode_python_fns_32032",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an initial list of integers called `register`. You also have a list of instructions, where each instruction is a tuple of two elements: an operation and a value. The operations can be 'add', 'subtract', or 'multiply'. Your task is to apply each instruction sequent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process([1, 2, 3], [('add', 2), ('multiply', 3)]) == [9, 12, 15]\", \"assert process([5, 5, 5], [('subtract', 1), ('add', 2)]) == [6, 6, 6]\", \"assert process([0, 0, 0], [('multiply', 10)]) == [0, 0, 0]\", \"assert process([1, -1], [('add', 1), ('subtract',... | {
"split": "train",
"index": 64079,
"acecode_id": "bigcode_python_fns_32607",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that identifies offending processes based on certain criteria. The function should accept the following parameters: a list of processes, where each process is represented as a dictionary containing 'pid', 'name', 'cpu_percent', 'memory_pe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert identify_offending_processes([{'pid': 2, 'name': 'ProcessB', 'cpu_percent': 20, 'memory_percent': 25}], 5, 15) == [{'pid': 2, 'name': 'ProcessB', 'cpu_percent': 20, 'memory_percent': 25}]\", \"assert identify_offending_processes([{'pid': 3, 'name': 'ProcessC... | {
"split": "train",
"index": 64080,
"acecode_id": "oss_846",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that formats shipping addresses. The function should take a list of dictionaries, where each dictionary contains the keys 'street_address', 'city', 'state', and 'postal_code'. The function should return a list of formatted shipping... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_shipping_addresses([{'street_address': '123 Main St', 'city': 'Anytown', 'state': 'CA', 'postal_code': '12345'}]) == ['123 Main St, Anytown, CA 12345']\", \"assert format_shipping_addresses([{'street_address': '789 Oak St', 'city': 'Sometown', 'state'... | {
"split": "train",
"index": 64081,
"acecode_id": "oss_23039",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_total_cost(price: float, quantity: int) -> float` that computes the total cost based on the given price per unit and quantity of items. The function should return the total cost as a float value. Ensure that the function handles cases where the p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_cost(10, 5) == 50.0\", \"assert calculate_total_cost(0, 5) == 0.0\", \"assert calculate_total_cost(10, 0) == 0.0\", \"assert calculate_total_cost(0, 0) == 0.0\", \"assert calculate_total_cost(15.5, 2) == 31.0\", \"assert calculate_total_cost(... | {
"split": "train",
"index": 64082,
"acecode_id": "evol_33623",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages the configuration name for an Arduino application. The function should allow you to set and get the name of the application. Implement a function `manage_config(name: str, command: str, new_name: Optional[str] = None) -> Unio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_config('ArduinoApp', 'get') == 'ArduinoApp'\", \"assert manage_config('ArduinoApp', 'set', 'NewArduinoApp') is None\", \"assert manage_config('NewArduinoApp', 'get') == 'NewArduinoApp'\", \"assert manage_config('ArduinoApp', 'set', 'AnotherApp') is No... | {
"split": "train",
"index": 64083,
"acecode_id": "oss_30709",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of vulnerability IDs and a scan ID. The function should take two inputs: a string of comma-separated vulnerability IDs and a scan ID. The function should return a dictionary containing the total number of vulnerabili... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_vulnerabilities('1,2,3,4,5,6,7,8,9', 'scan_123') == {'total_vul': 9, 'high_vul': 3, 'medium_vul': 3, 'low_vul': 3}\", \"assert process_vulnerabilities('1,3,5,7', 'scan_456') == {'total_vul': 4, 'high_vul': 2, 'medium_vul': 1, 'low_vul': 1}\", \"asser... | {
"split": "train",
"index": 64084,
"acecode_id": "bigcode_python_fns_9103",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a reinforcement learning algorithm for a simple game. The game has a reward system based on the player's health and the proximity to enemies. You need to implement a function that takes the current state of the game, represented as a `GameState`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reinforcement_learning(GameState((0, 0), (1, 1), 0)) == (-1.0, True)\", \"assert reinforcement_learning(GameState((0, 0), (3, 3), 10)) == (0.1, False)\", \"assert reinforcement_learning(GameState((1, 1), (1, 0), 5)) == (-0.5, False)\", \"assert reinforcement... | {
"split": "train",
"index": 64085,
"acecode_id": "oss_17175",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `default_data(sim_type: str) -> dict` that simulates the retrieval of base data for a given simulation type. The function should return a dictionary representing the default data associated with the provided simulation type. The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert default_data('physics') == {'mass': 1.0, 'velocity': 10.0}\", \"assert default_data('chemistry') == {'reactants': ['H2', 'O2'], 'products': ['H2O']}\", \"assert default_data('biology') == {'cells': 100, 'organisms': 5}\", \"assert default_data('astronomy') =... | {
"split": "train",
"index": 64086,
"acecode_id": "bigcode_python_fns_4941",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to simulate a simple messaging system. The function should allow setting a message only once and retrieving it later. Your task is to implement the function `message_system(operations: List[Tuple[str, str]]) -> List[str]` where `opera... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert message_system([('set', 'Hello World'), ('get', '')]) == ['Hello World']\", \"assert message_system([('set', 'Hello'), ('set', 'World'), ('get', '')]) == ['Hello']\", \"assert message_system([('get', ''), ('set', 'Message'), ('get', '')]) == ['No message set... | {
"split": "train",
"index": 64087,
"acecode_id": "oss_5981",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings `seq1` and `seq2`, and an integer `word_len`, implement a function `check_substring(seq1: str, seq2: str, word_len: int) -> bool`. The function should return `True` if `seq2` does not contain any substring of `seq1` of length `word_len`. Otherwise, return `Fal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_substring('hello', 'world', 3) == True\", \"assert check_substring('abcde', 'xyzabc', 2) == False\", \"assert check_substring('python', 'java', 4) == True\", \"assert check_substring('abcdef', 'defabc', 3) == False\", \"assert check_substring('test', '... | {
"split": "train",
"index": 64088,
"acecode_id": "bigcode_python_fns_1607",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of movie IDs representing the vocabulary of a graph. The movie IDs are represented as strings and are stored in the `vocabulary` list. The first element of the list is 'NA', and the subsequent elements are the movie IDs. Your task is to write a function `ge... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_movie_pairs(['NA', 'M1', 'M2', 'M3']) == [('M1', 'M2'), ('M1', 'M3'), ('M2', 'M3')]\", \"assert generate_movie_pairs(['NA', 'M1', 'M2']) == [('M1', 'M2')]\", \"assert generate_movie_pairs(['NA', 'M1']) == []\", \"assert generate_movie_pairs(['NA', '... | {
"split": "train",
"index": 64089,
"acecode_id": "oss_35227",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of pairs of integers and returns a list of results from addition and subtraction operations performed on each pair. Your function should accept a list of tuples, where each tuple contains two integers (num_1, num_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert arithmetic_operations([(1, 2), (3, 4)]) == [(3, -1), (7, -1)]\", \"assert arithmetic_operations([(5, 5), (10, 2)]) == [(10, 0), (12, 8)]\", \"assert arithmetic_operations([(0, 0), (1, 1)]) == [(0, 0), (2, 0)]\", \"assert arithmetic_operations([(100, 200), (3... | {
"split": "train",
"index": 64090,
"acecode_id": "oss_34704",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that calculates the weighted average for each unique set of indices defined in a nested list. Each integer in the main list represents a value associated with its index, and in the nested list, each sublist contains indices of valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert weighted_average([10, 20, 30, 40], [[0, 1], [2, 3]], [[1, 1], [1, 1]]) == [15.0, 35.0]\", \"assert weighted_average([5, 15, 25], [[0, 1, 2]], [[1, 2, 3]]) == [18.333333333333332]\", \"assert weighted_average([2, 4, 6, 8], [[0, 2], [1, 3]], [[1, 1], [1, 1]]) ... | {
"split": "train",
"index": 64091,
"acecode_id": "bigcode_python_fns_32447",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a click event on a graphical window. The function should keep track of clicks and alternate between drawing a filled circle (dot) and drawing a line based on the click events. Implement a function `click_event_tracker(click... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert click_event_tracker([(10, 20), (30, 40)]) == ['Added dot at (10, 20)', 'Removed dot and created line from (10, 20) to (30, 40)']\", \"assert click_event_tracker([(0, 0), (100, 100)]) == ['Added dot at (0, 0)', 'Removed dot and created line from (0, 0) to (10... | {
"split": "train",
"index": 64092,
"acecode_id": "bigcode_python_fns_22299",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a publication's header, your task is to parse the header and extract the publication title, journal name, publication year, DOI, and list of authors. The header string will follow a specific format where the title is enclosed in 'Title: ', the journa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_header('Title: Understanding AI\\\\nJournal: AI Research Journal\\\\nYear: 2023\\\\nDOI: 10.1000/xyz123\\\\nAuthors: Alice Smith, Bob Johnson') == ('Understanding AI', 'AI Research Journal', '2023', '10.1000/xyz123', ['Alice Smith', 'Bob Johnson'])\", ... | {
"split": "train",
"index": 64093,
"acecode_id": "bigcode_python_fns_3763",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `value_to_int(value: Union[int, str]) -> int` that converts a given value to an integer. The input `value` can either be an integer or a string representation of an integer. If the input is a valid integer or a string that can be converted to an integer, re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert value_to_int(123) == 123\", \"assert value_to_int('456') == 456\", \"assert value_to_int('-789') == -789\", \"assert value_to_int('0') == 0\", \"assert value_to_int('000123') == 123\", \"assert value_to_int('-000456') == -456\", \"assert value_to_int('214748... | {
"split": "train",
"index": 64094,
"acecode_id": "bigcode_python_fns_49741",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `least_frequent_letters(input_string: str) -> List[str]` that takes an alphanumeric string as input, which may contain both uppercase and lowercase letters, punctuation, white spaces, and numbers. The function should return a sorted list of the least freque... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert least_frequent_letters('abcdefg') == ['a', 'b', 'c', 'd', 'e', 'f', 'g']\", \"assert least_frequent_letters('') == []\", \"assert least_frequent_letters('12345!@#$%^&*()') == []\", \"assert least_frequent_letters('aA! bB! cC!') == ['a', 'b', 'c']\", \"assert... | {
"split": "train",
"index": 64095,
"acecode_id": "evol_24835",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified version of a tweak management system for startup applications. In this system, a 'tweak' is represented as a string that describes a functionality. You need to implement a function that manages the tweaks by allowing the addition an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_tweak(['tweak1', 'tweak2'], 'tweak3') == ['tweak1', 'tweak2', 'tweak3']\", \"assert add_tweak(['tweak1', 'tweak2'], 'Tweak1') == ['tweak1', 'tweak2']\", \"assert remove_tweak(['tweak1', 'tweak2'], 'tweak2') == (['tweak1'], True)\", \"assert remove_tweak(... | {
"split": "train",
"index": 64096,
"acecode_id": "oss_12652",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of medication statuses represented as strings where each status can be either 'NONE', 'NEW', or any other string. Your task is to implement a function `reformat_medication_statuses(statuses: List[str]) -> List[int]` that reformats these medication statuses ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reformat_medication_statuses(['NONE', 'NEW', 'ACTIVE', 'COMPLETED']) == [0, 0, 1, 1]\", \"assert reformat_medication_statuses(['ACTIVE', 'COMPLETED', 'NONE', 'NEW', 'PENDING']) == [1, 1, 0, 0, 1]\", \"assert reformat_medication_statuses(['NEW', 'ACTIVE']) ==... | {
"split": "train",
"index": 64097,
"acecode_id": "bigcode_python_fns_8202",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the installation of Python packages. Your function will take a list of package requirements and additional flags as input, and you will need to return a string that describes the installation command that would be ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_install_command(['requests', 'numpy==1.18.1'], ['--proxy=http://user:pass@proxy.com:8080'], ['--no-cache-dir']) == 'pip install -r requirements.txt --proxy=http://user:pass@proxy.com:8080 --no-cache-dir'\", \"assert format_install_command(['flask>=1.0... | {
"split": "train",
"index": 64098,
"acecode_id": "oss_37390",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `verify_json(input_json: str, schema: dict) -> bool` that checks if a given string is a valid JSON document and verifies it against a specified schema. The function should raise a `ValueError` if the input string is not a valid JSON. If the JSON is valid bu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_json('{\\\"name\\\": \\\"John\\\", \\\"age\\\": 30}', {\\\"type\\\": \\\"object\\\", \\\"properties\\\": {\\\"name\\\": {\\\"type\\\": \\\"string\\\"}, \\\"age\\\": {\\\"type\\\": \\\"integer\\\"}}, \\\"required\\\": [\\\"name\\\", \\\"age\\\"]}) == T... | {
"split": "train",
"index": 64099,
"acecode_id": "evol_6105",
"num_tests": 9
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.