data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Given a confusion matrix represented as a 2D list of integers, implement a function that calculates the percentage of correct predictions for each class in the confusion matrix and returns a list of these percentages. The percentage for each class is calculated as the number of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_classwise_accuracy([[50, 2], [1, 47]]) == [96.2, 97.9]\", \"assert calculate_classwise_accuracy([[0, 0], [0, 0]]) == [0.0, 0.0]\", \"assert calculate_classwise_accuracy([[10, 0, 0], [0, 10, 0], [0, 0, 10]]) == [100.0, 100.0, 100.0]\", \"assert calc... | {
"split": "train",
"index": 78900,
"acecode_id": "bigcode_python_fns_49249",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given an array of spherical coordinates represented as a list of tuples, where each tuple contains two elements: the zenith angle (theta) and the azimuthal angle (phi), both in radians. Your task is to convert these spherical coordinates into Horizon coordinates. The co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_horizon_coordinates([(0, 0)]) == [(1.5707963267948966, 6.283185307179586)]\", \"assert get_horizon_coordinates([(1, 0)]) == [(0.5707963267948966, 6.283185307179586)]\", \"assert get_horizon_coordinates([(0, 1)]) == [(1.5707963267948966, 5.283185307179586... | {
"split": "train",
"index": 78901,
"acecode_id": "bigcode_python_fns_20649",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates a list of email addresses. The function should check if each email address in the list is valid based on the following criteria: 1. It must contain exactly one '@' symbol. 2. The domain part (the part after the '@') ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_email_addresses(['test@example.com', 'user@domain.co', 'invalidemail@', '@missinglocalpart.com', 'another.test@domain.com']) == [True, True, False, False, True]\", \"assert validate_email_addresses(['valid.email@domain.com', 'invalid.email@domain', ... | {
"split": "train",
"index": 78902,
"acecode_id": "oss_9430",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of integers and two numerical values, which represent a range. The function should determine all the unique multiples of the integers in the list that lie within the specified range. The inputs can be provided as strings or other non-integer t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_multiples([2], 1, 10) == ([2, 4, 6, 8, 10], 30)\", \"assert find_multiples([1], 1, 5) == ([1, 2, 3, 4, 5], 15)\", \"assert find_multiples([5], 1, 100) == ([5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100], 1050)\", \"asser... | {
"split": "train",
"index": 78903,
"acecode_id": "evol_26988",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings `LR`, where each string represents a range of bus stops in the format 'start:stop'. Your task is to write a function that converts each range into a list of integers representing the individual bus stops within that range and then returns a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_bus_stops([\\\"1:5\\\", \\\"7:9\\\", \\\"12:15\\\"]) == [[1, 2, 3, 4, 5], [7, 8, 9], [12, 13, 14, 15]]\", \"assert convert_bus_stops([\\\"3:3\\\", \\\"4:4\\\", \\\"5:5\\\"]) == [[3], [4], [5]]\", \"assert convert_bus_stops([\\\"0:3\\\", \\\"3:5\\\"])... | {
"split": "train",
"index": 78904,
"acecode_id": "oss_33957",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a Python script file with a specified name and content. The function should take two parameters: 'filename' (a string representing the name of the script file) and 'content' (a string representing the content to be written ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_script('script1', 'print(\\\"Hello, World!\\\")') == '#!/usr/bin/env python\\\\nprint(\\\"Hello, World!\\\")'\", \"assert generate_script('test_script', 'a = 5\\\\nb = 10\\\\nprint(a + b)') == '#!/usr/bin/env python\\\\na = 5\\\\nb = 10\\\\nprint(a ... | {
"split": "train",
"index": 78905,
"acecode_id": "bigcode_python_fns_5660",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers, and your task is to find the maximum product of any two distinct integers in the list. Implement a function called `max_product(nums: List[int]) -> int` that takes in a list of integers `nums` and returns the maximum product of any two distinct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_product([1, 2, 3, 4]) == 12\", \"assert max_product([0, 1, 2, 3]) == 6\", \"assert max_product([5]) == 0\", \"assert max_product([]) == 0\", \"assert max_product([-1, 2]) == -2\", \"assert max_product([10, 20, 30]) == 600\", \"assert max_product([7, -5, ... | {
"split": "train",
"index": 78906,
"acecode_id": "bigcode_python_fns_32347",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that modifies a given string by performing the following operations: \n1. Replace all instances of empty spaces with an underscore symbol. \n2. Replace any occurrence of two or more successive blank spaces with a hyphen. \n3. Convert all words within the st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sophisticated_text_modification('example') == 'EXAMPLE'\", \"assert sophisticated_text_modification('example 1') == 'EXAMPLE_1'\", \"assert sophisticated_text_modification(' example 2') == '_EXAMPLE_2'\", \"assert sophisticated_text_modification(' example ... | {
"split": "train",
"index": 78907,
"acecode_id": "evol_26558",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function that isolates and returns the numerical characters embedded within a provided string, and calculates the sum of all even numbers present in the string. The function should return a tuple containing a list of the numerical characters and the sum of the even numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_and_aggregate_even_numbers('Born in 1980, John has 2 kids and 3 pets. He lives on the 4th floor.') == ([1, 9, 8, 0, 2, 3, 4], 14)\", \"assert extract_and_aggregate_even_numbers('There are 5 apples and 6 oranges.') == ([5, 6], 6)\", \"assert extract_a... | {
"split": "train",
"index": 78908,
"acecode_id": "evol_2219",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a square grid of integers, write a function minPath(grid, k) that returns the smallest k paths starting from the smallest value cell in the grid. A path is defined by the sequence of cell values you visit, and the length of the path must be exactly k. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minPath([[1, 2], [5, 4]], 1) == [[1]]\", \"assert minPath([[1]], 1) == [[1]]\", \"assert minPath([[2, 2], [2, 2]], 1) == [[2]]\", \"assert minPath([[10, 20], [30, 40]], 1) == [[10]]\", \"assert minPath([[0, 1], [1, 0]], 1) == [[0]]\", \"assert minPath([[8, 9... | {
"split": "train",
"index": 78909,
"acecode_id": "evol_22376",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the final price of a product after applying a discount. The function should take two parameters: `original_price` (float): the original price of the product, and `discount_percentage` (float): the percentage of discount to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_final_price(100.0, 10) == 'Com o desconto de 10%: 90.00R$'\", \"assert calculate_final_price(200.0, 25) == 'Com o desconto de 25%: 150.00R$'\", \"assert calculate_final_price(50.0, 50) == 'Com o desconto de 50%: 25.00R$'\", \"assert calculate_final... | {
"split": "train",
"index": 78910,
"acecode_id": "oss_29166",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a distance matrix representing the costs between different points and a specific route. Your task is to implement a function that calculates the total cost of traversing the route based on the provided distance matrix. The function should take in the distance matr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_route_cost([[0, 10, 15, 20], [10, 0, 35, 25], [15, 35, 0, 30], [20, 25, 30, 0]], [0, 1, 2]) == 45\", \"assert calculate_route_cost([[0, 10, 15, 20], [10, 0, 35, 25], [15, 35, 0, 30], [20, 25, 30, 0]], [1, 3, 2]) == 55\", \"assert calculate_route_co... | {
"split": "train",
"index": 78911,
"acecode_id": "evol_18264",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes parameters and calculates their properties based on given input values. The function `calculate_properties` should take in four parameters: \n- `param_list`: A list of numerical parameters to be processed. \n- `mean_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_properties([5, 10, 15], {'param1': 10}, {'param1': 1}, 'mean') == 10.0\", \"assert calculate_properties([2, 4, 6], {'param1': 5}, {'param1': 1}, 'mean') == 4.0\", \"assert calculate_properties([1, 3, 5], {'param1': 1, 'param2': 1, 'param3': 1}, {'p... | {
"split": "train",
"index": 78912,
"acecode_id": "oss_18998",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given the root of a binary tree, return all possible paths from the root to the leaf nodes, where a leaf node is defined as a node with no children. Each path should be represented as a string of node values joined by '->'. Write a function `binaryTreePaths(root)` that takes th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binaryTreePaths(TreeNode(1, TreeNode(2, None, TreeNode(5)), TreeNode(3))) == ['1->2->5', '1->3']\", \"assert binaryTreePaths(TreeNode(1)) == ['1']\", \"assert binaryTreePaths(TreeNode(1, TreeNode(2), TreeNode(3))) == ['1->2', '1->3']\", \"assert binaryTreePa... | {
"split": "train",
"index": 78913,
"acecode_id": "evol_1639",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_even(n: int) -> bool` that determines if a given non-negative integer `n` is even using mutual recursion. You should also implement a corresponding helper function `is_odd(n: int) -> bool` that determines if the integer is odd. The function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_even(0) == True\", \"assert is_even(1) == False\", \"assert is_even(2) == True\", \"assert is_even(3) == False\", \"assert is_even(4) == True\", \"assert is_even(5) == False\", \"assert is_even(6) == True\", \"assert is_even(7) == False\", \"assert is_eve... | {
"split": "train",
"index": 78914,
"acecode_id": "evol_18613",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, you need to implement a function that constructs a Binary Search Tree (BST) from the list. The function should return the root node of the constructed BST. You can assume that the input list contains distinct integers. The BST should be constructed suc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_bst([4, 2, 6, 1, 3, 7, 5]).val == 4\", \"assert construct_bst([4, 2, 6, 1, 3, 7, 5]).left.val == 2\", \"assert construct_bst([4, 2, 6, 1, 3, 7, 5]).right.val == 6\", \"assert construct_bst([4, 2, 6, 1, 3, 7, 5]).left.left.val == 1\", \"assert const... | {
"split": "train",
"index": 78915,
"acecode_id": "bigcode_python_fns_14222",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `contains_substring` that takes in a list of strings and a substring. The function should return a list of booleans where each boolean at index n indicates whether the nth string in the list contains the given substring. The function should efficient... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_substring(['hello', 'world', 'example', 'substring'], 'sub') == [False, False, False, True]\", \"assert contains_substring(['apple', 'banana', 'cherry'], 'na') == [False, True, False]\", \"assert contains_substring(['test', 'testing', 'tester'], 'te... | {
"split": "train",
"index": 78916,
"acecode_id": "evol_9989",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integer scores for multiple comments. Your task is to find the maximum score and the index of the comment that has this score. If there are multiple comments with the same maximum score, return the index of the first occurrence. Implement a function `fin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_score_comment([1, 2, 3, 4, 5]) == (5, 4)\", \"assert find_max_score_comment([5, 3, 2, 1, 5]) == (5, 0)\", \"assert find_max_score_comment([1, 1, 1, 1, 1]) == (1, 0)\", \"assert find_max_score_comment([10, 20, 20, 10]) == (20, 1)\", \"assert find_max... | {
"split": "train",
"index": 78917,
"acecode_id": "bigcode_python_fns_10981",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `s` that contains only the characters '(', ')', '{', '}', '[' and ']'. Write a function `isValid` to determine if the input string is valid. An input string is valid if: 1. Open brackets must be closed by the same type of brackets. 2. Open brackets must b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isValid('()') == True\", \"assert isValid('') == True\", \"assert isValid('()[]{}') == True\", \"assert isValid('{[]}') == True\", \"assert isValid('([{}])') == True\", \"assert isValid('((()))') == True\", \"assert isValid('(()') == False\", \"assert isVali... | {
"split": "train",
"index": 78918,
"acecode_id": "oss_3983",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an array of 5 integers, each ranging from 1 to 10, and sorts the array in descending order without using any built-in sorting functions. The function should return the sorted array.\nPlease reason step by step, then write a self-contained Python ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_descending([1, 5, 2, 9, 3]) == [9, 5, 3, 2, 1]\", \"assert sort_descending([10, 8, 6, 7, 9]) == [10, 9, 8, 7, 6]\", \"assert sort_descending([4, 4, 4, 4, 4]) == [4, 4, 4, 4, 4]\", \"assert sort_descending([1, 1, 1, 1, 10]) == [10, 1, 1, 1, 1]\", \"asser... | {
"split": "train",
"index": 78919,
"acecode_id": "evol_34329",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of behavioral event timestamps and a target alignment value. Your task is to adjust the timestamps based on the provided alignment such that the adjusted timestamps are as close as possible to a set of candidate timestamps. The adjustment should not exceed ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_events([], 0.0, [1.0], 0.0) == []\", \"assert adjust_events([1.0, 2.0], 0.5, [1.0, 2.0], 0.1) == [1.0, 2.0]\", \"assert adjust_events([0.0, 1.0, 2.0], 0.0, [0.0, 1.0, 2.0], 0.0) == [0.0, 1.0, 2.0]\", \"assert adjust_events([1.2, 1.5, 1.8], 0.1, [1.0, ... | {
"split": "train",
"index": 78920,
"acecode_id": "bigcode_python_fns_26237",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `symmetric_difference` that takes two sets as input and returns the symmetric difference of those sets. The symmetric difference of two sets is defined as the set of elements that are in either of the sets but not in their intersection. For example, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert symmetric_difference({1, 2, 3, 5, 7}, {3, 4, 5, 6}) == {1, 2, 4, 6, 7}\", \"assert symmetric_difference({1, 2, 3}, {2, 3, 4}) == {1, 4}\", \"assert symmetric_difference({1, 1, 2}, {2, 3}) == {1, 3}\", \"assert symmetric_difference(set(), {1, 2, 3}) == {1, 2,... | {
"split": "train",
"index": 78921,
"acecode_id": "evol_1327",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function called `get_latest_game_number`. This function will take a list of integers, `game_numbers`, where each integer represents a game number. Your goal is to return the highest game number from the list. If the list is empty, return -1. Imple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_latest_game_number([1, 2, 3, 4, 5]) == 5\", \"assert get_latest_game_number([10, 3, 5, 7]) == 10\", \"assert get_latest_game_number([8, 9, 1]) == 9\", \"assert get_latest_game_number([0]) == 0\", \"assert get_latest_game_number([-1, -5, -3]) == -1\", \"a... | {
"split": "train",
"index": 78922,
"acecode_id": "bigcode_python_fns_30395",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the total experience points (XP) a user has earned based on their profile. Each user has a unique ID and their experience points are stored in a dictionary where the keys are user IDs and the values are their respective XP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_total_xp(1, {1: 100, 2: 150, 3: 200}) == 100\", \"assert get_total_xp(2, {1: 100, 2: 150, 3: 200}) == 150\", \"assert get_total_xp(3, {1: 100, 2: 150, 3: 200}) == 200\", \"assert get_total_xp(4, {1: 100, 2: 150, 3: 200}) == 0\", \"assert get_total_xp(1, ... | {
"split": "train",
"index": 78923,
"acecode_id": "bigcode_python_fns_9708",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of geographical coordinates and returns the coordinates that are closest to a given reference point. The function should accept the following parameters: a list of tuples, where each tuple contains two floats representin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert closest_coordinate([(1.0, 2.0), (2.0, 3.0), (3.0, 4.0)], (1.5, 2.5)) == (1.0, 2.0)\", \"assert closest_coordinate([(0.0, 0.0), (1.0, 1.0)], (0.5, 0.5)) == (0.0, 0.0)\", \"assert closest_coordinate([(1.1, 1.1), (1.2, 1.2)], (1.15, 1.15)) == (1.1, 1.1)\", \"as... | {
"split": "train",
"index": 78924,
"acecode_id": "oss_4425",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `normalize(arr)` that takes a unidimensional numerical array as input and normalizes its elements to support a typical Gaussian distribution. The normalization should be done using a recursive approach to calculate the mean and standard deviation. If the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize([-10, 0, 10]) == [-1.224744871391589, 0.0, 1.224744871391589]\", \"assert normalize([3.5, 4.5, 5.5]) == [-1.224744871391589, 0.0, 1.224744871391589]\", \"assert normalize([100, 200, 300]) == [-1.224744871391589, 0.0, 1.224744871391589]\", \"assert ... | {
"split": "train",
"index": 78925,
"acecode_id": "evol_14047",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given CloudFormation template represented as a string and extracts specific information related to an Amazon EMR (Elastic MapReduce) Studio configuration. Your function should extract the following details: 1. Auth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_emr_studio_config(\\\"auth_mode = 'SSO', default_s3_location = 's3://bucket/studio/', engine_security_group_id = 'sg-12345', name = 'MyStudio', service_role = 'arn:aws:iam::123456789012:role/MyRole'\\\") == {'auth_mode': 'SSO', 'default_s3_location':... | {
"split": "train",
"index": 78926,
"acecode_id": "oss_117",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a job schema validator. A job schema is defined by a name and a list of required fields it must contain. Your goal is to write a function `validate_job_schema(schema_name: str, schema_fields: List[str], data: Dict[str, Any]) -> bool` that takes ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_job_schema('JobSchema1', ['field1', 'field2'], {'field1': 'value1', 'field2': 'value2'}) == True\", \"assert validate_job_schema('JobSchema1', ['field1', 'field2'], {'field1': 'value1'}) == False\", \"assert validate_job_schema('JobSchema1', ['field... | {
"split": "train",
"index": 78927,
"acecode_id": "oss_11182",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists, `indices` and `times`, along with a float `second`, implement a function `sort_and_multiply` that multiplies each element in the `times` list by `second`, and then returns two new lists: `indices` sorted in ascending order and `times` sorted based on the multip... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_and_multiply([3, 1, 2], [5.0, 3.0, 4.0], 2.0) == ([1, 2, 3], [6.0, 8.0, 10.0])\", \"assert sort_and_multiply([0, 1, 2], [1.0, 2.0, 3.0], 1.0) == ([0, 1, 2], [1.0, 2.0, 3.0])\", \"assert sort_and_multiply([], [], 2.0) == ([], [])\", \"assert sort_and_mul... | {
"split": "train",
"index": 78928,
"acecode_id": "oss_20554",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves constraints and properties for a given data type. Write a function `get_constraints_and_properties(data_type_name: str) -> Tuple[List[str], Dict[str, str]]` that takes a string `data_type_name` as input and returns a tuple ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_constraints_and_properties('User') == (['Must be unique', 'Cannot be empty'], {'username': 'String', 'email': 'String'})\", \"assert get_constraints_and_properties('Product') == (['Must have a price', 'Must have a name'], {'name': 'String', 'price': 'Flo... | {
"split": "train",
"index": 78929,
"acecode_id": "oss_26095",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_mac_address(mac: str) -> bool` that checks if a given string `mac` is a valid Media Access Control (MAC) address. A valid MAC address should consist of six groups of two hexadecimal digits (0-9, A-F, a-f), separated by either colons (:) or hyphens (-). ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_mac_address('00:1A:2B:3C:4D:5E') == True\", \"assert is_mac_address('00-1A-2B-3C-4D-5E') == True\", \"assert is_mac_address('00:1A:2B:3C:4D:5G') == False\", \"assert is_mac_address('001A:2B:3C:4D:5E') == False\", \"assert is_mac_address('00:1A:2B:3C:4D') ... | {
"split": "train",
"index": 78930,
"acecode_id": "evol_11533",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a dictionary that describes an optical illusion based on given parameters. The function should take in the strength of the illusion, an array of colors for the rectangles and backgrounds, and an array of RGB values for these colors. If the strengt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_optical_illusion(3, ['red', 'blue', 'white', 'black'], [(255, 0, 0), (0, 0, 255), (255, 255, 255), (0, 0, 0)]) == {'Illusion_Type': 'Congruent', 'Rectangle_Top': 'red', 'Rectangle_Bottom': 'blue', 'Background_Top': 'white', 'Background_Bottom': 'bla... | {
"split": "train",
"index": 78931,
"acecode_id": "oss_4555",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with transforming a 3D point represented by a list of three numbers `[x, y, z]`. Your goal is to implement a function `transform_ajax` that performs a specific transformation on the given 3D point according to the following rules: The x-coordinate should be incre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_ajax([0, 0, 0]) == [6.76, -26.95, 21.571]\", \"assert transform_ajax([5.5, 2.2, -3.3]) == [12.26, -24.75, 18.271]\", \"assert transform_ajax([100, 100, 100]) == [106.76, 73.05, 121.571]\", \"assert transform_ajax([-1, -1, -1]) == [5.76, -27.95, 20.... | {
"split": "train",
"index": 78932,
"acecode_id": "oss_204",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given an array of words, construct a function that calculates the cumulative count of vowels from the array. However, only consider words that meet the following criteria: they must start with a vowel, end with a consonant, have a length of at least 3 characters, not be palindr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vowels(['a', 'e', 'i', 'o', 'u']) == 0\", \"assert count_vowels(['sky', 'fly', 'by']) == 0\", \"assert count_vowels(['banana', 'civic', 'deed']) == 0\", \"assert count_vowels(['hello', 'world']) == 0\", \"assert count_vowels(['aeiou', 'moose', 'racecar... | {
"split": "train",
"index": 78933,
"acecode_id": "evol_21938",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of prices where the ith element represents the price of a rod of length i. You want to cut the rod into pieces such that you maximize the total revenue you can obtain by selling the pieces. Write a function `max_revenue(prices: List[int], n: int) -> int` th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_revenue([1, 5, 8, 9, 10, 17, 17, 20], 8) == 22\", \"assert max_revenue([1, 2, 3, 4, 5], 5) == 5\", \"assert max_revenue([0, 0, 0, 0, 0], 5) == 0\", \"assert max_revenue([3, 5, 8, 9, 10], 3) == 9\", \"assert max_revenue([5, 10, 15, 20], 2) == 10\", \"asse... | {
"split": "train",
"index": 78934,
"acecode_id": "bigcode_python_fns_8404",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `quadratic_roots(a: complex, b: complex, c: complex) -> Tuple[Union[float, complex], Union[float, complex]]` that takes three coefficients of a quadratic equation represented as complex numbers, `a`, `b`, and `c`. The function should calculate and return th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert quadratic_roots(1, -3, 2) == (2.0, 1.0)\", \"assert quadratic_roots(1, 2, 1) == (-1.0, -1.0)\", \"assert quadratic_roots(1, 0, -1) == (1.0, -1.0)\", \"assert quadratic_roots(1, 0, 0) == (0.0, 0.0)\", \"assert quadratic_roots(1, -4, 4) == (2.0, 2.0)\", \"asse... | {
"split": "train",
"index": 78935,
"acecode_id": "evol_27326",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `create_custom_button` that simulates the behavior of a custom button. The function should accept the following parameters: `text` (a string representing the button's text), `icon_path` (a string representing the path to the button's ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_custom_button('Click Me', 'path/to/icon.png', 'TextOnly') == {'text': 'Click Me', 'icon': 'path/to/icon.png', 'style': 'TextOnly'}\", \"assert create_custom_button('Submit', 'path/to/submit_icon.png', 'IconOnly') == {'text': 'Submit', 'icon': 'path/to... | {
"split": "train",
"index": 78936,
"acecode_id": "oss_20979",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of input strings, implement a function that identifies the shortest unique subsequence across all the strings. The function should return the shortest unique subsequence along with its index position within the string it was found. If there are no unique subsequenc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_unique_subsequence(['A', 'B', 'C', 'D']) == ('A', (0, 0))\", \"assert min_unique_subsequence(['HELLO', 'WORLD', 'PYTHON', 'CODE']) == ('H', (0, 0))\", \"assert min_unique_subsequence(['CAT', 'DOG', 'FISH', 'BIRD']) == ('C', (0, 0))\", \"assert min_unique... | {
"split": "train",
"index": 78937,
"acecode_id": "evol_32728",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes in the format of a bounding box and its corresponding parameters to calculate its width, height, and the second set of coordinates. The function should accept the following parameters: format (1 for XYWH, 2 for XYX2Y2), x, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_bounding_box(1, 10, 20, 30, 40) == (30, 40, 40, 60)\", \"assert calculate_bounding_box(2, 10, 20, 50, 60) == (40, 40, 50, 60)\", \"assert calculate_bounding_box(1, 0, 0, 5, 5) == (5, 5, 5, 5)\", \"assert calculate_bounding_box(2, 15, 25, 35, 45) ==... | {
"split": "train",
"index": 78938,
"acecode_id": "oss_29581",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers, n_batch and n_ch, write a function that initializes and returns two lists: the first list should contain n_batch lists, each containing n_ch lists filled with the batch index (which is the corresponding index of the outer list), and the second list should co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert index_initial(2, 3) == ([[[0], [0], [0]], [[1], [1], [1]]], [[[0], [0], [0]], [[1], [1], [1]]])\", \"assert index_initial(3, 2) == ([[[0], [0]], [[1], [1]], [[2], [2]]], [[[0], [0]], [[1], [1]], [[2], [2]]])\", \"assert index_initial(0, 0) == ([], [])\", \"a... | {
"split": "train",
"index": 78939,
"acecode_id": "bigcode_python_fns_13114",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an integer number, write a function named sum_digits that calculates and returns the sum of the absolute value of each of the number's decimal digits. For example, if the input is -123, the output should be 6, as 1 + 2 + 3 = 6. You need to ensure that the function handles... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_digits(123) == 6\", \"assert sum_digits(-123) == 6\", \"assert sum_digits(0) == 0\", \"assert sum_digits(456) == 15\", \"assert sum_digits(-789) == 24\", \"assert sum_digits(1001) == 2\", \"assert sum_digits(-1001) == 2\", \"assert sum_digits(999) == 27\... | {
"split": "train",
"index": 78940,
"acecode_id": "bigcode_python_fns_15952",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the setup of a quantum circuit. The function should take in three parameters: the number of logical qubits (an integer), a parity check matrix (a 2D list of integers), and a list of codewords (a list of strings). The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_quantum_circuit(1, [[1]], ['0', '1'], False) is None\", \"assert setup_quantum_circuit(2, [[1, 0], [0, 1]], ['00', '01', '10', '11'], False) is None\", \"assert setup_quantum_circuit(3, [[1, 0, 0], [0, 1, 0], [0, 0, 1]], ['000', '001', '010', '011', '1... | {
"split": "train",
"index": 78941,
"acecode_id": "bigcode_python_fns_29368",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that filters a list of ratings based on a specified category. The function should take two parameters: a list of ratings, where each rating is a string in the format 'rating,category', and a list of categories to filter by. Your go... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_ratings_by_category(['4.5,food', '3.0,service', '5.0,food'], ['food']) == ['4.5,food', '5.0,food']\", \"assert filter_ratings_by_category(['2.0,service', '3.5,ambiance', '4.0,service'], ['service']) == ['2.0,service', '4.0,service']\", \"assert filter... | {
"split": "train",
"index": 78942,
"acecode_id": "oss_20198",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates contact details for a person, which includes their email address and mobile number. The function should check if the provided email address is in a valid format and if the mobile number consists of exactly 10 digits. If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_contact_details('alicebob@gmail.com', '1234567890') == 'Valid details'\", \"assert validate_contact_details('charlie!delta.com', '1234567890') == 'charlie!delta.com is not a valid email'\", \"assert validate_contact_details('alicebob@gmail.com', 'ab... | {
"split": "train",
"index": 78943,
"acecode_id": "evol_12167",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given three sides of a triangle, determine if the triangle is valid based on the triangle inequality theorem. If the triangle is valid, return its area using Heron's formula. If the triangle is not valid, return 0. Implement the function `triangle_area(side1, side2, side3)`.\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert triangle_area(3, 4, 5) == 6.0\", \"assert triangle_area(1, 1, 2) == 0\", \"assert triangle_area(5, 12, 13) == 30.0\", \"assert triangle_area(6, 8, 10) == 24.0\", \"assert triangle_area(0, 5, 5) == 0\", \"assert triangle_area(9, 12, 15) == 54.0\", \"assert tr... | {
"split": "train",
"index": 78944,
"acecode_id": "evol_15643",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `power(a, b)` that takes two integers `a` and `b`, and returns the result of raising `a` to the power of `b`. The power can be negative, zero, or positive, and the function should handle these cases correctly. If `b` is negative, the function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert power(2, 3) == 8\", \"assert power(2, 0) == 1\", \"assert power(-2, 3) == -8\", \"assert power(-2, 2) == 4\", \"assert power(3, -2) == 1/9\", \"assert power(5, 1) == 5\", \"assert power(10, -1) == 0.1\", \"assert power(0, 5) == 0\", \"assert power(0, 0) == 1... | {
"split": "train",
"index": 78945,
"acecode_id": "bigcode_python_fns_27726",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that logs messages based on a timer's status. Your function should take a boolean parameter `past_due`, which indicates whether the timer is past due. If `past_due` is True, your function should log the message 'The timer is past due!... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_messages(True) == ['The timer is past due!', 'function warm up']\", \"assert log_messages(False) == ['function warm up']\", \"assert log_messages(True) == ['The timer is past due!', 'function warm up']\", \"assert log_messages(False) == ['function warm u... | {
"split": "train",
"index": 78946,
"acecode_id": "oss_22599",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine whether a given user is a power user based on certain criteria. A user is considered a power user if they meet all of the following criteria: 1. The user's role is 'admin'. 2. The user has been active for at least 1 year.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_power_user(User('alice', 'admin', datetime(2022, 1, 1))) == True\", \"assert is_power_user(User('charlie', 'user', datetime(2020, 1, 1))) == False\", \"assert is_power_user(User('david', 'admin', datetime(2020, 1, 1))) == True\", \"assert is_power_user(Us... | {
"split": "train",
"index": 78947,
"acecode_id": "oss_14439",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes two 2D arrays of integers, `main_array` and `control_array`, as input. The function should return a list of strings representing the processed rows of the `main_array`. For each row in the `main_array`, if the corresponding row in the `control_array`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert control_print([[1, 2], [3, 4]], [[0, 1], [0, 1]]) == ['2, 1', '4, 3']\", \"assert control_print([[1, 2], [3, 4]], [[0, 0], [1, 0]]) == ['1, 2', '4, 3']\", \"assert control_print([[1]], [[0]]) == ['1']\", \"assert control_print([[1]], [[1]]) == ['1']\", \"ass... | {
"split": "train",
"index": 78948,
"acecode_id": "evol_6920",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `unique_elements(hmaps: List[Dict], key: str) -> List[Any]` that takes in a list of dictionaries (hash maps) and a string representing a key. The function should return a list of unique values associated with the specified key from the dictionaries. The key... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([{'id': 1, 'name': 'Jane', 'address': {'city': 'NY', 'street': 'ABC'}}, {'id': 2, 'name': 'Jane', 'address': {'city': 'NY', 'street': 'DEF'}}, {'id': 3, 'name': 'Bob', 'address': {'city': 'Chicago', 'street': 'GHI'}}], 'address.city') == ['NY... | {
"split": "train",
"index": 78949,
"acecode_id": "evol_8551",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `send_message(body: str) -> str` that simulates sending a text message. The function should take a string `body` as input, representing the content of the message. The function should return a confirmation message in the format 'Message S... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_message('Hello, World!') == 'Message Sent: Hello, World!'\", \"assert send_message('') == 'Message Sent: '\", \"assert send_message('This is a test message.') == 'Message Sent: This is a test message.'\", \"assert send_message('Python is awesome!') == '... | {
"split": "train",
"index": 78950,
"acecode_id": "bigcode_python_fns_37661",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the total number of valid IP addresses that can be formed using a given string of digits. An IP address consists of four numbers (each ranging from 0 to 255) separated by periods. The input string can contain an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_valid_ip_addresses('0000') == 1\", \"assert count_valid_ip_addresses('1111') == 1\", \"assert count_valid_ip_addresses('010010') == 2\", \"assert count_valid_ip_addresses('101023') == 5\", \"assert count_valid_ip_addresses('123123123123') == 1\", \"ass... | {
"split": "train",
"index": 78951,
"acecode_id": "oss_14120",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given two ordered numerical sequences, implement a function `merge_sequences(seq1, seq2)` that accepts these two sequences as input and returns a unified ordered sequence as output. The output sequence should contain all the elements from both input sequences, sorted in ascendi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sequences([1, 3, 4, 6, 10], [2, 5, 8, 9]) == [1, 2, 3, 4, 5, 6, 8, 9, 10]\", \"assert merge_sequences([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sequences([], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_sequences([1, 2, 3], []) == [1, ... | {
"split": "train",
"index": 78952,
"acecode_id": "evol_28978",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a Modbus response for writing values to registers. The function should take a list of integers as input and return a list of integers representing the values that would be written to the Modbus registers. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modbus_response([1, 2, 3]) == [1, 2, 3]\", \"assert modbus_response([]) == []\", \"assert modbus_response([10, 20, 30]) == [10, 20, 30]\", \"assert modbus_response([-1, -2, -3]) == [-1, -2, -3]\", \"assert modbus_response([100]) == [100]\", \"assert modbus_r... | {
"split": "train",
"index": 78953,
"acecode_id": "oss_36457",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of strings and returns the frequency of each word across all strings. The function should ignore punctuation and be case-insensitive. Additionally, the function should return a dictionary where the keys are the un... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency(['This is a test file.', 'It contains some words.', 'This file is for testing purposes.']) == {'this': 2, 'is': 2, 'file': 2, 'a': 1, 'test': 1, 'it': 1, 'contains': 1, 'some': 1, 'words': 1, 'for': 1, 'testing': 1, 'purposes': 1}\", \"assert ... | {
"split": "train",
"index": 78954,
"acecode_id": "oss_12435",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary that defines various types of lists (words, phrases, nested lists, Cartesian lists, and constants). Your task is to write a function that processes this configuration and returns the appropriate list structure for a given identifier. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_list_structure({'a': {'type': 'words', 'words': ['apple', 'banana']}, 'b': {'type': 'const', 'value': 'test'}, 'c': {'type': 'nested', 'lists': ['a', 'b']}}, 'a') == ['apple', 'banana']\", \"assert create_list_structure({'a': {'type': 'const', 'value'... | {
"split": "train",
"index": 78955,
"acecode_id": "bigcode_python_fns_27742",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the type of player based on their color and certain attributes. The function should take three parameters: a string representing the player's color ('white' or 'black'), a boolean indicating whether the player is a human o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert player_type('black', True, '') == 'Human'\", \"assert player_type('white', True, '') == 'Human'\", \"assert player_type('black', False, 'Random') == 'Random Moves'\", \"assert player_type('white', False, 'Random') == 'Random Moves'\", \"assert player_type('b... | {
"split": "train",
"index": 78956,
"acecode_id": "bigcode_python_fns_43466",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_primes_and_sum(start: int, end: int) -> List[Tuple[int, int]]` that generates a list of all prime numbers between `start` and `end` (inclusive), and for each prime number, calculates the sum of its digits. The function should return a list of tuples, wher... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_primes_and_sum(50, 70) == [(53, 8), (59, 14), (61, 7), (67, 13)]\", \"assert find_primes_and_sum(1, 10) == [(2, 2), (3, 3), (5, 5), (7, 7)]\", \"assert find_primes_and_sum(10, 30) == [(11, 2), (13, 4), (17, 8), (19, 10), (23, 5), (29, 11)]\", \"assert f... | {
"split": "train",
"index": 78957,
"acecode_id": "evol_9108",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the multiplication of two lists of integers element-wise. The function should take two lists of integers, `list_a` and `list_b`, of the same length, and return a new list containing the products of the corresponding ele... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert elementwise_multiply([1, 2, 3], [4, 5, 6]) == [4, 10, 18]\", \"assert elementwise_multiply([0, 1, 2], [5, 4, 3]) == [0, 4, 6]\", \"assert elementwise_multiply([-1, -2, -3], [1, 2, 3]) == [-1, -4, -9]\", \"assert elementwise_multiply([1, 2], [3, 4, 5]) == []\... | {
"split": "train",
"index": 78958,
"acecode_id": "bigcode_python_fns_38735",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of font file names, write a function `reinstall_fonts` that takes a list of font file names as input and returns a new list containing the font file names that would be installed in the system's font directory. The function should ensure that the new list contains ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reinstall_fonts(['font1.ttf', 'font2.otf', 'font1.ttf']) == ['font1.ttf', 'font2.otf']\", \"assert reinstall_fonts(['fontA.ttf', 'fontB.otf', 'fontC.ttf']) == ['fontA.ttf', 'fontB.otf', 'fontC.ttf']\", \"assert reinstall_fonts(['font1.ttf', 'font1.ttf', 'fon... | {
"split": "train",
"index": 78959,
"acecode_id": "bigcode_python_fns_12341",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a document, implement a function that extracts all occurrences of the substring 'kwd-group' from the string and returns a list of these occurrences. If 'kwd-group' does not exist in the string, return an empty list.\nPlease reason step by step, then ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_kwd_group('This is a test of kwd-group extraction. Here is another kwd-group section.') == ['kwd-group', 'kwd-group']\", \"assert extract_kwd_group('No keyword here.') == []\", \"assert extract_kwd_group('kwd-group at the beginning and kwd-group at t... | {
"split": "train",
"index": 78960,
"acecode_id": "bigcode_python_fns_21113",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a log probability calculator for a given grid configuration. The grid consists of cells, and each cell has a probability value indicating the likelihood of that cell being occupied. Your task is to implement a function `calculate_log_probability... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_log_probability([[0.5, 0.5]], (0, 0)) == -0.6931471805599453\", \"assert calculate_log_probability([[0.0]], (0, 0)) == float('-inf')\", \"assert calculate_log_probability([[0.2, 0.3], [0.4, 0.5]], (1, 1)) == -0.6931471805599453\", \"assert calculat... | {
"split": "train",
"index": 78961,
"acecode_id": "oss_30732",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a link to a VK group. Your task is to process this list and categorize the links as either valid or invalid. A link is considered valid if it matches the regex pattern '^https?://vk\\.com/(.+)$' and can be fetched su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_vk_links(['https://vk.com/test_group']) == (['test_group_name'], [])\", \"assert process_vk_links(['https://vk.com/valid_group', 'https://vk.com/another_valid_group']) == (['valid_group_name', 'another_valid_group_name'], [])\", \"assert process_vk_l... | {
"split": "train",
"index": 78962,
"acecode_id": "bigcode_python_fns_33434",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given two integer arrays `nums1` and `nums2` representing the digits of two distinct numbers, and an integer `k`, write a function `max_number(nums1: List[int], nums2: List[int], k: int) -> List[int]` that constructs the largest possible number of length `k` by utilizing the di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_number([3,4,6,5], [9,1,2,5,8,3], 5) == [9,8,6,5,3]\", \"assert max_number([6,7], [6,0,4], 5) == [6,7,6,0,4]\", \"assert max_number([3,9], [8,9], 3) == [9,8,9]\", \"assert max_number([9,8,7], [6,5,4], 6) == [9,8,7,6,5,4]\", \"assert max_number([0,0,0], [0... | {
"split": "train",
"index": 78963,
"acecode_id": "evol_34634",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "In the Milky Way galaxy, there are numerous celestial objects including stars, planets, and moons. Develop a function that takes two string parameters, object1 and object2, along with a string parameter type indicating the kind of celestial objects to be included in the output ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert output_celestial_array('Venus', 'Earth', 'planet') == []\", \"assert output_celestial_array('Saturn', 'Uranus', 'planet') == []\", \"assert output_celestial_array('Mercury', 'Venus', 'planet') == []\", \"assert output_celestial_array('Jupiter', 'Saturn', 'st... | {
"split": "train",
"index": 78964,
"acecode_id": "evol_28135",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are provided with two positive integers n and m (n <= m), and an additional starting number (start). Your task is to determine the sum of all the numbers from n through m (inclusive), starting from the 'start' number. Then convert the sum into a custom base system. The cust... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_all_sums(7, 5, 2, 2) == -1\", \"assert convert_all_sums(1, 1, 0, 2) == '0b1'\", \"assert convert_all_sums(1, 10, 0, 10) == '55'\", \"assert convert_all_sums(8, 10, -1, 2) == -1\", \"assert convert_all_sums(1, 1, -5, 5) == -1\", \"assert convert_all_s... | {
"split": "train",
"index": 78965,
"acecode_id": "evol_3962",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of dominant gases in Mars' atmosphere, implement a function that checks if a given gas is present in the list. The function should take a string as an argument and return True if the gas is present, and False otherwise. The dominant gases on Mars are carbon dioxide... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_gas('carbon dioxide') == True\", \"assert check_gas('argon') == True\", \"assert check_gas('nitrogen') == True\", \"assert check_gas('oxygen') == False\", \"assert check_gas('methane') == False\", \"assert check_gas('helium') == False\", \"assert check... | {
"split": "train",
"index": 78966,
"acecode_id": "evol_5102",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines if a given string contains only unique characters. The function should return True if all characters in the string are unique, and False otherwise. Note that the input string may contain any ASCII characters.\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isUniqueChars2('') == True\", \"assert isUniqueChars2('a') == True\", \"assert isUniqueChars2('abc') == True\", \"assert isUniqueChars2('abcd') == True\", \"assert isUniqueChars2('aabb') == False\", \"assert isUniqueChars2('abcde') == True\", \"assert isUniq... | {
"split": "train",
"index": 78967,
"acecode_id": "evol_35557",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of completions, each represented by a dictionary containing a 'type' key. The 'type' can be one of three strings: 'function', 'instance', or any other string (considered as 'other'). Your task is to implement a function that sorts these completions based on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_completions([{'type': 'function'}, {'type': 'instance'}, {'type': 'other'}]) == [{'type': 'function'}, {'type': 'instance'}, {'type': 'other'}]\", \"assert sort_completions([{'type': 'other'}, {'type': 'function'}, {'type': 'instance'}]) == [{'type': 'f... | {
"split": "train",
"index": 78968,
"acecode_id": "bigcode_python_fns_15673",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the weight of a book represented by a variable 'w', write a function that validates whether the weight of the book falls within the range of 1.2 pounds to 3.5 pounds, inclusive. The function should return True if the weight is within the range and False otherwise.\nPlease... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_book_weight(1.2) == True\", \"assert validate_book_weight(3.5) == True\", \"assert validate_book_weight(2.0) == True\", \"assert validate_book_weight(1.5) == True\", \"assert validate_book_weight(3.0) == True\", \"assert validate_book_weight(1.1) ==... | {
"split": "train",
"index": 78969,
"acecode_id": "evol_23621",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the maximum, minimum, and mean values of a specified numeric column within a given time range. The function should take as input a list of records, where each record is a dictionary containing a 'timestamp' and a numeric ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_max_min_mean([{'timestamp': '2022-01-01 08:00:00', 'value': 10}, {'timestamp': '2022-01-01 09:00:00', 'value': 20}, {'timestamp': '2022-01-01 10:00:00', 'value': 15}, {'timestamp': '2022-01-01 11:00:00', 'value': 25}], '2022-01-01 09:00:00', '2022-01-01 ... | {
"split": "train",
"index": 78970,
"acecode_id": "oss_11696",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that simulates a login process. The function `simulate_login(username: str, password: str) -> str` takes in a username and a password. It checks if the username is 'kivanc' and the password is '1234'. If the credentials are correct, the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_login('kivanc', '1234') == 'access_token_1234'\", \"assert simulate_login('kivanc', 'wrong_password') == 'Invalid credentials'\", \"assert simulate_login('wrong_username', '1234') == 'Invalid credentials'\", \"assert simulate_login('kivanc', '') == ... | {
"split": "train",
"index": 78971,
"acecode_id": "bigcode_python_fns_16138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a rating system for articles in a web application. Your goal is to create a single function `average_rating(ratings: List[Tuple[str, str, int]], article_id: str) -> float` that computes the average rating for a specific article based on a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_rating([('article1', 'user1', 4)], 'article1') == 4.0\", \"assert average_rating([('article2', 'user1', 3), ('article2', 'user2', 5)], 'article2') == 4.0\", \"assert average_rating([('article3', 'user1', 2), ('article3', 'user2', 3), ('article3', 'us... | {
"split": "train",
"index": 78972,
"acecode_id": "oss_31068",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `prime_sequence(n: int) -> List[int]` that generates the first n prime numbers and returns them as a list. For example, if n = 5, the function should return [2, 3, 5, 7, 11].\nPlease reason step by step, then write a self-contained Python solution. Give you... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_sequence(1) == [2]\", \"assert prime_sequence(2) == [2, 3]\", \"assert prime_sequence(3) == [2, 3, 5]\", \"assert prime_sequence(4) == [2, 3, 5, 7]\", \"assert prime_sequence(5) == [2, 3, 5, 7, 11]\", \"assert prime_sequence(6) == [2, 3, 5, 7, 11, 13]\... | {
"split": "train",
"index": 78973,
"acecode_id": "evol_27564",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a multi-dimensional array that can contain integers and nested arrays up to 2 levels deep, implement a function that removes all duplicate elements and returns a flat array containing only unique integers. The input array will never be empty.\nPlease reason step by step, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten([[1, 2, 2], [3, [4, 4, 5]]]) == [1, 2, 3, 4, 5]\", \"assert flatten([[1], [1], [1]]) == [1]\", \"assert flatten([[10, 20, [10, 30]], [20, 40]]) == [10, 20, 30, 40]\", \"assert flatten([[1, 1], [1, 1, [1]]]) == [1]\", \"assert flatten([]) == []\", \"a... | {
"split": "train",
"index": 78974,
"acecode_id": "evol_33985",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total discount for a group of children attending an event based on the number of children in the group. The discount rates are defined as follows: for 2 children, there is a 10% discount; for 3 children, there is a 15% discount; for 4 childre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_discount(2) == 10\", \"assert calculate_discount(3) == 15\", \"assert calculate_discount(4) == 18\", \"assert calculate_discount(5) == 19\", \"assert calculate_discount(6) == 20\", \"assert calculate_discount(7) == 21\", \"assert calculate_discount... | {
"split": "train",
"index": 78975,
"acecode_id": "oss_15930",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that simulates the logout process for a user in a web application. The function, `logout_user()`, is assumed to handle the backend logic for logging out a user. Your task is to implement a function `logout()` that calls this `logout_user()` function and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert logout() == 'User has been logged out successfully.'\", \"assert logout() == 'User has been logged out successfully.'\", \"assert logout() == 'User has been logged out successfully.'\", \"assert logout() == 'User has been logged out successfully.'\", \"asser... | {
"split": "train",
"index": 78976,
"acecode_id": "bigcode_python_fns_28477",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts two lists and a boolean switch. If the switch is 'True', the function should return the indices of all occurrences of elements from the second list that are found in the first list, in the order of their appearance in the second list. If the sw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_indices([1, 2, 3, 2, 1], [1, 2], True) == [0, 4, 1, 3]\", \"assert find_indices([1, 2, 3, 2, 1], [1, 2], False) == [0, 1]\", \"assert find_indices([10, 20, 30, 40, 20, 10], [20, 30], False) == [1, 2]\", \"assert find_indices([], [1, 2, 3], True) == []\"... | {
"split": "train",
"index": 78977,
"acecode_id": "evol_4867",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing setpoints for a device that can only achieve values in the range of 0 to 300. Your task is to implement a function `check_setpoints(setpoints: List[int]) -> List[bool]` that returns a list of boolean values indicating whether each s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_setpoints([0, 100, 200, 300]) == [True, True, True, True]\", \"assert check_setpoints([100, 250, -100, 400]) == [True, True, False, False]\", \"assert check_setpoints([50, 75, 125, 200]) == [True, True, True, True]\", \"assert check_setpoints([0, 1, 29... | {
"split": "train",
"index": 78978,
"acecode_id": "bigcode_python_fns_3754",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that removes the last element from the list and returns the modified list. The function should handle lists containing up to 10^6 elements efficiently. If the list is empty, return an empty list.\nPlease rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_last_item([1, 2, 3, 4]) == [1, 2, 3]\", \"assert remove_last_item([5]) == []\", \"assert remove_last_item([]) == []\", \"assert remove_last_item([10, 20, 30, 40, 50]) == [10, 20, 30, 40]\", \"assert remove_last_item([100, 200, 300]) == [100, 200]\", \... | {
"split": "train",
"index": 78979,
"acecode_id": "evol_2941",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing audio sample values from an audio file. Your task is to implement a function that computes the harmonic and percussive components of the audio signal. The harmonic component is the sum of the even-indexed values, while the percussiv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_harmonic_percussive([1, 2, 3, 4, 5]) == {'harmonic': 9, 'percussive': 6}\", \"assert compute_harmonic_percussive([0, 0, 0, 0]) == {'harmonic': 0, 'percussive': 0}\", \"assert compute_harmonic_percussive([10, 20, 30, 40, 50]) == {'harmonic': 90, 'perc... | {
"split": "train",
"index": 78980,
"acecode_id": "bigcode_python_fns_10820",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that verifies if a given string is a valid palindrome, considering only alphanumeric characters and ignoring case sensitivity. A palindrome is a word, phrase, number, or other sequences of characters that reads the same forward and ba... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('race a car') == False\", \"assert is_palindrome(' ') == True\", \"assert is_palindrome('0P') == False\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_pa... | {
"split": "train",
"index": 78981,
"acecode_id": "oss_6182",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string representing the name of a job and returns a dictionary containing the count of days for each unique job type that has been recorded in a predefined list. The list of recorded jobs is fixed and consists of the followin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_job_days('Engineer') == {'Engineer': 1, 'Manager': 0, 'Intern': 0, 'Technician': 0, 'Clerk': 0}\", \"assert count_job_days('Manager') == {'Engineer': 0, 'Manager': 1, 'Intern': 0, 'Technician': 0, 'Clerk': 0}\", \"assert count_job_days('Intern') == {'E... | {
"split": "train",
"index": 78982,
"acecode_id": "bigcode_python_fns_37058",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple financial transaction request. The function should accept two parameters: a dictionary representing query parameters and a string representing an authentication token. The function should return a simulated res... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_financial_transaction({}, '') == 'Authentication required.'\", \"assert simulate_financial_transaction({}, 'token123') == 'No query parameters provided.'\", \"assert simulate_financial_transaction({'amount': 100}, '') == 'Authentication required.'\"... | {
"split": "train",
"index": 78983,
"acecode_id": "oss_9399",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `set_default_sale_order_template_id_if_empty(sale_order_template_id: Optional[str]) -> str` that checks if the given `sale_order_template_id` is empty (None or an empty string). If it is empty, the function should return a default sal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_default_sale_order_template_id_if_empty(None) == 'default_sale_order_template_id'\", \"assert set_default_sale_order_template_id_if_empty('') == 'default_sale_order_template_id'\", \"assert set_default_sale_order_template_id_if_empty('template_123') == '... | {
"split": "train",
"index": 78984,
"acecode_id": "oss_24915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `circular_queue_operations(operations: List[Tuple[str, int]]) -> List[Union[bool, int]]` that simulates a circular queue based on a list of operations. The operations are provided as a list of tuples where each tuple consists of an operation name (a string)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert circular_queue_operations([('init', 1), ('enQueue', 5), ('Front', 0), ('Rear', 0), ('deQueue', 0), ('isEmpty', 0)]) == [True, 5, 5, True, True]\", \"assert circular_queue_operations([('init', 0), ('enQueue', 1)]) == [False]\", \"assert circular_queue_operati... | {
"split": "train",
"index": 78985,
"acecode_id": "oss_11214",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a user authentication process. Your function should prompt the user for a username and a password, then authenticate the user based on predefined credentials. If the authentication is successful, return a message ind... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_user('wrong_user', 'wrong_password') == 'Authentication failed'\", \"assert authenticate_user('admin', 'wrong_password') == 'Authentication failed'\", \"assert authenticate_user('wrong_user', 'password123') == 'Authentication failed'\", \"assert... | {
"split": "train",
"index": 78986,
"acecode_id": "oss_36772",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with optimizing a scheduling problem based on a set of constraints that define task durations and resource availability. Your goal is to create a Python function that generates an optimized schedule by utilizing a series of heuristics. The function should take a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_optimized_schedule({'task_durations': [2, 3, 1], 'resources': 2}) == [2, 0, 1]\", \"assert generate_optimized_schedule({'task_durations': [1, 2, 3], 'resources': 1}) == [0, 1, 2]\", \"assert generate_optimized_schedule({'task_durations': [5, 3, 2], ... | {
"split": "train",
"index": 78987,
"acecode_id": "oss_29620",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that may contain pinyin notations enclosed in square brackets. Your task is to find all occurrences of pinyin notations in the format 'CC-CEDICT' (e.g., '[pin1 yin1]') and replace them with their correct pinyin representation. The correct pinyin represent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bracketpy('Hello [pin1 yin1] World') == 'Hello p\\u012bny\\u012bn World'\", \"assert bracketpy('Test [zhong1 guo2] example') == 'Test zh\\u014dnggu\\u00f3 example'\", \"assert bracketpy('No pinyin here') == 'No pinyin here'\", \"assert bracketpy('Just text w... | {
"split": "train",
"index": 78988,
"acecode_id": "bigcode_python_fns_18205",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes an array of strings and concatenates them into a single string, separating each string with a space. The function should return the concatenated string. For example, given the input array ['hello', 'world'], the output should be 'hello world'.\nPleas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate(['hello', 'world']) == 'hello world'\", \"assert concatenate(['this', 'is', 'a', 'test']) == 'this is a test'\", \"assert concatenate(['python', 'is', 'fun']) == 'python is fun'\", \"assert concatenate(['concatenate', 'these', 'words']) == 'conca... | {
"split": "train",
"index": 78989,
"acecode_id": "evol_33963",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers: `sample_counts` and `expected_counts`. Your task is to implement a function `chi_square_test(sample_counts: List[int], expected_counts: List[int], delta_degrees_of_freedom: int) -> Tuple[float, float, int]` that calculates the chi-square tes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert chi_square_test([5, 5, 5], [5, 5, 5], 1) == (0.0, 1.0, 3)\", \"assert chi_square_test([20, 30, 50], [25, 25, 50], 2) == (2.0, -1.0, 3)\", \"assert chi_square_test([4, 4, 4, 4], [4, 4, 4, 4], 1) == (0.0, 1.0, 4)\", \"assert chi_square_test([5, 10, 15], [10, 1... | {
"split": "train",
"index": 78990,
"acecode_id": "bigcode_python_fns_34490",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Define a Python function named 'calculateDifferences' that processes a list of integers called 'numbers'. The function should compute the difference between every pair of consecutive numbers in the list. If the list contains less than two elements, the function should return an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculateDifferences([1, 2, 3]) == [1, 1]\", \"assert calculateDifferences([2, 5, 9, 16]) == [3, 4, 7]\", \"assert calculateDifferences([10, 15, 20]) == [5, 5]\", \"assert calculateDifferences([5]) == []\", \"assert calculateDifferences([]) == []\", \"assert... | {
"split": "train",
"index": 78991,
"acecode_id": "evol_6091",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two lists of numbers and their corresponding weights as inputs. The first list is a list of numbers and the second one contains their weights. Calculate the weighted standard deviation of these numbers without using any built-in functions for cal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert weighted_std_dev([1, 2, 3], [1, 1, 1]) == 0.816496580927726\", \"assert weighted_std_dev([1, 2, 3, 4], [1, 1, 1, 1]) == 1.118033988749895\", \"assert weighted_std_dev([5, 10], [0.5, 0.5]) == 2.5\", \"assert weighted_std_dev([1, 1, 1, 1], [1, 1, 1, 1]) == 0.0... | {
"split": "train",
"index": 78992,
"acecode_id": "evol_8557",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing file paths and a search prefix. Your task is to implement a function `filter_paths(file_paths: List[str], search_prefix: str) -> List[str]` that filters the provided list of file paths, returning only those that contain the specified... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_paths(['folder1/file1.txt', 'folder2/file2.txt', 'folder3/file3.txt'], 'folder1') == ['folder1/file1.txt']\", \"assert filter_paths(['folder1/file1.txt', 'folder2/file2.txt', 'folder3/file3.txt'], 'folder2') == ['folder2/file2.txt']\", \"assert filter... | {
"split": "train",
"index": 78993,
"acecode_id": "bigcode_python_fns_37770",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `interchange_integers(x: int, y: int) -> Tuple[int, int]` that takes two unique integers as input and returns a tuple with their values swapped without using a third temporary variable. The function should raise a ValueError if either input is not an integer. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert interchange_integers(10, 20) == (20, 10)\", \"assert interchange_integers(-5, 15) == (15, -5)\", \"assert interchange_integers(0, 100) == (100, 0)\", \"assert interchange_integers(1, -1) == (-1, 1)\", \"assert interchange_integers(42, 84) == (84, 42)\", \"as... | {
"split": "train",
"index": 78994,
"acecode_id": "evol_35758",
"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 only the even integers from the original list in the same order they appeared. Write a Python function `filter_even_numbers(numbers)` that takes in one parameter: - `numb... | 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([1, 3, 5]) == []\", \"assert filter_even_numbers([2, 4, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([-2,... | {
"split": "train",
"index": 78995,
"acecode_id": "oss_36380",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `below_zero(operations: List[Tuple[str, int]], case_insensitive: bool = False) -> bool:` that detects if a bank account balance falls below zero after performing a series of deposit and withdrawal operations. The account starts with a zero balance. The inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_zero([('Deposit', 1), ('Deposit', 2), ('Withdrawal', 4), ('Deposit', 5)]) == True\", \"assert below_zero([('Deposit', 1), ('Deposit', 2), ('withdrawal', 3)], True) == True\", \"assert below_zero([('Deposit', 10), ('Withdrawal', 15)]) == True\", \"asser... | {
"split": "train",
"index": 78996,
"acecode_id": "evol_28226",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `vector_magnitude(x: int, y: int, z: int) -> float` that computes the magnitude of a vector in three-dimensional space given its components (x, y, z). The magnitude of a vector is calculated using the formula: √(x² + y² + z²).\nPlease reason step by step, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert vector_magnitude(1, 2, 3) == 3.7416573867739413\", \"assert vector_magnitude(0, 0, 0) == 0.0\", \"assert vector_magnitude(3, 4, 0) == 5.0\", \"assert vector_magnitude(-1, -2, -2) == 3.0\", \"assert vector_magnitude(1, 1, 1) == 1.7320508075688772\", \"assert ... | {
"split": "train",
"index": 78997,
"acecode_id": "evol_18345",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `create_vrt_string` that generates a VRT (Virtual Dataset) string for a raster dataset based on given parameters. The function should take the following parameters: \n\n1. `raster_x_size` (int): The width of the raster dataset.\n2. `raste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_vrt_string(1024, 768, 'EPSG:4326', '0, 30, 0, 0, 0, -30', 'Float32', 'nearest', '-9999') == '<VRTDataset rasterXSize=\\\"1024\\\" rasterYSize=\\\"768\\\"><SRS dataAxisToSRSAxisMapping=\\\"1,2\\\">EPSG:4326</SRS><GeoTransform>0, 30, 0, 0, 0, -30</GeoTr... | {
"split": "train",
"index": 78998,
"acecode_id": "bigcode_python_fns_29936",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that represents a game character's attributes for modifications (mods). Each mod has three attributes: protection, speed, and tenacity, which are represented by integers. The function should take three integer parameters, `protection_roll... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_mod(1, 2, 3) == {'protection_roll': 1, 'speed_roll': 2, 'tenacity_roll': 3}\", \"assert create_mod(0, 0, 0) == {'protection_roll': 0, 'speed_roll': 0, 'tenacity_roll': 0}\", \"assert create_mod(-1, -2, -3) == {'protection_roll': -1, 'speed_roll': -2, ... | {
"split": "train",
"index": 78999,
"acecode_id": "oss_12152",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.