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": "Write a function called `find_smallest_integer` that takes a list of integers as an argument and returns the smallest positive integer greater than 0 that is not present in the list. For example, given the input list [2, 3, 7, 8, 10], the function should return 1, as it is the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_smallest_integer([2, 3, 7, 8, 10]) == 1\", \"assert find_smallest_integer([1, 2, 3, 4]) == 5\", \"assert find_smallest_integer([5, 6, 7, 8, 9]) == 1\", \"assert find_smallest_integer([1, 2, 3, 5]) == 4\", \"assert find_smallest_integer([1, 1, 1, 1]) == ...
{ "split": "train", "index": 65200, "acecode_id": "evol_22898", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a grid layout representation of a specified number of images. The function accepts a list of image file names and an integer representing the number of images to display per row. The output should be a list of lists,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_image_grid(['car1.jpg', 'car2.jpg', 'car3.jpg', 'car4.jpg', 'car5.jpg'], 3) == [['car1.jpg', 'car2.jpg', 'car3.jpg'], ['car4.jpg', 'car5.jpg']]\", \"assert generate_image_grid(['car1.jpg', 'car2.jpg', 'car3.jpg'], 2) == [['car1.jpg', 'car2.jpg'], ['...
{ "split": "train", "index": 65201, "acecode_id": "oss_21296", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function 'calculate_area' that takes three positive integers representing the lengths of the sides of a triangle and returns the area of the triangle using Heron's formula. The lengths are guaranteed to form a valid triangle.\nPlease reason step by step, then write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_area(3, 4, 5) == 6.0\", \"assert calculate_area(5, 12, 13) == 30.0\", \"assert calculate_area(8, 15, 17) == 60.0\", \"assert calculate_area(7, 24, 25) == 84.0\", \"assert calculate_area(10, 10, 10) == 43.30127018922193\", \"assert calculate_area(6,...
{ "split": "train", "index": 65202, "acecode_id": "evol_4227", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_student(name: str, age: int, course: str, GPA: float) -> dict` that creates a student record with the provided `name`, `age`, `course`, and `GPA`. Ensure that the GPA is valid, meaning it must be between 0.0 and 4.0, inclusive. If the GPA is invalid...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_student('Alice', 20, 'Mathematics', 3.5) == {'name': 'Alice', 'age': 20, 'course': 'Mathematics', 'GPA': 3.5}\", \"assert create_student('Bob', 21, 'Physics', 4.0) == {'name': 'Bob', 'age': 21, 'course': 'Physics', 'GPA': 4.0}\", \"assert create_stude...
{ "split": "train", "index": 65203, "acecode_id": "evol_735", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named 'count_significant_nums' that takes a list of integers as input. The function should return the count of integers for which the sum of their signed digits (considering a negative sign for negative integers) is greater than zero and divisible by 4. A s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_significant_nums([]) == 0\", \"assert count_significant_nums([1, 1, 2]) == 0\", \"assert count_significant_nums([3, 7, 11]) == 0\", \"assert count_significant_nums([-3, -7, -11]) == 0\", \"assert count_significant_nums([-5, 5]) == 0\", \"assert count_s...
{ "split": "train", "index": 65204, "acecode_id": "evol_10377", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a target integer. Your task is to determine if any two distinct integers in the list add up to the target integer. Write a function `check_pair_sum(nums: List[int], target: int) -> bool` that takes in the list of integers `nums` and the inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_pair_sum([1, 2, 3, 4, 5], 9) == True\", \"assert check_pair_sum([1, 2, 3, 4, 5], 10) == False\", \"assert check_pair_sum([0, -1, 2, -3, 1], -2) == True\", \"assert check_pair_sum([1, 2, 3, 4, 5], 0) == False\", \"assert check_pair_sum([1, 1, 2, 3], 4) ...
{ "split": "train", "index": 65205, "acecode_id": "bigcode_python_fns_45740", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `broadcast_messages(clients: List[Tuple[str, int]], messages: List[str]) -> List[str]` that simulates a simple chat server where messages are broadcasted from one client to all other connected clients. The function should take two parameters: a list of tupl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert broadcast_messages([('localhost', 9991)], ['Single message']) == []\", \"assert broadcast_messages([], ['No clients']) == []\", \"assert broadcast_messages([('localhost', 9991)], ['Only one client']) == []\", \"assert broadcast_messages([('localhost', 5000),...
{ "split": "train", "index": 65206, "acecode_id": "oss_17766", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given two timestamps in the form of datetime strings. Your task is to write a function called `calculate_duration` that takes two datetime strings as input and returns the duration in seconds between the two timestamps. The timestamps are guaranteed to be in the ISO 860...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_duration('2022-01-01T12:00:00', '2022-01-01T12:00:10') == 10\", \"assert calculate_duration('2022-01-01T12:00:00', '2022-01-01T12:05:00') == 300\", \"assert calculate_duration('2022-01-01T00:00:00', '2022-01-01T00:01:30') == 90\", \"assert calculat...
{ "split": "train", "index": 65207, "acecode_id": "oss_18392", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function to extract the innermost values between parentheses from a string. The function should handle nested parentheses correctly and return a list of all innermost values found in the input string. If no innermost values are found, return an empty list. For example, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_parentheses('no parentheses') == []\", \"assert extract_parentheses('()') == []\", \"assert extract_parentheses('a()b') == []\", \"assert extract_parentheses('(a)b(c)') == ['a', 'c']\", \"assert extract_parentheses('((((x))))') == ['x']\", \"assert e...
{ "split": "train", "index": 65208, "acecode_id": "evol_20606", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with validating a set of gene IDs associated with specific diseases. Implement a function named `validate_gene_ids_for_disease(disease: str, gene_ids: List[str]) -> bool` that takes a disease name as a string and a list of gene IDs as input. The function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_gene_ids_for_disease('cancer', ['gene1', 'gene2']) == True\", \"assert validate_gene_ids_for_disease('cancer', ['gene1', 'gene4']) == False\", \"assert validate_gene_ids_for_disease('cancer', ['gene3']) == True\", \"assert validate_gene_ids_for_dise...
{ "split": "train", "index": 65209, "acecode_id": "oss_10993", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with designing a class that manages a collection of comments for a discussion forum. Each comment must have a unique identifier, the text of the comment, the timestamp when it was created, and the author's username. Your goal is to create a function that will acc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_comments([(1, 'Great post!', '2023-01-01 12:00:00', 'user1'), (2, 'Thanks for sharing!', '2023-01-02 14:30:00', 'user2')]) == [{'id': 1, 'text': 'Great post!', 'timestamp': '2023-01-01 12:00:00', 'author': 'user1'}, {'id': 2, 'text': 'Thanks for shari...
{ "split": "train", "index": 65210, "acecode_id": "oss_872", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a binary tree represented as a string in level order traversal format, where each node contains an integer value and 'null' denotes a null node. Write a function that takes this binary tree string and a target sum as inputs, and returns the number of paths in the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pathSum('[10,5,-3,3,2,null,11,3,-2,null,1]', 8) == 3\", \"assert pathSum('[1,2,3,null,null,4,5]', 7) == 1\", \"assert pathSum('[1,1,1,1,1,null,null]', 2) == 4\", \"assert pathSum('[1,2,3]', 5) == 0\", \"assert pathSum('[3,9,20,null,null,15,7]', 30) == 1\", \...
{ "split": "train", "index": 65211, "acecode_id": "oss_19228", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Craft a function that sorts an array of positive integers based on the length of their binary representations, from smallest to largest. If multiple integers have the same binary length, use their decimal values as a tie-breaker. Implement a function named `sort_by_binary_len(a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_by_binary_len([1, 31, 15, 2, 7]) == [1, 2, 7, 15, 31]\", \"assert sort_by_binary_len([14, 58, 39, 41, 61]) == [14, 39, 41, 58, 61]\", \"assert sort_by_binary_len([1, 0, 2, 3, 4]) == [0, 1, 2, 3, 4]\", \"assert sort_by_binary_len([3, 5, 7, 11, 13]) == [3...
{ "split": "train", "index": 65212, "acecode_id": "evol_12833", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tuples representing terms in a quadratic expression, where each tuple contains a coefficient and two variables (var1, var2), implement a function to determine the convexity of the quadratic expression. The function should return 'Convex' if the expression is con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_convexity([(1, 0, 0), (2, 1, 1)], 2) == 'Convex'\", \"assert determine_convexity([(4, 0, 0), (1, 1, 1), (0.5, 0, 1)], 2) == 'Convex'\", \"assert determine_convexity([(2, 0, 0)], 1) == 'Convex'\", \"assert determine_convexity([(1, 0, 0), (1, 1, 1), ...
{ "split": "train", "index": 65213, "acecode_id": "bigcode_python_fns_34601", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function called `below_zero` that receives a chronological list of bank account transactions performed on an account with zero initial balance. The transactions are represented as a list of tuples, where each tuple consists of a transaction type (either 'Deposit' or...
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([('Withdrawal', 1), ('Withdrawal', 1)]) == True\", \"asse...
{ "split": "train", "index": 65214, "acecode_id": "evol_19723", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `sum_of_evens` that returns the sum of all even numbers in the list. If there are no even numbers, return 0. The function should take a single parameter `numbers`, which is a list of integers. For example, if the input list is [1, 2, 3...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4]) == 6\", \"assert sum_of_evens([0, 1, 2, 3]) == 2\", \"assert sum_of_evens([5, 7, 9]) == 0\", \"assert sum_of_evens([10, 20, 30]) == 60\", \"assert sum_of_evens([-2, -4, 5]) == -6\", \"assert sum_of_evens([-1, -3, -5]) == 0\", \"ass...
{ "split": "train", "index": 65215, "acecode_id": "bigcode_python_fns_48409", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a Markdown document. Your task is to check if the document contains atx headings (i.e., headings that start with one or more '#' characters) that are well-spaced, meaning there should be at least one empty line before and after each atx headi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_well_spaced_headings('# Heading 1\\\\nSome text\\\\n## Heading 2') == False\", \"assert is_well_spaced_headings('# Heading 1\\\\n\\\\n\\\\n## Heading 2') == False\", \"assert is_well_spaced_headings('Some text\\\\n\\\\n# Heading 1\\\\n\\\\nSome text\\\\n\...
{ "split": "train", "index": 65216, "acecode_id": "bigcode_python_fns_42112", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a logging system for an application. The system should generate a log file name based on the current timestamp if a log file name is not provided. The log file name should be in the format 'log_YYYY-MM-DD_HH-MM-SS.log'. Additionally, if a report fil...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_file_names(log_file='log.txt', report_file='report.txt') == ('log.txt', 'report.txt')\", \"assert create_file_names('log.log', 'report.html') == ('log.log', 'report.html')\", \"assert create_file_names('log.txt', 'report.html') == ('log.txt', 'report....
{ "split": "train", "index": 65217, "acecode_id": "bigcode_python_fns_28503", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a function `vowel_lowercase(phrase: str) -> Tuple[str, int]` that takes a string `phrase` as input and returns a tuple containing a new string where every letter that directly follows a vowel (a, e, i, o, u) is converted to lowercase, and an integer representing the total...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert vowel_lowercase('Python is fun') == ('Python is fun', 3)\", \"assert vowel_lowercase('AEIOU') == ('AEIOU', 5)\", \"assert vowel_lowercase('') == ('', 0)\", \"assert vowel_lowercase('cOdIng') == ('cOdIng', 2)\", \"assert vowel_lowercase('A B C D E') == ('A B ...
{ "split": "train", "index": 65218, "acecode_id": "evol_15209", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a list of integers representing dates in the format YYYYMMDD, and a list of time ranges represented as strings (e.g., '20230101-20230131'), return a boolean array indicating whether each date in the input list falls within any of the specified time ranges. The time ranges...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert date_match([20230115, 20230201, 20230301], ['20230101-20230131', '20230201-20230228']) == [True, True, False]\", \"assert date_match([20230101, 20230131, 20230215], ['20230101-20230131']) == [True, True, False]\", \"assert date_match([20230201, 20230228, 202...
{ "split": "train", "index": 65219, "acecode_id": "bigcode_python_fns_37105", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of platform IDs and a dictionary that maps platform IDs to satellite names, implement a function that returns a list of satellite names corresponding to the provided platform IDs. If a provided platform ID does not exist in the dictionary, raise an exception with t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_satellite_names(['1', '2'], {'1': 'Satellite A', '2': 'Satellite B'}) == ['Satellite A', 'Satellite B']\", \"assert get_satellite_names([], {'1': 'Satellite A'}) == []\", \"assert get_satellite_names(['1'], {'1': 'Satellite A'}) == ['Satellite A']\", \"a...
{ "split": "train", "index": 65220, "acecode_id": "bigcode_python_fns_33599", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a string that contains JavaScript code, which may include unnecessary whitespace and formatting that can be optimized. Write a function `minify_js_code(code: str) -> str` that takes a string representing JavaScript code and removes all unnecessary whitespace, ensu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minify_js_code('function test() { return 42; }') == 'function test(){return 42;}'\", \"assert minify_js_code('let x = 1; let y = 2; let z = x + y;') == 'let x=1;let y=2;let z=x+y;'\", \"assert minify_js_code('var a = 5; var b = 10; console.log(a ...
{ "split": "train", "index": 65221, "acecode_id": "bigcode_python_fns_37539", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a string `s` consisting of lowercase letters. Your task is to write a function to find the minimum number of cuts needed to partition the string into substrings such that each substring is a palindrome. A palindrome is a string that reads the same forwards and bac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minPalindromeCuts('a') == 0\", \"assert minPalindromeCuts('ab') == 1\", \"assert minPalindromeCuts('aaa') == 0\", \"assert minPalindromeCuts('aab') == 1\", \"assert minPalindromeCuts('racecar') == 0\", \"assert minPalindromeCuts('abccba') == 0\", \"assert mi...
{ "split": "train", "index": 65222, "acecode_id": "oss_9747", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that processes a string containing space-separated characters, including uppercase and lowercase letters, numbers, and punctuation marks. The function should return a dictionary of the character(s) with the highest frequency (in lowercase for letters) and t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_histogram('A B c 1 @') == {'a': 1, 'b': 1, 'c': 1, '1': 1, '@': 1}\", \"assert advanced_histogram('A b C a B 1 2 2') == {'a': 2, 'b': 2, '2': 2}\", \"assert advanced_histogram('B B B b A ! ! ! !') == {'b': 4, '!': 4}\", \"assert advanced_histogram('...
{ "split": "train", "index": 65223, "acecode_id": "evol_14318", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts hyperlinks from a given Markdown string. The function should identify hyperlinks formatted as `[link text](URL)` and return a dictionary where the keys are the link texts and the values are the corresponding URLs. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_links('[Google](https://www.google.com)') == {'Google': 'https://www.google.com'}\", \"assert extract_links('[OpenAI](https://www.openai.com) and [GitHub](https://github.com)') == {'OpenAI': 'https://www.openai.com', 'GitHub': 'https://github.com'}\"...
{ "split": "train", "index": 65224, "acecode_id": "oss_12316", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of authors and a venue, implement a function that counts the number of unique authors who have published in that venue. The function should take in two parameters: a list of strings 'authors', where each string represents an author's name, and a string 'venue' repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_authors(['Alice', 'Bob', 'Alice', 'Charlie'], 'Conference') == 3\", \"assert count_unique_authors(['Alice', 'Bob', 'Charlie', 'Alice', 'Bob'], 'Journal') == 3\", \"assert count_unique_authors(['Alice', 'Alice', 'Alice'], 'Journal') == 1\", \"ass...
{ "split": "train", "index": 65225, "acecode_id": "bigcode_python_fns_40406", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `read_object_data(object_id: str, pin: str) -> str` that retrieves the data of a PIV object based on its object ID. The function should take two parameters: a string `object_id` representing the ID of the PIV object in hexadecimal format, and a string `pin`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert read_object_data('1A2B', '1234') == 'Sample Data for 1A2B'\", \"assert read_object_data('5F6A', '5678') == 'Sample Data for 5F6A'\", \"assert read_object_data('9C8D', '0000') == 'No data found.'\", \"assert read_object_data('FFFF', '9999') == 'No data found....
{ "split": "train", "index": 65226, "acecode_id": "bigcode_python_fns_2938", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `check_sequence(seq: str) -> bool` that checks if the input string `seq` contains a sequence of alternating lowercase letters and special characters. The sequence should start and end with a lowercase letter and can contain any special character (non-alphan...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_sequence('a#b$d') == True\", \"assert check_sequence('p&y*z') == True\", \"assert check_sequence('a!b@c#') == True\", \"assert check_sequence('x&y') == True\", \"assert check_sequence('k$l#m%n') == True\", \"assert check_sequence('a2b$c') == False\", \...
{ "split": "train", "index": 65227, "acecode_id": "evol_6733", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the control of a laser using a function. Your goal is to implement a function called `turn_off_laser` that takes a pin state (represented as an integer) and returns the new state of the laser after turning it off. The laser is considered on when t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert turn_off_laser(0) == 1\", \"assert turn_off_laser(1) == 1\", \"assert turn_off_laser(0) == 1\", \"assert turn_off_laser(1) == 1\", \"assert turn_off_laser(0) == 1\", \"assert turn_off_laser(1) == 1\", \"assert turn_off_laser(0) == 1\", \"assert turn_off_lase...
{ "split": "train", "index": 65228, "acecode_id": "oss_34548", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to construct a keyword similarity matrix from a given relevance matrix. The relevance matrix contains relevance scores between different keywords, and your goal is to identify which keywords are considered similar based on a specified...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_similarity_matrix([[0.1, 0.3], [0.4, 0.5]], 0.2) == [[0, 1], [1, 1]]\", \"assert construct_similarity_matrix([[0.0, 0.0], [0.0, 0.0]], 0.2) == [[0, 0], [0, 0]]\", \"assert construct_similarity_matrix([[0.1, 0.2], [0.2, 0.1]], 0.15) == [[0, 1], [1, ...
{ "split": "train", "index": 65229, "acecode_id": "oss_30543", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the capacity of adult ICU beds in a hospital over several days, implement a function that returns a new list containing only the capacities from a specified start date onwards. The start date is given as a string in the format 'YYYY-MM-DD'....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_icu_capacities([10, 20, 30], '2020-10-01') == [10, 20, 30]\", \"assert filter_icu_capacities([10, 20, 30], '2020-10-02') == [20, 30]\", \"assert filter_icu_capacities([10, 15, 20], '2020-10-03') == [20]\", \"assert filter_icu_capacities([0, 0, 0], '20...
{ "split": "train", "index": 65230, "acecode_id": "bigcode_python_fns_39717", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_expression(expression: str) -> float` that evaluates a mathematical expression represented as a string. The expression may include complex numbers, trigonometric functions (sin, cos, tan), logarithmic functions (log and exp), and basic arithmetic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_expression('2 + 2') == 4.0\", \"assert calculate_expression('sin(0)') == 0.0\", \"assert calculate_expression('cos(0)') == 1.0\", \"assert calculate_expression('tan(0)') == 0.0\", \"assert calculate_expression('log(1)') == 0.0\", \"assert calculate...
{ "split": "train", "index": 65231, "acecode_id": "evol_18804", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a context object that contains information about a member's transactions. Each member has a reporting category that can change over time. Your task is to implement a function `get_current_reporting_category(context)` that retrieves the most recent reporting catego...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_current_reporting_category({'member': {'reporting_categories': ['A', 'B', 'C']}}) == 'C'\", \"assert get_current_reporting_category({'member': {'reporting_categories': []}}) == None\", \"assert get_current_reporting_category({'member': {'reporting_catego...
{ "split": "train", "index": 65232, "acecode_id": "bigcode_python_fns_44585", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with comparing two strings and generating a formatted string that highlights the differences between them. Write a function `compare_strings(str1: str, str2: str) -> str` that takes in two strings and returns a formatted string showing the differences. The differ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_strings('openai', 'open') == 'open[a][i]'\", \"assert compare_strings('hello world', 'hello world!') == 'hello world(!)'\", \"assert compare_strings('aaa', 'a') == 'a[a][a]'\", \"assert compare_strings('abcd', 'ab') == 'ab[c][d]'\", \"assert compare_...
{ "split": "train", "index": 65233, "acecode_id": "bigcode_python_fns_10313", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a directed graph represented as a list of edges, where each edge is represented as a tuple (u, v) indicating a directed edge from vertex u to vertex v. Your task is to implement a function that determines if the directed graph is strongly connected. A directed gra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_strongly_connected([(1, 2), (2, 3), (3, 1)]) == True\", \"assert is_strongly_connected([(1, 2), (2, 1)]) == True\", \"assert is_strongly_connected([(1, 2), (2, 3), (3, 4), (4, 1)]) == True\", \"assert is_strongly_connected([(1, 2), (2, 1), (2, 3)]) == Fal...
{ "split": "train", "index": 65234, "acecode_id": "bigcode_python_fns_4111", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of genetic data points and their corresponding labels. The function should take in a list of genetic data and a list of labels, and perform the following operations: 1. Determine the number of unique class...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_genetic_data([1.0, 2.0, 3.0, 4.0], [0, 0, 1, 1]) == {0: 1.5, 1: 3.5}\", \"assert process_genetic_data([10.0, 20.0, 30.0, 40.0], [0, 0, 1, 1]) == {0: 15.0, 1: 35.0}\", \"assert process_genetic_data([5.0, 5.0, 5.0, 5.0], [0, 1, 0, 1]) == {0: 5.0, 1: 5....
{ "split": "train", "index": 65235, "acecode_id": "oss_20000", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of migration patches and their associated upgrade numbers. Your goal is to implement a function that, given two lists, one of upgrade numbers and another of patch times, returns a dictionary mapping each unique upgrade number to its latest pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_latest_patch_times([1, 2, 1, 3], ['2023-01-01 12:00:00', '2023-01-01 13:00:00', '2023-01-02 12:00:00', '2023-01-01 14:00:00']) == {1: '2023-01-02 12:00:00', 2: '2023-01-01 13:00:00', 3: '2023-01-01 14:00:00'}\", \"assert get_latest_patch_times([1, 1, 1],...
{ "split": "train", "index": 65236, "acecode_id": "oss_12457", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that removes an entry from a list of smart home device entries based on a given entry ID. The list of entries is represented as a dictionary where the keys are entry IDs and the values are device names. Implement a function called `re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_entry('device1', {'device1': 'Light', 'device2': 'Thermostat'}) == True\", \"assert remove_entry('device3', {'device1': 'Light', 'device2': 'Thermostat'}) == False\", \"assert remove_entry('device2', {'device2': 'Thermostat'}) == True\", \"assert remo...
{ "split": "train", "index": 65237, "acecode_id": "oss_19992", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the lengths of packets that need to be received over a network. Your task is to implement a function `receive_packets(lengths: List[int]) -> List[int]` that simulates receiving these packets. The function should return a list contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert receive_packets([2, 3, 5]) == [2, 5, 10]\", \"assert receive_packets([1, 1, 1, 1]) == [1, 2, 3, 4]\", \"assert receive_packets([4, 0, 6]) == [4, 4, 10]\", \"assert receive_packets([0, 0, 0]) == [0, 0, 0]\", \"assert receive_packets([]) == []\", \"assert rece...
{ "split": "train", "index": 65238, "acecode_id": "bigcode_python_fns_25306", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `index_get(array: List[int], *indices: int) -> Union[int, None]` that retrieves the value at a specified index, or nested indices if provided. If any of the indices is out of range or results in a TypeError during the retrieval pro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert index_get([1, [2, 3], 4], 1, 0) == 2\", \"assert index_get([1, [2, 3], 4], 1, 1) == 3\", \"assert index_get([1, [2, 3], 4], 1) == [2, 3]\", \"assert index_get([1, [2, 3], 4], 0) == 1\", \"assert index_get([1, [2, 3], 4], 2) == 4\", \"assert index_get([1, [2,...
{ "split": "train", "index": 65239, "acecode_id": "bigcode_python_fns_27013", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s` which represents a log entry, determine if the log entry is in an old format. The old log format is defined as containing a timestamp in the format 'YYYY/MM/DD HH:MM:SS'. Implement a function `is_old_log_format(s: str) -> bool` that returns `True` if the log ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_old_log_format('2023/10/07 12:30:45') == True\", \"assert is_old_log_format('This is a log entry without a timestamp.') == False\", \"assert is_old_log_format('Log entry: 2022/01/01 00:00:00') == True\", \"assert is_old_log_format('Invalid date 99/99/99 9...
{ "split": "train", "index": 65240, "acecode_id": "bigcode_python_fns_3586", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes song play data for a music streaming service. The function, `process_song_play_data`, should take a list of song play records, where each record is represented as a dictionary containing the keys 'song_id', 'user_id', and '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_song_play_data([]) == {}\", \"assert process_song_play_data([{'song_id': '1', 'user_id': 'A', 'play_time': '2023-01-01 10:00:00'}]) == {'1': 1}\", \"assert process_song_play_data([{'song_id': '1', 'user_id': 'A', 'play_time': '2023-01-01 10:00:00'}, ...
{ "split": "train", "index": 65241, "acecode_id": "oss_6117", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with generating an entity n-gram dictionary from a list of labels and a dictionary of patterns. Write a function named `generate_entity_ngram_dict(labels: List[str], patterns: Dict[str, List[str]]) -> Dict[str, List[str]]` that takes in a list of labels and a dic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_entity_ngram_dict(['car', 'truck'], {'pattern1': ['c', 'a'], 'pattern2': ['t', 'r']}) == {'car': [['c', 'a']], 'truck': [['t', 'r']]}\", \"assert generate_entity_ngram_dict([], {'pattern1': ['x', 'y']}) == {}\", \"assert generate_entity_ngram_dict([...
{ "split": "train", "index": 65242, "acecode_id": "oss_8322", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a singly linked list and a positive integer `k`. Your task is to rotate the linked list to the right by `k` places. This means that the last `k` nodes of the linked list will be moved to the front, and the rest of the elements will move to the right. Implement a f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert RotateLinkedList(ListNode(1, ListNode(2, ListNode(3))), 1).value == 3\", \"assert RotateLinkedList(ListNode(1, ListNode(2)), 2).value == 1\", \"assert RotateLinkedList(ListNode(1), 5).value == 1\", \"assert RotateLinkedList(ListNode(1, ListNode(2, ListNode(3...
{ "split": "train", "index": 65243, "acecode_id": "oss_17073", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple home automation system. The system will control a fan and a light. Your task is to write a function that simulates turning the fan on, turning the light off, and then turning the light on. Each action should be represented by a string: 'f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert home_automation_system() == ['fan_on', 'light_off', 'light_on']\", \"assert home_automation_system() == ['fan_on', 'light_off', 'light_on']\", \"assert home_automation_system() == ['fan_on', 'light_off', 'light_on']\", \"assert home_automation_system() == ['...
{ "split": "train", "index": 65244, "acecode_id": "oss_7389", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 1D list of integers, implement a function that performs the Euclidean reflection of each element in the list with respect to a specified integer 'a'. For each element 'x' in the list, the reflection is calculated as follows: If 'a' is the reflection point, the reflected...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert euclidean_reflection([1, 2, 3], 2) == [3, 2, 1]\", \"assert euclidean_reflection([-1, 0, 1], 0) == [1, 0, -1]\", \"assert euclidean_reflection([5, 10, 15], 10) == [15, 10, 5]\", \"assert euclidean_reflection([0], 5) == [10]\", \"assert euclidean_reflection([...
{ "split": "train", "index": 65245, "acecode_id": "bigcode_python_fns_14862", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an unordered list of words, implement a function `find_anagrams(word_list)` that returns groups of words that are anagrams of each other. If no anagram groups are found, the function should return the string 'No anagrams found'.\nPlease reason step by step, then write a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_anagrams(['listen', 'silent', 'enlist', 'google', 'gooogle']) == [['listen', 'silent', 'enlist']]\", \"assert find_anagrams(['rat', 'tar', 'art', 'car', 'arc']) == [['rat', 'tar', 'art'], ['car', 'arc']]\", \"assert find_anagrams(['hello', 'world', 'pyt...
{ "split": "train", "index": 65246, "acecode_id": "evol_17596", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string containing a person's name in the format 'first-name last-name'. Your task is to implement a function that takes this string as input and returns the name in the format 'last-name, first-name'. The input will always be a valid string with exactly two word...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert last_name_first('John Doe') == 'Doe, John'\", \"assert last_name_first('Alice Smith') == 'Smith, Alice'\", \"assert last_name_first('Bob Johnson') == 'Johnson, Bob'\", \"assert last_name_first('Charlie Brown') == 'Brown, Charlie'\", \"assert last_name_first(...
{ "split": "train", "index": 65247, "acecode_id": "bigcode_python_fns_40048", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and replaces each unique special character (non-alphanumeric characters) in that string with an underscore ('_'). The function should return the modified string with all special characters transformed into underscores.\nPlease r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_special_with_underscore('#Hello$World!') == '_Hello_World_'\", \"assert replace_special_with_underscore('Python@3.8') == 'Python_3_8'\", \"assert replace_special_with_underscore('No#Special$Chars%Here') == 'No_Special_Chars_Here'\", \"assert replace_...
{ "split": "train", "index": 65248, "acecode_id": "evol_33567", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that accepts a list of non-duplicated string inputs and returns the word with the highest number of distinct characters, ignoring case. If there are multiple words with the same number of unique characters, return the earliest one in alphabetical order. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max(['hello', 'world', 'python', 'java']) == 'python'\", \"assert find_max(['abc', 'def', 'ghi', 'jkl']) == 'abc'\", \"assert find_max(['dog', 'cat', 'mouse', 'elephant']) == 'elephant'\", \"assert find_max(['aaa', 'bbb', 'ccc']) == 'aaa'\", \"assert fi...
{ "split": "train", "index": 65249, "acecode_id": "evol_29124", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Create a function in Python called `display_user_info` that takes in four parameters: `first_name` (string), `last_name` (string), `date_of_birth` (string), and `birth_city` (string). The function should return a formatted string that includes the user's first name, last name, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert display_user_info('Daniel', 'Radcliffe', '23-07-1989', 'London') == 'First Name: Daniel, Last Name: Radcliffe, Date of Birth: 23-07-1989, Birth City: London'\", \"assert display_user_info('John', 'Doe', '01-01-2000', 'New York') == 'First Name: John, Last Na...
{ "split": "train", "index": 65250, "acecode_id": "evol_11313", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers and returns the maximum product that can be obtained by multiplying any three integers from the list. Write a function `max_product_of_three(nums: List[int]) -> int` that computes this value. The function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_product_of_three([1, 2, 3, 4]) == 24\", \"assert max_product_of_three([-10, -10, 5, 2]) == 500\", \"assert max_product_of_three([1, 2]) == 0\", \"assert max_product_of_three([0, 0, 0]) == 0\", \"assert max_product_of_three([-1, -2, -3]) == -6\", \"assert...
{ "split": "train", "index": 65251, "acecode_id": "oss_18861", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function called `filter_businesses` that processes a list of businesses represented as dictionaries. Each dictionary contains attributes of a specific business, such as its sector of activity, legal status, establishment year, and whether i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_businesses([{'secteur_activite': 'Technology', 'statut_juridique': 'SAS', 'date_ouverture_etablissement': 2015, 'activite_partielle': True}], 'Technology', 'SAS', 5, True) == [{'secteur_activite': 'Technology', 'statut_juridique': 'SAS', 'date_ouvertu...
{ "split": "train", "index": 65252, "acecode_id": "oss_29891", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a molecular modeling system that simulates the interaction of various molecular components. Your goal is to design a function that takes a list of substructures, where each substructure is represented by a list of atoms and a list of bonds. Your...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_complex([(['H', 'O'], [('H', 'O')])]) == {'atoms': ['H', 'O'], 'bonds': [('H', 'O')]}\", \"assert create_complex([(['H', 'O'], []), (['C'], [('H', 'C')])]) == {'atoms': ['H', 'O', 'C'], 'bonds': [('H', 'C')]}\", \"assert create_complex([]) == {'atoms'...
{ "split": "train", "index": 65253, "acecode_id": "oss_35181", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating unique ticket IDs for a ticket management system. Write a Python function `generate_ticket_id(category: str, counter: int) -> str` that takes the ticket category as input and the current ticket counter for that category, and returns the unique tic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_ticket_id('support', 1) == 'SUP0001'\", \"assert generate_ticket_id('support', 2) == 'SUP0002'\", \"assert generate_ticket_id('support', 10) == 'SUP0010'\", \"assert generate_ticket_id('sales', 1) == 'SAL0001'\", \"assert generate_ticket_id('sales',...
{ "split": "train", "index": 65254, "acecode_id": "oss_8115", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that reverses a given list of strings without using in-built reverse functions. The function should validate the input list to ensure all elements are strings. If any non-string element is found, the function should raise a ValueError with the message 'Inva...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_list(['apple', 'banana', 'cherry']) == ['cherry', 'banana', 'apple']\", \"assert reverse_list(['hello', 'world']) == ['world', 'hello']\", \"assert reverse_list(['a', 'b', 'c', 'd']) == ['d', 'c', 'b', 'a']\", \"assert reverse_list(['one', 'two', 'th...
{ "split": "train", "index": 65255, "acecode_id": "evol_7974", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates adding common options to a command-line parser. The function should take two optional string parameters: `data_path` and `data_identifier`. If `data_path` is not provided, it should default to \"/GWAS/data/\". If `data_iden...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_common_options() == {'data_path': '/GWAS/data/', 'data_identifier': 'file_name'}\", \"assert add_common_options(data_path='/custom/path/') == {'data_path': '/custom/path/', 'data_identifier': 'file_name'}\", \"assert add_common_options(data_identifier='c...
{ "split": "train", "index": 65256, "acecode_id": "bigcode_python_fns_4413", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of transactions represented as tuples (debtor, creditor, amount), write a function that calculates the total amount owed among all debtors in the list. The function should return the total amount owed, which is the sum of all positive amounts in the transactions. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_amount_owed([('A', 'B', 50000), ('C', 'D', -10000), ('B', 'A', -20000)]) == 50000\", \"assert total_amount_owed([('A', 'B', 0), ('C', 'D', 10000), ('B', 'A', -5000)]) == 10000\", \"assert total_amount_owed([]) == 0\", \"assert total_amount_owed([('A', ...
{ "split": "train", "index": 65257, "acecode_id": "bigcode_python_fns_16898", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `validate_email(email: str) -> bool` that checks if the given email address adheres to the standard RFC 5322 format. The function should return `True` if the email is valid and `False` otherwise. The valid format includes characters before the '@' symbol, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_email('test@example.com') == True\", \"assert validate_email('user.name+tag+sorting@example.com') == True\", \"assert validate_email('user@subdomain.example.com') == True\", \"assert validate_email('user@localhost') == False\", \"assert validate_ema...
{ "split": "train", "index": 65258, "acecode_id": "evol_847", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that performs a lookup operation based on the input value and returns the corresponding GeometryType. The function should handle three types of input: string, integer, and Driver. When the input is a string, the function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isinstance(get_geometry_type(0), GeofileType)\", \"assert isinstance(get_geometry_type(999), GeofileType)\", \"assert isinstance(get_geometry_type(7), GeofileType)\", \"assert isinstance(get_geometry_type(3), GeofileType)\", \"assert isinstance(get_geometry_...
{ "split": "train", "index": 65259, "acecode_id": "oss_27919", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You need to implement a function `activate_async_mode()` that configures a hypothetical prompt toolkit to use the asyncio event loop. The function should check if the prompt toolkit is version 3 or higher. If it is not, the function should configure the toolkit to use asyncio. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert activate_async_mode() == True\", \"assert activate_async_mode() == True\", \"assert activate_async_mode() == True\", \"assert activate_async_mode() == True\", \"assert activate_async_mode() == True\", \"assert activate_async_mode() == True\", \"assert activa...
{ "split": "train", "index": 65260, "acecode_id": "bigcode_python_fns_14593", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given two inputs, a and b, implement a function `sum(a, b)` that returns the sum of a and b. If either input cannot be converted to a number, return the string 'inputs couldn't be parsed to numbers'. If either input is not a number or cannot be added together, return 'inputs sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum(1, 2) == 3\", \"assert sum(1, '2') == 3\", \"assert sum('1', 2) == 3\", \"assert sum('1', '2') == 3\", \"assert sum(1, None) == 'inputs should be numbers'\", \"assert sum(None, 2) == 'inputs should be numbers'\", \"assert sum('1.5', '2.5') == 4.0\", \"as...
{ "split": "train", "index": 65261, "acecode_id": "evol_7951", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of pull requests (PRs) for various repositories. Your task is to write a function that counts the number of repositories that have more than a specified number of pull requests. The function should take two parameters: a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_repositories_with_prs_above_threshold([3, 5, 2, 8, 1], 4) == 2\", \"assert count_repositories_with_prs_above_threshold([0, 1, 2, 3, 4, 5], 5) == 0\", \"assert count_repositories_with_prs_above_threshold([10, 20, 30, 40], 25) == 2\", \"assert count_repo...
{ "split": "train", "index": 65262, "acecode_id": "bigcode_python_fns_4085", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Define a class `CombinedClass` that inherits from two base classes: `BaseClass1` and `BaseClass2`. The `CombinedClass` should have a method `getMessages` that returns a list containing messages from both base classes. The `BaseClass1` should have a method `message1` that return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert CombinedClass().getMessages() == ['Hello from BaseClass1', 'Hello from BaseClass2']\", \"assert CombinedClass().getMessages() != []\", \"assert CombinedClass().getMessages() == ['Hello from BaseClass1', 'Hello from BaseClass2']\", \"assert CombinedClass().ge...
{ "split": "train", "index": 65263, "acecode_id": "evol_11881", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with maintaining a dictionary that stores information about Open Reading Frames (ORFs) found in various DNA sequences. An ORF is identified by a query DNA sequence, which may have associated subject sequences and their corresponding BLAST results. Your task is to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_orfs({}, 1000, 1000, 'ATG', 'TAA', 'significant') == {'ATG': {'TAA': {'blastresult': 'significant'}}}\", \"assert update_orfs({'ATG': {'TAA': {'blastresult': 'significant'}}}, 1001, 1000, 'ATG', 'TAA', 'not significant') == {'ATG': {'TAA': {'blastresu...
{ "split": "train", "index": 65264, "acecode_id": "oss_11473", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that updates a global theme setting in an application. The function should take a parameter 'theme' which indicates the new theme to be set. If the theme is None or is the same as the current global theme, the function should do nothing. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_global_theme('Light') == 'Theme has been updated to Light'\", \"assert update_global_theme('Dark') == 'Theme has been updated to Dark'\", \"assert update_global_theme(None) == 'No change in theme'\", \"assert update_global_theme('Blue') == 'Theme has ...
{ "split": "train", "index": 65265, "acecode_id": "bigcode_python_fns_2730", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to track the balance of a medicine based on a list of ledger entries. Each ledger entry is represented as a dictionary containing a 'transaction_type' (which can be 'dispensing', 'receiving', or 'adjusting') and a 'quantity' (an integ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert recalculate_balance(100, [{'transaction_type': 'dispensing', 'quantity': 20}, {'transaction_type': 'receiving', 'quantity': 30}]) == 110\", \"assert recalculate_balance(50, [{'transaction_type': 'dispensing', 'quantity': 10}, {'transaction_type': 'dispensing...
{ "split": "train", "index": 65266, "acecode_id": "oss_16283", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of features associated with a given location ID. The function should receive a location ID and return the list of features for that location. If the location ID is invalid (not found), the function should return an e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_features(1, None) == [{'name': 'Feature A'}, {'name': 'Feature B'}]\", \"assert list_features(1, 'features') == {'features': [{'name': 'Feature A'}, {'name': 'Feature B'}]}\", \"assert list_features(3, None) == []\", \"assert list_features(3, 'features'...
{ "split": "train", "index": 65267, "acecode_id": "bigcode_python_fns_7205", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Design a function `find_median(numbers)` that takes a list of integers `numbers`, which is guaranteed to be sorted in non-decreasing order, and returns the median value of that list. The median is defined as the middle value in the list. If the list has an odd number of element...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_median([1]) == 1\", \"assert find_median([1, 2]) == 1.5\", \"assert find_median([1, 2, 3]) == 2\", \"assert find_median([1, 2, 3, 4]) == 2.5\", \"assert find_median([1, 3, 3, 6, 7, 8, 9]) == 6\", \"assert find_median([1, 2, 2, 2, 3, 4, 5]) == 2\", \"ass...
{ "split": "train", "index": 65268, "acecode_id": "evol_20510", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `text`, implement a function `to_vector_single(text: str, embeddings: Dict[str, List[float]], maxlen: int = 300) -> List[List[float]]` that converts the input string into a sequence of word embedding vectors using the provided `embeddings` dictionary. Each word i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_vector_single('hello world', {'hello': [0.1, 0.2], 'world': [0.3, 0.4]}, 2) == [[0.1, 0.2], [0.3, 0.4]]\", \"assert to_vector_single('hello unknown', {'hello': [0.1, 0.2]}, 2) == [[0.1, 0.2], [0.0, 0.0]]\", \"assert to_vector_single('sample text', {'sampl...
{ "split": "train", "index": 65269, "acecode_id": "bigcode_python_fns_36912", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing a DNA sequence to identify specific resistance genes. Implement a function called `find_resistance_genes` that takes a string `dna_sequence` as input and returns a list of resistance genes present in the sequence. The resistance genes to check for ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_resistance_genes('ATGCGTACGAMP') == []\", \"assert find_resistance_genes('AAATTCGATGCCCGC') == []\", \"assert find_resistance_genes('GCGCGCA') == []\", \"assert find_resistance_genes('ATGCGTCGA') == []\", \"assert find_resistance_genes('AAAAA') == []\"]...
{ "split": "train", "index": 65270, "acecode_id": "oss_13226", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the maximum sum of any contiguous subarray within the list. A contiguous subarray is defined as a sequence of elements that are consecutive in the array. You need to implement a single function `max_subarray_sum(arr: List[...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2, -3, -1]) == -1\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_subarray_sum([0]) == 0\", \"asser...
{ "split": "train", "index": 65271, "acecode_id": "bigcode_python_fns_21918", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the states of various charges, where each integer can be either 0 (CREATED) or 1 (IN_PROGRESS). Your task is to implement a function that updates the state of all charges in progress (denoted by the integer 1) to a new state represe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_charge_states([0, 1, 0, 1]) == [0, 2, 0, 2]\", \"assert update_charge_states([1, 1, 1]) == [2, 2, 2]\", \"assert update_charge_states([0, 0, 0]) == [0, 0, 0]\", \"assert update_charge_states([]) == []\", \"assert update_charge_states([1, 0, 1, 0, 1]) ...
{ "split": "train", "index": 65272, "acecode_id": "bigcode_python_fns_34587", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function in Python that takes in a list of integers and returns the second largest element along with its index in the original list. The function should not use any built-in functions to find the largest element and must handle cases with duplicate elements appropriate...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert second_largest([5, 10, 15, 20, 15]) == (15, 2)\", \"assert second_largest([10, 10, 10]) == (-1, -1)\", \"assert second_largest([1, 2, 3, 4, 5]) == (4, 3)\", \"assert second_largest([5, 5, 5, 5, 5]) == (-1, -1)\", \"assert second_largest([20, 20, 10, 30, 30])...
{ "split": "train", "index": 65273, "acecode_id": "evol_1231", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple card game between two players. The game involves drawing cards from a deck consisting of cards numbered from 1 to N, where N is a positive integer. Each player draws a card from the deck, and the player with th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determineWinner(3, [1, 2, 3], [3, 2, 1]) == (1, 1, 1)\", \"assert determineWinner(5, [1, 1, 1, 1, 1], [1, 1, 1, 1, 1]) == (0, 0, 5)\", \"assert determineWinner(2, [2, 1], [1, 2]) == (1, 1, 0)\", \"assert determineWinner(0, [], []) == (0, 0, 0)\", \"assert de...
{ "split": "train", "index": 65274, "acecode_id": "oss_17561", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are working on a Python application that interacts with a database using a mock `cursor` object. The `cursor.execute()` method is used to execute SQL queries. However, you want to ensure that the application handles potential errors that may arise during the execution of th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_query_safe(mock_cursor_success, 'SELECT * FROM employees') == [('John', 'Doe'), ('Jane', 'Doe')]\", \"assert execute_query_safe(mock_cursor_failure, 'SELECT * FROM non_existing_table') == None\", \"assert execute_query_safe(mock_cursor_failure, 'INVA...
{ "split": "train", "index": 65275, "acecode_id": "oss_9009", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a string that represents a URL. Your task is to write a function `get_domain_name(url: str) -> str` that extracts and returns the domain name from the given URL. The domain name is the part of the URL that comes after 'http://' or 'https://' and before the next '/...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_domain_name('https://www.leetcode.com/problems') == 'www.leetcode.com'\", \"assert get_domain_name('http://example.com') == 'example.com'\", \"assert get_domain_name('https://openai.com/research') == 'openai.com'\", \"assert get_domain_name('http://local...
{ "split": "train", "index": 65276, "acecode_id": "bigcode_python_fns_2902", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a dataset. Your task is to implement a function `split_and_extract` that takes the following parameters: \n- `data`: A list of integers representing the dataset. \n- `percentage`: A float representing the percentage of data to be al...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_and_extract([1, 2, 3, 4, 5], 0.2) == 4\", \"assert split_and_extract([5, 10, 15], 0.3) == 10\", \"assert split_and_extract([1, 2, 3, 4], 0.5) == 2\", \"assert split_and_extract([], 0.5) == -1\", \"assert split_and_extract([1, 2, 3, 4, 5, 6, 7, 8, 9, 10...
{ "split": "train", "index": 65277, "acecode_id": "oss_30792", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of strings, implement a function that identifies the string element that appears with the lowest frequency. If there are multiple strings with the same lowest frequency, return a list of those strings. The function should take one parameter: an array of strings. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lowest_frequency_strings([ 'apple', 'banana', 'apple', 'orange', 'banana', 'kiwi' ]) == ['orange', 'kiwi']\", \"assert lowest_frequency_strings([ 'a', 'b', 'a', 'c', 'b', 'd', 'd' ]) == ['c']\", \"assert lowest_frequency_strings([ 'single' ]) == ['single']\"...
{ "split": "train", "index": 65278, "acecode_id": "evol_15644", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of points in a 2D plane represented as tuples (x, y), write a function `find_convex_hull(points)` that returns the points that form the vertices of the convex hull in counter-clockwise order. The convex hull is the smallest convex polygon that can enclose all the g...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_convex_hull([(0, 0), (2, 2), (0, 2), (2, 0)]) == [(0, 0), (2, 0), (2, 2), (0, 2)]\", \"assert find_convex_hull([(1, 2), (3, 1), (3, 3), (1, 4)]) == [(1, 2), (3, 1), (3, 3), (1, 4)]\", \"assert find_convex_hull([(0, 0), (1, 0), (0, 1), (1, 1), (0.5, 0.5)...
{ "split": "train", "index": 65279, "acecode_id": "bigcode_python_fns_35176", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a list of the ARNs of ECS clusters in a given region. The function should take a region as a string parameter and return a predefined list of ARNs based on that region. The function will not interact with external re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_ecs_cluster_arns('us-west-2') == ['arn:aws:ecs:us-west-2:123456789012:cluster/cluster1', 'arn:aws:ecs:us-west-2:123456789012:cluster/cluster2']\", \"assert get_ecs_cluster_arns('us-east-1') == ['arn:aws:ecs:us-east-1:123456789012:cluster/cluster3']\", \"...
{ "split": "train", "index": 65280, "acecode_id": "oss_3338", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of tasks represented as dictionaries. Each task has a unique identifier, a title, a description, and a status (either 'pending' or 'completed'). Your function should take a list of tasks and return a new list con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_completed_tasks([{'id': 1, 'title': 'Task 1', 'description': 'First Task', 'status': 'completed'}, {'id': 2, 'title': 'Task 2', 'description': 'Second Task', 'status': 'pending'}]) == [{'id': 1, 'title': 'Task 1', 'description': 'First Task', 'status'...
{ "split": "train", "index": 65281, "acecode_id": "oss_12537", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes vehicle messages in a fleet management system. Each vehicle message contains a vehicle number and a floating-point value representing the vehicle type. Your task is to implement the function `process_vehicle_message(src...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_vehicle_message(1, 2.5) == 'vehicle #1 is of type 2'\", \"assert process_vehicle_message(2, 3.8) == 'vehicle #2 is of type 3'\", \"assert process_vehicle_message(3, 0.0) == 'vehicle #3 is of type 0'\", \"assert process_vehicle_message(4, 4.99) == 've...
{ "split": "train", "index": 65282, "acecode_id": "oss_31707", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers where each integer represents an extension of a data object. Each extension has an associated data array, an uncertainty array, and a mask array. Your task is to implement a function that takes this list of integers and returns a new list of dic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_data_objects([1, 2, 3]) == [{'data': [0], 'uncertainty': [1], 'mask': [0]}, {'data': [0, 0], 'uncertainty': [1, 1], 'mask': [0, 0]}, {'data': [0, 0, 0], 'uncertainty': [1, 1, 1], 'mask': [0, 0, 0]}]\", \"assert build_data_objects([4]) == [{'data': [0, ...
{ "split": "train", "index": 65283, "acecode_id": "bigcode_python_fns_35134", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a board represented as a grid where each cell can contain a ship or halite. Your task is to implement a function that determines the nearest shipyard to a given ship's position. The function should take two inputs: a 2D list representing the board and a tuple repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nearest_shipyard([[0, 0, 0], [0, 2, 0], [1, 0, 0]], (2, 0)) == (1, 1)\", \"assert nearest_shipyard([[0, 0, 0], [0, 0, 0], [0, 0, 0]], (1, 1)) == (-1, -1)\", \"assert nearest_shipyard([[0, 0, 2], [0, 1, 0], [0, 0, 0]], (1, 1)) == (0, 2)\", \"assert nearest_sh...
{ "split": "train", "index": 65284, "acecode_id": "bigcode_python_fns_6987", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Marguerite consistently scored in the range of 75 to 89 on all her previous spelling tests. After scoring a perfect 100 on her most recent test, you need to determine the effect of this new score on the average score (mean) of her tests. Write a function `calculate_new_mean(pre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_new_mean([], 100) == 100.0\", \"assert calculate_new_mean([88, 89, 86, 87], 100) == 90.0\", \"assert calculate_new_mean([75], 100) == 87.5\", \"assert calculate_new_mean([80, 85], 100) == 88.33333333333333\", \"assert calculate_new_mean([100], 100)...
{ "split": "train", "index": 65285, "acecode_id": "evol_15798", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `find_least_common(input_string: str) -> List[Tuple[str, int]]` that takes a string of alphanumeric characters as input and returns a list of tuples containing the least common characters and their respective counts. If there are multiple characters with th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_least_common('abc') == [('a', 1), ('b', 1), ('c', 1)]\", \"assert find_least_common('aabbccdde') == [('e', 1)]\", \"assert find_least_common('aaaabbbcc') == [('c', 2)]\", \"assert find_least_common('1a2b3c') == [('1', 1), ('2', 1), ('3', 1), ('a', 1), (...
{ "split": "train", "index": 65286, "acecode_id": "evol_16872", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of items, where each item can be represented as a string. Your task is to implement a function that checks if there are any conflicts between every possible pair of items in the list. A conflict between two items is defined as their first characters being t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert no_conflicts(['apple', 'banana', 'cherry']) == True\", \"assert no_conflicts(['apple', 'apricot', 'banana']) == False\", \"assert no_conflicts(['dog', 'cat', 'fish']) == True\", \"assert no_conflicts(['grape', 'kiwi']) == True\", \"assert no_conflicts(['melo...
{ "split": "train", "index": 65287, "acecode_id": "bigcode_python_fns_43928", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of sorted characters `letters` containing only lowercase letters, and a target letter `target`, find the smallest element in the list that is larger than the given target. The function should raise an error if the input is not a list, if the list does not contain o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert next_greatest_letter(['c', 'f', 'j'], 'a') == 'c'\", \"assert next_greatest_letter(['c', 'f', 'j'], 'c') == 'f'\", \"assert next_greatest_letter(['c', 'f', 'j'], 'd') == 'f'\", \"assert next_greatest_letter(['c', 'f', 'j'], 'g') == 'j'\", \"assert next_great...
{ "split": "train", "index": 65288, "acecode_id": "evol_3960", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with positioning resources on a grid based on specified alignment and position parameters. Create a function `position_resources` that takes the following parameters: \n- `resource_list`: a list of strings representing resource names. \n- `position`: a string rep...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert position_resources(['Resource1', 'Resource2'], 'top_left', 'horizontal', 300, 150) == [('Resource1', (100, 50)), ('Resource2', (400, 50))]\", \"assert position_resources(['Resource1', 'Resource2'], 'middle_center', 'vertical', 300, 150) == [('Resource1', (70...
{ "split": "train", "index": 65289, "acecode_id": "bigcode_python_fns_9294", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of students in a class. Write a function that computes the average score of the students. The function should take a list of integers as input and return a float representing the average score. If the list is empty, retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_score([90, 80, 70]) == 80.0\", \"assert average_score([100, 90, 95, 85]) == 92.5\", \"assert average_score([60, 70, 80, 90, 100]) == 80.0\", \"assert average_score([]) == 0.0\", \"assert average_score([0, 0, 0]) == 0.0\", \"assert average_score([50])...
{ "split": "train", "index": 65290, "acecode_id": "oss_8799", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that finds the nearest waypoint to a given position from a list of waypoints. Each waypoint is defined by its coordinates (x, y). Your function should take the following inputs: a float x, a float y representing the position, and a list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nearest_waypoint(0, 0, [(1, 1), (2, 2), (3, 3)], [1, 0, 0]) == 0\", \"assert nearest_waypoint(2, 2, [(1, 1), (2, 2), (3, 3)], [0, 1, 0]) == 1\", \"assert nearest_waypoint(0, 0, [(0, 1), (1, 0)], [1, 1]) == 0\", \"assert nearest_waypoint(10, 10, [(1, 1), (2, ...
{ "split": "train", "index": 65291, "acecode_id": "oss_3212", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a string representing the content of a Python file and returns a list of class names defined within that file. The input string will contain valid Python code, and you should extract class names from it. Implement a function nam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_classes_from_code('class MyClass:\\\\n pass\\\\nclass AnotherClass:\\\\n pass') == ['MyClass', 'AnotherClass']\", \"assert get_classes_from_code('') == []\", \"assert get_classes_from_code('class SingleClass:\\\\n pass') == ['SingleClass']\", \"...
{ "split": "train", "index": 65292, "acecode_id": "bigcode_python_fns_27555", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representation of an IPv6 address, which may contain compressed parts represented by '::'. Your task is to implement a function that parses the IPv6 address and returns its full 128-bit representation as a tuple of 16 integers. Each integer in the tuple s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_ipv6('::') == (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)\", \"assert parse_ipv6('1234:5678::abcd:0:ff00') == (18, 52, 86, 120, 0, 0, 0, 0, 0, 0, 171, 205, 0, 0, 255, 0)\", \"assert parse_ipv6('abcd:ef01:2345:6789:abcd:ef01:2345:6789') == (171, 20...
{ "split": "train", "index": 65293, "acecode_id": "bigcode_python_fns_42071", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the login process for a web application. The function should take a dictionary representing a user context with the following structure: {'browser': {'visible_md': True/False, 'modal_body': {'signInFormPassword': String...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert login_submit_step({'browser': {'visible_md': True, 'modal_body': {'signInFormPassword': 'mypassword'}}}) == 'Form submitted'\", \"assert login_submit_step({'browser': {'visible_md': False, 'modal_body': {'signInFormPassword': 'mypassword'}}}) == 'Form not su...
{ "split": "train", "index": 65294, "acecode_id": "bigcode_python_fns_5452", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function to determine if a given 64-bit integer is even or odd without using any arithmetic or comparison operators. The function should return 'Even' if the number is even and 'Odd' if the number is odd, handling both positive and negative inputs. For example, for the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_even_or_odd(0) == 'Even'\", \"assert is_even_or_odd(1) == 'Odd'\", \"assert is_even_or_odd(2) == 'Even'\", \"assert is_even_or_odd(3) == 'Odd'\", \"assert is_even_or_odd(4) == 'Even'\", \"assert is_even_or_odd(5) == 'Odd'\", \"assert is_even_or_odd(-1) ==...
{ "split": "train", "index": 65295, "acecode_id": "evol_14820", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the creation of access control rules for a file management system. Each access control rule specifies permissions granted to a specific identity (user or group) for a particular file or directory. The permissions are de...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_access_control_rule('admin', 1, 0, 1, 2) == {'identity': 'admin', 'fileSystemRights': 1, 'inheritanceFlags': 0, 'propagationFlags': 1, 'flags': 2, 'AccessMask': 3}\", \"assert create_access_control_rule('user3', 2, 1, 0, 1) == {'identity': 'user3', 'f...
{ "split": "train", "index": 65296, "acecode_id": "oss_21597", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given two lists of bounding boxes, `bboxes1` and `bboxes2`, each containing bounding boxes defined by their coordinates in the form `[x1, y1, x2, y2]` where `(x1, y1)` is the top-left corner and `(x2, y2)` is the bottom-right corner, implement a function `bbox_overlaps(bboxes1:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bbox_overlaps([[0, 0, 1, 1]], [[0, 0, 1, 1]], 'iou') == [[1.0]]\", \"assert bbox_overlaps([[0, 0, 2, 2]], [[2, 2, 3, 3]], 'iou') == [[0.0]]\", \"assert bbox_overlaps([[0, 0, 1, 1], [1, 1, 2, 2]], [[0, 0, 1, 1]], 'iou') == [[1.0], [0.0]]\", \"assert bbox_over...
{ "split": "train", "index": 65297, "acecode_id": "bigcode_python_fns_3434", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Create a Python function that takes in a string and a list of words and returns true if the string contains any of the words in the list. The function should be case-insensitive when checking for the presence of words in the string.\nPlease reason step by step, then write a sel...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert string_contains_any('This is a test', ['test', 'hello', 'world']) == True\", \"assert string_contains_any('Hello there', ['goodbye', 'hello']) == True\", \"assert string_contains_any('Python programming', ['java', 'c++', 'python']) == True\", \"assert string...
{ "split": "train", "index": 65298, "acecode_id": "evol_28435", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `custom_norm` that calculates the norm of a given input, which can be either a vector or a matrix. The function should take two parameters: \n1. `input_data`: A list representing either a vector (1D list) or a matrix (2D list). \n2. `norm_order`: An integer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_norm([3, -4, 5], 1) == 12\", \"assert custom_norm([3, -4, 5], float('inf')) == 5\", \"assert custom_norm([[1, 2, 3], [4, 5, 6]], 2) == 'L2 norm for matrices not implemented'\", \"assert custom_norm([[1, 2, 3], [4, 5, 6]], float('inf')) == 15\", \"asse...
{ "split": "train", "index": 65299, "acecode_id": "oss_8387", "num_tests": 16 }