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": "Implement a function that simulates a Two-Factor Authentication (2FA) login process. The function should take two parameters: a username and a password. If the username is 'admin' and the password is 'password123', the function should return 'Login successful, 2FA required'. Fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert two_factor_auth('admin', 'password123') == 'Login successful, 2FA required'\", \"assert two_factor_auth('admin', 'wrongpassword') == 'Login failed'\", \"assert two_factor_auth('user', 'password123') == 'Login failed'\", \"assert two_factor_auth('user', 'wron... | {
"split": "train",
"index": 82900,
"acecode_id": "evol_1271",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of integers as input and returns the number of unique integers in that list.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_elements([1, 2, 3, 4, 5]) == 5\", \"assert count_unique_elements([1, 1, 1, 1]) == 1\", \"assert count_unique_elements([]) == 0\", \"assert count_unique_elements([10, 10, 10, 10, 10]) == 1\", \"assert count_unique_elements([1, 2, 3, 3, 2, 1]) == ... | {
"split": "train",
"index": 82901,
"acecode_id": "evol_17777",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple function that returns a welcome message and a status code. Implement the function `get_welcome_message` that returns a tuple containing the message 'Welcome to Agenda API!' and the status code 200. Your function should not take any paramete... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_welcome_message() == ('Welcome to Agenda API!', 200)\", \"assert get_welcome_message()[0] == 'Welcome to Agenda API!'\", \"assert get_welcome_message()[1] == 200\", \"assert isinstance(get_welcome_message(), tuple)\", \"assert len(get_welcome_message()) ... | {
"split": "train",
"index": 82902,
"acecode_id": "oss_33213",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Implement a function that swaps the elements at two specified indices in the list. The function should take three parameters: the list of integers and the two indices to swap. The function should return the modified list after performing the sw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap([1, 2, 3, 4, 5], 0, 4) == [5, 2, 3, 4, 1]\", \"assert swap([1, 2, 3], 1, 2) == [1, 3, 2]\", \"assert swap([10, 20, 30], 0, 1) == [20, 10, 30]\", \"assert swap([5], 0, 0) == [5]\", \"assert swap([], 0, 0) == []\", \"assert swap([1, 2, 3, 4], 2, 3) == [1,... | {
"split": "train",
"index": 82903,
"acecode_id": "bigcode_python_fns_39262",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the Levenshtein distance between two strings. The Levenshtein distance is defined as the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into the other. Your function should ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_distance('kitten', 'sitting') == 3\", \"assert get_distance('flaw', 'lawn') == 2\", \"assert get_distance('intention', 'execution') == 5\", \"assert get_distance('abc', 'abc') == 0\", \"assert get_distance('', 'a') == 1\", \"assert get_distance('a', '') ... | {
"split": "train",
"index": 82904,
"acecode_id": "oss_6384",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function called `concatenate_strings` that takes a variable number of string arguments and returns a single string that is the concatenation of all the provided strings, separated by a space. If no strings are provided, the function should return an empty string.\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate_strings() == ''\", \"assert concatenate_strings('Hello') == 'Hello'\", \"assert concatenate_strings('Hello', 'World') == 'Hello World'\", \"assert concatenate_strings('This', 'is', 'Python') == 'This is Python'\", \"assert concatenate_strings('Py... | {
"split": "train",
"index": 82905,
"acecode_id": "evol_28348",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string and an integer m as input, and returns a list of all distinct words in the string that have a length of m or greater. Words are defined as sequences of alphanumeric characters, and punctuation should be ignored. For example, given the st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_words('Short words only.', 6) == []\", \"assert detect_words('Over the rainbow.', 6) == ['rainbow']\", \"assert detect_words('Run code run!', 4) == ['code']\", \"assert detect_words('Keep it simple.', 5) == ['simple']\", \"assert detect_words('What a ... | {
"split": "train",
"index": 82906,
"acecode_id": "evol_9032",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a sequence of numbers. Your task is to implement a function that takes this list as input and returns a new list containing all the even numbers from the original list, in the order they appeared. If there are no even numbers, retur... | 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([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4,... | {
"split": "train",
"index": 82907,
"acecode_id": "bigcode_python_fns_434",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string and encodes it by shifting each character 2 positions in the ASCII table. The function should ensure that the encoded string only contains printable characters (ASCII values between 32 and 126). If shifting a character results in a non-p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encode_string('Hello') == 'Jgnnq'\", \"assert encode_string('abc') == 'cde'\", \"assert encode_string('~') == '?'\", \"assert encode_string('A') == 'C'\", \"assert encode_string('!') == '#'\", \"assert encode_string('Foo!') == 'Hqq#'\", \"assert encode_strin... | {
"split": "train",
"index": 82908,
"acecode_id": "evol_20706",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function to filter a given list of integers. This function should remove any number that is divisible by 7 and return a dictionary containing the filtered list and the list of indexes of the removed numbers. The function should handle cases where the list is empty or co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_list([28, 12, 49, 33]) == {'filtered_list': [12, 33], 'removed_indexes': [0, 2]}\", \"assert filter_list([1, 2, 3, 4, 5, 6]) == {'filtered_list': [1, 2, 3, 4, 5, 6], 'removed_indexes': []}\", \"assert filter_list([7, 14, 21]) == {'filtered_list': [], ... | {
"split": "train",
"index": 82909,
"acecode_id": "evol_7260",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `common_hobbies(hobbies1: List[str], hobbies2: List[str]) -> List[str]` that takes two lists of hobbies as input and returns a list of hobbies that are common to both lists. The output should be sorted in alphabetical order. Assume that each list will only ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert common_hobbies(['reading', 'gaming', 'hiking'], ['hiking', 'cooking', 'gaming']) == ['gaming', 'hiking']\", \"assert common_hobbies(['swimming', 'dancing'], ['dancing', 'swimming']) == ['dancing', 'swimming']\", \"assert common_hobbies(['music', 'art'], ['sp... | {
"split": "train",
"index": 82910,
"acecode_id": "evol_9601",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python decorator that logs the arguments and return value of a given function. Implement a decorator named `log_arguments_and_return` that takes a function as an argument and returns a new function that logs the arguments and return value when the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply(4, 6) == 24\", \"assert multiply(0, 5) == 0\", \"assert multiply(-3, 7) == -21\", \"assert multiply(10, 0) == 0\", \"assert multiply(-2, -5) == 10\", \"assert multiply(1, 1) == 1\", \"assert multiply(2, -3) == -6\", \"assert multiply(100, 1) == 100\... | {
"split": "train",
"index": 82911,
"acecode_id": "oss_12801",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of trajectories, where each trajectory is represented by a list of states, and each state is represented as a tuple of integers. Your task is to implement a function `average_trajectory_length(trajectories: List[List[Tuple[int]]]) -> float` that calculates ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_trajectory_length([[1, 2], [3, 4, 5], [6]]) == 2.0\", \"assert average_trajectory_length([[1, 2, 3], [4, 5]]) == 2.5\", \"assert average_trajectory_length([[1], [2], [3], [4], [5]]) == 1.0\", \"assert average_trajectory_length([[], [], []]) == 0.0\",... | {
"split": "train",
"index": 82912,
"acecode_id": "bigcode_python_fns_8328",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a JSON Web Token (JWT) payload based on specific claims. Implement the function `generate_jwt_payload` which constructs a JWT payload using the provided input parameters. The function should accept the following parameters:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_jwt_payload(type_header='Bearer', issuer='issuer1', subject='subject1', audiences=['aud1'], jwt_id='12345') == {'iss': 'issuer1', 'sub': 'subject1', 'aud': ['aud1'], 'jti': '12345'}\", \"assert generate_jwt_payload(issuer='issuer2', subject='subject... | {
"split": "train",
"index": 82913,
"acecode_id": "oss_23649",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_primes_in_range(start: int, end: int) -> List[int]` that takes two integers, `start` and `end`, and returns a list of all prime numbers within the inclusive range from `start` to `end`. The range is defined such that `start` is less than or equal to `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_primes_in_range(1, 20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert find_primes_in_range(10, 30) == [11, 13, 17, 19, 23, 29]\", \"assert find_primes_in_range(1, 1) == []\", \"assert find_primes_in_range(2, 2) == [2]\", \"assert find_primes_in_range(15, 1... | {
"split": "train",
"index": 82914,
"acecode_id": "evol_12834",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings, `old` and `new`, representing two versions of a text, implement a function `get_diff_text(old: str, new: str) -> str` that returns the diff output of the two strings in a unified diff format. The diff should indicate which lines were removed, added, or change... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_diff_text('Hello World', 'Hello World') == ''\", \"assert get_diff_text('No changes here', 'No changes here') == ''\", \"assert get_diff_text('Same text', 'Same text') == ''\", \"assert get_diff_text('Test', 'Test') == ''\", \"assert get_diff_text('', ''... | {
"split": "train",
"index": 82915,
"acecode_id": "bigcode_python_fns_38216",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given two strings, s1 and s2, implement a function `longest_common_subsequence(s1: str, s2: str) -> Tuple[int, str]` that returns a tuple containing the length of the longest common subsequence and the longest common subsequence itself. The longest common subsequence is defined... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_common_subsequence('ABC', 'AC') == (2, 'AC')\", \"assert longest_common_subsequence('AGGTAB', 'GXTXAYB') == (4, 'GTAB')\", \"assert longest_common_subsequence('AAAA', 'A') == (1, 'A')\", \"assert longest_common_subsequence('A', 'AAAA') == (1, 'A')\",... | {
"split": "train",
"index": 82916,
"acecode_id": "evol_14314",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts time intervals specified as strings into seconds. The time intervals are formatted as a number followed by a unit indicator, where the unit can be seconds (s), minutes (m), hours (h), or days (d). If the unit indicator is ab... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_time('15m') == 900\", \"assert parse_time('2h') == 7200\", \"assert parse_time('1d') == 86400\", \"assert parse_time('10s') == 10\", \"assert parse_time('5') == 5\", \"assert parse_time('3d') == 259200\", \"assert parse_time('0') == 0\", \"assert parse... | {
"split": "train",
"index": 82917,
"acecode_id": "oss_28262",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a range of x values as input and returns two lists: the first list contains the values of the function y1 = x^2 evaluated at the given x values, and the second list contains the values of the function y2 = x^3 evaluated at the same x values. The inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_functions([-10, 0, 10]) == ([100, 0, 100], [-1000, 0, 1000])\", \"assert calculate_functions([-5, 5]) == ([25, 25], [-125, 125])\", \"assert calculate_functions([-1, 1]) == ([1, 1], [-1, 1])\", \"assert calculate_functions([2, 3, 4]) == ([4, 9, 16]... | {
"split": "train",
"index": 82918,
"acecode_id": "evol_35832",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and returns a list of unique words in that string. The words should be returned in the order they first appeared in the input string, and the comparison should be case-insensitive. For example, 'The quick brown fox' and 'the Quick B... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_to_unique_words('The quick brown fox') == ['The', 'quick', 'brown', 'fox']\", \"assert string_to_unique_words('the Quick Brown fox') == ['the', 'Quick', 'Brown', 'fox']\", \"assert string_to_unique_words('hello world hello') == ['hello', 'world']\", \... | {
"split": "train",
"index": 82919,
"acecode_id": "evol_33451",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sieve_of_eratosthenes(n)` that generates a list of the first n prime numbers using the Sieve of Eratosthenes method. The function should take an integer n (1 <= n <= 1000) as input and return a list of the first n prime numbers.\nPlease reason step by step... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sieve_of_eratosthenes(2) == [2, 3]\", \"assert sieve_of_eratosthenes(3) == [2, 3, 5]\", \"assert sieve_of_eratosthenes(4) == [2, 3, 5, 7]\", \"assert sieve_of_eratosthenes(5) == [2, 3, 5, 7, 11]\", \"assert sieve_of_eratosthenes(6) == [2, 3, 5, 7, 11, 13]\",... | {
"split": "train",
"index": 82920,
"acecode_id": "evol_24754",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes XML data containing box distribution information and returns a dictionary with the box IDs as keys and the corresponding quantities as values. The XML data is represented as an `xml.etree.ElementTree.Element` object ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_box_distribution(ET.fromstring('<boxes><box><id>001</id><quantity>10</quantity></box></boxes>')) == {'001': 10}\", \"assert parse_box_distribution(ET.fromstring('<boxes><box><id>002</id><quantity>5</quantity></box></boxes>')) == {'002': 5}\", \"assert ... | {
"split": "train",
"index": 82921,
"acecode_id": "oss_24748",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of integers and returns a new list containing the squares of each integer. The input list may contain both positive and negative integers, as well as zero. Your function should handle an empty list as well, returning... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_integers([]) == []\", \"assert square_integers([1, 2, 3]) == [1, 4, 9]\", \"assert square_integers([-1, -2, -3]) == [1, 4, 9]\", \"assert square_integers([0]) == [0]\", \"assert square_integers([0, 1, -1]) == [0, 1, 1]\", \"assert square_integers([-5,... | {
"split": "train",
"index": 82922,
"acecode_id": "oss_25818",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes loan requests. The function should take a dictionary representing a loan request with the following keys: 'lender_id', 'borrower_id', and 'amount'. The function should check if the lender's role is valid (i.e., the lend... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_loan_request({'lender_id': 1, 'borrower_id': 2, 'amount': 1000}) == 'Loan executed successfully'\", \"assert process_loan_request({'lender_id': 1, 'borrower_id': 2, 'amount': 0}) == 'Invalid loan request.'\", \"assert process_loan_request({'lender_id... | {
"split": "train",
"index": 82923,
"acecode_id": "bigcode_python_fns_10749",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a JSON object of environment variables, write a function called `parse_environment` that parses the string and returns a dictionary with the environment variable names as keys and their corresponding values. The input string will be in the format '{\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_environment('{\\\"VAR1\\\":\\\"VALUE1\\\", \\\"VAR2\\\":\\\"VALUE2\\\"}') == {'VAR1': 'VALUE1', 'VAR2': 'VALUE2'}\", \"assert parse_environment('{\\\"VAR1\\\":\\\"TEST\\\", \\\"VAR2\\\":\\\"EXAMPLE\\\"}') == {'VAR1': 'TEST', 'VAR2': 'EXAMPLE'}\", \"ass... | {
"split": "train",
"index": 82924,
"acecode_id": "bigcode_python_fns_31392",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_bicycle(color: str, size: str, style: str) -> dict` that takes in three parameters: `color`, `size`, and `style`. The function should return a dictionary representing a bicycle with the given attributes. The dictionary should have keys 'color', 'siz... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_bicycle('red', 'medium', 'Mountain') == {'color': 'red', 'size': 'medium', 'style': 'Mountain'}\", \"assert create_bicycle('blue', 'small', 'Road') == {'color': 'blue', 'size': 'small', 'style': 'Road'}\", \"assert create_bicycle('green', 'large', 'Hy... | {
"split": "train",
"index": 82925,
"acecode_id": "evol_21080",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of strings, where each string may contain leading or trailing whitespace. Your function should perform the following operations on each string in the list: 1. Remove any leading or trailing whitespace from the string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_lines([' Hello, World ', ' Python Programming', ' Coding Challenge ']) == ['Hello, World\\\\n', 'Python Programming\\\\n', 'Coding Challenge\\\\n']\", \"assert process_lines([' Test Case 1 ']) == ['Test Case 1\\\\n']\", \"assert proce... | {
"split": "train",
"index": 82926,
"acecode_id": "oss_27217",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a network device port. Implement a function `validate_port(port: str) -> str` that checks if the provided port is a valid network port. A valid port must be a non-empty string that consists only of digits. If the port is valid, the function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_port('8080') == '8080'\", \"assert validate_port('0') == '0'\", \"assert validate_port('65535') == '65535'\", \"assert validate_port('1234567890') == '1234567890'\", \"assert validate_port('9999') == '9999'\", \"assert validate_port('1') == '1'\", \... | {
"split": "train",
"index": 82927,
"acecode_id": "oss_30169",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the selection of various data visualization options based on user input. The available options are 'Yelp Average Ratings', 'Yelp Sum Reviews', 'Meetup Responses', 'Incubators and Accelerators Count', and 'Combined'. Your fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_visualization('Yelp Average Ratings') == 'Displaying Yelp Average Ratings visualization.'\", \"assert get_visualization('Yelp Sum Reviews') == 'Displaying Yelp Sum Reviews visualization.'\", \"assert get_visualization('Meetup Responses') == 'Displaying M... | {
"split": "train",
"index": 82928,
"acecode_id": "oss_23283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 0-indexed integer array `nums`, an integer `k`, and an array of obstacles `obs`. You are initially standing at index `0`. In one move, you can jump at most `k` steps forward without going outside the boundaries of the array. That is, you can jump from index `i` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxResult([1,-1,-2,4,-7,3], 2, [1]) == 6\", \"assert maxResult([1,2,3,4,5,6], 3, []) == 21\", \"assert maxResult([1,2,3,4,5], 1, [2]) == 9\", \"assert maxResult([10,0,10,0,10], 2, [1,3]) == 30\", \"assert maxResult([1,2,3,-1,4], 4, []) == 10\", \"assert maxR... | {
"split": "train",
"index": 82929,
"acecode_id": "evol_33594",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a method represented as a dictionary with various parameters and their corresponding values. Your task is to implement a function called `update_method(method_dict, updates)` that takes two arguments: a dictionary `method_dict` representing the original method and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_method({'a': 1, 'b': 2}, {'b': 3}) == {'a': 1, 'b': 3}\", \"assert update_method({'x': 10, 'y': 20}, {'y': 25, 'z': 30}) == {'x': 10, 'y': 25}\", \"assert update_method({'key1': 'value1', 'key2': 'value2'}, {'key3': 'value3'}) == {'key1': 'value1', 'k... | {
"split": "train",
"index": 82930,
"acecode_id": "bigcode_python_fns_31739",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function named `process_environment_data` that simulates the loading of environment variables for an application. The function should take a dictionary of environment variables as input, where the keys are variable names (strings) and the values ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_environment_data({'VAR1': 'value1', 'VAR2': 'value2'}) == ['VAR1=value1', 'VAR2=value2']\", \"assert process_environment_data({'NAME': 'Alice'}) == ['NAME=Alice']\", \"assert process_environment_data({'KEY': '123', 'ANOTHER_KEY': '456'}) == ['KEY=123... | {
"split": "train",
"index": 82931,
"acecode_id": "oss_13206",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to delete a search query identified by a unique identifier. The function `delete_query_connection` takes one parameter: `search_id` (a string representing the unique identifier of the search query connection to be deleted). The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_query_connection('valid_id') == 'Search query connection deleted successfully.'\", \"assert delete_query_connection('another_valid_id') == 'Search query connection deleted successfully.'\", \"assert delete_query_connection('test_id_1') == 'Search quer... | {
"split": "train",
"index": 82932,
"acecode_id": "oss_17902",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of node names and a dictionary of update rules, implement a function `parse_input_update_rules(update_rules_dict: Dict[str, str], node_names: List[str]) -> Tuple[List[List[int]], List[Dict[Tuple[bool], bool]]]`. The update rules are strings that can contain logical... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_input_update_rules({'A': 'not A or 0'}, ['A']) == ([[0]], [{(False,): True, (True,): False}])\", \"assert parse_input_update_rules({'C': 'C or 0'}, ['C']) == ([[0]], [{(False,): False, (True,): True}])\", \"assert parse_input_update_rules({'F': 'F and ... | {
"split": "train",
"index": 82933,
"acecode_id": "bigcode_python_fns_4925",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the total cost of a purchase after applying a fixed discount rate. The function should take the purchase amount as input and return the total cost after the discount has been applied. The discount rate is fixed at 1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_cost(100.0) == 85.0\", \"assert calculate_total_cost(200.0) == 170.0\", \"assert calculate_total_cost(0.0) == 0.0\", \"assert calculate_total_cost(50.0) == 42.5\", \"assert calculate_total_cost(15.0) == 12.75\", \"assert calculate_total_cost(... | {
"split": "train",
"index": 82934,
"acecode_id": "oss_3833",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `recursive_func(n)` that computes the nth number in the Fibonacci sequence using recursion. The Fibonacci sequence is defined as follows: Fibonacci(0) = 0, Fibonacci(1) = 1, and Fibonacci(n) = Fibonacci(n-1) + Fibonacci(n-2) for n > 1. Ensure that your func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recursive_func(0) == 0\", \"assert recursive_func(1) == 1\", \"assert recursive_func(2) == 1\", \"assert recursive_func(3) == 2\", \"assert recursive_func(4) == 3\", \"assert recursive_func(5) == 5\", \"assert recursive_func(6) == 8\", \"assert recursive_fun... | {
"split": "train",
"index": 82935,
"acecode_id": "evol_9875",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an input array of random binary strings (each string representing a binary number), implement a Python function to convert each binary string into its decimal equivalent and return an array containing the sum of all equivalent decimal numbers followed by the respective in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_to_decimal([]) == [0]\", \"assert binary_to_decimal(['1', '1', '1']) == [3, 1, 1, 1]\", \"assert binary_to_decimal(['']) == [0]\", \"assert binary_to_decimal(['101', '102', 'abc']) == [5, 5]\", \"assert binary_to_decimal(['0000', '1010']) == [10, 0, 1... | {
"split": "train",
"index": 82936,
"acecode_id": "evol_19201",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a sorting function that sorts a list of dictionaries representing people's information. Each dictionary contains two keys: 'name', a string representing the person's name, and 'age', an integer representing the person's age. Your function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_people([{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}]) == [{'name': 'Bob', 'age': 25}, {'name': 'Alice', 'age': 30}]\", \"assert sort_people([{'name': 'Charlie', 'age': 22}, {'name': 'David', 'age': 22}]) == [{'name': 'Charlie', 'age': 22}, ... | {
"split": "train",
"index": 82937,
"acecode_id": "oss_32578",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `binary_search(arr: List[int], x: int) -> int` that performs a binary search on a sorted list of integers. The function should return the index of the target integer `x` if it is present in the list `arr`. If `x` is not found, return -1. The input list `arr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert binary_search([10, 20, 30, 40, 50], 10) == 0\", \"assert binary_search([5, 6, 7, 8, 9], 6) == 1\", \"assert binary_search([1, 2, 3, 4, 5], 5) == 4\", \"assert binary_search([2, 4, 6, 8, 10], 10) == 4\", \"as... | {
"split": "train",
"index": 82938,
"acecode_id": "evol_9104",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of training iterations. Your task is to return the number of iterations that should be logged based on the following conditions: You log the iteration if it is divisible by a specified log frequency, if it is the last ite... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_log_iterations([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 2, False) == 5\", \"assert count_log_iterations([10, 20, 30, 40, 50], 10, False) == 5\", \"assert count_log_iterations([1, 2, 3], 1, False) == 3\", \"assert count_log_iterations([1, 2, 3, 4, 5], 3, False)... | {
"split": "train",
"index": 82939,
"acecode_id": "bigcode_python_fns_24099",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `shutdown_nameserver(ns: Nameserver)` that simulates shutting down a nameserver. The nameserver can either have agents registered or be empty. If the nameserver has no agents registered, the shutdown should proceed successfully and return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shutdown_nameserver(Nameserver(False)) == 'Shutdown successful'\", \"assert shutdown_nameserver(Nameserver(True)) == 'Shutdown failed: agents are still active'\", \"assert shutdown_nameserver(Nameserver(False)) == 'Shutdown successful'\", \"assert shutdown_n... | {
"split": "train",
"index": 82940,
"acecode_id": "bigcode_python_fns_41445",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of article titles and returns a list of tuples, where each tuple contains the index of the article and its title. The function should ensure that the title does not exceed 50 characters in length. If any title exceeds th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_article_list(['First Article', 'Second Article', 'This Title Is Way Too Long To Be Valid Because It Exceeds Fifty Characters', 'Third Article']) == [(0, 'First Article'), (1, 'Second Article'), (3, 'Third Article')]\", \"assert create_article_list(['S... | {
"split": "train",
"index": 82941,
"acecode_id": "oss_25756",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function called `sum_of_even_numbers` that returns the sum of all even numbers in the list. If there are no even numbers, return 0. The input list can contain both positive and negative integers. \n\nFunction Signature: `def sum_of_even_numbers... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_even_numbers([-10, -1, 2, 3, 4, 5, 6]) == 2\", \"assert sum_of_even_numbers([1, 3, 5, 7]) == 0\", \"assert sum_of_even_numbers([0, 2, 4, 6]) == 12\", \"assert sum_of_even_numbers([-2, -4, -6]) == -12\", \"assert sum_of_even_numbers([-1, -3, -5]) == 0\... | {
"split": "train",
"index": 82942,
"acecode_id": "bigcode_python_fns_41316",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes two strings as input: 'workon' and 'level'. The function should check if both inputs are non-empty strings. If either of the inputs is empty, the function should return False. If both are non-empty, the function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_service_installation('env1', 'level1') == True\", \"assert check_service_installation('env2', 'level2') == True\", \"assert check_service_installation('', 'level3') == False\", \"assert check_service_installation('env4', '') == False\", \"assert check_... | {
"split": "train",
"index": 82943,
"acecode_id": "bigcode_python_fns_38844",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a database and loads a given configuration. Implement a function `config_command(db: str, config: str, clear: bool) -> None` that takes three parameters: a database name `db` (string) representing the database to be used,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert config_command('database.sqlite', 'config.py', True) is None\", \"assert config_command('test_db.sqlite', 'settings.py', False) is None\", \"assert config_command('prod_db.sqlite', 'production_conf.py', True) is None\", \"assert config_command('dev_db.sqlite... | {
"split": "train",
"index": 82944,
"acecode_id": "bigcode_python_fns_41936",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a binary tree and a value. Your task is to implement a function that deletes the specified value from the tree. If the value is not present in the tree, the tree should remain unchanged. The function should return the size of the tree after the deletion operation.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_value_and_return_size(TreeNode(1, TreeNode(2), TreeNode(3)), 9999999999999) == 3\", \"assert delete_value_and_return_size(TreeNode(1), 1) == 0\", \"assert delete_value_and_return_size(TreeNode(1, TreeNode(2)), 3) == 2\", \"assert delete_value_and_retu... | {
"split": "train",
"index": 82945,
"acecode_id": "bigcode_python_fns_11681",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `compare_word_sets(phrase1: str, phrase2: str) -> bool` that compares two input strings to determine if they contain the same unique words. The comparison should be case sensitive and should consider punctuation. Return True if both phrases contain the same... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_word_sets('Hello, world.', 'Hello world') == False\", \"assert compare_word_sets('Python is great!', 'great! Python is') == True\", \"assert compare_word_sets('abc', 'abc') == True\", \"assert compare_word_sets('abc!', 'abc') == False\", \"assert com... | {
"split": "train",
"index": 82946,
"acecode_id": "evol_13444",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes the UUID, AKS ID, description, unit, creation timestamp, and update timestamp of a device in a home automation system as input and returns a dictionary containing this information. The function should be named `create_device_di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_device_dict('123e4567-e89b-12d3-a456-426614174000', 'aksID_001', 'Smart Light', 'light', 1610000000, 1610000005) == {'uuid': '123e4567-e89b-12d3-a456-426614174000', 'aksID': 'aksID_001', 'description': 'Smart Light', 'unit': 'light', 'createdAt': 1610... | {
"split": "train",
"index": 82947,
"acecode_id": "oss_34170",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a year, day-of-year, hour, minute, and second, write a function that converts these inputs into a formatted date-time string in the 'YYYY-MM-DD HH:MM:SS' format. The function should handle leap years and return the correct date-time representation. The input parameters ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_datetime_string(2020, 1, 0, 0, 0) == '2020-01-01 00:00:00'\", \"assert convert_to_datetime_string(2020, 60, 12, 30, 45) == '2020-02-29 12:30:45'\", \"assert convert_to_datetime_string(2021, 1, 23, 59, 59) == '2021-01-01 23:59:59'\", \"assert conve... | {
"split": "train",
"index": 82948,
"acecode_id": "bigcode_python_fns_44176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `quick_sort_binary_value(arr: List[int]) -> List[int]` that sorts a list of non-negative integers based on the value of their binary representation. The function should take a list `arr` as input and return a new list that is sorted in ascending order accor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quick_sort_binary_value([3, 5, 2, 7]) == [2, 3, 5, 7]\", \"assert quick_sort_binary_value([0, 1, 2, 3]) == [0, 1, 2, 3]\", \"assert quick_sort_binary_value([2, 18, 4, 16]) == [2, 4, 16, 18]\", \"assert quick_sort_binary_value([20, 25, 30]) == [20, 25, 30]\",... | {
"split": "train",
"index": 82949,
"acecode_id": "evol_20054",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple function to simulate a basic text-based user interface. Your function should accept the dimensions of a grid and a list of commands to move a cursor within that grid. The cursor starts at the top-left corner of the grid, which is considered... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_cursor_position(3, 3, ['up', 'up', 'left']) == (1, 1)\", \"assert final_cursor_position(4, 4, ['down', 'down', 'down', 'down']) == (4, 1)\", \"assert final_cursor_position(10, 10, ['up', 'up', 'up']) == (1, 1)\", \"assert final_cursor_position(1, 1, ['... | {
"split": "train",
"index": 82950,
"acecode_id": "oss_33086",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given the radius of a circle, write a function that calculates and returns the circumference, area, and diameter of the circle. The function should take a single parameter, the radius, which is a positive float value. The calculations should be based on the following formulas:\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_circle(1.0) == (6.283185307179586, 3.141592653589793, 2.0)\", \"assert calculate_circle(0.5) == (3.141592653589793, 0.7853981633974483, 1.0)\", \"assert calculate_circle(7.0) == (43.982297150257104, 153.93804002589985, 14.0)\", \"assert calculate_c... | {
"split": "train",
"index": 82951,
"acecode_id": "evol_16842",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers `A` of length `N`. The list `A` is 1-indexed and contains distinct integers. Your task is to find the smallest positive integer that is missing from the list. Implement a function `find_missing_integer(A)` that takes the list `A` as input and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_missing_integer([3, 4, -1, 1]) == 2\", \"assert find_missing_integer([1, 2, 0]) == 3\", \"assert find_missing_integer([-1, -2, -3]) == 1\", \"assert find_missing_integer([7, 8, 9, 10]) == 1\", \"assert find_missing_integer([1, 2, 3, 4, 5]) == 6\", \"ass... | {
"split": "train",
"index": 82952,
"acecode_id": "oss_37286",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `split_data(data: List[Tuple[str, int]], n_folds: int) -> List[List[Tuple[str, int]]]` that takes a list of data points, where each data point is represented as a tuple containing a string label and an integer value. The function should split the data into ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_data([('A', 1), ('B', 2), ('C', 3), ('D', 4)], 2) == [[('A', 1), ('B', 2)], [('C', 3), ('D', 4)]]\", \"assert split_data([('A', 1), ('B', 2), ('C', 3), ('D', 4)], 3) == [[('A', 1), ('B', 2)], [('C', 3)], [('D', 4)]]\", \"assert split_data([('A', 1), ('... | {
"split": "train",
"index": 82953,
"acecode_id": "bigcode_python_fns_35170",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_upper_prime(s: str) -> int` that computes the number of capital vowel letters situated strictly at prime number indices in the string `s`. Capital vowels are defined as 'A', 'E', 'I', 'O', 'U'. An index is considered prime if it is greater than 1 and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_upper_prime('abcdefg') == 0\", \"assert count_upper_prime('oBBE') == 1\", \"assert count_upper_prime('AEIOU') == 2\", \"assert count_upper_prime('aAeiou') == 0\", \"assert count_upper_prime('A') == 0\", \"assert count_upper_prime('B') == 0\", \"assert ... | {
"split": "train",
"index": 82954,
"acecode_id": "evol_8258",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function in Python that performs a Radix Sort on an array of integers, which can include both positive and negative multi-digit integers. The function should sort the integers in ascending order and should be implemented using a non-recursive approach. The input to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert radix_sort([-1, -2, -3, -4]) == [-4, -3, -2, -1]\", \"assert radix_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert radix_sort([0, -1, 1]) == [-1, 0, 1]\", \"assert radix_sort([100, 200, -300, 400]) == [-300, 100, 200, 400]\", \"assert radix_sort([150, 2... | {
"split": "train",
"index": 82955,
"acecode_id": "evol_12862",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of average monthly temperatures and precipitation levels for a set of glaciers, calculate the mean temperature and precipitation for the group. The input should be two lists: one containing the average monthly temperatures (as floats) and another containing the ave... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_temp_prec([5.0, 5.0, 5.0], [0.5, 0.5, 0.5]) == (5.0, 0.5)\", \"assert average_temp_prec([0.0, 0.0, 0.0], [0.0, 0.0, 0.0]) == (0.0, 0.0)\", \"assert average_temp_prec([12.0], [0.2]) == (12.0, 0.2)\", \"assert average_temp_prec([100.0, 200.0, 200.0], [... | {
"split": "train",
"index": 82956,
"acecode_id": "bigcode_python_fns_16874",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of assets, where each asset is represented by a dictionary containing the following keys: 'symbol' (a string representing the asset symbol), 'market_value' (a float representing the market value of the asset), 'qty' (a float representing the quantity of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert positions_to_list([{'symbol': 'AAPL', 'market_value': 150.0, 'qty': 10, 'cost_basis': 140.0}]) == [{'symbol': 'AAPL', 'market_value': 150.0, 'qty': 10, 'cost_basis': 140.0, 'Broker': 'alp'}]\", \"assert positions_to_list([{'symbol': 'TSLA', 'market_value': 7... | {
"split": "train",
"index": 82957,
"acecode_id": "bigcode_python_fns_30888",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the learning rate for a machine learning model based on the initial learning rate, the current epoch, and a decay factor. The learning rate should be decayed by a factor of 10 every 10 epochs. Write a function `calculate_l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_learning_rate(0.1, 0) == 0.1\", \"assert calculate_learning_rate(0.1, 5) == 0.1\", \"assert calculate_learning_rate(0.5, 0) == 0.5\", \"assert calculate_learning_rate(0.5, 9) == 0.5\", \"assert calculate_learning_rate(0.5, 10) == 0.05\", \"assert c... | {
"split": "train",
"index": 82958,
"acecode_id": "bigcode_python_fns_47866",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing pagination buttons on a webpage. Each button can either be a '<' representing the ability to move back to the previous page or a '>' representing the ability to move forward to the next page. Your task is to implement a function `che... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_movement(['<', '1', '2', '>']) == [True, True]\", \"assert check_movement(['1', '2', '>']) == [False, True]\", \"assert check_movement(['<', '1', '2']) == [True, False]\", \"assert check_movement(['<', '1', '2', '3', '>']) == [True, True]\", \"assert c... | {
"split": "train",
"index": 82959,
"acecode_id": "bigcode_python_fns_32310",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with tracking the influence of different factions in various systems controlled by different governments. You need to implement a function `get_influence_summary(system_ids: List[int], influence_data: List[Tuple[int, str, str, str, float]]) -> List[List[str]]`, w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_influence_summary([1, 3], [(1, 'Faction A', 'Anarchy', 'Control', 75.5), (1, 'Faction B', 'Dictatorship', 'Control', 40.0)]) == [['Control', '1', 'Faction A', 'Anarchy', '75.50'], ['Control', '1', 'Faction B', 'Dictatorship', '40.00'], ['N/A', '3', 'N/A'... | {
"split": "train",
"index": 82960,
"acecode_id": "bigcode_python_fns_13146",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that returns a list of supported content transfer encoding values. The values should be distinct strings that represent the encoding formats. Implement the function `get_supported_encodings()` that takes no parameters and returns a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_supported_encodings() == ['7bit', '8bit', 'binary', 'base64', 'quoted-printable']\", \"assert len(get_supported_encodings()) == 5\", \"assert '7bit' in get_supported_encodings()\", \"assert '8bit' in get_supported_encodings()\", \"assert 'binary' in get_... | {
"split": "train",
"index": 82961,
"acecode_id": "bigcode_python_fns_37471",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing event data from a JSON response. Write a function `process_event_data` that takes three parameters: a JSON response string `resp`, a string `returnas` which indicates the desired return format ('events' or 'dataframe'), and a list of strings `sys_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_event_data('{\\\"events\\\":[{\\\"name\\\":\\\"event1\\\",\\\"value\\\":10},{\\\"name\\\":\\\"event2\\\",\\\"value\\\":20}],\\\"timestamp\\\":\\\"2023-10-01T00:00:00Z\\\"}', 'events', []) == ([{'name': 'event1', 'value': 10}, {'name': 'event2', 'valu... | {
"split": "train",
"index": 82962,
"acecode_id": "oss_35758",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that compares the total number of confirmed COVID-19 cases between two specified regions from a given dataset. The function should take in a list of dictionaries representing COVID-19 data, where each dictionary contains keys 'Coun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_regions([{'Country/Region': 'New York', 'Confirmed': 100, 'Date': '2021-01-01'}, {'Country/Region': 'New York', 'Confirmed': 200, 'Date': '2021-01-02'}, {'Country/Region': 'California', 'Confirmed': 150, 'Date': '2021-01-01'}, {'Country/Region': 'Cal... | {
"split": "train",
"index": 82963,
"acecode_id": "oss_21825",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given two integers, x and y. Your task is to write a function `hammingDistance` that calculates the Hamming distance between these two integers. The Hamming distance between two integers is defined as the number of positions at which the corresponding bits are different... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hammingDistance(4, 1) == 2\", \"assert hammingDistance(3, 1) == 1\", \"assert hammingDistance(5, 6) == 2\", \"assert hammingDistance(0, 0) == 0\", \"assert hammingDistance(7, 7) == 0\", \"assert hammingDistance(2, 3) == 1\", \"assert hammingDistance(1, 2) ==... | {
"split": "train",
"index": 82964,
"acecode_id": "oss_21668",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given two sorted arrays, return the median of the two sorted arrays. The overall run time complexity should be O(log (min(n, m))), where n and m are the sizes of the two arrays. You may assume that the input arrays are non-empty and contain only numerical values.\nPlease reason... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findMedianOfTwoSortedArrays([1, 3], [2]) == 2.0\", \"assert findMedianOfTwoSortedArrays([1, 2], [3, 4]) == 2.5\", \"assert findMedianOfTwoSortedArrays([0, 0], [0, 0]) == 0.0\", \"assert findMedianOfTwoSortedArrays([], [1]) == 1.0\", \"assert findMedianOfTwoS... | {
"split": "train",
"index": 82965,
"acecode_id": "evol_19319",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a given length from one unit to another. The function should take three arguments: a float `value` representing the length to be converted, a string `from_unit` representing the unit of the input length, and a string `to_uni... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_length(1, 'inches', 'feet') == 0.08333333333333333\", \"assert convert_length(1, 'meters', 'centimeters') == 100.0\", \"assert convert_length(1, 'kilometers', 'meters') == 1000.0\", \"assert convert_length(1, 'millimeters', 'inches') == 0.03937007874... | {
"split": "train",
"index": 82966,
"acecode_id": "bigcode_python_fns_20100",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary that maps English category descriptions to their respective values, implement a function `translate_categories` that takes two parameters: a dictionary `categories_mapping` and a list of tuples `language_list`. Each tuple in `language_list` contains a languag... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert translate_categories({'Mobile': 1, 'Beauty': 2, 'Fashion': 3}, [('es', 1), ('fr', 1)]) == {'eliboM': 1, 'ytuaeB': 2, 'noihsaF': 3}\", \"assert translate_categories({'Food': 1, 'Drink': 2}, [('it', 1)]) == {'dooF': 1, 'knirD': 2}\", \"assert translate_categor... | {
"split": "train",
"index": 82967,
"acecode_id": "bigcode_python_fns_20969",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the Hamming distance between two integers. The Hamming distance is defined as the number of positions at which the corresponding bits of the two integers are different. You can compute this by using the XOR operation on the two integers and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hamming_distance(1, 4) == 2\", \"assert hamming_distance(2, 2) == 0\", \"assert hamming_distance(0, 1) == 1\", \"assert hamming_distance(7, 10) == 3\", \"assert hamming_distance(255, 0) == 8\", \"assert hamming_distance(4, 4) == 0\", \"assert hamming_distanc... | {
"split": "train",
"index": 82968,
"acecode_id": "evol_32571",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `convert_pressure(value: float, from_unit: str, to_unit: str) -> float` that converts pressure measurements between three systems: Pascal, Bar, and Atmosphere. The `from_unit` and `to_unit` parameters will be strings that specify the unit of the input value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_pressure(100000, 'Pascal', 'Bar') == 1.0\", \"assert convert_pressure(1, 'Bar', 'Pascal') == 100000.0\", \"assert convert_pressure(1, 'Atmosphere', 'Bar') == 1.01325\", \"assert convert_pressure(0, 'Pascal', 'Atmosphere') == 0.0\", \"assert convert_p... | {
"split": "train",
"index": 82969,
"acecode_id": "evol_516",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that retrieves and returns a list of values from a given dictionary that match specific criteria. The function should take three parameters: a dictionary, a string indicating the value type ('string' or 'number'), and an optional minimum value (only applicable... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_values({'a': 'apple', 'b': 5, 'c': 'banana'}, 'string') == ['apple', 'banana']\", \"assert get_values({'a': 'apple', 'b': 5, 'c': 'banana'}, 'number') == [5]\", \"assert get_values({'a': 'apple', 'b': 5, 'c': 10}, 'number', 6) == [10]\", \"assert get_val... | {
"split": "train",
"index": 82970,
"acecode_id": "evol_10417",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a time series dataset consisting of historical values of a variable 'y' and two external predictors 'x1' and 'x2'. Your task is to implement a function `predict_is_nan(h: int, data: List[Tuple[float, float, float]]) -> bool` that predicts the next `h` values of 'y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_is_nan(5, [(1.0, 2.0, 3.0), (2.0, 3.0, 4.0), (3.0, 4.0, 5.0)]) == False\", \"assert predict_is_nan(3, [(1.0, 2.0, None), (None, 3.0, 4.0), (3.0, 4.0, 5.0)]) == True\", \"assert predict_is_nan(1, [(None, 2.0, 3.0), (2.0, 3.0, 4.0), (3.0, None, 5.0)]) ... | {
"split": "train",
"index": 82971,
"acecode_id": "bigcode_python_fns_39386",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the configuration of multiple heterogeneous agents in a multi-agent environment. Each agent is defined by its name, bus identifier, class type, and configuration parameters. Your function should take the following inputs: a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_agents({'setting': 'default'}, {'pf_value': 0.9}, [{'name': 'building', 'bus': '675c', 'cls': 'MultiComponentEnv', 'config': {'components': 'building_config'}}, {'name': 'ev-charging', 'bus': '675c', 'cls': 'EVChargingEnv', 'config': 'ev_charging_c... | {
"split": "train",
"index": 82972,
"acecode_id": "bigcode_python_fns_45982",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates adding columns to a data structure that holds variable information. The function `add_columns` takes in a variable of type `TerminalMaterialInfo` and a list of columns of type `IdentityColumn`. Your goal is to ensure th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_columns(TerminalMaterialInfo(name='name', headers=['header1'], field='field1'), [IdentityColumn(data_source='name')]) is not None\", \"assert add_columns(TerminalMaterialInfo(name='foo', headers=['header1'], field='field1'), [IdentityColumn(data_source='... | {
"split": "train",
"index": 82973,
"acecode_id": "bigcode_python_fns_1669",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function `my_join` that concatenates all the strings in the list into a single string. The function should take a list of strings as input and return the concatenated string. If the input list is empty, the function should return an empty st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert my_join(['Hello', ' ', 'World']) == 'Hello World'\", \"assert my_join(['Leet', 'Code']) == 'LeetCode'\", \"assert my_join(['Python', 'is', 'awesome']) == 'Pythonisawesome'\", \"assert my_join(['This', 'is', 'a', 'test']) == 'Thisisatest'\", \"assert my_join(... | {
"split": "train",
"index": 82974,
"acecode_id": "bigcode_python_fns_29980",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of latitude boundaries (lats) and a list of longitude boundaries (lons), write a function that determines whether a point defined by its latitude and longitude is within the specified bounding box. The bounding box is defined by the south and north latitudes and th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_point_in_bbox([-10, 10], [-20, 20], 0, 0) == True\", \"assert is_point_in_bbox([-10, 10], [-20, 20], -5, -5) == True\", \"assert is_point_in_bbox([-10, 10], [-20, 20], -15, -5) == False\", \"assert is_point_in_bbox([-10, 10], [-20, 20], 5, 25) == False\",... | {
"split": "train",
"index": 82975,
"acecode_id": "bigcode_python_fns_25287",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `predictive_text` that takes a list of strings `words` and a string `prefix`. The function should return a list of all strings from `words` that start with the given `prefix`. The returned list should maintain the order of the original list and should be ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predictive_text(['apple', 'banana', 'apricot', 'grape'], 'ap') == ['apple', 'apricot']\", \"assert predictive_text(['dog', 'deer', 'cat', 'dove'], 'd') == ['dog', 'deer', 'dove']\", \"assert predictive_text(['Hello', 'world', 'HelloWorld'], 'Hello') == ['Hel... | {
"split": "train",
"index": 82976,
"acecode_id": "evol_23562",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a dictionary representing a schema and a dictionary of user properties. Your function should update the user properties by setting default values for any keys specified in the schema, while ignoring any required fields. The sch... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_defaults({'name': 'Unknown', 'age': 25}, {'name': 'Alice'}) == {'name': 'Alice', 'age': 25}\", \"assert set_defaults({'name': 'Unknown', 'age': 25}, {}) == {'name': 'Unknown', 'age': 25}\", \"assert set_defaults({'name': 'Unknown', 'age': 25}, {'age': 30... | {
"split": "train",
"index": 82977,
"acecode_id": "bigcode_python_fns_2895",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a dictionary of items with their respective counts and returns the total count of all items. The dictionary will have strings as keys and integers as values. Implement the function named 'total_item_count' which takes a single parameter 'item_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_item_count({'apples': 5, 'oranges': 6, 'bananas': 7}) == 18\", \"assert total_item_count({'grapes': 3, 'pears': 4}) == 7\", \"assert total_item_count({'mangoes': 10, 'kiwis': 2, 'pineapples': 5}) == 17\", \"assert total_item_count({'strawberries': 8}) ... | {
"split": "train",
"index": 82978,
"acecode_id": "evol_27670",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of user IDs and a specified user type ('admin' or 'user'), write a function that returns the corresponding profile picture filenames for each user ID in the list. The function should take in two parameters: a list of integers representing user IDs and a string indi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_pic_filenames([1, 2, 3], 'admin') == ['admin1.png', 'admin2.png', 'Not Found']\", \"assert get_user_pic_filenames([4, 5, 6], 'user') == ['user4.png', 'user5.png', 'user6.png']\", \"assert get_user_pic_filenames([7], 'admin') == ['Not Found']\", \"as... | {
"split": "train",
"index": 82979,
"acecode_id": "bigcode_python_fns_29055",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing line styles used in a series of images. Each integer corresponds to a specific line style, where 0 represents solid, 1 represents dashed, 2 represents dotted, and 3 represents double lines. Your task is to implement a function that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_line_styles([0, 1, 2, 0, 1, 3, 2]) == {0: 2, 1: 2, 2: 2, 3: 1}\", \"assert count_line_styles([1, 1, 1, 1]) == {1: 4}\", \"assert count_line_styles([2, 2, 2]) == {2: 3}\", \"assert count_line_styles([]) == {}\", \"assert count_line_styles([0, 0, 0, 3, 3... | {
"split": "train",
"index": 82980,
"acecode_id": "bigcode_python_fns_25109",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that searches for a specific item in an unsorted array and returns its index. If the item is not found, return -1. The function should be named `search_item` and take two parameters: an unsorted list of integers and the integer item to search for. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_item([1, 5, 7, 9, 8, 2, 4], 8) == 4\", \"assert search_item([10, 20, 30, 40], 30) == 2\", \"assert search_item([5, 3, 1, 4, 2], 5) == 0\", \"assert search_item([1, 3, 5, 7, 9], 2) == -1\", \"assert search_item([], 1) == -1\", \"assert search_item([100... | {
"split": "train",
"index": 82981,
"acecode_id": "evol_29581",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that simulates the creation of a cursor for iterating through results. Your task is to implement a function `create_cursor()` that returns a JSON-like dictionary containing a 'data' key with a string value 'cursor_handle' and a 'statusCode' key with an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_cursor() == {'data': 'cursor_handle', 'statusCode': 200}\", \"assert create_cursor() == {'data': 'cursor_handle', 'statusCode': 200}\", \"assert create_cursor() == {'data': 'cursor_handle', 'statusCode': 200}\", \"assert create_cursor() == {'data': 'c... | {
"split": "train",
"index": 82982,
"acecode_id": "bigcode_python_fns_6980",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the creation of chat groups for a chat application. The function `create_chat_group(group)` takes a dictionary representing the details of a chat group and returns a tuple containing the status code of the operation and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_chat_group({'name': 'Group 1', 'members': ['user1', 'user2']}) == (200, 2)\", \"assert create_chat_group({'name': 'Group 2', 'members': ['user3', 'user4', 'user5']}) == (200, 3)\", \"assert create_chat_group({'name': 'Group 3', 'members': ['user1']}) ... | {
"split": "train",
"index": 82983,
"acecode_id": "oss_140",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tiles, each represented by their width and height in pixels, and a request specifying the number of rows and a method ('byRow' or 'byColumn'), implement a function that aligns the tiles based on the specified request. The function should return a list of aligned... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert align_tiles_naive({'rows': 2, 'method': 'byRow'}, [{'width_px': 100, 'height_px': 100}] ) == [{'width_px': 100, 'height_px': 100, 'offset_x': 0, 'offset_y': 0}]\", \"assert align_tiles_naive({'rows': 1, 'method': 'byRow'}, [{'width_px': 100, 'height_px': 100... | {
"split": "train",
"index": 82984,
"acecode_id": "bigcode_python_fns_46595",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid representing a maze, where each cell can be either empty (denoted by 0) or blocked (denoted by 1). Your task is to implement a function `find_path(maze: List[List[int]], start: Tuple[int, int], end: Tuple[int, int]) -> List[Tuple[int, int]]` that finds t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_path([[0, 1, 0], [0, 1, 0], [0, 0, 0]], (0, 0), (2, 2)) == [(0, 0), (1, 0), (2, 0), (2, 1), (2, 2)]\", \"assert find_path([[0, 0, 0], [0, 1, 0], [0, 0, 0]], (0, 0), (2, 2)) == [(0, 0), (0, 1), (0, 2), (1, 2), (2, 2)]\", \"assert find_path([[1, 1, 1], [1... | {
"split": "train",
"index": 82985,
"acecode_id": "oss_2479",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional array of integers, implement a function that returns the sum of all elements in the array. The array may contain positive and negative integers, and can be of varying sizes.\nPlease reason step by step, then write a self-contained Python solution. Give y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_elements([[1, 2], [3, 4]]) == 10\", \"assert sum_of_elements([[0, 0], [0, 0]]) == 0\", \"assert sum_of_elements([[5, -1], [2, 3]]) == 9\", \"assert sum_of_elements([[1, 1, 1], [1, 1, 1], [1, 1, 1]]) == 9\", \"assert sum_of_elements([[-1, -1], [-1, -1]... | {
"split": "train",
"index": 82986,
"acecode_id": "evol_28594",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list (matrix) of integers representing an image, where each integer corresponds to the pixel intensity. Your task is to apply a Leaky ReLU activation function on the matrix. The Leaky ReLU function is defined as: for any input x, the output is x if x > 0, oth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_leaky_relu([[1, -2], [3, -4]]) == [[1, -0.02], [3, -0.04]]\", \"assert apply_leaky_relu([[0, 0], [0, 0]]) == [[0, 0], [0, 0]]\", \"assert apply_leaky_relu([[5, -5], [-5, 5]]) == [[5, -0.05], [-0.05, 5]]\", \"assert apply_leaky_relu([[-1, -1], [-1, -1]]... | {
"split": "train",
"index": 82987,
"acecode_id": "bigcode_python_fns_37453",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that filters a list of files based on a user's query. Each file is represented as a list containing an index, a description, and a spam indicator (1 for spam, 0 for non-spam). Your function should take a query string, an index (MII index)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_data('important', 12345, [[1, 'Important document', 0], [2, 'Spam email', 1], [3, 'Another important file', 0]]) == [[12345, 1, 'Important document', 0], [12345, 3, 'Another important file', 0]]\", \"assert get_data('spam', 54321, [[1, 'Important documen... | {
"split": "train",
"index": 82988,
"acecode_id": "oss_23871",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a string `access_token` and a list of strings `users`, implement a function `get_unscoped_token` that returns a dictionary where the keys are the usernames from the `users` list and the values are the unscoped tokens derived from the `access_token`. The unscoped token for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unscoped_token('token123', ['user1', 'user2']) == {'user1': 'token123:user1', 'user2': 'token123:user2'}\", \"assert get_unscoped_token('', ['user1', 'user2']) == {'user1': None, 'user2': None}\", \"assert get_unscoped_token('accessToken', ['alice', 'bob... | {
"split": "train",
"index": 82989,
"acecode_id": "bigcode_python_fns_49045",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts text from a list of strings, each representing the content of a PDF file. The function should take a list of strings as input, where each string contains the text of a single PDF file. The function should return a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_text_from_pdfs(['Hello World', 'Sample PDF text']) == ['Hello World', 'Sample PDF text']\", \"assert extract_text_from_pdfs(['PDF 1 content', 'PDF 2 content', 'PDF 3 content']) == ['PDF 1 content', 'PDF 2 content', 'PDF 3 content']\", \"assert extrac... | {
"split": "train",
"index": 82990,
"acecode_id": "oss_21313",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of IP addresses and their corresponding status values. Your function should return a dictionary containing the unique IP addresses as keys and their associated status values as values. If an IP address appears... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_ip_addresses([('10.20.30.40', 'included'), ('192.168.1.1', 'excluded'), ('10.20.30.40', 'included'), ('172.16.0.1', 'excluded')]) == {'10.20.30.40': 'included', '192.168.1.1': 'excluded', '172.16.0.1': 'excluded'}\", \"assert process_ip_addresses([('... | {
"split": "train",
"index": 82991,
"acecode_id": "oss_15076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to process soft masks generated by an instance segmentation model. Your function should take two inputs: a list of soft masks and a processing method. The processing method can be one of the following: 'basic', 'hover', 'dist', 'conto... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_soft_masks([[0.1, 0.2], [0.3, 0.4]], 'basic') == [[0.1, 0.2], [0.3, 0.4]]\", \"assert process_soft_masks([[0.1, 0.2], [0.3, 0.4]], 'hover') == [[1.1, 1.2], [1.3, 1.4]]\", \"assert process_soft_masks([[0.1, 0.2], [0.3, 0.4]], 'contour') == [[0, 0], [0... | {
"split": "train",
"index": 82992,
"acecode_id": "oss_20407",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with counting the number of trainable variables in a hypothetical machine learning model. A trainable variable is defined as a variable that is used to learn and adapt the model during the training process. You will implement a function that takes a list of varia... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vars(['layer1/kernel:0', 'layer1/bias:0', 'layer2/kernel:0', 'layer3/bias:0'], 'layer1') == 2\", \"assert count_vars(['layer1/kernel:0', 'layer1/bias:0', 'layer2/kernel:0', 'layer3/bias:0'], 'layer2') == 1\", \"assert count_vars(['layer1/kernel:0', 'la... | {
"split": "train",
"index": 82993,
"acecode_id": "oss_29707",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing response times for different tests. Each dictionary contains a timestamp and three response time metrics: 'mean', '90%', and '80%'. Write a function that processes this list and returns a new list of tuples. Each tuple should co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_response_times([{'timestamp': '2021-01-01T00:00:00Z', 'mean': 1.0, '90%': 1.5, '80%': 2.0}]) == [('2021-01-01T00:00:00Z', 1.5)]\", \"assert process_response_times([{'timestamp': '2021-01-01T00:00:00Z', 'mean': None, '90%': None, '80%': None}]) == [('... | {
"split": "train",
"index": 82994,
"acecode_id": "bigcode_python_fns_33198",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers `nums`, implement a function `find_element(nums: List[int], element: int) -> bool` that returns `True` if the specified `element` exists in `nums`, and `False` otherwise. Do not use any built-in functions for searching or checking membership.\nPlease re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_element([1, 2, 3, 4], 3) == True\", \"assert find_element([1, 2, 3, 4], 5) == False\", \"assert find_element([10, 20, 30, 40], 20) == True\", \"assert find_element([10, 20, 30, 40], 25) == False\", \"assert find_element([], 1) == False\", \"assert find_... | {
"split": "train",
"index": 82995,
"acecode_id": "evol_17856",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the functionality of a vehicle management system. The function, `manage_vehicles`, should accept a list of vehicles and a boolean flag called `use_nickname`. Each vehicle is represented as a dictionary containing the ke... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_vehicles([{'id': 1, 'make': 'Mazda', 'model': 'CX-5', 'nickname': 'My Car'}, {'id': 2, 'make': 'Toyota', 'model': 'Camry', 'nickname': 'Family Car'}], True) == [{'id': 1, 'make': 'Mazda', 'model': 'CX-5', 'nickname': 'My Car'}, {'id': 2, 'make': 'Toyo... | {
"split": "train",
"index": 82996,
"acecode_id": "bigcode_python_fns_16179",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of books, where each book is represented by a dictionary containing its availability and showability status. Write a function that calculates the ratio of unread books to the total number of showable books. An unread book is defined as one that is available... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unread_ratio([{'available': True, 'showable': False}, {'available': True, 'showable': True}, {'available': False, 'showable': True}]) == 'Unread Books: 1 / Total Showable: 2'\", \"assert unread_ratio([{'available': False, 'showable': False}, {'available': Fa... | {
"split": "train",
"index": 82997,
"acecode_id": "bigcode_python_fns_31453",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given two binary arrays, `bin_init` and `bin_target`, which consist of elements '0' and '1'. Your task is to determine the minimum number of swaps required to convert `bin_init` into `bin_target`. A swap consists of exchanging the positions of any two elements in the ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_swaps_binaries([0, 0, 1, 1], [1, 1, 0, 0]) == 2\", \"assert min_swaps_binaries([1, 0, 0, 1], [0, 1, 1, 0]) == 2\", \"assert min_swaps_binaries([0, 1], [1, 0]) == 1\", \"assert min_swaps_binaries([1, 1, 0, 0], [0, 1, 1, 0]) == 1\", \"assert min_swaps_bina... | {
"split": "train",
"index": 82998,
"acecode_id": "evol_13576",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that adds a new field to an existing model in a hypothetical ORM system. The function should take two parameters: a list of existing fields and a new field definition. The existing fields are represented as a list of strings, where ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_field(['id', 'name'], 'custom_field:CharField(100)') == ['id', 'name', 'custom_field:CharField(100)']\", \"assert add_field([], 'custom_field:CharField(100)') == ['custom_field:CharField(100)']\", \"assert add_field(['age'], 'name:CharField(100)') == ['a... | {
"split": "train",
"index": 82999,
"acecode_id": "oss_15660",
"num_tests": 15
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.