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 given two ranges defined by their lower and upper bounds, `range1` and `range2`. Your task is to implement a function that computes the range of possible values obtained by dividing every element in `range1` by every element in `range2`. If `range2` contains zero or spa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_div((-1, 5), (-5, 3)) == (-float('inf'), float('inf'))\", \"assert combine_div((0, 10), (1, 5)) == (0.0, 10.0)\", \"assert combine_div((1, 4), (0, 0)) == (-float('inf'), float('inf'))\", \"assert combine_div((-5, -1), (1, 5)) == (-5.0, -0.2)\", \"ass... | {
"split": "train",
"index": 83300,
"acecode_id": "bigcode_python_fns_26989",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether a project can be deleted based on the presence of models and cubes associated with it. You need to create a function `can_delete_project(project_name: str, models: List[str], cubes: List[str], force: bool) -> bool`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_delete_project('Project1', [], [], False) == True\", \"assert can_delete_project('Project2', ['Model1'], [], False) == False\", \"assert can_delete_project('Project3', [], ['Cube1'], False) == False\", \"assert can_delete_project('Project4', ['Model1'], ... | {
"split": "train",
"index": 83301,
"acecode_id": "oss_25907",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ages of a group of individuals. Write a function `can_vote(ages: List[int]) -> bool` that returns True if every individual is eligible to vote (i.e., age 18 or older), and False otherwise. The function should handle the case whe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_vote([18, 20, 25]) == True\", \"assert can_vote([17, 19, 21]) == False\", \"assert can_vote([18, 17, 22]) == False\", \"assert can_vote([20, 21, 22]) == True\", \"assert can_vote([16, 17, 18]) == False\", \"assert can_vote([19]) == True\", \"assert can_v... | {
"split": "train",
"index": 83302,
"acecode_id": "bigcode_python_fns_23259",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_credit_card(card_number: str) -> str` that checks if a given credit card number is valid. The card number should be a 16-digit number that can be separated by spaces in groups of four digits (e.g., '1234 5678 9012 3456'). The function should ignor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_credit_card('1234 5678 9012 345') == 'Invalid number'\", \"assert validate_credit_card('1234 5678 9012 34567') == 'Invalid number'\", \"assert validate_credit_card('1234 5678 90ab 3456') == 'Invalid number'\", \"assert validate_credit_card('12345 67... | {
"split": "train",
"index": 83303,
"acecode_id": "evol_26306",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_valid(s: str) -> bool` that checks if a given string `s` is a valid alphanumeric string. A valid string must contain at least one letter (including Unicode characters) and at least one digit. Strings that contain only letters or only digits are not cons... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid('abc123') == True\", \"assert is_valid('123abc') == True\", \"assert is_valid('abc') == False\", \"assert is_valid('123') == False\", \"assert is_valid('abc!@#') == False\", \"assert is_valid('!@#123') == False\", \"assert is_valid('a1') == True\", ... | {
"split": "train",
"index": 83304,
"acecode_id": "evol_31947",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that normalizes the values in the list to a standard scale. Normalization should be performed using the formula: normalized_value = (value - min) / (max - min), where 'min' is the minimum value in the list and 'max' is the maximum valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize([1, 2, 3, 4, 5]) == [0.0, 0.25, 0.5, 0.75, 1.0]\", \"assert normalize([10, 20, 30]) == [0.0, 0.5, 1.0]\", \"assert normalize([5, 5, 5]) == [0.0, 0.0, 0.0]\", \"assert normalize([0, 0, 0, 0]) == [0.0, 0.0, 0.0, 0.0]\", \"assert normalize([]) == []\"... | {
"split": "train",
"index": 83305,
"acecode_id": "bigcode_python_fns_23918",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function to perform a merge sort on a given list of integers. Merge sort is a divide-and-conquer algorithm that recursively divides the input list into smaller sublists until each sublist contains only one element. It then merges these ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mergeSort([3, 4, 5, 1, 2, 8, 3, 7, 6]) == [1, 2, 3, 3, 4, 5, 6, 7, 8]\", \"assert mergeSort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert mergeSort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert mergeSort([3, 3, 3, 3]) == [3, 3, 3, 3]\", \"assert mergeSor... | {
"split": "train",
"index": 83306,
"acecode_id": "oss_15318",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `process_file` that takes an index of a file and a status string as input. The function should simulate updating the status of the file and returning the result of the operation as a string. If the status string is 'success', the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_file(123, 'success') == 'File 123 processed successfully.'\", \"assert process_file(123, 'failure') == 'File 123 processing failed.'\", \"assert process_file(123, 'in-progress') == 'File 123 status updated to in-progress.'\", \"assert process_file(12... | {
"split": "train",
"index": 83307,
"acecode_id": "oss_6294",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function that generates a SQL update query to mark an entry as deleted in a database table. The function should take the name of the table as input and return a string representing a SQL query. The query should update the 'delete_t' column to the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_update_query('my_table') == \\\"UPDATE my_table SET delete_t = transaction_timestamp() WHERE subject = %s AND predicate = %s AND md5(object) = md5(%s) AND delete_t = 'infinity'::timestamp\\\"\", \"assert get_update_query('users') == \\\"UPDATE users SET ... | {
"split": "train",
"index": 83308,
"acecode_id": "bigcode_python_fns_42070",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that enforces mandatory attributes with specific names and types. The function should take keyword arguments and check for the presence and type of mandatory attributes. If any mandatory attribute is missing or has an incorrect type, the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enforce_mandatory_attributes(ttheta=1.5, intensity=3.0) is None\", \"assert enforce_mandatory_attributes(ttheta=0.0, intensity=1.0) is None\", \"assert enforce_mandatory_attributes(ttheta=2.2, intensity=4.4) is None\", \"assert enforce_mandatory_attributes(t... | {
"split": "train",
"index": 83309,
"acecode_id": "oss_36560",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_entity(x: int, y: int, z: int) -> dict` that takes three integers and returns a dictionary representing an entity with the keys 'x', 'y', and 'z' corresponding to the provided values. The dictionary should have the format {'x': x_value, 'y': y_value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_entity(10, 20, 30) == {'x': 10, 'y': 20, 'z': 30}\", \"assert create_entity(1, 2, 3) == {'x': 1, 'y': 2, 'z': 3}\", \"assert create_entity(-1, -2, -3) == {'x': -1, 'y': -2, 'z': -3}\", \"assert create_entity(0, 0, 0) == {'x': 0, 'y': 0, 'z': 0}\", \"a... | {
"split": "train",
"index": 83310,
"acecode_id": "evol_25198",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a command. Your task is to implement a function that checks if this command is a shell command by verifying if it starts with a predefined shell identifier. The shell identifier is given as an argument to the function. Write a function `is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_shell_command('bash -c ls', 'bash') == True\", \"assert is_shell_command('python script.py', 'python') == True\", \"assert is_shell_command('node app.js', 'node') == True\", \"assert is_shell_command('java Main.java', 'java') == True\", \"assert is_shell_... | {
"split": "train",
"index": 83311,
"acecode_id": "bigcode_python_fns_12958",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that calculates the number of cores based on a specified range of values. The function should take two parameters: the start value and the end value (inclusive), both of which are integers. The step size for the range is fixed at 25. For each va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_number_of_cores(25, 800) == [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.25, 4.5, 4.75, 5.0, 5.25, 5.5, 5.75, 6.0, 6.25, 6.5, 6.75, 7.0, 7.25, 7.5, 7.75, 8.0]\", \"assert calculate_number_of_cores(100, ... | {
"split": "train",
"index": 83312,
"acecode_id": "oss_16267",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a simple text document represented as a list of paragraphs. Each paragraph should be a string that contains specific text according to the requirements outlined below. Your function should return a list of strings represent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_document() == ['Hello, World!', 'This is the second paragraph. This text was added to the second paragraph.', 'This is the third paragraph. Adding text in the third paragraph.', 'Heading 0', 'Heading 1', 'Heading 2', 'Heading 3', 'Heading 4']\", \"a... | {
"split": "train",
"index": 83313,
"acecode_id": "bigcode_python_fns_30146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the total free memory in kilobytes from a list of memory values provided in bytes. Implement the function `getFreeMemory(memory_values: List[int]) -> int`, where `memory_values` is a list of integers representing me... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getFreeMemory([1024, 2048, 512]) == 3\", \"assert getFreeMemory([0, 0, 0]) == 0\", \"assert getFreeMemory([4096]) == 4\", \"assert getFreeMemory([2048, 2048, 2048]) == 6\", \"assert getFreeMemory([1000, 2000, 3000]) == 5\", \"assert getFreeMemory([1023, 1023... | {
"split": "train",
"index": 83314,
"acecode_id": "oss_18813",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a CSV (Comma Separated Values) formatted data, where each row corresponds to a line in the string and each value within a row is separated by a specified separator. Implement a function `load_data(csv_string: str, sep: str) -> List[List[str]]... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_data('name;age;city\\\\nAlice;30;New York\\\\nBob;25;Los Angeles', ';') == [['name', 'age', 'city'], ['Alice', '30', 'New York'], ['Bob', '25', 'Los Angeles']]\", \"assert load_data('a,b,c\\\\nd,e,f\\\\ng,h,i', ',') == [['a', 'b', 'c'], ['d', 'e', 'f'],... | {
"split": "train",
"index": 83315,
"acecode_id": "bigcode_python_fns_12020",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple attack on a machine learning model using a given dataset and a privacy budget. Instead of creating a class, your task is to implement a single function named `simulate_attack(model: str, dataset: str, epsilon: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_attack('model_1', 'dataset_1', 0.1) == 'Attack simulated on model_1 with dataset_1 using epsilon 0.1'\", \"assert simulate_attack('model_2', 'dataset_2', 0.5) == 'Attack simulated on model_2 with dataset_2 using epsilon 0.5'\", \"assert simulate_att... | {
"split": "train",
"index": 83316,
"acecode_id": "oss_21575",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of nodes, each represented by a dictionary with a 'type' key and optional 'elsePart' key, write a function `contains_if_else(nodes)` that checks whether there is at least one node of type 'if' that also has an 'elsePart'. The function should return True if such a n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_if_else([{'type': 'if', 'elsePart': True}, {'type': 'if', 'children': [{'type': 'block'}, {'type': 'if', 'elsePart': True}]}]) == True\", \"assert contains_if_else([{'type': 'if'}, {'type': 'script'}, {'type': 'if', 'elsePart': False}]) == False\", ... | {
"split": "train",
"index": 83317,
"acecode_id": "bigcode_python_fns_17038",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that calculates the minimal number of swaps required to transform one list of integers into another list of integers. The function should take in two lists as input and return a tuple containing the minimum number of swaps needed and a list of pairs ind... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimal_swaps([1, 2, 3], [3, 2, 1]) == (1, [(0, 2)])\", \"assert minimal_swaps([1, 2, 3, 4], [4, 3, 2, 1]) == (2, [(0, 3), (1, 2)])\", \"assert minimal_swaps([], []) == (0, [])\", \"assert minimal_swaps([1, 2, 3], [1, 2, 3]) == (0, [])\", \"assert minimal_sw... | {
"split": "train",
"index": 83318,
"acecode_id": "evol_479",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a string as input and returns the most common alphanumeric word in the string, ignoring case sensitivity and any punctuation. If there are multiple words with the same highest frequency, the function should return the wo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mostCommonWord('Hello world! Hello everyone.') == 'hello'\", \"assert mostCommonWord('The quick brown fox jumps over the lazy dog. The dog is lazy.') == 'the'\", \"assert mostCommonWord('Python is great. Python is fun! Is Python the best?') == 'python'\", \"... | {
"split": "train",
"index": 83319,
"acecode_id": "oss_37489",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numbers and a comparison function, implement a function that computes the median of the list after removing duplicate entries. The comparison function will dictate the order of the numbers. If the list has an even length, return the average of the two middle num... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([1, 2, 3, 4, 5], lambda a, b: a - b) == 3\", \"assert median([5, 3, 1], lambda a, b: a - b) == 3\", \"assert median([3, 1, 2], lambda a, b: a - b) == 2\", \"assert median([1, 1, 1, 1], lambda a, b: a - b) == 1\", \"assert median([10, 20, 30, 40], lamb... | {
"split": "train",
"index": 83320,
"acecode_id": "evol_248",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of county FIPS codes, which are unique identifiers for geographic areas in the United States. Your task is to implement a function that groups the counties into clusters based on their adjacency. Each county can be adjacent to one or more other counties, re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_county_clusters([1, 2, 3, 4], [(1, 2), (2, 3)]) == [{1, 2, 3}, {4}]\", \"assert get_county_clusters([10, 20, 30, 40], [(10, 20), (30, 40)]) == [{10, 20}, {30, 40}]\", \"assert get_county_clusters([1, 2], [(1, 2)]) == [{1, 2}]\", \"assert get_county_clust... | {
"split": "train",
"index": 83321,
"acecode_id": "bigcode_python_fns_23048",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an array of strings and returns a new array with all strings that contain the phrase 'not only' removed. The function should only return strings that do not contain this phrase.\nPlease reason step by step, then write a self-contained Python solu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_not_only(['This is an apple', 'It is not only delicious but also healthy', 'I like eating apples']) == ['This is an apple', 'I like eating apples']\", \"assert remove_not_only(['not only this', 'just a test', 'not only that too']) == ['just a test']\"... | {
"split": "train",
"index": 83322,
"acecode_id": "evol_8379",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `intricate_monotonic` that determines whether a given list of integers is monotonic under various conditions. The function should take the following parameters: a list of integers `l`, a boolean `strict` that indicates whether to use strict comparison, a bo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intricate_monotonic([1, 2, 3, 4]) == True\", \"assert intricate_monotonic([4, 3, 2, 1]) == True\", \"assert intricate_monotonic([1, 2, 2, 3]) == True\", \"assert intricate_monotonic([1, 3, 2]) == False\", \"assert intricate_monotonic([1, 2, 3, 0, 2], zero_cr... | {
"split": "train",
"index": 83323,
"acecode_id": "evol_8880",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the maximum number of allowed requests for a rate limiter based on a given total capacity and a rate limiting percentage. Write a function `calculate_allowed_requests` that takes in two parameters: an integer `total_capac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_allowed_requests(100, 0.5) == 50\", \"assert calculate_allowed_requests(200, 0.25) == 50\", \"assert calculate_allowed_requests(150, 1.0) == 150\", \"assert calculate_allowed_requests(300, 0.333) == 99\", \"assert calculate_allowed_requests(80, 0.0... | {
"split": "train",
"index": 83324,
"acecode_id": "oss_26016",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to determine if a given number is prime. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your function should take an integer as input and return a boolean ind... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser... | {
"split": "train",
"index": 83325,
"acecode_id": "oss_30380",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a utility function to manage file operations based on specified options. The function should take two parameters: a boolean flag `overwrite` and a string `newfile`. The function should handle the following scenarios: 1. If `overwrite` is True, the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_files(True, '') == 'Existing files will be overwritten.'\", \"assert manage_files(False, 'file.txt') == 'Creating a new file with name: file.txt'\", \"assert manage_files(False, '') == None\", \"assert manage_files(False, 'test_file.txt') == 'Creating... | {
"split": "train",
"index": 83326,
"acecode_id": "oss_29936",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_positive_and_sort` that takes a list of integers and returns a new list containing only the positive integers from the original list, sorted in ascending order. Do not use any built-in sorting functions. You may implement a helper function to assist wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_positive_and_sort([-1, 2, -4, 5, 6]) == [2, 5, 6]\", \"assert get_positive_and_sort([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [1, 2, 3, 3, 5, 9, 123]\", \"assert get_positive_and_sort([-10, -20, -30]) == []\", \"assert get_positive_and_sort([0, 0, 0]) ... | {
"split": "train",
"index": 83327,
"acecode_id": "evol_21481",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings representing country codes, implement a function `filter_countries(codes: List[str], countries_of_interest: List[str]) -> List[str]` that returns a list of country codes that are present in the `countries_of_interest`. You can assume that all country cod... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_countries(['US', 'CA', 'MX', 'FR', 'DE'], ['US', 'FR']) == ['US', 'FR']\", \"assert filter_countries(['BR', 'AR', 'CN'], ['JP', 'AU']) == []\", \"assert filter_countries(['IN', 'PK', 'BD', 'LK'], ['IN', 'BD']) == ['IN', 'BD']\", \"assert filter_countr... | {
"split": "train",
"index": 83328,
"acecode_id": "bigcode_python_fns_28215",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that sorts the integers in descending order and returns the sorted list. Do not use any built-in sorting functions.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```py... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_descending_order([1, 2, 3, 4]) == [4, 3, 2, 1]\", \"assert sort_descending_order([4, 3, 2, 1]) == [4, 3, 2, 1]\", \"assert sort_descending_order([3, 1, 4, 2]) == [4, 3, 2, 1]\", \"assert sort_descending_order([10, 9, 8, 7, 6]) == [10, 9, 8, 7, 6]\", \"a... | {
"split": "train",
"index": 83329,
"acecode_id": "evol_9969",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the even integers from the original list. If there are no even integers, the function should return an empty list. Your function should handle cases with negative intege... | 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, -2, -3, -4]) == [-2, -4]\", \"assert filter_even_numbers([-6, -7, -8, 0]) == [-6, -8, 0]\", \"assert filter_even... | {
"split": "train",
"index": 83330,
"acecode_id": "bigcode_python_fns_21872",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns the sum of all even numbers in the list. If there are no even numbers, the function should return 0. The function signature should be: def sum_of_even_numbers(numbers: List[int]) -> int.\nPlease reason step by step, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_even_numbers([10, 15, 20, 25, 30]) == 60\", \"assert sum_of_even_numbers([1, 3, 5, 7]) == 0\", \"assert sum_of_even_numbers([2, 4, 6, 8]) == 20\", \"assert sum_of_even_numbers([]) == 0\", \"assert ... | {
"split": "train",
"index": 83331,
"acecode_id": "evol_238",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that creates a new class based on an existing class. The function should take an existing class and a string as input, and return a new class that inherits from the existing class. This new class should have an additional attribute th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classfactory(Person, 'https://example.com').__name__ == 'ExPerson'\", \"assert classfactory(Person, 'https://example.com')('Bob').name == 'Bob'\", \"assert classfactory(Person, 'https://example.com')('Bob').url == 'https://example.com'\", \"assert classfacto... | {
"split": "train",
"index": 83332,
"acecode_id": "oss_19846",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `compare_novels` that takes two instances of a `Novel` class and checks if they share the same author, publisher, or publication year. The function should return a tuple of three boolean values: the first indicating if the authors are the same, the s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_novels(Novel('Author A', 'Publisher A', 2000), Novel('Author A', 'Publisher B', 2001)) == (True, False, False)\", \"assert compare_novels(Novel('Author B', 'Publisher A', 2000), Novel('Author A', 'Publisher A', 2000)) == (False, True, True)\", \"asse... | {
"split": "train",
"index": 83333,
"acecode_id": "evol_25019",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a variable, determine if it is an integer. Implement a function `is_int(var)` that takes a single parameter `var` and returns `True` if `var` is an integer, and `False` otherwise. The input can be of any type, including but not limited to integers, floats, strings, lists,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_int(5) == True\", \"assert is_int(-3) == True\", \"assert is_int(0) == True\", \"assert is_int(3.14) == False\", \"assert is_int('hello') == False\", \"assert is_int([1, 2, 3]) == False\", \"assert is_int({'key': 'value'}) == False\", \"assert is_int(None... | {
"split": "train",
"index": 83334,
"acecode_id": "bigcode_python_fns_21904",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `extract_positive_numbers` that takes a list of integers and returns a new list containing only the positive integers from the original list, preserving the order of their appearance. If there are no positive integers, return an empty ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_positive_numbers([-1, -2, -3]) == []\", \"assert extract_positive_numbers([1, 2, 3]) == [1, 2, 3]\", \"assert extract_positive_numbers([0, -1, 2, -3, 4]) == [2, 4]\", \"assert extract_positive_numbers([-5, -10, -20]) == []\", \"assert extract_positiv... | {
"split": "train",
"index": 83335,
"acecode_id": "bigcode_python_fns_43819",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a connection to a local database system and retrieves a specific value based on a given identifier. The function `connect_and_get_value(identifier: str) -> str` should take a string `identifier` as input and return a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert connect_and_get_value('user1') == 'Alice'\", \"assert connect_and_get_value('user2') == 'Bob'\", \"assert connect_and_get_value('user3') == 'Charlie'\", \"assert connect_and_get_value('user4') == 'Diana'\", \"assert connect_and_get_value('user5') == 'Eve'\",... | {
"split": "train",
"index": 83336,
"acecode_id": "bigcode_python_fns_4294",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that returns the first N elements of a list in reverse order, where N is an input parameter. The function should raise an appropriate exception if the list is null, not a list, or if the length of the list is less than N. The list can contain elements of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_n_elements_reversed([1, 2, 3, 4, 5], 2) == [2, 1]\", \"assert first_n_elements_reversed(['a', 'b', 'c', 'd'], 3) == ['c', 'b', 'a']\", \"assert first_n_elements_reversed([True, False, True], 1) == [True]\", \"assert first_n_elements_reversed([1.1, 2.2,... | {
"split": "train",
"index": 83337,
"acecode_id": "evol_20078",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a keyframe region track context for a dope sheet editor. The function should accept the following parameters: `q` (int), `e` (boolean), `ex` (boolean), `ch` (boolean), `i1` (string), `i2` (string), `i3` (str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_keyframe_context(1, True, True, True, 'icon1', 'icon2', 'icon3', 'MyContext') == 'MyContext_icon1_icon2_icon3 with history'\", \"assert create_keyframe_context(1, True, True, False, 'icon1', 'icon2', 'icon3', 'MyContext') == 'MyContext_icon1_icon2_ico... | {
"split": "train",
"index": 83338,
"acecode_id": "bigcode_python_fns_13820",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns the largest prime factor of a given number n, which can be positive, negative, or a floating-point number. The function should raise a ValueError for inputs that are not finite or are zero, and a TypeError for non-integer values. You may assume... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_prime_factor(13195.0) == 29\", \"assert largest_prime_factor(2048.0) == 2\", \"assert largest_prime_factor(-13195.0) == 29\", \"assert largest_prime_factor(-2048.0) == 2\", \"assert largest_prime_factor(5.0) == 5\", \"assert largest_prime_factor(-5.0... | {
"split": "train",
"index": 83339,
"acecode_id": "evol_16469",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts the domain name from a given URL. The domain name is the part of the URL that comes after 'https://' or 'http://' and before the next '/' or the end of the URL. Write a function called `extract_domain` that takes a UR... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_domain('https://www.nhsx.nhs.uk/covid-19-response/data-and-covid-19/national-covid-19-chest-imaging-database-nccid/') == 'www.nhsx.nhs.uk'\", \"assert extract_domain('http://example.com/path/to/resource') == 'example.com'\", \"assert extract_domain('... | {
"split": "train",
"index": 83340,
"acecode_id": "oss_8713",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `hex_to_ascii(hex_string: str) -> Tuple[str, List[str]]` that takes a string of hexadecimal values as input and converts each hexadecimal value to its corresponding ASCII character. The string can contain hexadecimal values for all uppercase and lowercase alpha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_ascii('48656c6c6f') == ('Hello', [])\", \"assert hex_to_ascii('776f726c64') == ('world', [])\", \"assert hex_to_ascii('') == ('', [])\", \"assert hex_to_ascii('4d616e') == ('Man', [])\", \"assert hex_to_ascii('54657374') == ('Test', [])\", \"assert he... | {
"split": "train",
"index": 83341,
"acecode_id": "evol_34607",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `dismiss_notification` that takes a list of integers representing notification IDs and a single integer `notificationId`. The function should return a dictionary with a `success` key. If the `notificationId` exists in the list, `succes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dismiss_notification([1, 2, 3], 2) == {'success': True}\", \"assert dismiss_notification([5, 10, 15], 20) == {'success': False, 'message': 'notification_not_found'}\", \"assert dismiss_notification([], 1) == {'success': False, 'message': 'notification_not_fo... | {
"split": "train",
"index": 83342,
"acecode_id": "bigcode_python_fns_10773",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `introduce_person(first_name: str, last_name: str, age: int, sex: str, title: str) -> str` that generates an expressive introduction statement for an individual. The function should take in the individual's first name, last name, chronological age, sex, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert introduce_person('John', 'Doe', 34, 'male', 'Mr') == 'Mr. John Doe, 34 years old.'\", \"assert introduce_person('Jane', 'Doe', 30, 'female', 'Mrs') == 'Mrs. Jane Doe, 30 years old.'\", \"assert introduce_person('Eve', 'Adams', 36, 'female', 'Miss') == 'Miss.... | {
"split": "train",
"index": 83343,
"acecode_id": "evol_5701",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function `fibonacci(n: int) -> int` that calculates the nth Fibonacci number using recursion and memoization. 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. The function should return the nth Fibonacci ... | 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": 83344,
"acecode_id": "evol_3651",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of tuples, `annotations` and `detections`. Each tuple consists of two elements: the first element is an integer representing the frame number, and the second element is a float representing the detection score. Your task is to identify false positives (d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_blinks([(1, 0.90)], [(1, 0.85)]) == ([], [])\", \"assert evaluate_blinks([(1, 0.95), (2, 0.91)], [(1, 0.87), (2, 0.88)]) == ([], [])\", \"assert evaluate_blinks([(1, 0.95)], [(1, 0.80), (3, 0.85)]) == ([(3, 0.85)], [])\", \"assert evaluate_blinks([(... | {
"split": "train",
"index": 83345,
"acecode_id": "bigcode_python_fns_23441",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given two 2-D matrices (lists of lists) `input1` and `input2`, each containing floating point numbers, compute the cosine distance matrix between the two matrices. The cosine distance between two vectors A and B is defined as 1 - (A . B) / (||A|| * ||B||), where '.' denotes the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cosine_distance([[1, 0], [0, 1]], [[1, 0], [0, 1]]) == [[0.0, 1.0], [1.0, 0.0]]\", \"assert cosine_distance([[0, 0]], [[1, 1]]) == [[1.0]]\", \"assert cosine_distance([[1, 0], [0, 1]], [[0, 0], [0, 0]]) == [[1.0, 1.0], [1.0, 1.0]]\", \"assert cosine_distance... | {
"split": "train",
"index": 83346,
"acecode_id": "bigcode_python_fns_35213",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that creates a simple representation of a DOM (Document Object Model) element. The function should take two optional parameters: a dictionary representing the attributes of the DOM element and a list of child nodes for the DOM element... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_dom_element() == {'attrs': {}, 'children': []}\", \"assert create_dom_element({'id': 'main'}) == {'attrs': {'id': 'main'}, 'children': []}\", \"assert create_dom_element(None, ['Text content']) == {'attrs': {}, 'children': ['Text content']}\", \"asser... | {
"split": "train",
"index": 83347,
"acecode_id": "oss_29077",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, return the maximum number of unique substrings that the given string can be split into. You can split string `s` into any list of non-empty substrings, where the concatenation of the substrings forms the original string. However, you must split the substring... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxUniqueSplit('aba') == 2\", \"assert maxUniqueSplit('aeiou') == 5\", \"assert maxUniqueSplit('iouae') == 5\", \"assert maxUniqueSplit('eieio') == 4\", \"assert maxUniqueSplit('xyzabc') == 0\", \"assert maxUniqueSplit('uoiea') == 5\", \"assert maxUniqueSpli... | {
"split": "train",
"index": 83348,
"acecode_id": "evol_24420",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers 'arr' and a predefined limit of unique modifications 'limit', determine the smallest number of elements that need to be changed to form a palindrome. Each modification allows transformation of a single element to any other number. Implement a function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smallest_change([1, 2, 3, 4, 3, 2, 2], 2) == 1\", \"assert smallest_change([1, 2, 3, 2, 1], 1) == 0\", \"assert smallest_change([1, 1, 1, 1], 0) == 0\", \"assert smallest_change([1, 2, 3, 3, 2, 1], 0) == 0\", \"assert smallest_change([0, 1, 2, 3, 3, 2, 1, 0]... | {
"split": "train",
"index": 83349,
"acecode_id": "evol_23399",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of words, you need to implement a function that processes the list and performs the following operations: 1. Count the total number of words in the list. 2. Find the longest word in the list. 3. Sort the words in the list in alphabetical order. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_word_list(['apple', 'banana', 'cherry']) == {'total_words': 3, 'longest_word': 'banana', 'sorted_words': ['apple', 'banana', 'cherry']}\", \"assert process_word_list(['dog', 'cat', 'elephant', 'giraffe']) == {'total_words': 4, 'longest_word': 'elepha... | {
"split": "train",
"index": 83350,
"acecode_id": "oss_18052",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `generate_message(output: bool) -> str` that generates a message string based on whether the output is local or being sent to Google BigQuery. If the `output` is `True`, the function should return a message indicating where the results wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_message(True) == '----------------------------------------------------\\\\n* OUTPUT \\\\n* The results will be located in the State folder \\\\n* in the population-output directory \\\\n* T... | {
"split": "train",
"index": 83351,
"acecode_id": "bigcode_python_fns_40200",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a word and a character as input and returns the index of the first occurrence of the character in the word. The function should be case-sensitive and return -1 if the character is not found in the word.\nPlease reason step by step, then write a self-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_character('supercalifragilisticexpialidocious', 's') == 0\", \"assert find_character('supercalifragilisticexpialidocious', 'u') == 1\", \"assert find_character('supercalifragilisticexpialidocious', 'p') == 2\", \"assert find_character('supercalifragilis... | {
"split": "train",
"index": 83352,
"acecode_id": "evol_24445",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that formats a given string based on the provided arguments. The function should replace placeholders in the string with the corresponding values from the arguments. The string can contain '%' followed by a number (1-based index) or a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_string('Hello, %1! Your score is %2.', 'Alice', 90) == 'Hello, Alice! Your score is 90.'\", \"assert format_string('Your balance is %1 and your name is %name.', 100.5, name='John') == 'Your balance is 100.5 and your name is John.'\", \"assert format_s... | {
"split": "train",
"index": 83353,
"acecode_id": "bigcode_python_fns_45895",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple GPIO (General Purpose Input/Output) pin reading system. Implement a function `read_pin_state(pin: int) -> int` that takes an integer `pin` representing the pin number and returns the state of that pin, which can either be 0 (LOW) or 1 (HI... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_pin_state(1) == 1\", \"assert read_pin_state(2) == 0\", \"assert read_pin_state(3) == 1\", \"assert read_pin_state(4) == 0\", \"assert read_pin_state(5) == 1\", \"assert read_pin_state(6) == 0\", \"assert read_pin_state(7) == 1\", \"assert read_pin_stat... | {
"split": "train",
"index": 83354,
"acecode_id": "bigcode_python_fns_48973",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of employee records and returns a summary of the data. Each employee record is represented as a tuple containing their name (a string), department (a string), and salary (an integer). Your function should calc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_salary_by_department([('John', 'Digital Marketing', 50000), ('Alice', 'Engineering', 60000), ('Bob', 'Engineering', 55000), ('Eve', 'Digital Marketing', 48000)]) == {'Digital Marketing': 49000.0, 'Engineering': 57500.0}\", \"assert calculat... | {
"split": "train",
"index": 83355,
"acecode_id": "oss_1943",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a specialized stack that supports the following operations: push, pop, and getMin. The push operation should append a value to the stack, the pop operation should remove and return the top value from the stack, and the getMin operation should return the minimum value ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_max_stack.getMin() is None\", \"assert min_max_stack.pop() is None\", \"assert min_max_stack.getMin() is None\", \"assert min_max_stack.pop() is None\"]}"
} | {
"split": "train",
"index": 83356,
"acecode_id": "oss_3721",
"num_tests": 4
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that removes a specific item from a list based on the provided value. The function should take in a list of integers and a target integer value to remove from the list. If the target integer exists in the list, the function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_item([1, 2, 3, 4, 5], 3) == [1, 2, 4, 5]\", \"assert remove_item([1, 2, 3, 4, 5], 6) == [1, 2, 3, 4, 5]\", \"assert remove_item([1, 2, 3, 2, 5], 2) == [1, 3, 2, 5]\", \"assert remove_item([], 1) == []\", \"assert remove_item([1, 1, 1], 1) == [1, 1]\",... | {
"split": "train",
"index": 83357,
"acecode_id": "oss_16779",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a multi-dimensional list of integers and returns a flat list containing all the integers in reverse order. The input list can contain other lists of integers at any level of nesting. Your function should handle lists of varying depths and return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert inverse_sequence([[1, 2], [3, 4], [5]]) == [5, 4, 3, 2, 1]\", \"assert inverse_sequence([[10], [20, 30], [40, 50]]) == [50, 40, 30, 20, 10]\", \"assert inverse_sequence([[1, [2, [3]]], [4]]) == [4, 3, 2, 1]\", \"assert inverse_sequence([[[1, 2]], 3, 4]) == [... | {
"split": "train",
"index": 83358,
"acecode_id": "evol_19198",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes and formats cryptocurrency data for display. The function will take a list of dictionaries `crypto_data` containing cryptocurrency data and a string `sortby` representing the column to sort the data by. Each dictiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_crypto_data([], 'Volume [$]') == []\", \"assert process_crypto_data([{'Coin':'Bitcoin', 'Volume [$]': 123456789, 'Market Cap [$]': 1000000000000}], 'Market Cap [$]') == [{'Coin':'Bitcoin', 'Volume [$]': '123.46M', 'Market Cap [$]': '1.00T'}]\", \"ass... | {
"split": "train",
"index": 83359,
"acecode_id": "oss_29245",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates a list of all prime numbers within a specified range, inclusive of the boundaries. The function should take two integer parameters, `start` and `end`, where 1 <= start <= end <= 10^6. Return a list of prime numbers in ascending order.\nPlease... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_prime_numbers(1, 10) == [2, 3, 5, 7]\", \"assert generate_prime_numbers(10, 20) == [11, 13, 17, 19]\", \"assert generate_prime_numbers(20, 30) == [23, 29]\", \"assert generate_prime_numbers(30, 40) == [31, 37]\", \"assert generate_prime_numbers(40, ... | {
"split": "train",
"index": 83360,
"acecode_id": "evol_26500",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that removes all consonants from a given string and returns the resulting string. The input string may contain letters, digits, punctuation, and whitespace.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_consonants('Python 3.8') == 'o 3.8'\", \"assert remove_consonants('12345!@#') == '12345!@#'\", \"assert remove_consonants('') == ''\", \"assert remove_consonants('This is a test.') == 'i i a e.'\", \"assert remove_consonants('ABCDEFGHIJKLMNOPQRSTUVWXY... | {
"split": "train",
"index": 83361,
"acecode_id": "evol_7499",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing peak areas of different compounds and a corresponding list of scores for those compounds. Write a function that takes these two lists and returns a new list of tuples, where each tuple contains the peak area and its corresponding sc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_peak_areas_and_scores([5, 2, 8], [10, 20, 15]) == [(8, 15), (5, 10), (2, 20)]\", \"assert sort_peak_areas_and_scores([1, 2, 3], [3, 2, 1]) == [(3, 1), (2, 2), (1, 3)]\", \"assert sort_peak_areas_and_scores([10, 10, 5], [5, 15, 10]) == [(10, 5), (10, 15)... | {
"split": "train",
"index": 83362,
"acecode_id": "bigcode_python_fns_24118",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `sum_of_squares_fibonacci(n: int) -> int` that computes the sum of the squares of the first `n` Fibonacci numbers. 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. The function should return the sum of squa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares_fibonacci(0) == 0\", \"assert sum_of_squares_fibonacci(1) == 1\", \"assert sum_of_squares_fibonacci(15) == 0\", \"assert sum_of_squares_fibonacci(20) == 0\", \"assert sum_of_squares_fibonacci(25) == 5\", \"assert sum_of_squares_fibonacci(30) =... | {
"split": "train",
"index": 83363,
"acecode_id": "evol_761",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a sequence of integers and calculates a running total based on specific criteria. The function should iterate through the sequence of integers and perform the following actions: 1. Ignore any integer less than or equal ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_sequence([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 0\", \"assert process_sequence([60, 70, 80]) == 0\", \"assert process_sequence([5, 5, 5, 5, 5]) == 0\", \"assert process_sequence([10, 20, 30, 50, 60]) == 100\", \"assert process_sequence([15, 15, 15, 15, ... | {
"split": "train",
"index": 83364,
"acecode_id": "oss_13185",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if two strings are identical. The function should take two strings as input, and return True if they are exactly the same, and False otherwise. The comparison should be case-sensitive. For example, 'Hello' and 'hello' shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_strings_identical('Hello', 'Hello') == True\", \"assert are_strings_identical('hello', 'hello') == True\", \"assert are_strings_identical('Hello', 'hello') == False\", \"assert are_strings_identical('abc', 'abc') == True\", \"assert are_strings_identical... | {
"split": "train",
"index": 83365,
"acecode_id": "bigcode_python_fns_22152",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a URL based on the given parameters. The function should take in the following parameters: a boolean `https` that indicates whether to use HTTPS (default is False), a string `host` that specifies the host (default is 'local... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_url() == 'http://localhost:5984'\", \"assert generate_url(https=True) == 'https://localhost:5984'\", \"assert generate_url(port=0) == 'http://localhost'\", \"assert generate_url(https=True, port=0) == 'https://localhost'\", \"assert generate_url(hos... | {
"split": "train",
"index": 83366,
"acecode_id": "bigcode_python_fns_11096",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of strings as input arguments and returns a specific output based on the following rules: 1. If the input list is empty, return 'No arguments provided'. 2. If the input list contains only one element which is 'help',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_arguments([]) == 'No arguments provided'\", \"assert process_arguments(['help']) == 'Displaying help information'\", \"assert process_arguments(['arg1']) == 'Processing arguments: arg1'\", \"assert process_arguments(['arg1', 'arg2']) == 'Processing a... | {
"split": "train",
"index": 83367,
"acecode_id": "oss_35770",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a boolean variable called `event_loop`. Write a function `test_event_loop(event_loop: bool) -> str` that returns 'ok' if `event_loop` is true, and returns 'not ok' if `event_loop` is false. The function should only implement this logic. Please ensure that the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert test_event_loop(True) == 'ok'\", \"assert test_event_loop(False) == 'not ok'\", \"assert test_event_loop(True) == 'ok'\", \"assert test_event_loop(False) == 'not ok'\", \"assert test_event_loop(True) == 'ok'\", \"assert test_event_loop(False) == 'not ok'\", ... | {
"split": "train",
"index": 83368,
"acecode_id": "bigcode_python_fns_27854",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integer arrays A and B, write a function `difference_array(A: List[int], B: List[int]) -> List[int]` that returns a new list containing the elements from array A that are not present in array B. The order of elements in the output list should be the same as they appea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert difference_array([1, 2, 3, 4, 5], [2, 4]) == [1, 3, 5]\", \"assert difference_array([5, 5, 6, 7], [5, 7]) == [6]\", \"assert difference_array([], []) == []\", \"assert difference_array([10, 20, 30], [40, 50]) == [10, 20, 30]\", \"assert difference_array([1, ... | {
"split": "train",
"index": 83369,
"acecode_id": "bigcode_python_fns_12697",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that checks for the presence of a set of ASCII alphanumeric characters within a given string. The function should take a string and a list of characters as input parameters. It should return a dictionary indicating whether each character from the list is pres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_characters('Hello World!', ['!', 'Z', 'o']) == {'!': True, 'Z': False, 'o': True}\", \"assert analyze_characters('12345', ['6', '5', '0']) == {'6': False, '5': True, '0': False}\", \"assert analyze_characters('OpenAI GPT-3', ['G', 'T', '!', 'O']) == ... | {
"split": "train",
"index": 83370,
"acecode_id": "evol_11934",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function to calculate the factorial of a given positive integer n. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. For example, the factorial of 5 (denoted as 5!) is 5 * 4 * 3 * 2 * 1 = 120. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 83371,
"acecode_id": "evol_26847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that configures the logging level based on given verbosity flags. The function should take in two boolean parameters, `debug` and `verbose`, which indicate the desired logging level. If `debug` is True, the function should return 'DEBUG'.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_logging_level(True, False) == 'DEBUG'\", \"assert configure_logging_level(False, True) == 'INFO'\", \"assert configure_logging_level(False, False) == 'WARNING'\", \"assert configure_logging_level(True, True) == 'DEBUG'\", \"assert configure_logging... | {
"split": "train",
"index": 83372,
"acecode_id": "bigcode_python_fns_38428",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and returns a new list containing only the even numbers from the original list. The function should maintain the original order of the elements. Please implement the function `filter_even_numbers(nums: List[int]) -> List[int]`.... | 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, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([0, 1, 2, 3, 4]) == [0, 2, 4]\", \"assert filter_even_numbers([7, 9, 11]) == []\", \"assert filter_even_numbe... | {
"split": "train",
"index": 83373,
"acecode_id": "evol_33945",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the process of connecting to a database. Write a Python function `simulate_connect_to_database` that takes the following parameters: \n- `username` (string): The username for the database connection. \n- `password` (... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_connect_to_database('admin', 'password123', 'mydb', 'UTF-8', 'UTF-16') == {'status': 'success', 'dsn': 'mydb', 'encoding': 'UTF-8', 'nencoding': 'UTF-16'}\", \"assert simulate_connect_to_database('user', 'wrongpass', 'mydb', 'UTF-8', 'UTF-16') == {'... | {
"split": "train",
"index": 83374,
"acecode_id": "oss_34204",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of strings and a character as parameters, and returns a single string that consists of all the strings in the list joined together using the provided character as a delimiter.\nPlease reason step by step, then write a self-contained Python sol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert join_strings(['apple', 'banana', 'cherry'], ', ') == 'apple, banana, cherry'\", \"assert join_strings(['hello', 'world'], '-') == 'hello-world'\", \"assert join_strings(['foo'], '|') == 'foo'\", \"assert join_strings([], '*') == ''\", \"assert join_strings([... | {
"split": "train",
"index": 83375,
"acecode_id": "evol_33876",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing label indices and an integer representing the total number of classes, write a function that constructs a binary vector of size equal to the number of classes. Each index of the binary vector should be set to 1 if that index exists in the i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert as_binary_vector([0, 1, 2], 3) == [1.0, 1.0, 1.0]\", \"assert as_binary_vector([0, 1, 1, 2], 3) == [1.0, 1.0, 1.0]\", \"assert as_binary_vector([0, 2, 2, 2], 3) == [1.0, 0.0, 1.0]\", \"assert as_binary_vector([], 5) == [0.0, 0.0, 0.0, 0.0, 0.0]\", \"assert a... | {
"split": "train",
"index": 83376,
"acecode_id": "bigcode_python_fns_17863",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the process of uploading a file to a cloud storage bucket. The function should take three parameters: the name of the bucket (a string), the name of the source file (a string), and the destination path where the file will b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert upload_file('my_bucket', 'file.txt', 'uploads/file.txt') == 'Upload successful!'\", \"assert upload_file('my_bucket', 'image.png', 'uploads/images/image.png') == 'Upload successful!'\", \"assert upload_file('my_bucket', 'document.pdf', 'uploads/documents/doc... | {
"split": "train",
"index": 83377,
"acecode_id": "bigcode_python_fns_6008",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine if a given IP address is blacklisted based on a predefined list of blacklisted IP addresses. The function should take an IP address as input and check if it matches any of the blacklisted addresses. If the IP address is f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_ip_blacklisted('192.168.1.1', ['192.168.1.1', '10.0.0.1']) == True\", \"assert is_ip_blacklisted('10.0.0.2', ['192.168.1.1', '10.0.0.1']) == False\", \"assert is_ip_blacklisted('172.16.0.5', ['172.16.0.5', '192.168.1.1']) == True\", \"assert is_ip_blackli... | {
"split": "train",
"index": 83378,
"acecode_id": "oss_9825",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes an integer number as input and returns its representation in words. The input number will be between 0 and 999999. For example, the number 123 should be converted to 'one hundred and twenty three'.\nPlease reason step by step, then write a self-conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_number_word(0) == 'zero'\", \"assert get_number_word(1) == 'one'\", \"assert get_number_word(15) == 'fifteen'\", \"assert get_number_word(20) == 'twenty'\", \"assert get_number_word(21) == 'twenty one'\", \"assert get_number_word(99) == 'ninety nine'\", ... | {
"split": "train",
"index": 83379,
"acecode_id": "evol_22033",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list representing a grayscale image and a 2D list representing a binary mask, implement a function that computes the average pixel value of the image for the area defined by the mask. The mask consists of 1s and 0s, where 1 indicates the pixels of interest and 0 indi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_pixel_value([[100, 150], [200, 250]], [[0, 0], [0, 0]]) == []\", \"assert average_pixel_value([[255, 255], [255, 255]], [[1, 1], [1, 1]]) == [255.0]\", \"assert average_pixel_value([[0, 0], [0, 0]], [[1, 1], [1, 1]]) == [0.0]\", \"assert average_pixe... | {
"split": "train",
"index": 83380,
"acecode_id": "bigcode_python_fns_23943",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given filename is a valid audio file based on its extension. The function should accept a string representing the filename and return a boolean value: `True` if the filename has a valid audio extension (mp3, m4a, snd, au,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_audio_file('song.mp3') == True\", \"assert is_valid_audio_file('track.m4a') == True\", \"assert is_valid_audio_file('sound.snd') == True\", \"assert is_valid_audio_file('audio.au') == True\", \"assert is_valid_audio_file('sample.sd2') == True\", \"a... | {
"split": "train",
"index": 83381,
"acecode_id": "oss_19677",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers called 'observed'. Your task is to write a function that identifies and returns a dictionary. The dictionary should contain integers from 1 to 10 as keys. Each key should map to a list of integers which are present in the 'observed' list and are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_divisible_mapping([1, 2, 3, 4, 5, 6, 7, 8, 9]) == {1: [1, 2, 3, 4, 5, 6, 7, 8, 9], 2: [2, 4, 6, 8], 3: [3, 6, 9], 4: [4, 8], 5: [5], 6: [6], 7: [7], 8: [8], 9: [9], 10: []}\", \"assert get_divisible_mapping([]) == {1: [], 2: [], 3: [], 4: [], 5: [], 6: [... | {
"split": "train",
"index": 83382,
"acecode_id": "bigcode_python_fns_48646",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates a user's request to perform an operation based on certain conditions. The function should receive a user's unique ID and a set of parameters required for the operation. The function must check if the user exists, if the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_operation('user1', {'param1': 'value1', 'param2': 'value2'}, lambda param1, param2: {'success': True}) == {'success': True}\", \"assert validate_user_operation('user7', {'param1': 'value1'}, lambda param1: {'success': True}) == 'from_not_exist'... | {
"split": "train",
"index": 83383,
"acecode_id": "bigcode_python_fns_13562",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function in Python that takes a list of integers and returns the index of the maximum value in the list. If the list is empty, the function should return -1. Do not use any built-in functions for finding the maximum value.\nPlease reason step by step, then... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum([1, 2, 3, 4, 5]) == 4\", \"assert find_maximum([-10, -5, 0, 5, 10]) == 4\", \"assert find_maximum([5, 5, 5, 5]) == 0\", \"assert find_maximum([3, 1, 2, 4, 1]) == 3\", \"assert find_maximum([2]) == 0\", \"assert find_maximum([]) == -1\", \"assert... | {
"split": "train",
"index": 83384,
"acecode_id": "evol_30738",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a character, write a function `is_uppervowel(char: str) -> bool` that checks if the character is an uppercase Irish vowel. The uppercase Irish vowels are 'A', 'E', 'I', 'O', 'U', 'Á', 'É', 'Í', 'Ó', and 'Ú'. The function should return True if the input is a single charact... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_uppervowel('A') == True\", \"assert is_uppervowel('E') == True\", \"assert is_uppervowel('I') == True\", \"assert is_uppervowel('O') == True\", \"assert is_uppervowel('U') == True\", \"assert is_uppervowel('\\u00c1') == True\", \"assert is_uppervowel('\\u... | {
"split": "train",
"index": 83385,
"acecode_id": "bigcode_python_fns_34243",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `log_with_level` that allows logging messages with different severity levels. The function should take a string representing the logging level and a variable number of message arguments. It should concatenate the message arguments into a single ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_with_level('INFO', 'User', 'logged', 'in') == '[INFO] User logged in'\", \"assert log_with_level('ERROR', 'File', 'not', 'found') == '[ERROR] File not found'\", \"assert log_with_level('DEBUG', 'Processing', 'data') == '[DEBUG] Processing data'\", \"asse... | {
"split": "train",
"index": 83386,
"acecode_id": "oss_36112",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of geographical coordinates represented by their longitudes, write a function `mid_longitude(longitudes: List[float]) -> float` that returns the average longitude of the given coordinates. The input list will contain at least one longitude value. The average longit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mid_longitude([10.0, 20.0, 30.0]) == 20.0\", \"assert mid_longitude([-10.0, 0.0, 10.0]) == 0.0\", \"assert mid_longitude([100.0, 200.0]) == 150.0\", \"assert mid_longitude([5.5, 6.5, 7.5]) == 6.5\", \"assert mid_longitude([-5.0, -15.0, -25.0]) == -15.0\", \"... | {
"split": "train",
"index": 83387,
"acecode_id": "bigcode_python_fns_37631",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two number strings, determine if all digits of the second number string appear in the first number string in the same order. Additionally, check if each digit in the second number string is a prime number (2, 3, 5, or 7). Return True if the subsequence is valid and contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_subsequence('123456789', '2468') == False\", \"assert is_subsequence('9876543210', '753') == True\", \"assert is_subsequence('123456789', '89') == False\", \"assert is_subsequence('123456789', '11') == False\", \"assert is_subsequence('123456789', '57') =... | {
"split": "train",
"index": 83388,
"acecode_id": "evol_17160",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `safe_divide(numerator: int, denominator: int) -> float` that performs division of two integers. The function should handle the following errors: if the denominator is zero, it should return 'Division by zero is not allowed.' If the inputs are not integers,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert safe_divide(10, 2) == 5.0\", \"assert safe_divide(10, 0) == 'Division by zero is not allowed.'\", \"assert safe_divide(10, 'a') == 'Invalid input type.'\", \"assert safe_divide(10.5, 2) == 'Invalid input type.'\", \"assert safe_divide(10, -2) == -5.0\", \"as... | {
"split": "train",
"index": 83389,
"acecode_id": "evol_14255",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents a field with various attributes. Each field dictionary contains the following keys: 'ID', 'ERR_FLD', 'FLD_INFO', and 'CAT_NM'. The 'FLD_INFO' key maps to another dictionary containing the keys 'MNEMONIC', 'D... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_fields([{'ID': '1', 'FLD_INFO': {'MNEMONIC': 'A', 'DATA_TP': 'string', 'DESC': 'Description A', 'DOC': 'Document A', 'PPTY': {}, 'OVDS': {}}}]) == {'A': {'ID': '1', 'DATA_TP': 'string', 'CAT_NM': [], 'DESC': 'Description A', 'DOC': 'Document A', 'FTY... | {
"split": "train",
"index": 83390,
"acecode_id": "bigcode_python_fns_40049",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a list of exercise records and a specific sport name, and returns the total count of exercises and the total time spent on those exercises for the given sport. Each exercise record is represented as a dictionary with two key... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exercise_summary([{'sport': 'running', 'time': 30}, {'sport': 'cycling', 'time': 45}, {'sport': 'running', 'time': 20}], 'running') == (2, 50)\", \"assert exercise_summary([{'sport': 'swimming', 'time': 60}, {'sport': 'swimming', 'time': 30}], 'running') == ... | {
"split": "train",
"index": 83391,
"acecode_id": "bigcode_python_fns_22827",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that verifies the login credentials of a user in a hypothetical authentication system. The function, `verify_login`, should accept two parameters: a username and a password. The function should return `True` if the credentials match the p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_login('user', 'secure_password') == True\", \"assert verify_login('user', 'wrong_password') == False\", \"assert verify_login('wrong_user', 'secure_password') == False\", \"assert verify_login('wrong_user', 'wrong_password') == False\", \"assert verif... | {
"split": "train",
"index": 83392,
"acecode_id": "oss_30927",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two strings: 'frame_bg' representing a background layer and 'frame_fg' representing a foreground layer. Your task is to implement a function 'merge_layers(frame_bg: str, frame_fg: str) -> str' that combines these two strings into a single string. The merging proce... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_layers('background', 'foreground') == 'backgroundforeground'\", \"assert merge_layers('Hello, ', 'World!') == 'Hello, World!'\", \"assert merge_layers('', 'test') == 'test'\", \"assert merge_layers('test', '') == 'test'\", \"assert merge_layers('123', ... | {
"split": "train",
"index": 83393,
"acecode_id": "bigcode_python_fns_37635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `swap_elements(arr: List[Union[int, str]], index1: int, index2: int) -> List[Union[int, str]]` that swaps the elements at the specified indices in a given list. The function should handle lists containing duplicate values and should raise an IndexError if a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_elements([1, 2, 3, 4], 0, 1) == [2, 1, 3, 4]\", \"assert swap_elements(['a', 'b', 'c'], 1, 2) == ['a', 'c', 'b']\", \"assert swap_elements([1, 2, 2, 3], 1, 2) == [1, 2, 2, 3]\", \"assert swap_elements([5, 5, 5], 0, 2) == [5, 5, 5]\", \"assert swap_eleme... | {
"split": "train",
"index": 83394,
"acecode_id": "evol_31602",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a password-protected withdrawal system for a bank account. The system should allow a user to withdraw funds using a password. If the user provides the correct password, the withdrawal is processed; otherwise, an error message is returned. Additional... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_joint(lambda amount, password: 100 - amount if password == 'hax0r' else 'Incorrect password', 'hax0r', 'secret')(25, 'secret') == 75\", \"assert make_joint(lambda amount, password: 100 - amount if password == 'hax0r' else 'Incorrect password', 'hax0r', ... | {
"split": "train",
"index": 83395,
"acecode_id": "bigcode_python_fns_20862",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given two sets representing the brands of smartphones and televisions. Your task is to write a Python function called `find_unique_brands(phone, tv)` that takes two sets `phone` and `tv` as input and returns a new set containing the brands that are present in the `phone... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_unique_brands({'mi', 'apple'}, {'samsung', 'apple'}) == {'mi'}\", \"assert find_unique_brands({'samsung', 'nokia'}, {'nokia'}) == {'samsung'}\", \"assert find_unique_brands({'a', 'b', 'c'}, {'c', 'd'}) == {'a', 'b'}\", \"assert find_unique_brands({'bran... | {
"split": "train",
"index": 83396,
"acecode_id": "oss_37120",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the behavior of a pipetting robot. The robot has two pipettes, one mounted on the left and the other on the right. Each pipette has a memory that can store its unique identifier and model. Your task is to implement a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert write_to_pipette_memory('left', 'ID001', 'ModelA') == \\\"Successfully wrote identifier 'ID001' and model 'ModelA' to the memory of the left pipette.\\\"\", \"assert write_to_pipette_memory('right', 'ID002', 'ModelB') == \\\"Successfully wrote identifier 'ID... | {
"split": "train",
"index": 83397,
"acecode_id": "oss_25404",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D array of integers 'X' representing a set of data points, a positive integer 'n_clusters' representing the number of clusters, an optional integer 'seed' for random number generation, and a constant 'cste'. Your task is to implement a function 'rand_initialisa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rand_initialisation([[1, 2], [3, 4], [5, 6]], 3, None, 0) in [[[1, 2], [3, 4], [5, 6]], [[3, 4], [1, 2], [5, 6]], [[5, 6], [1, 2], [3, 4]]]\", \"assert rand_initialisation([[1, 2], [3, 4], [5, 6]], 4, None, 0) == []\", \"assert rand_initialisation([[10, 20],... | {
"split": "train",
"index": 83398,
"acecode_id": "bigcode_python_fns_1301",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a 2D numerical array, implement a function that returns the position (row and column index) of the first occurrence of the integer value 3. The search should be conducted row-wise from left to right and top to bottom. If the integer value 3 does not exist in the array, re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_initial_three([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == (0, 2)\", \"assert find_initial_three([[1, 2, 4], [3, 5, 6], [7, 8, 9]]) == (1, 0)\", \"assert find_initial_three([[1, 2, 1], [4, 5, 6], [7, 8, 9]]) == None\", \"assert find_initial_three([[3]]) == (0,... | {
"split": "train",
"index": 83399,
"acecode_id": "evol_23369",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.